File "std-quizzes.min.js"
Path: /StudyIB/js/std-quizzesminjs
File size: 2.47 KB
MIME-type: text/plain
Charset: utf-8
function checkTotalQuizNetworks(t,e){var a=$(".exercise").length,s,i=$(".exercise").find(".score.A").length+"/"+a,r=0;$.when(e.find(".btn.check").trigger("click")).then(e.find(".actions .score").each((function(){r+=parseFloat($(this).data("score"))}))),score=Math.round(r/a|0);var n=$("#total-score");100==score?n.addClass("A"):score>70?n.addClass("B"):score>50?n.addClass("C"):score>30?n.addClass("D"):n.addClass("E"),n.attr("rel",score),n.show("fast")}$(document).ready((function(){$(".tib-quiz").each((function(){prepareAnswers($(this)),emptyTextAnswers($(this)),labelMultipleCorrectAnswers($(this)),addLettersBeforeOptions($(this)),adjustImageSizes($(this))})),$("#main-column, #netviewer, #main-article").on("click",".exercise .btn.check",(function(t){var e=$(this).closest("div.tib-quiz"),a=$(this).closest("div.exercise"),s=e.find(".exercise").length,i;void 0===e.data("n-to-check")?(e.attr("data-n-to-check",s),i=s):i=parseInt(e.attr("data-n-to-check"));var r=a.find(".actions .score");if(void 0===r.attr("data-marktotal")){var n=checkExercise($(this));r.attr("data-score",n.score),r.attr("data-markcorrect",n.markCorrect),r.attr("data-marktotal",n.markTotal),gradeColor(r,n.score);var c=a.find(".q-explanation");c.find("p").filter((function(){return""==$.trim($(this).html())||" "==$.trim($(this).html())})).remove(),$.trim(c.html())&&c.prepend("<h5><strong>Explanation</strong></h5>").show();var o=getQuestionMark(n);r.append("Score: "+o)}i-=1,e.attr("data-n-to-check",i),0!=i||a.parent(".tib-quiz").find(".check-total").hasClass("done")||a.parent(".tib-quiz").find(".check-total").trigger("click"),$(this).closest(".actions").css("padding","0"),$(this).remove()})),$('.exercise input[type="checkbox"]').click((function(){limitedMultipleChoices($(this))})),$("#main-column, #netviewer").on("click",".tib-quiz .check-total",(function(t){t.preventDefault();var e=$(this).closest(".tib-quiz");$(this).addClass("done"),$(this).remove(),$.when(e.find(".btn.check").trigger("click")).then((function(){var t=checkTotalQuiz(e),a=e.find(".totals"),s=a.find(".score");gradeColor(s,t.score),s.append('<strong style="font-size: 1.2em">'+t.score+"%</strong> ("+t.mark+")"),s.attr("rel",t.score),a.show("fast");var i=0;e.hasClass("score-on-top")||(i=a.offset().top-200),$("html, body").animate({scrollTop:i},"300","swing"),e.hasClass("qbank")&&$(".btn-again").length&&($(".btn-again").removeClass("hidden"),$(".btn-new").removeClass("hidden"))}))})),initDraggableEvents(!1),preventMatchKeyInput(!1),adjustMatchExerciseHeight()}));