countdowntimer
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
countdowntimer [2022/09/07 09:10] – admin | countdowntimer [2024/06/12 08:28] (current) – [Pausing the Timer] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== countdownTimer - Set and display a time limit across pages and blocks ====== | ====== countdownTimer - Set and display a time limit across pages and blocks ====== | ||
- | The countdownTimer function allows the setting of a time limit across pages and blocks. It displays the time remaining in the survey header. Once the time expires the remaining questions are skipped. The countdown timer can be turned on or off, allowing for timed and untimed survey sections and multiple timed sections in a survey. Configuration is done by setting values of embedded data fields in the survey flow. countdownTimer keeps accurate timing info even if the browser window is closed. | + | The **countdownTimer** function allows the setting of a time limit across pages and blocks. It displays the time remaining in the survey header. Once the time expires the remaining questions are skipped. The countdown timer can be turned on or off, allowing for timed and untimed survey sections and multiple timed sections in a survey. Configuration is done by setting values of embedded data fields in the survey flow. **countdownTimer** keeps accurate timing info even if the browser window is closed. |
+ | |||
+ | New updated version works with Simple AND non-Simple layouts! | ||
{{ :: | {{ :: | ||
- | This function is available for a reasonable fee. Contact [[https:// | + | This function is available for a reasonable fee. Contact |
===== Set-up Instructions ===== | ===== Set-up Instructions ===== | ||
==== Survey Header ==== | ==== Survey Header ==== | ||
Line 11: | Line 13: | ||
< | < | ||
<div id=" | <div id=" | ||
+ | </ | ||
+ | === Add jQuery if using Simple Layout === | ||
+ | If using Simple layout add jQuery to the header. While still editing the survey header in html mode, add: | ||
+ | < | ||
+ | <script src=" | ||
</ | </ | ||
=== Add countdownTimer Function == | === Add countdownTimer Function == | ||
Line 31: | Line 38: | ||
</ | </ | ||
- | To override the default options, specify the desired [[countdownTimer# | + | To override the default options, specify the desired |
< | < | ||
countdownTimer({timerSecsVar:" | countdownTimer({timerSecsVar:" | ||
Line 51: | Line 58: | ||
</ | </ | ||
=== Timer Seconds === | === Timer Seconds === | ||
- | Set the timer seconds embedded data field(s) by setting the field value in seconds at the appropriate places in the survey flow. Timer seconds is the amount of time allowed to complete a timed section of the survey. | + | Set the timer seconds embedded data field(s) by setting the field value in seconds at the appropriate places in the survey flow. Timer seconds is the amount of time allowed to complete a timed section of the survey. |
- | For example, to set the time limit to one hour: | + | |
< | < | ||
- | timerSecs | + | __js_timerSecs |
</ | </ | ||
- | If multiple timers are used in a survey, each timer seconds embedded field should have a unique name (e.g., timerSecs1, timerSecs2, etc.). The default field name is timerSecs, but this can be overridden in the function [[countdownTimer# | + | If multiple timers are used in a survey, each timer seconds embedded field should have a unique name (e.g., timerSecs1, timerSecs2, etc.). The default field name is timerSecs, but this can be overridden in the function |
=== Initialization Block === | === Initialization Block === | ||
- | Add a question block immediately after setting [[countdowntimer# | + | Add a question block immediately after setting |
< | < | ||
Qualtrics.SurveyEngine.addOnReady(function() { | Qualtrics.SurveyEngine.addOnReady(function() { | ||
Line 68: | Line 74: | ||
==== Question Configuration ==== | ==== Question Configuration ==== | ||
=== Display Logic === | === Display Logic === | ||
- | Add display logic based on the [[countdowntimer# | + | Add display logic based on the **[[countdowntimer# |
< | < | ||
- | if timerSecs | + | if __js_timerSecs |
</ | </ | ||
=== Response Requirements === | === Response Requirements === | ||
Line 85: | Line 91: | ||
Default: false | Default: false | ||
==== timerSecsVar ==== | ==== timerSecsVar ==== | ||
- | **timerSecsVar** is the name of the embedded field that contains the [[countdowntimer# | + | **timerSecsVar** is the name of the embedded field that contains the **[[countdowntimer# |
- | Default: " | + | Default: |
==== timerSelector ==== | ==== timerSelector ==== | ||
**timerSelector** is the css style selector for the time remaining display span. | **timerSelector** is the css style selector for the time remaining display span. | ||
- | Default: "# | + | Default: |
==== updateSecs ==== | ==== updateSecs ==== | ||
**updateSecs** specifies how often the timer should be updated and checked in seconds. | **updateSecs** specifies how often the timer should be updated and checked in seconds. | ||
Line 97: | Line 103: | ||
Default: 1 | Default: 1 | ||
===== Pausing the Timer ===== | ===== Pausing the Timer ===== | ||
- | To pause a timer (have a timed section, pause, then start the timer where it left off), turn the timer off at the end of the first timed section, then when it is turned back on set the new Timer Seconds equal to the previous Timer Seconds. | + | To pause a timer (have a timed section, pause, then start the timer where it left off), turn **[[countdowntimer# |
< | < | ||
+ | countdownTimer({timerSecsVar: | ||
+ | </ | ||
+ | Then the survey flow would be: | ||
+ | < | ||
+ | Set Embedded Data: | ||
+ | timerOn = 0 | ||
+ | __js_timerSecs1 = 3600 | ||
+ | timerSecsVar = timerSecs1 | ||
Block: Timed section | Block: Timed section | ||
Set Embedded Data: | Set Embedded Data: | ||
Line 105: | Line 119: | ||
Set Embedded Data: | Set Embedded Data: | ||
timerOn = 1 | timerOn = 1 | ||
- | | + | |
+ | timerSecsVar = timerSecs2 | ||
Block: Initialization Block | Block: Initialization Block | ||
- | Block: | + | Block: |
</ | </ | ||
====== Qualtrics Wiki ====== | ====== Qualtrics Wiki ====== | ||
[[start|Qualtrics Wiki]] | [[start|Qualtrics Wiki]] |
countdowntimer.1662556219.txt.gz · Last modified: by admin