Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Setting up a conditional script
PostPosted: January 4th, 2006, 3:46 pm 
Offline

Joined: November 3rd, 2004, 2:22 pm
Posts: 54
Location: Kent, Ohio, USA
As always, I am in need of some scripting assistance.

I am building a quiz. One of the requirements is that users have to answer all of the T/F questions before they can proceed to the next section. I have placed all of the T/F questions together and have the scoring all sorted out, but I need to figure out how to show the "Next" button only when all of the questions have been answered (wheter right or wrong).

I had thought that I could assign a variable to each of the T/F pairs that was given a value when the users clicked on them and then build a script that examined the variables and showed the button when all the variables had the correct value.

Any insight into this would be greatly appreciated.

_________________
Tom Hutchins
The Davey Institute
Kent, OH
800-445-8733
http://www.davey.com

Opus ProXE 5.5
Windows XP SP2


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 5th, 2006, 2:45 am 
Offline

Joined: October 26th, 2004, 1:26 pm
Posts: 262
Hi Tom,

You could add a value of 1 to a numeric variable <questions_set1> on each question once they're answered. (regardless of right/wrong answers within that section)

An example for 5 questions, you would add the following script to each question on the appropriate action...

--------

questions_set1++
if (questions_set1 == 5)
{
YourNextButton.Show()
questions_set1 = 0 //read note below if you'll use this?
}

--------

Where I have 'questions_set1=0' you could then re-use the variable in the next section of T/F questions if you wanted, as it gets reset. Therefore you could name the variable more generically like <questions>.

_________________
Cheers,
Steve


Top
 Profile  
 
 Post subject:
PostPosted: January 5th, 2006, 11:03 am 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
You can also do this without the need for scripting.

When each question is answered add 1 to a variable regardless of if the question is right or wrong.

Have a Variable change trigger and set it to the above variable with an If Variable = number of questions show button.

See attached example.

Regards

Brenden


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


Top
 Profile Visit website  
 
 Post subject: Hidden Frames
PostPosted: January 5th, 2006, 5:19 pm 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
Notice in Brenden's solution, he uses Initially Hidden Frames which are set to "Stop mouse clicks passing through", which Show whichever Answer Button is selected. This prevents a second response.

I like that solution, except you can't change your answer if you decide you made a mistake.

My "non-script" solution involves having a variable for each question, then one more for a Total, with no Frames. I have a Page On Show which Rests all the Variables. Then, whichever answer is selected sets my variable "A1" to "1". If you go back and change your answer, A1 is still "1".

I also would use Brenden's "Variable Changed" Trigger on the Page for my "Total" variable, but I'd use "Set Variable To Expression" to calculate my Total variable. The expression would be A1 + A2 +A3, etc. THEN I'd have Brenden's "If Total=" Action plus the Show Button.

OPUS provides multiple ways to achieve just what you want. I LOVE the fact you don't have to use Scripting!

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 63 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