Source language: Translate to:

disable action?

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

disable action?

Postby seanie » Thu Feb 21, 2013 5:41 pm

Hello Neobookers,

I make audio exams for my students with Neobook.

I usually control page changes by using a timer. However, some computers on campus are old/slow and the audio sometimes takes more 'juice' to start up than the timer... this means that on some computers, the pages would change too quickly.

To avoid this problem, I decided to cut the audio files to make them specific for each page, then link the page turns to the end of the audio: when audio ends, the page changes. I did this by inserting the following actions in Page Properties:

PlaySoundFile
"F:\Exam 4\Pt1.mp3" "Wait"
GotoNextPage

This solved the 'slow computer' problem, but created another:

I want to put in Admin controls that allow a teacher to stop an exam, re-start it, or navigate to a specific part of the exam. However, when I re-start (the first page of the app does not have audio, just a button which the students press when they are ready to take the test), I can still hear the audio for the page that I jumped from. If I put in a button to stop the audio, the GotoNextPage command (above) kicks in.

So, my question is, Is there a way to go to another page in an app without triggering the actions which I put under Page Properties? Can I override or disable those actions somehow, or would my exam application be completely confused? :-)

If that's not possible, do you have any other suggestions for dealing with my slow computer issue? (I suppose I could go back to doing what I was doing before but add 30 additional seconds to each timer. The school could also buy better computers, but I have no control over that.)

Hope I have expressed myself well.
seanie
 
Posts: 47
Joined: Tue Jul 31, 2007 9:33 am

Re: disable action?

Postby Neosoft Support » Fri Feb 22, 2013 12:09 am

Change your page code to something like this:

PlaySoundFile "F:\Exam 4\Pt1.mp3" "Wait"
If "[StopExam]" "<>" "True"
GotoNextPage
EndIf

Then when you want to stop the exam, you can do this:

SetVar "[StopExam]" "True"
StopMedia ""
GotoPage "Start"

Before restarting the exam, remember to clear the [StopExam] variable:

SetVar "[StopExam]" ""
GotoPage "whatever"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: disable action?

Postby seanie » Fri Feb 22, 2013 3:13 pm

Thank you very much! I don't quite understand how it works, but it does:-) I think I should study programming or something.
seanie
 
Posts: 47
Joined: Tue Jul 31, 2007 9:33 am

Re: disable action?

Postby dpayer » Sat Feb 23, 2013 7:20 am

seanie wrote:Thank you very much! I don't quite understand how it works, but it does:-) I think I should study programming or something.


If you are attempting to make apps and are reading this forum, you ARE studying programming! :)

Much of what I know, I gathered here plus other resource books I have read on my own. At times, I take on rather complex projects just to develop my own skills so I have the ability to do new things. Many of the functions I made that adapt vb/js scripts to NB were done for that purpose.

I think NB is a very good way to gain understanding about programming. Of course, the challenge is to become verbose in many languages. I'm still working on it.

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1382
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest