Author Message

Posted: Fri Mar 22, 2013 3:46 am   Post subject: Getting Pass/Fail to execute Javascript

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.

The reason I am interested is because I am embedding some of these quizzes on my secured website that users have to log into. My site already has a test player engine that asks multiple choice questions and stores the users answer to a database under their username.

I want to use Ispring to ask more in depth questions, but I currently have no way to have the data sent to my database reliably. Having the user enter their username and credentials by hand in the flash frame is not an acceptable answer because the users are school children who are not trusted to enter this information reliably.

Currently I can display the quiz and have the user take the quiz and know whether they got questions right or wrong, but without being able to have the .swf file talk to my test engine via Javascript I can't think of a way to reliably mark on my database whether the quiz/question was marked correctly.

My only other idea was to write some code that would interpret the notification at the end of the quiz (which I can currently manipulate in Ispring) and determine based on what the results page says whether the user passed or failed. The problem with this is I am not sure if any code I write is going to be able to access the text in the .swf frame as it is a flash frame and so I don't think any javascript I write will be able to interpret the text in the frame.

Please help! Thanks!

Profile profile test

Posted: Fri Mar 22, 2013 4:24 am   Post subject: Re: Getting Pass/Fail to execute Javascript

I was looking at your iSpring JS API and saw fsplayer.api.SlideInfo Class.

The description says you can use this to get the text from a slide, but I see no API that actually gets the text from the slide, just the title.

This could be a possibility, if I could retrieve the text on the result slide via this API, I could have in my options possibly a text indicator that could alert my script whether the user passed or failed.

Profile profile test

Posted: Fri Mar 22, 2013 4:06 pm   Post subject: Re: Getting Pass/Fail to execute Javascript

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.

It has the function iSpring.LMS.prototype.setQuizScore (that is called at the end of a quiz) and the parameter PASSED which tells if a quiz was passed or not. This possibility is not included into the official documentation available at our website. It will definitely work for the 6th generation of iSpring software.

Regarding your last post – only text can be retrieved.

Profile profile test

Posted: Sat Mar 23, 2013 2:50 pm   Post subject: Re: Getting Pass/Fail to execute Javascript

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 need to be able to deliver the quiz in a standard html atmosphere, where basically the quiz is input via a simple .swf reference like any other media file.

Regarding my second post, what would be the actual Javascript command if I wanted to retrieve all of the text on my Results slide (or any slide for that matter?)? I don't see in your documentation where this is explained. Also is there a command to retrieve the text in the Question feedback box that pops up. I could use that to determine whether a question was answered correctly or not.

Lastly, is there a javascript api command to activate the submit button on the page without actually having the user to physically click it? My web pages already have an html submit button for tests that I would like to automatically activate the submit button in the flash quiz.

Profile profile test

Posted: Sat Mar 23, 2013 7:45 pm   Post subject: Re: Getting Pass/Fail to execute Javascript

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.

I have found the setQuizScore function you referred to, but I am almost certain this function is never called by the quiz. I inserted this code into the function to test:

   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.

Profile profile test

Posted: Mon Mar 25, 2013 11:48 am   Post subject: Re: Getting Pass/Fail to execute Javascript

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:

Profile profile test

Posted: Mon Mar 25, 2013 3:26 pm   Post subject: Re: Getting Pass/Fail to execute Javascript

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.

I know that your system is built to have JavaScript APIs to do everything I need, I just need to know what those APIs are. Is there a contact for one of your programmers I can talk with? What I am asking I think is fairly simple, I just need to know what the SCORM APIs are so that I can call them and get the quiz details output.

If I can not get this to work I will have to re-evaluate my use of the program on a larger scale. We are planning to have hundreds of users using this to create quiz content, but if it won't talk with our system than it isn't worth taking the time to implement it.

Profile profile test

Posted: Tue Mar 26, 2013 4:40 pm   Post subject: Re: Getting Pass/Fail to execute Javascript

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.

To let quiz pass the session id you need to pass the "userid" parameter to the Flash Quiz via URL parameter. You can also pass user name and user email to the quiz via "username" and "email" URL parameters. Please see the example below:

<object id="quiz" width="100%" height="100%" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=",0,0,0" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="New Quiz.swf?userid=someuserid&username=username&" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowFullScreen" value="true" />
<embed src="New Quiz.swf?userid=someuserid&username=username&" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="quiz" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="" allowFullScreen="true" />

I hope it will help.

Profile profile test
Display posts from previous:  Sort by  


Who is online
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