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
Next revisionBoth sides next revision
en:create:checks [12.01.2015 21:29] adminen:create:checks [05.05.2015 13:02] admin
Line 64: Line 64:
 With the PHP function [[:en:create:functions:getanswermissing|getAnswerMissing()]] and [[:en:create:functions:listfails|listFails()]] you are able to check which questions or items were not answered. By using [[:en:create:functions:text|text()]] you can then display customized error message text -- but only in addition to the predefined error message. With the PHP function [[:en:create:functions:getanswermissing|getAnswerMissing()]] and [[:en:create:functions:listfails|listFails()]] you are able to check which questions or items were not answered. By using [[:en:create:functions:text|text()]] you can then display customized error message text -- but only in addition to the predefined error message.
  
-===== Customized Response Checks =====+===== Customized Response Check =====
  
 If the predefined checks are insufficient, you can program a customized response check using a filter and the [[:en:create:functions:repeatpage|repeatPage()]] function. If the predefined checks are insufficient, you can program a customized response check using a filter and the [[:en:create:functions:repeatpage|repeatPage()]] function.
Line 74: Line 74:
 **Tip:** Use the function ''[[:en:create:functions:markfail|markFail()]]'' to highlight inputs with incorrect responses. **Tip:** Use the function ''[[:en:create:functions:markfail|markFail()]]'' to highlight inputs with incorrect responses.
  
-You will receive an error message when you display a text element using [[:en:create:functions:text|text()]] when answers are missing/incorrect. When you set up the text element make sure the text is displayed in the style of a //warning// -- then it will have the same format as the standard error messages.+Display an error message by passing the ID of a text element to ''repeatPage()'' (see below). Alternatively, you may simply display a text element using [[:en:create:functions:text|text()]] when answers are missing/incorrect. When you set up the text element make sure the text is displayed in the style of a //warning// -- then it will have the same format as the standard error messages.
  
 ==== Example: All Items or None at All ==== ==== Example: All Items or None at All ====
Line 87: Line 87:
 // Error and go back if not all or none were answered // Error and go back if not all or none were answered
 if ((count($answered) > 0) and (count($answered) < count($items))) { if ((count($answered) > 0) and (count($answered) < count($items))) {
-  text('error_AB01'); +  repeatPage('error_AB01');
-  repeatPage();+
 } }
 </code> </code>
  
  
-===== Probing =====+===== Probe =====
  
 It can make sense to probe when answers are missing for questions that are important for data analysis, or for questions that were simply missed out (e.g. items in long rows). It can make sense to probe when answers are missing for questions that are important for data analysis, or for questions that were simply missed out (e.g. items in long rows).
en/create/checks.txt · Last modified: 23.11.2020 15:35 by sophia.schauer
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki