This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:create:checks [05.05.2015 13:02] – admin | 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 the question must be put at the top on page 3. | + | A detailed explanation and examples |
| - | + | ||
| - | **Tip:** Further details about programming filters | + | |
| - | + | ||
| - | **Tip:** Use the function '' | + | |
| - | + | ||
| - | Display an error message by passing the ID of a text element to '' | + | |
| - | + | ||
| - | ==== 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))) { | + | |
| - | repeatPage(' | + | |
| - | } | + | |
| - | </ | + | |