0% found this document useful (0 votes)
339 views

Conjuguemos

The document contains JavaScript code that customizes an online activity based on the activity type. It sets variables, calls AJAX requests, randomizes lists, and fills in answers depending on the type. It then simulates the user getting a set number of questions correct and incorrect by automatically submitting correct or incorrect responses and verifying the answers without timing. Finally, it stops the clock, sets variables, and displays an alert.

Uploaded by

unknown racerx50
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
339 views

Conjuguemos

The document contains JavaScript code that customizes an online activity based on the activity type. It sets variables, calls AJAX requests, randomizes lists, and fills in answers depending on the type. It then simulates the user getting a set number of questions correct and incorrect by automatically submitting correct or incorrect responses and verifying the answers without timing. Finally, it stops the clock, sets variables, and displays an alert.

Uploaded by

unknown racerx50
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

if (start == 0) {

if (activityType == "vocabulary") {
jQuery.ajax('/au.php?x=sa&t='+activityType);
randomizeList("yes");
setvariable();
}
else if (activityType == "verbs") {
jQuery.ajax('/au.php?x=sa&t='+activityType);
howToSelectVerbs('yes');
setvariable();
}
else if (activityType == "fillin")
{
for (var r = 0; r < answers.length; r++)
document.form.elements[r].value = (answers instanceof Array) ? answers[r][
0] : answers[r];
alert("Done! All answers have been filled in for you.\n\nTweaked by WW.");
}
else
jQuery.ajax('/au.php?x=sa&t='+activityType);
}
var getCorrect = parseInt(prompt("How many would you like to get correct?", 1));
var getIncorrect = parseInt(prompt("How many would you like to get incorrect?",
1));
var qTime = parseInt(prompt("How much time would you like to take? (in minutes)"
, 5));
var totalMins = qTime;
tmin = Math.round(totalMins - 1);
tsec = Math.round(59);
var yi = 0;
for(yi = 0; yi < getIncorrect; yi++)
{
qTime = false;
$('#response').val(solution + yi);
verifyAnswer();
$("#form").submit();
}
for(yi = 0; yi < getCorrect; yi++)
{
qTime = false;
if (solution instanceof Array)
$('#response').val(solution[0]);
else
$('#response').val(solution);
verifyAnswer();
$("#form").submit();
}
stopClock();
qTime = false;
alert("Done! Click 'Print Results', check your results, and if all is good click
'Record/send results'.\n\nTweaked by WW.");

You might also like