Skip navigation
Currently Being Moderated

Name / Score / Results

May 12, 2012 9:32 AM

On the educational software i'm creating it is important to know the student who is taking the test and also track the score of the students. The software will have 4 sections with 10 or more chapters in each section.

 

How can i add the name of the student and keep it till the end? For example: at the beggining of the application to prompt the user to fill his/her name.

 

How can i track the score in each section and have a result page with all the scores from the 4 sections?

 

Thank you in advance for any help.

 

Costas--

 
Replies
  • Currently Being Moderated
    May 12, 2012 2:19 PM   in reply to Costas_B

    Use a Parent script and initialize an instance of it using a global variable. If the sections/chapters are not going to be completed concurrently during any given session then you'll need to save the information which can be done a number of ways depending on if this will be online or offline (on a client computer).

     
    |
    Mark as:
  • Currently Being Moderated
    May 14, 2012 5:52 AM   in reply to Costas_B

    After reading your other posts I think a simpler solution is in order. Use a global variable to keep track of scores. If you need to have a score for each section then make 4 global variables. For example:

     

    -- in a moviescript

    global gScoreSection1

    global gScoreSection2

    global gScoreSection3

    global gScoreSection4

     

    on startMovie

      gScoreSection1 = 0

      gScoreSection2 = 0

      gScoreSection3 = 0

      gScoreSection4 = 0

    end startMovie

    -- end of moviescript

     

    then, wherever your code is to add to the score for a correct answer you simply do this:

    gScoreSection1 = gScoreSection1 + 1

     

    you'll need to keep track of what sections you are in so however you are doing that just change to the appropriate global variable.

    Note: make sure that in each script member where you're using the global variable that you declare it at the top of the script just as in the moviescript example above, ie:

    -- in any script you use that global variable

    global gScoreSection1

     

    on someHandler me

    -- some code here

    gScoreSection1 = gScoreSection1 + 1

    end someHandler

    -- end script

     

    otherwise, if you don't declare it at the top of the script you will get an error stating something like, "Script error: Variable used before assigned a value"

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points