1 2function loadQuestions() { 3 4 if (!!wrquestions && !!wrresults) { 5 6 var score = 0; 7 var step = 0; 8 var stepSize = 100 / wrquestions.length; 9 var progress = stepSize; 10 11 function convertInt(number) { 12 // Hängt ein Prozent-Zeichen für CSS an den errechneten Wert an 13 temp = number.toString(); 14 temp += "%"; 15 return temp; 16 } 17 18 function calculate(points) { 19 20 score += points; 21 step += 1; 22 $('#frage').html(wrquestions[step]); 23 progress += stepSize; 24 $('#progress').css("width", convertInt(progress)); 25 26 if (step >= wrquestions.length) { 27 if (score <= 18) { 28 $('#frage').html(wrresults[2]); 29 } else if (score > 18 && score <= 28) { 30 $('#frage').html(wrresults[1]); 31 } else { 32 $('#frage').html(wrresults[0]); 33 } 34 $('.antworten').css("display", "none"); 35 $('.neustart').css("display", "flex"); 36 } 37 } 38 39 function restart() { 40 step = 0; 41 score = 0; 42 progress = 0; 43 $('.antworten').css("display", "flex"); 44 $('.neustart').css("display", "none"); 45 $('#progress').css("width", convertInt(stepSize)); 46 $('#frage').html(wrquestions[step]); 47 } 48 49 $(document).ready(function () { 50 $('#progress').css("width", convertInt(progress)); 51 $('#frage').html(wrquestions[step]); 52 $('#ja').on("click", function () { 53 calculate(4); 54 }); 55 $('#unsicher').on("click", function () { 56 calculate(2); 57 }); 58 $('#nein').on("click", function () { 59 calculate(0); 60 }); 61 $('.neustart').on("click", function () { 62 restart(); 63 }); 64 65 }); 66 } 67}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.