This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:create:checks [14.01.2015 18:52] – [Customized Response Checks] alexander.ritter | en:create:checks [23.11.2020 15:35] (current) – [Example: All Items or None at All] sophia.schauer | ||
---|---|---|---|
Line 66: | Line 66: | ||
===== Customized Response Check ===== | ===== Customized Response Check ===== | ||
- | If the predefined checks are insufficient, | + | If the predefined checks are insufficient, |
- | The PHP code used to check the answer must be put on the page __after__ the question at the top. Therefore, if the question that needs to be checked is on page 2 then the PHP code that checks | + | A detailed explanation and examples can be found in the [[: |
- | **Tip:** Further details about programming filters can be found under [[: | ||
- | **Tip:** Use the function '' | + | ===== Probe ===== |
- | + | ||
- | You will receive an error message when you display a text element using [[: | + | |
- | + | ||
- | ==== Example: All Items or None at All ==== | + | |
- | + | ||
- | The following PHP code checks whether all items in a scale were answered -- or none at all. The question' | + | |
- | + | ||
- | <code php> | + | |
- | // Create a list of all items in the question | + | |
- | $items = getItems(' | + | |
- | // Determine items answered | + | |
- | $answered = getItems(' | + | |
- | // Error and go back if not all or none were answered | + | |
- | if ((count($answered) > 0) and (count($answered) < count($items))) { | + | |
- | text(' | + | |
- | repeatPage(); | + | |
- | } | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ===== Probing | + | |
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). |