Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Time Limit Questions in Captivate

New Here ,
Dec 05, 2017 Dec 05, 2017

Hi everyone,

               I am pretty sure you will have a solution to my issue that is making me go crazy since this morning. Frustrated is a very light word. Hope you will understand the issue.

I have created a quiz with 10 questions all having a time limit of 10 seconds. the students have to answer within the given time, so if they choose A,B, or C from the given options they need to select it and then click on submit to move forward where they get a feedback depending if they chose correctly.

the issue that i have with this is for example if A is the correct answer and the user selects A and has not clicked on submit and the time runs out, the user gets a prompt that the time is up but, captivate still considers it a correct answer even though it was not submitted in time.

Am I missing something here? Please help me out guys.

Thanks

923
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Dec 06, 2017 Dec 06, 2017

Try deleting your myVar and myTimer variables from captivate if you added them 'manually' because that might interfere with the code.

The javascript works as follows:

The setInterval will execute the myTimer function every 10 seconds (10000 milliseconds)

For example if you want to change the timing to every 25 seconds it would you would be

"var myVar = setInterval(function(){ myTimer() }, 25000);"

The myTimer function executes the following:

alert("Your time ran out");

//launches an alert window

windo

...
Translate
Engaged ,
Dec 05, 2017 Dec 05, 2017

I tested the problem here and I think that captivate's built in 'Time Limit' feature basically triggers the submit button.  I thought a workaround could be to create your own timer.

On Frame Enter for your first quiz slide execute the following javascript

var myVar = setInterval(function(){ myTimer() }, 10000);

function myTimer() {

window.cpAPIInterface.next();

alert("Your time ran out"); 

clearInterval(myVar)

}

I tested this and it will not record any answers that have not been 'submitted'.  You'll need to turn off the timer so on the following slides you'll have to execute:

clearInterval(myVar)

var myVar = setInterval(function(){ myTimer() }, 10000);

function myTimer() {

window.cpAPIInterface.next();

alert("Your time ran out"); 

clearInterval(myVar)

}

When the quiz is finished you'll also have to turn off the timer with just.

clearInterval(myVar)

Let me know if that works.  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 06, 2017 Dec 06, 2017

Hi, Jeremy, You are a star!!!. I am not so good with javascript but I will try this solution and see if it works for me. might need a little more explaining if I am not able to figure it out. Thanks a lot, mate.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 06, 2017 Dec 06, 2017

Hi Jeremy, unfortunately i couldnt get it to work. so what i did i executed the top javascript you provided on the first slide and on every question slide i put the 2nd javascript that you provided. i created two variables myVar and myTimer as well but it still submitted the correct option as submitted when the time ran out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 06, 2017 Dec 06, 2017

I tested it out and it seems to be working for me.  I'm using multiple choice questions so I'm not sure if that is the issue.  Make sure you deactivate the captivate 'Time Limit' by un-ticking the box. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 06, 2017 Dec 06, 2017

Yes i have unchecked the time limit box. how do you set the timer for each question to move to the next slide then? is it in the javascript? because i would like the question to move to next slide after 10 seconds.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 06, 2017 Dec 06, 2017

Try deleting your myVar and myTimer variables from captivate if you added them 'manually' because that might interfere with the code.

The javascript works as follows:

The setInterval will execute the myTimer function every 10 seconds (10000 milliseconds)

For example if you want to change the timing to every 25 seconds it would you would be

"var myVar = setInterval(function(){ myTimer() }, 25000);"

The myTimer function executes the following:

alert("Your time ran out");

//launches an alert window

window.cpAPIInterface.next();

//Tells captivate to go to the next slide

clearInterval(myVar)

//Clears the timer so it won't go off.

Try deleting the manually inputted in variables and see if that makes a difference. Also when you launch the project (assuming you are using Chrome) press F12 and go to the console to see if any errors are popping up. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 06, 2017 Dec 06, 2017

yes yes yes, you made my day jeremy

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 06, 2017 Dec 06, 2017

I thought of something else.  You may want to clear the timer if they successfully answer the question.

Under 'Quiz' -> 'Actions' -> 'On Success' change it to execute javascript and put in the following:

clearInterval(myVar);

confirm("You got the right answer");

window.cpAPIInterface.next();

You also need to uncheck the 'Correct' under 'Captions'. 

This way as soon as they click submit, it will clear the timer and prompt them to go to the next question before the timer starts again. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 06, 2017 Dec 06, 2017

What i am trying to achieve with this quiz is that they get a question on one slide and the feedback on the next. so the next slide you either get a positive feedback and explaining why its right and if wrong the correct feedback with a negative prompt. I tried the javascript on a new file and it worked. will try again with my original file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 06, 2017 Dec 06, 2017

What I found trying this out is that when the user hits the submit button, it is not yet 'submitted' until they press 'y' to continue. To deactivate that you need to turn the captions off.

When they move to the feedback slide, just make sure you clear the timer using clearInterval(myVar);

Hope that helps. 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 06, 2017 Dec 06, 2017

yes its working on the normal template. i will get it working on the original file hopefully. but yes your comments have been really helpful. thanks a lot.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 07, 2017 Dec 07, 2017

Hi Jeremy, its working fine on all questions (MCQs and hotspots), just wanted to ask another favour, do you think there is a way we can customise the window that pops up and says "your time ran out". i can tell we can change your time ran out by changing the script but the top of the window says adobe captivate. is it possible to change this? because it looks out of context in the training. thanks a lot. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 07, 2017 Dec 07, 2017
LATEST

Glad to hear it is working.  You can try this:

cp.alert("You got the right answer", "yourTitle")

I think the colour is taken from your slide background colour. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources