Register

Variables

Questions regarding the authoring of Viewlets, installation or possible bugs with our products. For urgent issues, please use our support form on our website: http://www.qarbon.com/help/helpme.php
tvoverton

Variables

Postby tvoverton » Mon Feb 18, 2008 4:34 pm

Hello
How do I make a ViewletQuiz go to a slide that I want it to go to if the user doesn't pass the quiz?


I want to show up two end slide either or - you were successful, or you weren't successful try again. This will depend on the score reaching 100% for the pass slide to appear and less than 100% then go to other slide - unsuccessful.

So how to give it the command to go to a particular slide based on the total score?

Thanks

Joel

Site Admin
User avatar
Posts: 223
Joined: Fri May 26, 2006 1:51 pm
Location: Rochester, NY

Postby Andrew » Tue Feb 19, 2008 2:36 pm

The product doesn't currently support this directly, but there may be a workarond. I've submitted a case to our development team on this issue. I'll get back to you on this by tomorrow.
Andrew Branch

Site Admin
User avatar
Posts: 223
Joined: Fri May 26, 2006 1:51 pm
Location: Rochester, NY

Postby Andrew » Wed Feb 20, 2008 3:10 pm

You can do this via the JavaScript action.

Here is a simple example:
http://www.viewletcentral.com/vc/viewlet/221711314/

After all your questions, add a blank slide. Add a Pause Zone to that slide and add a JavaScript action to the slides OnLoad event.

Enter the following JavaScript. With the number of the slides you what to go to if the user passed or failed.

Code: Select all
if($CURRENT_SCORE$ >= $PASSING_SCORE$)
   flashProxy.call('gotoSlide', 4);
else
   flashProxy.call('gotoSlide', 5);
Andrew Branch

Site Admin
User avatar
Posts: 223
Joined: Fri May 26, 2006 1:51 pm
Location: Rochester, NY

Postby Andrew » Wed Feb 20, 2008 3:13 pm

For a list of all the JavaScript commands you can call see this FAQ:

How do I call ActionScript methods in a Viewlet from JavaScript?
Andrew Branch

User
Posts: 2
Joined: Tue Jul 01, 2008 3:42 pm

Re: Variables

Postby alamoksha » Tue Jul 01, 2008 3:50 pm

I followed these exact instructions, but once I get to the blank slide with the pause zone and javascript, nothing happens. My blank slide is right after my last question and I put the correct slide numbers in the javascript as well. I just can't seem to figure out what is wrong! Any ideas?

Thanks

Site Admin
User avatar
Posts: 223
Joined: Fri May 26, 2006 1:51 pm
Location: Rochester, NY

Re: Variables

Postby Andrew » Wed Jul 02, 2008 7:06 am

If you're using ViewletBuilder6 the format has changed slightly.

See if this FAQ helps you:
http://www.qarbon.com/faqs/viewletbuild ... tionscript
Andrew Branch

User
Posts: 8
Joined: Mon Nov 17, 2008 7:41 am

Re: Variables

Postby rick2428 » Wed Jan 06, 2010 11:30 pm

Can we revisit this? I've tried many many iterations of this and I cannot get it to work. I want it to go exactly like your example.
I have 8 questions - if they pass, go to slide 17. Fail goes to slide 18. Not working.

I have the most recent version of ViewletQuiz.

Thanks.

User
User avatar
Posts: 50
Joined: Mon May 29, 2006 12:47 am
Location: Dolny Kubin, Slovakia

Re: Variables

Postby Michal » Thu Jan 07, 2010 10:18 am

Hi,

you'll need to manage the quiz score by yourself via JavaScript, it's easy in your case.

On the last question slide add a javascript action for the "Submit" button onClick event and add this line:
Code: Select all
checkStatus();


Now you'll need to edit the HTML frame. Add this code:
Code: Select all
function checkStatus()
{
   var flashObject = window.document.$VIEWLET_NAME$;
   var correct = flashObject.viewletGetVariable("QUESTION_CORRECT_TOTAL");
   if (correct == 8)
   {
      flashObject.viewletGotoSlide(17);   // pass
   }
   else
   {
      flashObject.viewletGotoSlide(18);   // not pass
   }
}


Please, see the attached file, it's simple version of your case, with just 2 questions.

Please, let me know, if this helps you.

Michal
Attachments
cust_support.zip
Custom scoring example
(57.49 KiB) Downloaded 338 times
Michal

Return to Discussions

Who is online

Users browsing this forum: No registered users and 1 guest