Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 6th, 2025, 10:42 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Calculation problems
PostPosted: February 21st, 2005, 1:06 pm 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Hi ! Can anyone help me out on this one ?

I'm setting up a quiz for students and want to evaluate their answers with a simple percentage function.
I created three variables:

Tries shows the number of attempts
Correct shows the number of correct answers.
Percent shows the correct percentage.

I set up the variable percent using th Math.floor function to round it down to the nearest integer :

percent=Math.floor(Correct/Tries*100)

The variables Tries and Correct display correctly, but when , for example you get 8 out of 8 correct , the variable Percent displays 111 or 114

Did I set up the function correctly or am I missing something ? :?

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


Top
 Profile  
 
 Post subject:
PostPosted: February 21st, 2005, 2:29 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

Without seeing the publication in question, it is difficult to determine what could be causing this problem. However, I see nothing wrong with the function you are using and have attached a small publication which uses this same function without problems.

Please compare the actions in this publication to your current project and see if you can spot any discrepancies. If you are unable to determine the cause, please forward me your publication .imp file and I will be happy to investigate further.

Kind regards,


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

_________________
Robin Garrett
Digital Workshop Technical Support


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 21st, 2005, 3:00 pm 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Thank you for your quick help Robin.

I've looked at your example , but seen no differences to mine.
I've attached my IMP file , so if you could please look into it it would be of great help.

In this example the variable Ergebnis1 displays the number of correct answers and fehler the number of tries . Percent_correct displays the faulty percentage

Here's the screen shot of the results I get :


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

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


Top
 Profile  
 
 Post subject:
PostPosted: February 21st, 2005, 4:32 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi Klaus,

Thank you for your reply.

The problem is that the final correct answer button updates the <ergebnis1> variable before it updates the <fehler> variable. This causes the Variable Changed <ergebnis1> trigger on the page to process its actions before the <fehler> variable has reached its final value, and the resulting percentage is incorrect.

The easiest solution is to open the actions for the correct button on Question 8 and swap the order of the two Set Variable actions so that <fehler> is updated before <ergebnis1>. This should ensure that <fehler> is set to its correct final value before the percentage is calculated.

I hope this helps. Please do not hesitate to contact me if you have any further queries.

Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 21st, 2005, 4:49 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Further to my previous reply, as your quiz allows users to answer the questions in any order, you will need to reverse the order of the Set Variable actions on all of the correct answer buttons. This should ensure that both variables have been updated before the percentage calculation takes place.

Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 21st, 2005, 4:54 pm 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Hi Robin !

You and your team are fantastic. I would probably have spent hours ( or even longer) searching for the solution. You are real pros . Another reason why I have chosen Opus for my multimedia productions - the support is world class !! :D

You were of course right. I changed the order of all the set variable functions and everything works perfectly now !!

Thanks, once again !

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 33 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group