'; qFrame.location.replace("javascript: parent.frames[0].nextQ"); // Increment variables for the next question qIdx++; // Allow early quitting if(qIdx >= 2 && !stopOK) { stopOK = true; } } function makeButton(optLtr, optAnswer) { return '' + optAnswer + '
'; } function chickenOut() { if(stopOK && // If the user qualifies to stop early confirm('¿Detenemos el Test?')) { gradeTest(); } } function gradeTest() { // Compare student answers with correct answers for (var i = 0; i < qIdx; i++) { if (keeper[i] == units[i].answer) { correct++; } } // Print the test results, and pass the student ranking as an argument var idx = Math.ceil((correct/howMany) * rank.length - 1) < 0 ? 0 : Math.ceil((correct/howMany) * rank.length - 1); printResults(rank[idx]); itemReset(); } // Print the questions, answer options, and other info function printResults(ranking) { // Set variable results equal to an entire web page results = '' + '' + '

Tu Calificación ' + correct + '/' + howMany + ' Aciertos.

' + 'Apreciación : ' + ranking + '
Pasa el mouse sobre el texto en rojo para ver la referencia de la cita...
' + '

Estas son tus respuestas:

'; // Add each question-answer set to variable results for (var i = 0; i < howMany; i++) { results += '\n\r\n\r\n\rPregunta ' + (i + 1) + '
' + units[i].question + '

\n\r' + 'a. ' + units[i].a + '
' + 'b. ' + units[i].b + '
' + 'c. ' + units[i].c + '
' + 'd. ' + units[i].d + '
'; // Determine if the student answered each question appropriately, and display accordingly if (keeper[i] == units[i].answer) { results += 'Elegiste la respuesta correcta... (' + keeper[i] + ').\n\r


'; } else { // results += '' + 'Fallaste... La respuesta correcta es: ' + units[i].answer + '\n\r


'; } } // Close out the HTML, and replace the location href with the variable results += '\n\r'; qFrame.location.replace("javascript: parent.frames[0].results"); } // For clearing the status bar function show() { parent.status = ''; } // For displaying explanations of those answers the user missed function explain(str) { globalStr = str; with (aFrame.document) { open(); writeln('' + globalStr + ''); close(); } } // For returning frames to their original content function cleanSlate() { aFrame.location.replace('javascript: parent.dummy1'); qFrame.location.replace('javascript: parent.dummy2'); }