ReviewMyElearning.com

Lock/unlock game slides with Articulate API

After viewing my previous post"Making Forklift eLearning Interesting w/Examples"
A few folks wanted a peek at the code I use to lock the Articulate course until the user completed the game.
It's actually only a few lines
This section is near the top of my code:

var ArtAPI = _level0.ArtAPI;
slidenum = ArtAPI.GetCurrentSlide();
_level44.Presentation.Slides[0].Slide[slidenum - 1].waitforuser[0]._value = "true"; 
if(!_global.baseHit){
_level44.Presentation.Slides[0].Slide[slidenum - 1].navlocked[0]._value = "true";
}

That code grabs the Articulate API.
Gets the current slide's number
Sets the slide to wait for the user to click the next button
If the base (cargo area) has not ever been hit (more on this global variable below)
Lock this slide so the student can not click next/back etc.

Then later in my code when I have determined the cargo hit the base I run this function:

function baseHit() {
	winner_txt.text = "Good Job!";
	winner_txt._visible = true;
	timer = setInterval(resetAllCones, 3000);
	 Key.removeListener(keyListener);
	_global.baseHit = true
	_level44.Presentation.Slides[0].Slide[slidenum - 1].navlocked[0]._value = "false";
}

Most of that is for the game... the only parts that pertain to Articulate are the last two lines.
Set my global variable to true. This way the slide wont lock if they just want to come back and play.
Unlock the slide.

One thing you need to make sure of is that you disable the Articulate Keyboard shortcuts or else the course move to the next slide when the user presses their arrow keys. You 'should' be able to do this with the ArtAPI.EnableKeyboardShortcuts(bEnable) but it never works for me...

Comments

I know this thread is ages old but it's still very helpful information! Here's hoping someone still checks the posts...

I have an Articulate presentation that uses a preloader. I have an interactive swf on slide 4 that uses the code above to lock the navigation controls until the user interacts with the swf. When I preview slides 3-5, the swf code works fine and navigation is only locked for slide 4. When I preview from slide 1, navigation is locked in slide 1. Could this be because the preloader loads my swf ahead of time?

As you can imagine, it's hard to get anywhere when slide 1 is locked and the key to unlocking the navigation controls is on slide 4... :(

Yes I believe the issue is caused by the prloader loading the code early.

I'm also interested in only locking the "Next" button, i.e. I want them to be able to go back without completing the conditions if they want.

Did you ever do any development in this direction? Thanks!

Nice article, really helpful! Thanks for sharing! Just have a quick question though, is it possible to just lock/unlock the next-slide button?

I understand that by setting navlocked[0]._value to "true" will actually lock the play button, the back button and the next button. In my project, I only want to lock the next button. Please let me know if you have any idea, thanks again!

Su

Hi Su,
What sort of timeline do you have for your project? I may be able to build a small widget that would do this.

Thanks
James

Thanks sci72 it will try that!

Everyone sci72 is one of the wonderfully helpful contributors to the Articulate forums.

His work here really helped me with this project.

hmmmm... instead of 'bEnable' try a string of true or false, I've noticed that Articulate in a lot of cases doesn't use true boolean's but instead it uses strings that have 'true' or 'false' in them. Oh and nice locking code for articulate, where ever did you find it ;)

Great post it is very informative thanks!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Images can be added to this post.
  • You may use [inline:xx] tags to display uploaded files or images inline.
  • You may use <swf file="song.mp3"> to display Flash files inline
  • Twitter-style @usersnames are linked to their Twitter account pages.
  • Twitter-style #hashtags are linked to search.twitter.com.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
                     _  _  _  _  _      _  _  _  _  _                                           
(_)(_)(_)(_)(_) (_)(_)(_)(_)(_)
_ _ _ _ (_) _(_) _ _ _ _ _ _
_(_)(_)(_)(_) (_) _ _ _(_) (_)(_)(_)(_)_ (_) (_)
(_)_ _ _ _ (_)(_)(_) _(_) (_) (_) (_) _ (_)
(_)(_)(_)(_)_ (_) _(_) (_) (_) (_)_ _(_)_ _(_)
_ _ _ _(_) (_) _ (_) _ _ _ (_) _ _ _(_) (_)(_) (_)(_)
(_)(_)(_)(_) (_) (_)(_)(_)(_)(_) (_)(_)(_)(_) (_) (_)
(_)
(_)
Enter the code depicted in ASCII art style.