Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
en:create:timer-submit [28.04.2021 17:53] – [Implementation] sophia.schaueren:create:timer-submit [28.04.2021 17:57] – [Display Countdown] sophia.schauer
Line 57: Line 57:
 <script type="text/javascript"> <script type="text/javascript">
 <!-- <!--
 +
 // Function to forward // Function to forward
 function next() { function next() {
Line 91: Line 92:
  
 Now insert text elements and/or questions to be shown in the questionnaire underneath the PHP and JavaScript codes. Positioning them below the PHP code is important to ensure the filter works properly if time has already expired. Now insert text elements and/or questions to be shown in the questionnaire underneath the PHP and JavaScript codes. Positioning them below the PHP code is important to ensure the filter works properly if time has already expired.
 +
 +**Multilingual versions:** If you use different languages for the questionnaire, use the translation help tool (under language versions) and copy the code for the timer into the different language versions.
  
 ===== Display Countdown ===== ===== Display Countdown =====
Line 106: Line 109:
 <script type="text/javascript"> <script type="text/javascript">
 <!-- <!--
 +
 // Function to forward // Function to forward
 function weiter() { function weiter() {
Line 113: Line 117:
   SoSciTools.submitPage();   SoSciTools.submitPage();
 } }
 +
 // Display countdown // Display countdown
 var date0 = new Date(); var date0 = new Date();
Line 135: Line 140:
   out.appendChild(displayNode);   out.appendChild(displayNode);
 } }
 +
 +// Hide Next button (optional)
 +  SoSciTools.submitButtonsHide();
 +  
 // Initialize forwarding // Initialize forwarding
 SoSciTools.attachEvent(window, "load", function(evt) { SoSciTools.attachEvent(window, "load", function(evt) {
-  // Hide Next button (optional) +  
-  SoSciTools.submitButtonsHide();+
   // Additional timer to update the countdown   // Additional timer to update the countdown
   window.setInterval(updateCountdown, 1000);   window.setInterval(updateCountdown, 1000);
Line 145: Line 153:
   window.setTimeout(next, %remain% * 1000);   window.setTimeout(next, %remain% * 1000);
 }); });
 +
 // --> // -->
 </script> </script>
en/create/timer-submit.txt · Last modified: 12.04.2022 21:39 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki