quiz
2 TopicsMagic JavaScript switch?
I have a drag and drop quiz with 95 drag options that are then added to a chart. This is all working beautifully and tiling onto the chart very nicely, but if I want to randomize the order that the 95 options appear in (on the drag sequence menu) then I have to manually drag them around to make them appear randomized. Has anyone ever incorporated javascript to make drag options appear in random order if they are appearing one by one? Apologies if this is unclear or not allowed to ask.154Views0likes6CommentsSending Points to the LMS using Javascript
I have a quiz that contains 14 free-form questions and one custom built question for a total of 15 points. Variable: customScore stores the custom question result. Variable: quiz.ScorePoints stores the built in quiz result. Variable: finalScore combines both values. On the result slide i can see all of these variables working as intended and being combined correctly. When i try and print the score to Moodle however the score repeatedly returns 0. I have played around with switching Results.ScorePercent with quiz.ScorePercent and quiz.ScorePoints without luck. Can anyone see any error in the script? Here is the code: var player = GetPlayer(); var customScore = player.GetVar("customScore"); var quizScore = player.GetVar("Results.ScorePercent"); var finalScore = quizScore + customScore; // Set the final score (0-100 scale) lmsAPI.SetScore(finalScore, 100, 0); // Mark the course as completed lmsAPI.SetReachedEnd();107Views0likes5Comments