### Preview lessons, content and tests

#### Computer Science & Programming solved. All in one platform.

1. To trial the platform and take tests, please take a few seconds to SIGN UP and SET UP FREE.

2. Searching for something specific? See our text overview of all tests. Scroll right for levels, and lists.

3. Student and Teacher User Guides |  Schemes of Work |   Real Teacher use Videos |

Join 36000+ teachers and students using TTIO.

### Timewise and Spacewise comparison

An algorithm is a step-by-step set of instructions to solve a specific problem and it is important to understand that the same problem can be solved with a variety of algorithms. How can we measure the efficiency of a given algorithm, so it can be compared with a different algorithm which solves the same problem?

### Spacewise Complexity

That is the amount of (memory) space the algorithm will take up before it terminates with the correct solution.

In order to identify the space-wise efficiency we need to look at the amount of data structures used as the algorithm is running. When considering space-wise efficiency, the aim is to utilise data structures which take up the least amount in memory.

Examples:

• populating a list with variables of type real will be space-wise inefficient, when it is clear that only whole numbers (integers) will ever be needed to solve the problem.
• initialising an array with a length of 1000 will be space-wise inefficient, when it is clear that the maximum elements to be stores will be 100.

### Timewise Complexity

This is the amount of time it takes for the algorithm to terminate with the correct solution.

Any measure of time will depend on other factors, like

• the particular version and type of programming language used to implement the algorithm;
• the hardware specification on which the implementation will be running;
• and of course the input to the algorithm, e.g. searching through a very very large set will take longer that searching through a short set and searching for an item which does not exist in a set will take longer than searching for an item which is present in a given set.

### Time Complexity

