Skip to main content
Quest5639
Known Participant
January 24, 2016
Question

How to enable a button conditional to viewing all slides?

  • January 24, 2016
  • 1 reply
  • 1562 views

Hi,

I have a number of scorm modules, each with a quiz in the second half of the module (e.g. slides 16-30). At the beginning of the module there is a screen that allows the students to jump straight to the quiz, so that they can review and assess their skills later on without going through all the content slides again. The problem is, the first time they access the module, I want to disable this button, so that they cannot jump ahead without viewing the content slides.

Is there a system variable or some way of reading whether the student has viewed all the slides in this module before, and enable or disable this button based on that condition? I'd settle for simply a second visit even without ensuring that they had previously viewed all slides, if I had to.

Lilybiri‌ any help is much appreciated!

Thanks,

Tal

This topic has been closed for replies.

1 reply

Lilybiri
Brainiac
January 24, 2016

When you mean 'access': is this after closing the module and returning? Normally all variables are cleared when closing a course. You'll need a way to transfer the variable to a next visit, which can be done for SWF with a widget created by Michael Lund, and soon with another widget to be launched by InfoSemantics for HTML5 output (Introduction to CpExtra - YouTube). There is a way with JS as well. This answer is not about JS at this moment.

I would prefer personally not only to disable that button on first view, but even to hide it! I will label that button 'Bt_Quiz'.

There are several possibilities. I hope first of all that you do not use a default playbar with progress bar, because that could override everything: the user can scrub the progress bar and get to any slide in the project. First of all: you need to use custom navigation buttons. That is pretty easy: use shape buttons either on the master slide or on the first slide, timed for the rest of the project. That means that the user can only continue to a next slide when he presses your custom Next button. That way he has to view all content slides, but cannot be forced to view all content on a slide. I suppose this is a linear project? If not, it will be a bit more complicated.

Create a user variable: v_visit, with a default value of 0 (Boolean variable), which means that the user has not yet viewed the content slides. For the last content slide, either use another master slide (if you put the Next button on the master slide) or hide the default Next button with the On Enter action (if you timed it for the rest of the project). You'll need an exact copy of that Next button that has to trigger a special advanced action (better shared, because you can use it on all the projects, the variable will be created automatically in the next projects) with two commands:

    Assign v_visit with 1

    Go to Next Slide

For the slide that allows jumping directly to the quiz, you'll need a conditional advanced (or shared, since you need it in all your modules)

  IF v_visit is equal to 0

     Disable Bt_Quiz
     Hide Bt_Quiz
     Continue

ELSE

     Show Bt_Quiz

     Enable Bt_Quiz

     Continue

Maybe Continue is superfluous, depends on setup of that slide
 

Quest5639
Quest5639Author
Known Participant
January 24, 2016

Hi Lilybiri, thanks for the answer.

It's just as you asked - I am referring to access upon closing the module and re-opening it. I want the button on the initial screen to be enabled only on the 2nd visit, i.e. the second time the module is opened. Otherwise I think I'll make it disabled and with some kind of a greyed out effect by showing/hiding a semi-alpha image over it.

So, it seems the Infomatics widget will be the way to go. I had a look at the video and it looks impressive. At the moment I'm exporting as both SWF and HTML but I imagine you can't put in both the SWF and HTML5 widgets (or wouldn't want to!) and I have to have HTML5 supported, so the infomatics one seems to be the way to go. I'd be interested to hear the JS approach if you have that handy! I'd prefer that to a plugin actually.

It seems the answer you gave is dealing with unlocking it within the one use, which is not really the problem I'm trying to solve at the moment.

PS. It is linear, and no default playbar or progress bar.

Quest5639
Quest5639Author
Known Participant
January 26, 2016

SCORM does have a variable you can access, in the cmi.entry (2004) or cmi.core.entry (1.2) field. Their value is ab-initio.

Captivate has functions that return values that designate initial entry.

2004

SCORM2004_GetEntryMode()

1.2

SCORM_GetEntryMode()

both functions return "ENTRY_FIRST_TIME" if initial entry.

You would need to populate a custom variable with the result in a JavaScript window, then execute a conditional action based on the variable.

I haven't tested in one advanced action, the first part would execute JavaScript and the second statement would evaluate the variable the JavaScript is setting, but it may work in sequence. For HTML5 it's easy, swf is a little more difficult.

var checkEntry = SCORM_GetEntryMode();

cp.APIInterface.setVariableValue("yourVariable", checkEntry)


I can't seem to access the SCORM_GetEntryMode() function using the line of code that you suggested:

var checkEntry = SCORM_GetEntryMode();


It seems to break the script, I have an alert afterwards reporting the value of checkEntry which doesn't run when I use the function name as is. I don't think it's finding the function? Is there something I need to add?


TIA!