Getting Pass/Fail to execute Javascript
Author | Message |
Hi, I was wondering if it is possible to get a pass/fail or even an incorrect/correct event on a quiz or item respectively to execute a Javascript.
|
I was looking at your iSpring JS API and saw fsplayer.api.SlideInfo Class.
|
You can figure out if a course was passed or not if you publish your presentation into SCORM (Publish --> LMS tab) and check out the file lms.js inside the package.
|
Thank you Stacy for the response. If I publish to SCORM will I still have a .swf file though? My system is not built to SCORM compliance, nor am I certain what files it may output.
|
I have been looking through the lms.js file in great details, and I just can't figure out what function to call to get the score the user had on the quiz. Code: document.getElementById("demo").innerHTML="quizId" + quizId + "pointScore" + pointScore + "percentScore" + percentScore + "totalScore" + totalScore + "totalScoreNormalized" + totalScoreNormalized + "passed" + passed + "quizIsSurvey" + quizIsSurvey;; alert ("I am running"); I have a simple html blob under the quiz that this code should transform into the arguments that this function should be receiving from the flash quiz, but it never changes. So then I added an alert window that should run if this function is ever called and I never get the alert window when taking the test or on the review page. Unfortunately I can not access the .swf source code to aid me in my looking so I don't know what that file is doing. Can you help in pointing me to the correct function that simply returns the users score on the quiz? My idea is to have a script run at the end of the quiz that will simply collect the users score and then send it to my server.
|
Perhaps an option to send quiz results to server can work for you in this situation. This way you'll get the detailed report every time someone takes a quiz. You can learn more about this option here:
|
Stacy, this option will not work for me. I need to know exactly who is taking the quiz so I can assign the grade to a user. By using the simple send to server is not good enough because I will have no idea whose grade I am receiving. And we do not trust the user to input their correct username credentials into the quiz, nor can we afford to burden a logged-in user with re-inputting their credentials.
|
In this case you can use the optional quiz authorization feature which allows to establish user identity via the quiz URL if a quiz is embedded to a webpage. Code: <object id="quiz" width="100%" height="100%" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="New Quiz.swf?userid=someuserid&username=username&email=some@email.com" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowFullScreen" value="true" /> <embed src="New Quiz.swf?userid=someuserid&username=username&email=some@email.com" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="quiz" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" allowFullScreen="true" /> </object> I hope it will help.
|
||||
|
Who is online | |
---|---|
![]() |
In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 5 minutes) Most users ever online was 803 on Sat Dec 12, 2020 9:21 am Registered users: No registered users |