Welcome, Guest
Username: Password: Remember me

TOPIC: Timer Attribute and Next Button

Timer Attribute and Next Button 3 years 9 months ago #50759

  • mbo
  • mbo's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hello All,

I'm using version 1.90, and I have a question about setting the timer attribute on a boilerplate question.

In the boilerplate, all I want them to do is watch a brief video without breezing past it. So I want to set the timer to a few seconds shorter than the length of the video (e.g., 26). After that, I want the next button to appear, and they'll be able to click "next" to proceed to some questions.

Right now here's what I have in the boiler-plate question:
Time Limit: 26
Time Limit Action: Disable Only
Time Limit Disable Next: Yes
Time Limit Disable Previous: No

That it. The questionnaire is set up to be question-by-question.

The problem is that the "Next" button is never grayed out in this question. They can click next from the very start.

If anyone can help me with this, I would be most grateful.

Thank you in advance.

With kind regards,

Mary
The administrator has disabled public write access.

Re:Timer Attribute and Next Button 3 years 9 months ago #50760

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2549
  • Thank you received: 285
  • Karma: 102
Well, I think the time limit works just into the different direction.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:Timer Attribute and Next Button 3 years 9 months ago #50809

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5300
  • Thank you received: 291
  • Karma: 247
Could you solve the problem meanwhile?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re:Timer Attribute and Next Button 3 years 9 months ago #50818

  • mbo
  • mbo's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hi There,

No, I'm afraid I don't have this resolved. I don't understand what it means to say that it works but in a "different direction." I'm sorry, but I just don't understand.

Can anyone tell me if it's possible to just have the "next" button grayed out for a given length of time before it appears and the participant can then move forward?

Thanks much in advance for any help.

Kind regards,

Mary
The administrator has disabled public write access.

Re:Timer Attribute and Next Button 3 years 9 months ago #50825

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5300
  • Thank you received: 291
  • Karma: 247
The action "Disable only" disables changes in the question so the participant can't change anything but doesn't automatically click the "Next >>" button.
I think you have to code your own Javascript to disable the button and enable it once the timer is counted down.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re:Timer Attribute and Next Button 3 years 3 months ago #59511

  • HCI_Guy
  • HCI_Guy's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 20
  • Karma: 0
Hi, Mary.

Looking through code at qanda sheds some light on this, but my question here should give you most of the information you need.

There are two total files I'm using: the question source, and the external .js file. I call the external .js file from startpage.pstpl and include the following line:
<SCRIPT type="text/javascript" charset="utf-8" src="{TEMPLATEURL}<library name>.js"></SCRIPT>

My library has a couple methods you'll want to use. I've distilled some here. Viz:
function disableNextButton(e) {
        // This function disables the "Next" button.
	var evtobj=window.event? event : e
	$('input[id="movenextbtn"]').attr('disabled', true);
	return false;
}
 
function enableNextButton() {
        // This function enables the "Next" button.
	document.getElementById('movenextbtn').disabled=false;
	return false;
}
 
function delayThings(timer) {
        // This function waits a specified time, then calls the permitNextButton() function, below.
	timeoutID = setTimeout(permitNextButton,timer);
	return false;
}
 
function permitNextButton(timer, e) {
        // This function clears the timeoutID, from above, and calls the function that enables the "Next" button.
	var evtobj=window.event? event : e
	window.clearTimeout(timeoutID);
	enableNextButton();
	return false;
}

My HTML source of the question follows thusly:
<SCRIPT type="text/javascript">
	timer=2;
	timer=timer*1000;
	addEvent(window, 'ready', delayThings(timer)); 
</SCRIPT> 
<script type="text/javascript">
 
	$(document).ready(function() {
		disableNextButton();
	});
 
</script>
This goes above my actual information in the question.

I hope this helps you, Mary. The insight I received in my question really nailed this for me.
Last Edit: 3 years 3 months ago by HCI_Guy.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.164 seconds
Donation Image