Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 8:56 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Adding (total) Page Scores
PostPosted: February 2nd, 2009, 4:55 pm 
Offline

Joined: November 3rd, 2004, 8:12 pm
Posts: 129
Location: New Brunswick, Canada
Opus: 8.6
OS: Win 8 (ASUS) - Win 7: (ASUS)
System: Asus - Windows 7 - 8 - Intel Core 3 - 4RAM - 16RAM
I've created a quiz where the player is presented with a "Menu Page" showing 10 buttons that link to ten pages, each page has 10 questions. The correct answers are stored and saved in the var <SCORE_TOTAL> which in turn is stored in the variable, PAGE_1_SCORE, PAGE_2_SCORE, etc. up to, PAGE_10_SCORE, for each of the ten pages.

Now the problem:
If the player selects the pages (from the menu page) in order 1 thru 10 then using the following script works fine:

ALL_SCORE=PAGE_1_SCORE+PAGE_2_SCORE+PAGE_3_SCORE+PAGE_4_SCORE+PAGE_5_SCORE+PAGE_6_SCORE+PAGE_7_SCORE+PAGE_8_SCORE+PAGE_9_SCORE+PAGE_10_SCORE

If however the player selects a link on the menu page at random, say page 1 and then page 5, and they got "6" correct on the Page 1 and "6" correct on Page 5, then using the above script their score would show as <ALL_SCORE> = 66 instead of 12.

What am I doing wrong? Thanks.


You do not have the required permissions to view the files attached to this post.

_________________
Leo Taylor
Win XP Home / Opus Pro 7.01 & 6.4 / P4-2.8 / 1.5 GB RAM / ATI All-in-Wonder 9600 /160GB-HD


For this message Leo Taylor has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 2nd, 2009, 5:27 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It's treating the variables as strings and concatenating them.

Make sure any page / publication variables are setup as numbers.

Also if this is done though a script use ParseInt to force the conversion to a number before adding.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 8th, 2009, 12:22 am 
Offline

Joined: November 3rd, 2004, 8:12 pm
Posts: 129
Location: New Brunswick, Canada
Opus: 8.6
OS: Win 8 (ASUS) - Win 7: (ASUS)
System: Asus - Windows 7 - 8 - Intel Core 3 - 4RAM - 16RAM
Mack,

Thanks for the help. That what was happening.

_________________
Leo Taylor
Win XP Home / Opus Pro 7.01 & 6.4 / P4-2.8 / 1.5 GB RAM / ATI All-in-Wonder 9600 /160GB-HD


For this message Leo Taylor has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group