Algorithm Data Structure Time Complexity
Best Average Worst
Quicksort Array `O(n log(n))` `O(n log(n))` `O(n^2)`
Mergesort Array `O(n log(n))` `O(n log(n))` `O(n log(n))`
Heapsort Array `O(n log(n))` `O(n log(n))` `O(n log(n))`
Bubble Sort Array `O(n)` `O(n^2)` `O(n^2)`
Insertion Sort Array `O(n)` `O(n^2)` `O(n^2)`
Select Sort Array `O(n^2)` `O(n^2)` `O(n^2)`
Bucket Sort Array ```O(n+k) www.teachyourselfpython.com // Load the SDK asynchronously (function (d, s, id) { var js, sjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "https://sdk.snapkit.com/js/v1/create.js"; sjs.parentNode.insertBefore(js, sjs); })(document, "script", "snapkit-creative-kit-sdk"); function addsocialsharelinks(type) { if(type == 'q') { \$('#div-test-msg').hide(); var level= \$('#hdnSelectedLevelid').val(); var Topic=\$('#hdnSelectedTopicid').val(); var Quiz=\$('#hdnSelectedQuizid').val(); \$('#ddllevel').val( \$('#hdnSelectedLevelid').val()); \$('#ddlTopic').val( \$('#hdnSelectedTopicid').val()); \$('#ddlQuiz').val( \$('#hdnSelectedQuizid').val()); var url = "https://www.testandtrack.io/index.php/studenttest/test/"+level+'/'+Topic+'/'+Quiz; \$('#hdnURL').val(url); \$("#fbHref").attr("href", "http://www.facebook.com/sharer.php?u="+ url); \$("#gglHref").attr("href", "https://plus.google.com/share?url="+ url); \$("#twtHref").attr("href", "https://twitter.com/share?url="+ url); \$("#teams-share-quiz").attr("data-href",url); shareToMicrosoftTeams.renderButtons(); gapi.sharetoclassroom.render("gclass-share-quiz", {"url": url,"size": "20"} ); \$('#hdnquizurl').val(url); } else if(type == 't') { \$('#div-test-msg').hide(); var level= \$('#hdnSelectedLevelid').val(); var Topic=\$('#hdnSelectedTopicid').val(); var Quiz=\$('#hdnSelectedQuizid').val(); \$('#ddllevel').val( \$('#hdnSelectedLevelid').val()); \$('#ddlTopic').val( \$('#hdnSelectedTopicid').val()); \$('#ddlQuiz').val( \$('#hdnSelectedQuizid').val()); var url = "https://www.testandtrack.io/index.php/studenttest/test/"+level+'/'+Topic; \$('#hdnURL-topic').val(url); \$("#fbHref-topic").attr("href", "http://www.facebook.com/sharer.php?u="+ url); \$("#gglHref-topic").attr("href", "https://plus.google.com/share?url="+ url); \$("#twtHref-topic").attr("href", "https://twitter.com/share?url="+ url); \$('#hdnquizurl-topic').val(url); \$('#div-share-topic').show(); \$("#teams-share-topic").attr("data-href",url); shareToMicrosoftTeams.renderButtons(); gapi.sharetoclassroom.render("gclass-share-topic", {"url": url,"size": "20"} ); } else if(type == 'l') { \$('#div-test-msg').hide(); var level= \$('#hdnSelectedLevelid').val(); var Topic=\$('#hdnSelectedTopicid').val(); var Quiz=\$('#hdnSelectedQuizid').val(); \$('#ddllevel').val( \$('#hdnSelectedLevelid').val()); \$('#ddlTopic').val( \$('#hdnSelectedTopicid').val()); \$('#ddlQuiz').val( \$('#hdnSelectedQuizid').val()); var url = "https://www.testandtrack.io/index.php/studenttest/test/"+level; \$('#hdnURL-level').val(url); \$("#fbHref-level").attr("href", "http://www.facebook.com/sharer.php?u="+ url); \$("#gglHref-level").attr("href", "https://plus.google.com/share?url="+ url); \$("#twtHref-level").attr("href", "https://twitter.com/share?url="+ url); \$('#hdnquizurl-level').val(url); \$('#div-share-level').show(); \$("#teams-share-level").attr("data-href",url); shareToMicrosoftTeams.renderButtons(); gapi.sharetoclassroom.render("gclass-share-level", {"url": url,"size": "20"} ); } } \$('.div-loading').hide(); function checkquizscores() { var result = jQuery.parseJSON('[{"id":"9","level":"Early Years (KS1 and KS2)","status":"1","displayorder":"0","image":"level_earlyyears.png","topic_count":"15"},{"id":"1","level":"Beginner (KS3) or Primary","status":"1","displayorder":"1","image":"level_beginner.png","topic_count":"31"},{"id":"2","level":"Intermediate (GCSE Level)","status":"1","displayorder":"2","image":"level_icon_intermediate.png","topic_count":"25"},{"id":"3","level":"Advanced (A Level)","status":"1","displayorder":"3","image":"level_icon_uk_advanced_A.png","topic_count":"47"},{"id":"4","level":"Algorithms and Computational Thinking","status":"1","displayorder":"4","image":"level_icon_algorithims_logicalthinking.png","topic_count":"3"},{"id":"7","level":"Python Programming","status":"1","displayorder":"7","image":"level_icon_python.png","topic_count":"11"},{"id":"8","level":"Aptitude, IQ, Logical tests","status":"1","displayorder":"8","image":"level_aptitudelogicalsmart.png","topic_count":"3"},{"id":"11","level":"Real Certification","status":"1","displayorder":"9","image":"level_icon_certificate.png","topic_count":"11"},{"id":"10","level":"Java Programming","status":"1","displayorder":"9","image":"level_icon_java_eclipse.png","topic_count":"4"},{"id":"12","level":"IGCSE (Computer Science)","status":"1","displayorder":"10","image":"icons8-venn-diagram-48.png","topic_count":"27"},{"id":"13","level":"IB (Comp Sci)","status":"1","displayorder":"11","image":"icons8-vertical-timeline-48.png","topic_count":"60"},{"id":"14","level":"Web Design (Zero to Pro)","status":"1","displayorder":"12","image":"level_icon_APCSPrinciples.png","topic_count":"5"},{"id":"15","level":"Creative iMedia","status":"1","displayorder":"13","image":"level_icon_ApComputerScienceA.png","topic_count":"4"},{"id":"16","level":"Game Design & Creation","status":"1","displayorder":"14","image":"icons8-virtual-reality-48.png","topic_count":"1"},{"id":"17","level":"Machine Learning & AI","status":"1","displayorder":"15","image":"icons8-heat-map-48.png","topic_count":"10"},{"id":"18","level":"Learn Python - Mini Projects","status":"1","displayorder":"16","image":"icons8-code-file-48.png","topic_count":"5"},{"id":"19","level":"Unplugged CS Lessons","status":"1","displayorder":"17","image":"fast-track.png","topic_count":"4"},{"id":"20","level":"CS History & Famous People","status":"1","displayorder":"18","image":"people.png","topic_count":"2"},{"id":"22","level":"ICT Topics","status":"1","displayorder":"19","image":"icttopics1.png","topic_count":"38"},{"id":"23","level":"Year 7 SOW","status":"1","displayorder":"20","image":"Year7.png","topic_count":"17"},{"id":"24","level":"Year 8 SOW","status":"1","displayorder":"21","image":"year8.png","topic_count":"12"},{"id":"27","level":"Year 8 SOW #2","status":"1","displayorder":"22","image":"yr82.jpg","topic_count":"12"},{"id":"25","level":"Year 9 SOW","status":"1","displayorder":"23","image":"year9.png","topic_count":"18"},{"id":"26","level":"Cryptocurrency and Computing","status":"1","displayorder":"24","image":"bitcoin.png","topic_count":"4"},{"id":"28","level":"IGCSE Computer Science (CAIE) 2023+","status":"1","displayorder":"25","image":"uploadpic.png","topic_count":"41"}]'); \$('#div-levels').html(''); var topic = '<div class="row" style="margin:0px;padding-bottom:20px;"><div class="col-md-1"></div>'; for (var i = 0; i < result.length; i++) { } } function showalllevels() { \$('#div-levels').hide(); \$('.quizlistclass').hide(); \$('#div-selectedtopic').hide(); \$('#div-share').hide(); \$('#div-selectedlevel').hide(); \$('.div-loading').show(); \$('#div-selectedquiz').hide(); var result = jQuery.parseJSON('[{"id":"9","level":"Early Years (KS1 and KS2)","status":"1","displayorder":"0","image":"level_earlyyears.png","topic_count":"15"},{"id":"1","level":"Beginner (KS3) or Primary","status":"1","displayorder":"1","image":"level_beginner.png","topic_count":"31"},{"id":"2","level":"Intermediate (GCSE Level)","status":"1","displayorder":"2","image":"level_icon_intermediate.png","topic_count":"25"},{"id":"3","level":"Advanced (A Level)","status":"1","displayorder":"3","image":"level_icon_uk_advanced_A.png","topic_count":"47"},{"id":"4","level":"Algorithms and Computational Thinking","status":"1","displayorder":"4","image":"level_icon_algorithims_logicalthinking.png","topic_count":"3"},{"id":"7","level":"Python Programming","status":"1","displayorder":"7","image":"level_icon_python.png","topic_count":"11"},{"id":"8","level":"Aptitude, IQ, Logical tests","status":"1","displayorder":"8","image":"level_aptitudelogicalsmart.png","topic_count":"3"},{"id":"11","level":"Real Certification","status":"1","displayorder":"9","image":"level_icon_certificate.png","topic_count":"11"},{"id":"10","level":"Java Programming","status":"1","displayorder":"9","image":"level_icon_java_eclipse.png","topic_count":"4"},{"id":"12","level":"IGCSE (Computer Science)","status":"1","displayorder":"10","image":"icons8-venn-diagram-48.png","topic_count":"27"},{"id":"13","level":"IB (Comp Sci)","status":"1","displayorder":"11","image":"icons8-vertical-timeline-48.png","topic_count":"60"},{"id":"14","level":"Web Design (Zero to Pro)","status":"1","displayorder":"12","image":"level_icon_APCSPrinciples.png","topic_count":"5"},{"id":"15","level":"Creative iMedia","status":"1","displayorder":"13","image":"level_icon_ApComputerScienceA.png","topic_count":"4"},{"id":"16","level":"Game Design & Creation","status":"1","displayorder":"14","image":"icons8-virtual-reality-48.png","topic_count":"1"},{"id":"17","level":"Machine Learning & AI","status":"1","displayorder":"15","image":"icons8-heat-map-48.png","topic_count":"10"},{"id":"18","level":"Learn Python - Mini Projects","status":"1","displayorder":"16","image":"icons8-code-file-48.png","topic_count":"5"},{"id":"19","level":"Unplugged CS Lessons","status":"1","displayorder":"17","image":"fast-track.png","topic_count":"4"},{"id":"20","level":"CS History & Famous People","status":"1","displayorder":"18","image":"people.png","topic_count":"2"},{"id":"22","level":"ICT Topics","status":"1","displayorder":"19","image":"icttopics1.png","topic_count":"38"},{"id":"23","level":"Year 7 SOW","status":"1","displayorder":"20","image":"Year7.png","topic_count":"17"},{"id":"24","level":"Year 8 SOW","status":"1","displayorder":"21","image":"year8.png","topic_count":"12"},{"id":"27","level":"Year 8 SOW #2","status":"1","displayorder":"22","image":"yr82.jpg","topic_count":"12"},{"id":"25","level":"Year 9 SOW","status":"1","displayorder":"23","image":"year9.png","topic_count":"18"},{"id":"26","level":"Cryptocurrency and Computing","status":"1","displayorder":"24","image":"bitcoin.png","topic_count":"4"},{"id":"28","level":"IGCSE Computer Science (CAIE) 2023+","status":"1","displayorder":"25","image":"uploadpic.png","topic_count":"41"}]'); \$('#div-levels').html(''); var topic = '<div class="row" style="margin:0px;padding-bottom:20px;">'; var rowtiles = 0; for (var i = 0; i < result.length; i++) { rowtiles++; topic = topic + ' <div class="col-md-2 levelclass" style="margin-top:10px;"><a href="javascript:showtopics('+result[i].id+')"><div class="card assigncard" style="max-height:250px !important;max-width:250px;"><h3 style="padding:0%;padding-top:15%;height:80px;margin:0px;" id="level-'+result[i].id+'">'+result[i].level+'</3><p style="padding-top:0px;margin:0px;"><img src="https://www.testandtrack.io/upload/levels/'+result[i].image+'" height="65" width="65" style="margin-bottom:20px;"></p><p style="float:right;padding-right:10px;padding-bottom:0px;margin:0px;font-weight:800;text-align:right;color:#4fcccd;">'+ (i +1 ) + '/' + result.length +'</p>'; { topic = topic + '<button class="qbutton" '; if(rowtiles == 1) { topic = topic + 'style = "text-align:center;background-color:royalblue;" '; } else if(rowtiles == 2) { topic = topic + 'style = "text-align:center;background-color:green;" '; } else if(rowtiles == 3) { topic = topic + 'style = "text-align:center;background-color:#2f9697;" '; } else if(rowtiles == 4) { topic = topic + 'style = "text-align:center;background-color:red;" '; } else { topic = topic + 'style = "text-align:center;" '; } topic = topic + '>'+result[i].topic_count+' Topics</button></div></a></div>' ; } if((i+1)%5 == 0) { topic = topic + '</div><div class="row" style="margin:0px;margin-bottom:20px;">'; rowtiles = 0; } } \$('#div-levels').append(topic); \$('#div-levels').fadeIn("slow"); \$('.div-loading').hide(); \$('html,body').animate({ scrollTop: \$("#div-levels").offset().top}, 'slow'); } var topics; function showtopics(levelId) { \$('.div-loading').show(); \$('.quizlistclass').hide(); \$('#div-share').hide(); \$('.levelclass').hide(); \$('#div-selectedquiz').hide(); \$('#div-selectedlevel').fadeIn("slow"); // \$("#div2").fadeIn("slow"); \$('#hdnSelectedLevelid').val(levelId); \$('#lnkselectedlevel').attr("href", "javascript:showtopics("+levelId+")"); \$('#selectedlevel').html(\$('#level-'+levelId).html()); \$('#hdnSelectedLevel').val(\$('#level-'+levelId).html()); \$('#div-selectedtopic').hide(); \$.ajax({ type: "POST", url: "https://www.testandtrack.io/index.php/profile/getTopicByLevel/"+levelId , success: function (data) { var result = jQuery.parseJSON(data); \$('#div-levels').html(''); var topic = '<div class="row" style="margin:0px;padding-bottom:20px;">';//<div class="col-md-1"></div>'; for (var i = 0; i < result.length; i++) { var quizcount = 'Coming soon'; if(result[i].quiz_count > 0 ) { quizcount = result[i].quiz_count + " Units " ; } topic = topic + ' <div class="col-md-2 topicsclass mt-3"><a href="javascript:showquizzes('+result[i].id+')"><div class="card assigncard" style="max-height:250px;max-width:250px"><p style="float:right;padding-right:10px;text-align:right;color:#4fcccd;">'+ (i +1 ) + '/' + result.length +'</p>' + '<h3 style="padding-top:20%;height:140px;word-break:break-word;" id="topic-'+result[i].id+'">'+result[i].topic+'</3>'; topic = topic + '<button class="qbutton" style = "text-align:center">'+quizcount+'</button></div></a></div>' ; if((i+1)%5 == 0) { topic = topic + '</div><div class="row" style="margin:0px;padding-bottom:20px;">';//<div class="col-md-1"></div>'; } } \$('#div-levels').append(topic); \$('.div-loading').hide(); } }); \$('html,body').animate({ scrollTop: \$("#div-levels").offset().top}, 'slow'); addsocialsharelinks('l'); } function fnLoadSelections() { if(true) return true; if(true) showquizzes(169); else if(true) showtopics(3); }; function selectquiz(qid,nqid) { \$('#div-selectedquiz').fadeIn("slow"); if(nqid > 0) { \$('#hdnNextQuiz').val(nqid); } \$('#quiz-perc-'+qid).hide(); \$('#hdnpassreq').val(\$('#quiz-pass-req-'+qid).val()); \$('#div-share').fadeIn("slow"); \$('#hdnSelectedQuizid').val(qid); \$('#lnkselectedtquiz').attr("href", "javascript:void()"); \$('#btnselectedquiz').attr("onclick", "javascript:showquizzes("+\$('#hdnSelectedTopicid').val()+")"); \$('#selectedquiz').html(\$('#quiz-'+qid).html()); \$('#hdnSelectedQuiz').val(\$('#quiz-'+qid).html()); \$('#div-levels').html(''); \$('.quizlistclass').hide(); addsocialsharelinks('q'); \$.ajax({ type: "POST", url: "https://www.testandtrack.io/index.php/profile/getdescription/"+qid , success: function (data) { if(data != -1 ){ var result = jQuery.parseJSON(data); if(result[0].description != null && result[0].description != "") { \$('#div-levels').html('<div class="col-12" style="background:white;padding-bottom: 20px;padding-right: 30px;"><div class="mt-3 quizdesc" style="text-align:center;padding:20px;border-radius:5px;/* background:#f4f3ef; */width:60%;border: 1px solid rgba(0,0,0,.125);">' + result[0].description + '</div></div>'); } } } }); \$('html,body').animate({ scrollTop: \$("#div-selectedquiz").offset().top}, 'slow'); } var quizlist; function showquizzes(topicId) { \$('#div-share').hide(); \$('.quizlistclass').hide(); \$('#div-selectedquiz').hide(); \$('#hdnSelectedTopicid').val(topicId); \$('.div-loading').show(); \$('.levelclass').hide(); \$('#div-selectedlevel').show(); \$('.topicsclass').hide(); \$('#div-selectedtopic').fadeIn("slow"); \$('#lnkselectedtopic').attr("href", "javascript:showquizzes("+topicId+")"); \$('#btnselectedtopic').attr("onclick", "javascript:showtopics("+\$('#hdnSelectedLevelid').val()+")"); \$('#selectedtopic').html(\$('#topic-'+topicId).html()); \$('#hdnSelectedTopic').val(\$('#topic-'+topicId).html()); \$('#div-levels').html(''); \$.ajax({ type: "POST", url: "https://www.testandtrack.io/index.php/profile/getQuizByTopic/"+topicId , success: function (data) { quizlist = data; var result = jQuery.parseJSON(data); var topic = '<div class="row" style="margin:0px;padding-bottom:20px;">';//<div class="col-md-1"></div>'; for (var i = 0; i < result.length; i++) { var nextquiz = 0; var lock = "none;" var locktext = ""; if( i < result.length - 1 ) { nextquiz = result[i+1].id; } if(result[i].passreq == 'Y') { lock = "block;" locktext = "This test requires a password. Please ask your teacher to provide this."; } if(result[i].ispremium == '1') { lock = "block;" locktext = "'This content is only available to premium members'"; } topic = topic + '<div class="col-md-2 quizclass quizlistclass" style=""><a href="'; if(result[i].ispremium == '1' && ('' == 'N' || '' == '' )) topic = topic +'javascript:fnpremiumonly(); ">'; else topic = topic + 'javascript:selectquiz('+result[i].id+', '+nextquiz+');">'; topic = topic + '<div style="text-align:center;" class="asisgnquiz"><img id="icon-teacher-'+result[i].id+'" src="https://www.testandtrack.io/images/ico/icon-teacher.png" height="25" style="margin-bottom:0px;display:none;"><div class="card cardassignmentdefault" id="card-quiz-'+result[i].id+'" style="max-height:250px;max-width:250px;" ><p style="float:right;padding-right:10px;text-align:right;color:#4fcccd;"><img id="quiz-icon-lock-'+result[i].id+'" src="https://www.testandtrack.io/images/ico/icon-lock.png" height="15" width="10" style="float:left;display:'+lock+'margin:5px;" title="'+ locktext +'"> <input type="hidden" id="quiz-pass-req-'+result[i].id+'" value="'+result[i].passreq+'" >'+ (i +1 ) + '/' + result.length +'</p>' + '<h3 id="quiz-'+result[i].id+'" style="padding:20%;height:108px;font-size:16px;padding-left:5px;padding-right:5px;margin:0px;">'+result[i].quiz_name+'</3><p id="quiz-perc-'+result[i].id+'" style="color:red;font-weight:700;margin:0px;">&nbsp;</p>'; topic = topic + '<div class="tooltips" id="assigment-text-'+result[i].id+'" style="color:red;font-size:10px;margin:0px;"></div>'; { topic = topic + '<p id="p-quiz-'+result[i].id+'" style="border-top:none;margin:-4px;" class="cardassignmentdefaultbutton"><button id="qbutton-'+result[i].id+'" class="qbutton qbuttonred quizbutton">'; if(result[i].display_questions == 0) { topic = topic + ' Coming Soon '; } else { topic = topic + '.... Lesson + Test Qs ' + '['+result[i].display_questions+']'; } topic = topic + ' <img id="quiz-completed-star-icon-'+result[i].id+'" src="https://www.testandtrack.io/images/ico/icon-star.png" height="25" style="float:right;display:none;"> <img id="quiz-hand-star-icon-'+result[i].id+'" src="https://www.testandtrack.io/images/ico/icon-hand-check.png" height="25" style="float:right;display:none;"> <img id="quiz-completed-pencil-icon-'+result[i].id+'" src="https://www.testandtrack.io/images/ico/icon-pencil.png" height="25" style="float:right;"></button></p></div></div></div>' ; } if((i+1)%5 == 0) { topic = topic + '</a></div></div><div class="row" style="margin:0px;padding-bottom:20px;">'; } } \$('#div-levels').append(topic); \$('.div-loading').hide(); } }); \$('html,body').animate({ scrollTop: \$("#div-levels").offset().top}, 'slow'); addsocialsharelinks('t'); } /* \$( "#demo-form" ).submit(function( event ) { \$('#div-test-msg').hide(); var valid = true; var form_data = { qid: \$('#hdnSelectedQuizid').val(), pwd:\$('#vpass').val() }; if(\$('#hdnpassreq').val() == 'Y' ) { \$.ajax({ type: "POST", async: false, data: form_data, url: "https://www.testandtrack.io/index.php/profile/validatepwd" , success: function (data) { if(data=='0') { \$('#div-v-pass-error').show(); \$('#div-v-pass-error').html('Invalid Quiz Password.'); valid = false; } } });} if(!valid) { event.preventDefault(); } }); */ function tttt(){ alert('selected - ' + \$('#ddlQuiz').val()); var matchvalue = 0; \$('#ddlQuiz > option').each(function() { // alert(' quiz - ' + \$(this).text() + ' ' + \$(this).val()); if(matchvalue > 0 ) { alert('next quiz - ' + \$(this).text() + ' ' + \$(this).val()); matchvalue = -1; // break; } else if(\$('#ddlQuiz').val() == \$(this).val() ) { matchvalue = 1 ; alert('Its a match' + \$(this).text() + ' ' + \$(this).val()); } }); } \$('#ddllevel').on('change', function() { \$('#hdnURL').val(''); \$('#div-test-msg').hide(); }); \$('#ddlTopic').on('change', function() { \$('#hdnURL').val(''); \$('#div-test-msg').hide(); }); \$('#ddlQuiz').on('change', function() { \$('#div-test-msg').hide(); var level= \$('#ddllevel').val(); var Topic=\$('#ddlTopic').val(); var Quiz=\$('#ddlQuiz').val(); \$('#hdnSelectedLevel').val(\$( "#ddllevel option:selected" ).text()); \$('#hdnSelectedTopic').val(\$( "#ddlTopic option:selected" ).text()); \$('#hdnSelectedQuiz').val(\$( "#ddlQuiz option:selected" ).text()); var url = "https://www.testandtrack.io/index.php/studenttest/test/"+level+'/'+Topic+'/'+Quiz; \$('#hdnURL').val(url); \$("#fbHref").attr("href", "http://www.facebook.com/sharer.php?u="+ url); \$("#gglHref").attr("href", "https://plus.google.com/share?url="+ url); \$("#twtHref").attr("href", "https://twitter.com/share?url="+ url); //\$("#whtpHref").attr("href", "whatsapp://send?text="+ url); \$(".teams-share-button").attr("data-href", url); shareToMicrosoftTeams.renderButtons(); \$('#hdnquizurl').val(url); }); \$('#btnSubmitTest').click(function(e){ e.preventDefault(); \$('#lnklogin').click(); return false; // if (!checksession()) { // hideshowloginctrls('show'); // showlogin(); // e.preventDefault(); // }else // { // if( \$('#hdnpassreq').val() == 'Y'){ // e.preventDefault(); // \$('#btnSubmitPassTest').click(); // } if( \$('#hdnispremium').val() == 1 || \$('#hdnpassreq').val() == 'Y') { e.preventDefault(); fnpremiumonly(); } // } }); \$('#btnSubmitPassTest').click(function(e){ e.preventDefault(); }); //\$( "#frm-verify-pass" ).submit(function( e ) { \$('#btnVerifypass').click(function(e){ e.preventDefault(); \$('#div-v-pass-success').hide(); \$('#div-v-pass-error').hide(); var valid = true; var form_data = { qid: \$('#hdnSelectedQuizid').val(), pwd:\$('#vpass').val() }; \$.ajax({ type: "POST", async: false, data: form_data, url: "https://www.testandtrack.io/index.php/profile/validatepwd" , success: function (data) { if(data=='1') { \$('#btnSubmitTest1').click(); valid = true; } else{ \$('#div-v-pass-error').show(); \$('#div-v-pass-error').html('Invalid Quiz Password.'); valid = false; return false; } } }); if(valid) { \$( "#demo-form" ).submit(); } }); \$('#ddlQuiz').on('change', function() { \$('#div-desc').html(''); \$('#quiz_password').prop('required',false); \$('#div-quiz-pwd').hide(); \$('#hdnPwdReq').val('N'); \$('#div-test-msg').hide(); \$('#div-quiz-pwd').hide(); var QuizId = \$(this).val(); \$.ajax({ type: "POST", url: "https://www.testandtrack.io/index.php/profile/getdescription/"+QuizId , success: function (data) { if(data != -1 ){ var result = jQuery.parseJSON(data); if(result[0].description != null && result[0].description != "") { //\$('#div-desc').html(result[0].description); \$('#div-levels').html('<div class="col-12" style="background:white;padding-bottom: 20px;padding-right: 30px;padding-top:20px;"><div class="mt-3 quizdesc" style="text-align:center;padding:20px;border-radius:5px;/* background:#f4f3ef; */width:60%;border: 1px solid rgba(0,0,0,.125);">' + result[0].description + '</div></div>'); } } } }); }); function copy(type) { \$('#whtpHrefimg').attr('title','copy'); \$('#whtpHrefimg-level').attr('title','copy'); \$('#whtpHrefimg-topic').attr('title','copy'); var \$temp = \$("<input>"); \$("body").append(\$temp); if(type=='q') { \$temp.val(\$('#hdnquizurl').val()); \$temp.select(); document.execCommand("copy"); \$('#whtpHrefimg').attr('title','link copied.'); } else if(type=='t') { \$temp.val(\$('#hdnquizurl-topic').val()); \$temp.select(); document.execCommand("copy"); \$('#whtpHrefimg-topic').attr('title','link copied.'); } else if(type=='l') { \$temp.val(\$('#hdnquizurl-level').val()); \$temp.select(); document.execCommand("copy"); debugger; \$('#whtpHrefimg-level').attr('title','link copied.'); \$('#whtpHrefimg-level').tooltip('enable').tooltip('open'); } \$temp.remove(); } \$('.div-loading').hide(); fnLoadSelections(); // CKEDITOR.replace( 'notdesc'); // CKEDITOR.replace( 'notdescedit'); E: [email protected] www.teachingcomputing.com www.teachyourselfpython.com Find out more Preview What you get Leaderboard Our Pricing FAQs Company About Us The Team Privacy Statement Terms and Conditions Our to-do-list By Country UK USA AUSTRALIA © 2020-2021 TestandTrack. All Rights Reserved #cookieConsent{ background-color:white;text-align:center;display:none;position:fixed;z-index:65000;bottom:0px;width:100%;font-size:14px; } #cookieConsent button.cookieAccept{ background:#090;color:white;border:none;border-radius:0.2em;margin:0.5em;padding:0.2em 0.5em 0.2em 0.5em;} This website uses cookies to ensure you get the best experience on our website new WOW().init(); function myFunctionT() { // alert(""); \$('#tlSuccess').show(); \$('#tlSuccess').html("Thank you for signing in using google. We are logging you in...").fadeOut(8000); } function myFunctionTS() { //alert("Thank you for signing in using google. We are logging you in..."); \$('#tRegSuccess').show(); \$('#tRegSuccess').html("Thank you for signup using google. We are logging you in...").fadeOut(8000); } function myFunctionS() { // alert("Thank you for signing in using google. We are logging you in..."); \$('#slSuccess').show(); \$('#slSuccess').html("Thank you for signing in using google. We are logging you in...").fadeOut(8000); } function myFunctionSS() { // alert("Thank you for signing in using google. We are logging you in..."); \$('#srSuccess').show(); \$('#srSuccess').html("Thank you for Signup.Please wait We are logging you in...").fadeOut(8000); } function myFunctionFacebookS() { //alert("Thank you for signing in using facebook. We are logging you in..."); \$('#slSuccess').show(); \$('#slSuccess').html("Thank you for signing in using facebook. We are logging you in...").fadeOut(8000); } function myFunctionFacebookT() { //alert("Thank you for signing in using facebook. We are logging you in..."); \$('#tlSuccess').show(); \$('#tlSuccess').html("Thank you for signing in using facebook. We are logging you in...").fadeOut(8000); } function myFunctionFacebookSR() { //alert("Thank you for signing in using facebook. We are logging you in..."); \$('#srSuccess').show(); \$('#srSuccess').html("Thank you for Signup using facebook. We are logging you in...").fadeOut(8000); } function myFunctionFacebookTR() { //alert("Thank you for signing in using facebook. We are logging you in..."); \$('#tRegSuccess').show(); \$('#tRegSuccess').html("Thank you for signup using facebook. We are logging you in...").fadeOut(8000); } function myFunctionSignup() { alert("Thank you for Signup.Please wait We are logging you in..."); } function myfunctionLogin() { alert("Thank you for signing. We are logging you in..."); } function remove_photograph_change() { if (\$('#ticked').is(':checked')) { \$('#button1').on('click', function() { \$('#SignupModal').modal('hide'); \$('#TeacherSignupModal').modal(); }); \$('#button2').on('click', function() { \$('#SignupModal').modal('hide'); \$('#StudentSignupModal').modal(); }); // \$('#SignupModal').modal('hide'); //\$('#TeacherSignupModal').modal(); } else { \$('#SignupModal').modal(); } } // 15112018 : sudesh : moved this code from footer.php : issue - gmail login button takes time to load function renderButton() { gapi.signin2.render('test-login', { 'width': 200, 'height': 40, 'longtitle': false, 'theme': 'dark', 'onsuccess' :onSignIn }); gapi.signin2.render('test-login1', { 'width': 200, 'height': 40, 'longtitle': false, 'theme': 'dark', 'onsuccess' :onSignInT }); gapi.signin2.render('test-login2', { 'width': 200, 'height': 40, 'longtitle': false, 'theme': 'dark', 'onsuccess' :onSignIn }); gapi.signin2.render('test-login3', { 'width': 200, 'height': 40, 'longtitle': false, 'theme': 'dark', 'onsuccess' :onSignInT }); } \$(document).ready(function() { //alert('header ready'); \$('#div-stdl-loading').hide(); \$('#div-stds-loading').hide(); \$('#div-teachl-loading').hide(); \$('#div-teachs-loading').hide(); \$('#div-stds').show(); \$('#div-stdl').show(); \$('#div-teachs').show(); \$('#div-teachl').show(); }); window.onbeforeunload = function(e){ gapi.auth2.getAuthInstance().signOut(); }; function slide(){ \$(".slider-hill").animate({right: '250px'}); \$(".slider-hill").hide(); } var slideIndex = 0; carousel(); function carousel() { var i; var x = document.getElementsByClassName("mySlides"); for (i = 1; i < x.length; i++) { x[i].style.display = "none"; } \$('.mySlides').animate({right: '0px'}).hide(); slideIndex++; if (slideIndex > x.length) {slideIndex = 1} //x[slideIndex-1].style.display = "block"; \$('#sm'+slideIndex).show(1000).animate({right: '250px'}, "slow" ); for (i = 1; i < x.length; i++) { x[i].style.display = "none"; } setTimeout(carousel, 5000); // Change image every 2 seconds } \$('not_signed_incxfksqmnzu2e').html('Google'); // 15112018 : sudesh : moved this code to header.php : issue - gmail login button takes time to load /* function renderButton() { gapi.signin2.render('test-login', { 'width': 200, 'height': 40, 'longtitle': false, 'theme': 'dark', 'onsuccess' :onSignIn }); gapi.signin2.render('test-login1', { 'width': 200, 'height': 40, 'longtitle': false, 'theme': 'dark', 'onsuccess' :onSignInT }); gapi.signin2.render('test-login2', { 'width': 200, 'height': 40, 'longtitle': false, 'theme': 'dark', 'onsuccess' :onSignIn }); gapi.signin2.render('test-login3', { 'width': 200, 'height': 40, 'longtitle': false, 'theme': 'dark', 'onsuccess' :onSignInT }); } */ function fnpremiumonly() { \$('#lnkpremium').click(); } \$("#slError").hide(); \$("#slSuccess").hide(); \$("#srError").hide(); \$("srSuccess").hide(); function onSignIn(googleUser) { var profile = googleUser.getBasicProfile(); var form_data = { id: profile.getId(), email: profile.getEmail(), type : 'S', name : profile.getName() }; // debugger; \$.ajax({ url: "https://www.testandtrack.io/index.php/login/ggllogin", type: 'POST', data: form_data, success: function(msg) { //alert(msg); if (msg == '0') { \$("#srSuccess").hide(); \$("#srSuccess").hide(); \$("#slError").css("display","block"); \$("#slError").html('This e-mail has already been registered as a teacher...').fadeOut(8000); \$("#srError").css("display","block"); \$("#srError").html('This e-mail has already been registered as a teacher...').fadeOut(8000); // alert("Thank you for Signup.Please wait We are logging you in..."); } else if(msg == '2') { //alert("Thank you for Signup.Please wait We are logging you in..."); \$("#srSuccess").css("display","block").fadeOut(4000); \$("#srSuccess").html('Login Succesful').fadeOut(4000); \$("#slSuccess").css("display","block").fadeOut(4000); window.location.href = "https://www.testandtrack.io/index.php/student"; } //18012019 // added check for msg==1 , so system will now send welcome message only if new user signed up as login //prevously any case of error/exception was executing below code and sends email. //else{ else if(msg == '1'){ \$("#srSuccess").css("display","block"); \$("#srSuccess").html("Signup successful.. "); \$.ajax({ //url: "https://www.testandtrack.io/index.php/email/welcomegoogleS", url: "https://www.testandtrack.io/index.php/email/welcomeS", type:'POST', data: form_data, success: function(msg) { } }); \$("#slSuccess").css("display","block"); window.location.href = "https://www.testandtrack.io/index.php/student"; } //18012019 : added below condition to display error message else{ \$("#srSuccess").hide(); \$("#srSuccess").hide(); \$("#slError").css("display","block"); \$("#slError").html('Something went wrong. Please try again later.').fadeOut(8000); \$("#srError").css("display","block"); \$("#srError").html('Something went wrong. Please try again later.').fadeOut(8000); // alert("Thank you for Signup.Please wait We are logging you in..."); }} }); //console.log('ID: ' + profile.getId()); // console.log('Name: ' + profile.g<hr/>etName()); // console.log('Image URL: ' + profile.getImageUrl()); // console.log('Email: ' + profile.getEmail()); } \$( "#facebook-authorize-signup" ).click(function() { // alert('call'); checkLoginState(); }); \$( "#facebook-authorize-login" ).click(function() { // alert('call'); checkLoginState(); }); \$( "#facebook-authorize" ).click(function() { // alert('call'); checkLoginState(); }); function checkLoginState() { //debugger; FB.getLoginStatus(function(response) { if (response.status === 'connected') { // debugger; // alert('Welcome! Fetching your information.... '); FB.api('/me', {fields: 'last_name,first_name,email,short_name'}, function(response1) { \$("#slSuccess").css("display","block"); \$("#srSuccess").css("display","block"); \$("#slSuccess").html("Thank you for signing in using facebook. We are logging you in..."); \$("#srSuccess").html("Thank you for signing in using facebook. We are logging you in..."); // debugger; \$.ajax({ url: "https://www.testandtrack.io/index.php/login/fblogin", type: 'POST', data: response1, success: function(msg) { //alert('Login Successfull'); if (msg == '0') { \$("#slError").css("display","block"); \$("#slError").html('This account has already been registered as a teacher...'); \$("#srError").css("display","block"); \$("#srError").html('This account has already been registered as a teacher...'); } else{ \$("#slSuccess").css("display","block"); \$("#srSuccess").css("display","block"); \$("#slSuccess").html("Login successful.."); \$("#srSuccess").html("Login successful"); window.location.href = "https://www.testandtrack.io/index.php/student"; }} }); }); } else { FB.login(function(response) { if (response.authResponse) { checkLoginState(); } else { alert('User cancelled login or did not fully authorize.'); } }); } }); } window.fbAsyncInit = function() { FB.init({ appId : '2177361355866153', cookie : true, xfbml : true, version : 'v3.0' }); FB.AppEvents.logPageView(); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); \$("#slError").hide(); \$("#slSuccess").hide(); \$( "#form-s-login" ).submit(function( event ) { //alert( "student login" ); var isvalid = \$("#form-s-login").valid(); event.preventDefault(); var refresh = false; if("preview" == 'preview') { refresh = true; } \$("#slError").hide(); \$("#slSuccess").hide(); var form_data = { email: \$('#slemail').val(), password: \$('#slpassword').val(), type : 'S' }; if(isvalid) \$.ajax({ url: "https://www.testandtrack.io/index.php/login/check", type: 'POST', data: form_data, success: function(msg) { //debugger; //alert(msg); if (msg == '0') { //\$("#loginForm").submit(); \$("#slError").css("display","block").fadeOut(4000); //\$("#tRegError").html(""); // \$("#tRegError").html("<b>Sorry!</b> E-mail ID Already Exist."); } else { \$("#slSuccess").css("display","block").fadeOut(4000); if(refresh) location.reload(true); else window.location.href = "https://www.testandtrack.io/index.php/student"; }} }); }); \$("#srError").hide(); \$("#srSuccess").hide(); \$( "#form-s-signup" ).submit(function( event ) { var isvalid = \$("#form-s-signup").valid(); // debugger; // if (!isvalid) { // event.preventDefault(); // } //alert( "student signup" ); event.preventDefault(); // \$("#srError").hide(); // \$("#srSuccess").hide(); var email= \$('#sremail').val(); var password=\$('#srpassword').val(); var fname= \$('#srfname').val(); var lname= \$('#srlname').val(); var type = "S"; // debugger; var form_data = { email: \$('#sremail').val(), password: \$('#srpassword').val(), fname: \$('#srfname').val(), lname: \$('#srlname').val(), type : "S" }; if(isvalid){ \$.ajax({ url: "https://www.testandtrack.io/index.php/login/signup", type: 'POST', data: form_data, success: function(msg) { //alert(msg); if (msg == '0') { // \$("#tRegError").show().fadeOut(4000); //\$("#tRegError").css() \$("#srError").css("display","block"); \$("#srError").html('This account has already been registered as a student...').fadeOut(4000); } else if(msg == '1') { \$("#srError").css("display","block"); \$("#srError").html('This account has already been registered as a teacher...').fadeOut(4000); } else{ \$('#sremail').hide(); \$('#srpassword').hide(); \$('#srfname').hide(); \$('#srlname').hide(); \$('#sreremail').hide(); //alert('email'); \$("#srSuccess").css("display","block"); alert("Thank you for signing up. It will now take a few seconds to set up. Email verification is recommended but is not necessary to start using TestandTrack."); \$("#srSuccess").html("Do check your email (and junk folder) for the verification and welcome email. Note: Verification is recommended but not necessary for use of the platform."); \$.ajax({ url: "https://www.testandtrack.io/index.php/email/welcomeS", type: 'POST', data: form_data, success: function(msg) { //alert('email '+msg); } }); \$.ajax({ url: "https://www.testandtrack.io/index.php/login/check", type: 'POST', data: form_data, success: function(msg) { //debugger; // alert(msg); if (msg == '0') { //\$("#loginForm").submit(); \$("#srError").css("display","block"); //\$("#tRegError").html(""); // \$("#tRegError").html("<b>Sorry!</b> E-mail ID Already Exist."); }else if (msg == '-1') { //\$("#loginForm").submit(); \$("#srError").css("display","block"); \$("#srError").html('Please verify your account first.'); } else{ \$("#srSuccess").css("display","block"); window.location.href = "https://www.testandtrack.io/index.php/student"; }} }); }} }); } }); /* \$('#btnTeachS').click(function(){ var form_data = { fname: \$('#tFirstNameS').val(), lname: \$('#tLastNameS').val(), email: \$('#tEmailS').val(), password: \$('#btnTeachS').val(), type : 'T' }; \$.ajax({ url: "https://www.testandtrack.io/customer/checkAddTeacher", type: 'POST', data: form_data, success: function(msg) { if (msg == '0') { //\$("#loginForm").submit(); \$("#tRegError").css("display","block"); \$("#tRegError").html(""); \$("#tRegError").html("<b>Sorry!</b> E-mail ID Already Exist."); } else{ window.location.href = "https://www.testandtrack.io/teacher"; }} });}); */ window.onbeforeunload = function(e){ gapi.auth2.getAuthInstance().signOut(); }; \$("#slError").hide(); \$("#slSuccess").hide(); \$("#srError").hide(); \$("#srSuccess").hide(); function onSignInT(googleUser) { var profile = googleUser.getBasicProfile(); var form_data = { id: profile.getId(), email: profile.getEmail(), type : 'T', name : profile.getName() }; // debugger; \$.ajax({ url: "https://www.testandtrack.io/index.php/login/ggllogint", type: 'POST', data: form_data, success: function(msg) { //alert(msg); if (msg == '0') { \$("#tlSuccess").hide(); \$("#tRegSuccess").hide(); \$("#tlError").css("display","block"); \$("#tlError").html('This e-mail has already been registered as a student...').fadeOut(8000); \$("#tRegError").css("display","block"); \$("#tRegError").html('This e-mail has already been registered as a student...').fadeOut(8000); } else if(msg == '2') { \$("#tRegSuccess").css("display","block"); \$("#tRegSuccess").html('Login Succesful').fadeOut(4000); \$("#tlSuccess").css("display","block"); window.location.href = "https://www.testandtrack.io/index.php/teacher"; } //18012019 // added check for msg==1 , so system will now send welcome message only if new user signed up as login //prevously any case of error/exception was executing below code and sends email. //else{ else if(msg == '1'){ //\$('#tEmailS').hide(), // \$('#tPwdS').hide(), //\$('#tFirstNameS').hide(), //\$('#tLastNameS').hide(), \$("#tRegSuccess").css("display","block"); \$("#tRegSuccess").html("Signup successful...").fadeOut(4000); \$.ajax({ //url: "https://www.testandtrack.io/index.php/email/welcomegoogleT", url:"https://www.testandtrack.io/index.php/email/welcomeT", type:'POST', data: form_data, success: function(msg) { } }); \$("#tlSuccess").css("display","block").fadeOut(4000); window.location.href = "https://www.testandtrack.io/index.php/teacher"; } else{ \$("#tRegSuccess").hide(); \$("#tlSuccess").hide(); \$("#tlError").css("display","block"); \$("#tlError").html('Something went wrong. Please try again later.').fadeOut(8000); \$("#tRegError").css("display","block"); \$("#tRegError").html('Something went wrong. Please try again later.').fadeOut(8000); // alert("Thank you for Signup.Please wait We are logging you in..."); } } }); //console.log('ID: ' + profile.getId()); // console.log('Name: ' + profile.g<hr/>etName()); // console.log('Image URL: ' + profile.getImageUrl()); // console.log('Email: ' + profile.getEmail()); } \$( "#facebook-authorize-signup-teacher" ).click(function() { // alert('call'); checkLoginStatet(); }); \$( "#facebook-authorize-login-teacher" ).click(function() { // alert('call'); checkLoginStatet(); }); \$( "#facebook-authorize-teacher" ).click(function() { // alert('call'); checkLoginStatet(); }); function checkLoginStatet() { //debugger; FB.getLoginStatus(function(response) { if (response.status === 'connected') { // debugger; // alert('Welcome! Fetching your information.... '); FB.api('/me', {fields: 'last_name,first_name,email,short_name'}, function(response1) { debugger; \$.ajax({ url: "https://www.testandtrack.io/index.php/login/fblogint", type: 'POST', data: response1, success: function(msg) { //alert('Login Successfull'); if (msg == '0') { \$("#tlError").css("display","block"); \$("#tlError").html('This account has already been registered as a student...').fadeOut(4000); \$("#tRegError").css("display","block"); \$("#tRegError").html('This account has already been registered as a student...').fadeOut(4000); } else{ \$("#slSuccess").css("display","block").fadeOut(4000); window.location.href = "https://www.testandtrack.io/index.php/teacher"; }} }); }); } else { FB.login(function(response) { if (response.authResponse) { checkLoginStatet(); } else { alert('User cancelled login or did not fully authorize.'); } }); } }); } window.fbAsyncInit = function() { FB.init({ appId : '2177361355866153', cookie : true, xfbml : true, version : 'v3.0' }); FB.AppEvents.logPageView(); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); \$("#tlError").hide(); \$("#tlSuccess").hide(); \$( "#form-t-login" ).submit(function( event ) { //alert( "student login" ); var isvalid = \$("#form-t-login").valid(); event.preventDefault(); \$("#tlError").hide(); \$("#tlSuccess").hide(); var form_data = { email: \$('#tlemail').val(), password: \$('#tlpassword').val(), type : 'T' }; if(isvalid) \$.ajax({ url: "https://www.testandtrack.io/index.php/login/check", type: 'POST', data: form_data, success: function(msg) { //debugger; // alert(msg); if (msg == '0') { //\$("#loginForm").submit(); \$("#tlError").css("display","block").fadeOut(4000); //\$("#tRegError").html(""); // \$("#tRegError").html("<b>Sorry!</b> E-mail ID Already Exist."); } else{ // \$("#tlSuccess").css("display","block").fadeOut(4000); \$("#tlSuccess").html('Patience! We are loading your dashboard.'); \$("#tlSuccess").show(); \$("#tlpassword").hide(); \$("#tlemail").hide(); \$("#tlsubmit").hide(); \$("#div-loading-tlloading").show(); window.location.href = "https://www.testandtrack.io/index.php/teacher"; }} }); }); \$("#tRegError").hide(); \$("#tRegSuccess").hide(); \$( "#teach-signup-form" ).submit(function( event ) { var isvalid = \$("#teach-signup-form").valid(); //alert( "Teacher signup" ); event.preventDefault(); // \$("#srError").hide(); // \$("#srSuccess").hide(); var email= \$('#tEmailS').val(); var password=\$('#tPwdS').val(); var fname= \$('#tFirstNameS').val(); var lname= \$('#tLastNameS').val(); var type = "T"; //debugger; var form_data = { email: \$('#tEmailS').val(), password: \$('#tPwdS').val(), fname: \$('#tFirstNameS').val(), lname: \$('#tLastNameS').val(), type : "T" }; if(isvalid){ \$.ajax({ url: "https://www.testandtrack.io/index.php/login/signup", type: 'POST', data: form_data, success: function(msg) { //debugger; // alert(msg); if (msg == '0') { // \$("#tRegError").show().fadeOut(4000); //\$("#tRegError").css() \$("#tRegError").css("display","block"); \$("#tRegError").html('This account has already been registered as a student...').fadeOut(4000); } else if(msg == '1') { \$("#tRegError").css("display","block"); \$("#tRegError").html('This account has already been registered as a teacher...').fadeOut(4000); } else{ \$('#tEmailS').hide(); \$('#tPwdS').hide(); \$('#tFirstNameS').hide(); \$('#tLastNameS').hide(); \$('#treEmailS').hide(); alert("Give us a few seconds to prepare your dashboard. Email verification is recommended but is not necessary to start using TestandTrack."); \$("#tRegSuccess").css("display","block"); \$("#tRegSuccess").html("We are preparing your dashboard and in a few seconds the magic will begin. Do verify your email (check junk) but note you do not need to do this to start using the platform."); \$.ajax({ url: "https://www.testandtrack.io/index.php/email/welcomeT", type:'POST', data: form_data, success: function(msg) { } }); window.location.href = "https://www.testandtrack.io/index.php/teacher"; /* \$.ajax({ url: "https://www.testandtrack.io/index.php/login/check", type: 'POST', data: form_data, success: function(msg) { //debugger; //alert(msg); if (msg == '0') { //\$("#loginForm").submit(); \$("#tRegError").css("display","block").fadeOut(4000); //\$("#tRegError").html(""); // \$("#tRegError").html("<b>Sorry!</b> E-mail ID Already Exist."); }else if (msg == '-1') { //\$("#loginForm").submit(); \$("#tRegError").css("display","block"); \$("#tRegError").html('Please verify your account first.'); } else{ \$("#tRegSuccess").css("display","block").fadeOut(4000); window.location.href = "https://www.testandtrack.io/index.php/teacher"; }} });*/ //window.location.href = "https://www.testandtrack.io/index.php/teacher"; }} }); } }); /* \$('#btnTeachS').click(function(){ var form_data = { fname: \$('#tFirstNameS').val(), lname: \$('#tLastNameS').val(), email: \$('#tEmailS').val(), password: \$('#btnTeachS').val(), type : 'T' }; \$.ajax({ url: "https://www.testandtrack.io/customer/checkAddTeacher", type: 'POST', data: form_data, success: function(msg) { if (msg == '0') { //\$("#loginForm").submit(); \$("#tRegError").css("display","block"); \$("#tRegError").html(""); \$("#tRegError").html("<b>Sorry!</b> E-mail ID Already Exist."); } else{ window.location.href = "https://www.testandtrack.io/teacher"; }} });}); */ \$(document).ready(function() { \$("#form-s-signup").validate({ rules: { srfname: "required", sremail: { required: true, email: true }, sreremail: { required: true, equalTo: "#sremail" }, phone: { required: true, number: true }, url: { required: true, url: true }, username: { required: true, minlength: 6 }, srpassword: { required: true, minlength: 6 }, gender: { required: true, }, agree: "required" }, messages: { srfname: "Please enter your first name", sremail: "Please enter a valid email address", phone: { required: "Please enter your phone number", number: "Please enter only numeric value" }, url: { url: "Please enter valid url" }, username: { required: "Please enter a username", minlength: "Your username must consist of at least 6 characters" }, srpassword: { required: "Please provide a password", minlength: "Your password must be at least 6 characters long" }, sreremail: { required: "Please enter a valid email address", equalTo: "Please enter the same email address as above" }, gender: { required: "Please select gender", }, agree: "Please accept our policy" } }); }); \$(document).ready(function() { \$("#teach-signup-form").validate({ rules: { tFirstNameS: "required", sremail: { required: true, email: true }, treEmailS: { required: true, equalTo: "#tEmailS" }, phone: { required: true, number: true }, url: { required: true, url: true }, username: { required: true, minlength: 6 }, tPwdS: { required: true, minlength: 6 }, gender: { required: true, }, agree: "required" }, messages: { tFirstNameS: "Please enter your first name", tEmailS: "Please enter a valid email address", phone: { required: "Please enter your phone number", number: "Please enter only numeric value" }, url: { url: "Please enter valid url" }, username: { required: "Please enter a username", minlength: "Your username must consist of at least 6 characters" }, tPwdS: { required: "Please provide a password", minlength: "Your password must be at least 6 characters long" }, treEmailS: { required: "Please enter a valid email address", equalTo: "Please enter the same email address as above" }, gender: { required: "Please select gender", }, agree: "Please accept our policy" } }); }); \$(document).ready(function() { \$("#form-s-login").validate({ rules: { srfname: "required", slemail: { required: true, email: true }, sreremail: { required: true, equalTo: "#sremail" }, phone: { required: true, number: true }, url: { required: true, url: true }, username: { required: true, minlength: 6 }, slpassword: { required: true, minlength: 6 }, gender: { required: true, }, agree: "required" }, messages: { srfname: "Please enter your first name", slemail: "Please enter a valid email address", phone: { required: "Please enter your phone number", number: "Please enter only numeric value" }, url: { url: "Please enter valid url" }, username: { required: "Please enter a username", minlength: "Your username must consist of at least 6 characters" }, slpassword: { required: "Please provide a password", minlength: "Your password must be at least 6 characters long" }, sreremail: { required: "Please enter a valid email address", equalTo: "Please enter the same email address as above" }, gender: { required: "Please select gender", }, agree: "Please accept our policy" } }); }); \$(document).ready(function() { \$("#form-t-login").validate({ rules: { srfname: "required", tlemail: { required: true, email: true }, sremail: { required: true, equalTo: "#sremail" }, phone: { required: true, number: true }, url: { required: true, url: true }, username: { required: true, minlength: 6 }, tlpassword: { required: true, minlength: 6 }, gender: { required: true, }, agree: "required" }, messages: { srfname: "Please enter your first name", tlemail: "Please enter a valid email address", phone: { required: "Please enter your phone number", number: "Please enter only numeric value" }, url: { url: "Please enter valid url" }, username: { required: "Please enter a username", minlength: "Your username must consist of at least 6 characters" }, tlpassword: { required: "Please provide a password", minlength: "Your password must be at least 6 characters long" }, sreremail: { required: "Please enter a valid email address", equalTo: "Please enter the same email address as above" }, gender: { required: "Please select gender", }, agree: "Please accept our policy" } }); }); \$('#div-loading').hide(); \$("#slError").hide(); \$("#slSuccess").hide(); \$( "#forgot-pass" ).submit(function( event ) { var isvalid = \$("#forgot-pass").valid(); \$('#div-loading').show(); event.preventDefault(); \$("#forgot-pass").hide(); \$("#slError").hide(); \$("#slSuccess").hide(); var form_data = { email: \$('#email').val() }; if(isvalid) \$.ajax({ url: "https://www.testandtrack.io/index.php/email/welcomefps", type: 'POST', data: form_data, success: function(msg) { //\$('#div-loading').hide(); //\$('#forgotpwdmsg').show(); //\$("#forgot-pass").hide(); } }); \$('#div-loading').hide(); \$('#forgotpwdmsg').show(); \$("#forgot-pass").hide(); }); \$( "#reset-form" ).submit(function( event ) { // alert('submit'); \$('#diverror').hide(); \$('#diverror').html(''); if(\$('#password').val() != \$('#cpassword').val()){ event.preventDefault(); \$('#diverror').show(); \$('#diverror').html('Password does not match.') } }); var onloadCallback = function () { grecaptcha.render('gcptcha', { 'sitekey': '6LffL9cZAAAAALI9YwF3W-Ey9yDWUqwl0LGL2FpL', 'callback': function (response) { if(response){ \$('.recaptcha-error-message').hide(); } else { \$('.recaptcha-error-message').show(); } } }); }; \$("#slError").hide(); \$("#slSuccess").hide(); \$( "#main-contact-form" ).submit(function( event ) { //alert( "student login" ); var isvalid = \$("#main-contact-form").valid(); event.preventDefault(); var emailid= \$('#emailid').val(); var name=\$('#name').val(); var messg= \$('#message').val(); var subject= \$('#subject').val(); \$('.recaptcha-error-message').hide(); \$('#div-contact-error').hide(); var form_data = { emailid: \$('#emailid').val(), name: \$('#name').val(), messg:\$('#message').val(), subject:\$('#subject').val(), captcharesponse : \$('#g-recaptcha-response').val() }; if(isvalid) \$.ajax({ url: "https://www.testandtrack.io/index.php/email/sendmessage", type: 'POST', data: form_data, success: function(msg) { if(msg == '-1') { \$('.recaptcha-error-message').show(); } else if(msg == '1') { \$('#div-contact-success').show(); \$('#main-contact-form').hide(); } else { \$('#div-contact-error').show(); \$('#div-contact-error').html('Something went wrong. Please try after sometime.'); }} }); }); \$(document).ready(function() { \$('#cookieConsent').cookieConsent({ message: 'This website uses cookies. By using this website you consent to our use of these cookies.' }); }); checkacceptcookie(); function setCookie() { document.cookie = "acceptcookie=Y"; } function checkacceptcookie() { var name = "acceptcookie="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i <ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } \$('#cookieConsent').show(); return ""; } \$( '#btncookieAccept' ).click(function() { setCookie(); \$('#cookieConsent').hide(); }); ```