Indigo Rose Software
  #1  
Old 09-26-2003
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Grin Making a Basic Quiz/Testing Application

AutoPlay Media Studio 5.0 Knowledge Base

Making a Basic Quiz/Testing Application

Document ID: IR10051
The information in this article applies to:
  • AutoPlay Media Studio 5.0 Standard Edition
  • AutoPlay Media Studio 5.0 Professional Edition

SUMMARY

This article describes how to make a simple quiz.

DISCUSSION

As an example, we will create a two page test, and a third page to display the results:

  1. Create a project with three pages.

  2. Insert the following code in the Global Functions:

    --Each of the following tables contains a question, and 4 answers:
    Q_01 = {Question="How many legs does a three leg'd dog have?", A1="One", A2="Two", A3="Four", ACorrect="Three"};
    Q_02 = {Question="How many legs does a one leg'd cat have?", A1="Three", A2="Two", A3="Four", ACorrect="One"};
    Correct={Q1="",Q2=""};

  3. On Page1, create one paragraph object, and four button objects.

  4. In the On Preload event of Page1, insert the following code:

    Paragraph.SetText("Paragraph2", Q_01.Question);
    Button.SetText("Button1", Q_01.A2);
    Button.SetText("Button2", Q_01.A1);
    Button.SetText("Button3", Q_01.ACorrect);
    Button.SetText("Button4", Q_01.A3);

  5. Insert the following code into the On Click event of Button1:

    Correct.Q1 = "InCorrect";
    Page.Navigate(PAGE_NEXT);

  6. Insert the following code into the On Click event of Button2:

    Correct.Q1 = "InCorrect";
    Page.Navigate(PAGE_NEXT);

  7. Insert the following code into the On Click event of Button3:

    Correct.Q1 = "Correct";
    Page.Navigate(PAGE_NEXT);

  8. Insert the following code into the On Click event of Button4:

    Correct.Q1 = "InCorrect";
    Page.Navigate(PAGE_NEXT);

  9. On Page2, create one paragraph object, and four button objects.

  10. In the On Preload event of Page2, insert the following code:

    Paragraph.SetText("Paragraph2", Q_02.Question);
    Button.SetText("Button1", Q_02.A3);
    Button.SetText("Button2", Q_02.A2);
    Button.SetText("Button3", Q_02.A1);
    Button.SetText("Button4", Q_02.ACorrect);

  11. Insert the following code into the On Click event of Button1:

    Correct.Q2 = "InCorrect";
    Page.Navigate(PAGE_NEXT);

  12. Insert the following code into the On Click event of Button2:

    Correct.Q2 = "InCorrect";
    Page.Navigate(PAGE_NEXT);

  13. Insert the following code into the On Click event of Button3:

    Correct.Q2 = "InCorrect";
    Page.Navigate(PAGE_NEXT);

  14. Insert the following code into the On Click event of Button4:

    Correct.Q2 = "Correct";
    Page.Navigate(PAGE_NEXT);

  15. Create one paragraph object on the last page of your project.

  16. Insert the following code into the On Preload event of the last page:
    string_correct="";

    correct = 0;

    possible = 0;



    for j,k in Correct do

    possible = possible + 1;

    if k == "Correct" then

    correct = correct + 1;

    end

    end



    Paragraph.SetText("Paragraph2", "Question 1: " .. Correct.Q1 .. "\r\n" ..

    "Question 2: " .. Correct.Q2 .. "\r\n" ..

    "You answered correctly " .. correct .. " out of " .. possible ..

    " possible questions for a score of " .. ((correct/possible)*100) .. "%."

    );

KEYWORDS: AutoPlay Media Studio 5.0, Quiz, Test, Multiple Choice


Last reviewed: September 26, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
  #2  
Old 12-11-2005
Centurion's Avatar
Centurion Centurion is offline
Forum Member
 
Join Date: Dec 2005
Posts: 2
this doesn't work
  #3  
Old 12-11-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
I'm pretty sure it does, what specific problem are you having?
  #4  
Old 10-12-2007
thetford's Avatar
thetford thetford is offline
Forum Member
 
Join Date: Feb 2005
Location: Birmingham, Alabama
Posts: 170
it works, you just need to tweek the code a little bit. Desomds code refers to paragraph2, but by default AMS will name a new paragraph object paragraph1

So - you can either re-name your paragraphs, or change the code.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT -6. The time now is 07:49 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software