'); spawn.document.writeln(''); spawn.document.writeln(''); spawn.document.writeln('

Pitanje br. ' + (questionIndex + 1) + '

'); spawn.document.writeln('
'); spawn.document.writeln('' + question + '

'); spawn.document.writeln('' + optionA + '
'); spawn.document.writeln('' + optionB + '
'); spawn.document.writeln('' + optionC + '
'); spawn.document.writeln('' + optionD + '
'); spawn.document.writeln('

 

'); spawn.document.close(); // Increment variables for the next question questionIndex++; preventer++; } function gradeTest() { // Increment the variables for the last time questionIndex++; preventer++; // Compare student answers with correct answers for (var i = 0; i < killers.length; i++) { if (keeper[i] == answers[i]) { correctAnswers++; } } // Determine a ranking according to number of corrrect answers jsAbility = performance[Math.ceil((correctAnswers/killers.length) * performance.length - 1)]; // Print the test results printResults(); } // Print the questions, answer options, and other info function printResults() { spawn.document.clear(); spawn.document.open(); spawn.document.writeln(''); spawn.document.writeln('JavaScript Brain Masher Results'); spawn.document.writeln(' '); spawn.document.writeln(''); spawn.document.writeln('

Vasi poeni ' + correctAnswers + ' '+'od'+' ' + killers.length + ' mogucih.

'); spawn.document.writeln('Poredak: ' + jsAbility + '
'); spawn.document.writeln('

Ovdje je prikaz kako ste odgovarali:

'); for (var i = 0; i < killers.length; i++) { spawn.document.writeln('\n\nPitanje ' + (i + 1) + '
'); spawn.document.writeln(killers[i].substring(0, killers[i].indexOf('$$'))); spawn.document.writeln('

\na. ' + killers[i].substring((killers[i].indexOf('$$') + 2), killers[i].indexOf('%%')) + '
'); spawn.document.writeln('b. ' + killers[i].substring(killers[i].indexOf('%%') + 2, killers[i].indexOf('^^')) + '
'); spawn.document.writeln('c. ' + killers[i].substring(killers[i].indexOf('^^') + 2, killers[i].indexOf('&&')) + '
'); spawn.document.writeln('d. ' + killers[i].substring(killers[i].indexOf('&&') + 2, killers[i].length) + '
'); // Determine if the student answered each question appropriately, and display accordingly if (keeper[i] == answers[i]) { spawn.document.writeln('Ovo ste tacno odgovorili.\n


'); } else { spawn.document.writeln('Pogresno ste odgovorili. Tacan odgovor je: ' + answers[i] + '\n


'); } } // Add extra info about the ranking, questions, and application spawn.document.writeln('Kliknite ovdje za pokretanje ponovo.'); spawn.document.writeln('\n\n

 

'); spawn.document.close(); } function busted() { alert('Zao mi je, samo jednom mozete da odgovorite na pitanje.'); spawn.history.forward(); spawn.focus(); }

 

 

 

 

Pokrenite kviz ...