Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Count down with invisible counter: Difference between revisions

From Catglobe Wiki
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 == <...
 
Cg van (talk | contribs)
No edit summary
 
Line 1: Line 1:
== Challenge ==
== Count down with invisible counter  ==
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 ==
In order to change question without clicking Next button.
<source lang="javascript" line="1">
 
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 -&gt; Question scripts -&gt; Java script tab -&gt; 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