in

Quark Forums

QID Expression to keep score in a quiz

Last post 05-29-2009 2:31 PM by Matthias Guenther (Quark). 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-28-2009 2:39 AM

    • JPrit
    • Not Ranked
    • Joined on 05-28-2009
    • Posts 8

    QID Expression to keep score in a quiz

     Hi there,

     

    I've writen a very simple multiple choice quiz in QID. Each questions is set on its own page with three answer choices, two incorrect and one correct. Very simply an incorrect answer generates a try again script. A correct answer plays a 'correct' script and advances the user to the next page.

     I would like to do two things (for different quizzes)

    A) keep a score - so that a correct answer would be "score" + 1,  advance user to new page. An incorrect answer would be score unchanged, advance user to next page.

     B) Have the user start with 3 lives, score =3 and lose one, score = -1 for each incorrect answer. When score = 0, goto end page or start again.

     I believe this would be relatively simple to do in QID using expressions but after alot of trial & error I can't figure out how to structure them at all.

     Does somebody know the BLOCKED EXPRESSION required to define a numeric value and adjust it. Any help would b e greatly appreciated!

     

  • 05-28-2009 2:58 AM In reply to

    Re: QID Expression to keep score in a quiz

    Hi, JPrit,

    JPrit:
    Does somebody know the BLOCKED EXPRESSION required to define a numeric value and adjust it.
     

    I am not sure what you are asking? What is a blocked expression please?

    If I understand you correctly, you need variables. Define one (under Edit menu), as it is a non-fractional number it needs to be "Integer".

    You set it with "mylives = 3" and you reduce it (by one) with "mylives = mylives -1". You test with "If mylives == 0". Is that what you are asking?

    Best
    Matthias

    Matthias Günther
    Senior Product Manager
    Quark Software Inc.

    (Please note: As I am traveling frequently, answering your post might sometimes take longer)


    Want to easily publish for the iPad, using high-fidelity designs with stunning interactivity? See here:
    English: http://youtu.be/Gldk5lvXXTA
    French: http://youtu.be/nsgB4Q7lQzg
    German: http://youtu.be/lecdenqaUGY
    Italian: http://youtu.be/wjBpYZsF-8s


    Need help? Contact Quark's support: http://support.quark.com/contact_us.html


    Please don't install the newest update 10.7.3 of Mac OS X Lion yet.
    For details please see here: http://goo.gl/AzKeR

  • 05-28-2009 4:30 AM In reply to

    • JPrit
    • Not Ranked
    • Joined on 05-28-2009
    • Posts 8

    Re: QID Expression to keep score in a quiz

     Matthias,

     Thanks for your ultra-prompt response.

     Re: BLOCKED EXPRESSION - I typed, expression bracket 's' close brackets, meaning I thought I might need more than one expression. It came out in the post as BLOCKED EXPRESSION for some reason.

    Re: Your response

     Thank you! Now understand that I need to set a variable. i.e "mylives"

    In order to display the variable I assigned it to a text box called "box1" using Box1.Append(mylives)  

    I think from here I can work out what I need to do. I will try to post a link to the completed quiz with scripts if successful, otherwise I'll be back for more help!!

    One comment, I found the command for Append in the QID help files as Append does not appear anywhere in the expressions dialogue box.

     Is there a comprehensive list of expressions and their values somewhere??  Without some sort of guide it makes learning expressions for users unfamiliar with them very frustrating.

    Many thanks again

     

  • 05-28-2009 6:22 AM In reply to

    Re: QID Expression to keep score in a quiz

    Hi, JPrit,

    glad it is working for you.

    JPrit:
    Is there a comprehensive list of expressions and their values somewhere??  Without some sort of guide it makes learning expressions for users unfamiliar with them very frustrating.

    Sure. A list of ALL expressions with a short explanation is in the Expressions Editor:

    Best
    Matthias

    Matthias Günther
    Senior Product Manager
    Quark Software Inc.

    (Please note: As I am traveling frequently, answering your post might sometimes take longer)


    Want to easily publish for the iPad, using high-fidelity designs with stunning interactivity? See here:
    English: http://youtu.be/Gldk5lvXXTA
    French: http://youtu.be/nsgB4Q7lQzg
    German: http://youtu.be/lecdenqaUGY
    Italian: http://youtu.be/wjBpYZsF-8s


    Need help? Contact Quark's support: http://support.quark.com/contact_us.html


    Please don't install the newest update 10.7.3 of Mac OS X Lion yet.
    For details please see here: http://goo.gl/AzKeR

  • 05-29-2009 3:37 AM In reply to

    • JPrit
    • Not Ranked
    • Joined on 05-28-2009
    • Posts 8

    Re: QID Expression to keep score in a quiz

     Thanks for the above graphic. I'm starting to get to grips with expressions now!

    Looking at your predefined elements at the top of this forum (which are very useful and highly recommended for anyone looking to learn how to structure scripts and expression in QID). I was able to complete the scoring element of my quiz. In the end it just needed the "If" action, no expressions.

     I made each life a picture object labelled life 1, life 2 etc. and just ran the script -  if answer wrong hide life 1, if life 1 hidden hide life 2, if life 2 hidden Game Over - very simple really, but very helpful to see the actions you'd used in previous projects - so thank you.

    You can see the final quiz in situ at www.3-6-6.com/?page_id=56 

    How's your knowledge of World Capitals - Bet you can't finish it! Wink

  • 05-29-2009 2:31 PM In reply to

    Re: QID Expression to keep score in a quiz

    Hi, JPrit,

    JPrit:
    You can see the final quiz in situ at www.3-6-6.com/?page_id=56
     

    Very nice, though for a travelling European too easy maybe. Wink

    I have to admit I quit in the middle of level 3 (hey, it's Friday evening).

    Thanks
    Matthias

    Matthias Günther
    Senior Product Manager
    Quark Software Inc.

    (Please note: As I am traveling frequently, answering your post might sometimes take longer)


    Want to easily publish for the iPad, using high-fidelity designs with stunning interactivity? See here:
    English: http://youtu.be/Gldk5lvXXTA
    French: http://youtu.be/nsgB4Q7lQzg
    German: http://youtu.be/lecdenqaUGY
    Italian: http://youtu.be/wjBpYZsF-8s


    Need help? Contact Quark's support: http://support.quark.com/contact_us.html


    Please don't install the newest update 10.7.3 of Mac OS X Lion yet.
    For details please see here: http://goo.gl/AzKeR

Page 1 of 1 (6 items)
Powered by Community Server (Commercial Edition), by Telligent Systems