More actions
New page: == Challenge == You want to use automatically change question, but don't want to show the counter for the respondent. The Next button is often hided when this script is used. == Code == <... |
No edit summary |
||
Line 1: | Line 1: | ||
== | == Count down with invisible counter == | ||
== Code == | In order to change question without clicking Next button. | ||
<source lang="javascript | |||
As a questionnaire creator | |||
I want to use automatically change question, but don't want to show the counter for the respondent | |||
'''Example ''' | |||
*I have a Text grid question like below. | |||
[[Image:CountDownWithInvisibleCounter.png]] | |||
*I want to change question without clicking Next button. | |||
=== Solution === | |||
*Add a Single question to Questionnaire editor like below | |||
*Go to menu Properties -> Question scripts -> Java script tab -> Input script | |||
[[Image:CountDownWithInvisibleCounter Code.png]] | |||
=== Code === | |||
<source lang="javascript"> | |||
function jumpon() | function jumpon() | ||
{ | { | ||
Line 12: | Line 33: | ||
//defines how many milliseconds the question should be visible for the respondent | //defines how many milliseconds the question should be visible for the respondent | ||
window.setTimeout("jumpon();", 1500); | window.setTimeout("jumpon();", 1500); | ||
</source> | </source> | ||
=== Source === | |||
Questionnaire Resource Id on cg site: 159730 |
Latest revision as of 08:40, 11 January 2012
Count down with invisible counter
In order to change question without clicking Next button.
As a questionnaire creator
I want to use automatically change question, but don't want to show the counter for the respondent
Example
- I have a Text grid question like below.
- I want to change question without clicking Next button.
Solution
- Add a Single question to Questionnaire editor like below
- Go to menu Properties -> Question scripts -> Java script tab -> Input script
Code
function jumpon()
{
document["query"]["dir"].value = "next";
document["query"].submit();
}
//defines how many milliseconds the question should be visible for the respondent
window.setTimeout("jumpon();", 1500);
Source
Questionnaire Resource Id on cg site: 159730