This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en:create:checks-php [22.07.2019 16:36] – created johannes.jungilligens | en:create:checks-php [13.05.2022 19:14] (current) – saskia.mueller.577 | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| You can display an error message if you enter the ID of a text module as an argument in the '' | You can display an error message if you enter the ID of a text module as an argument in the '' | ||
| + | Below are some sample applications for individual response checks including the required PHP code. | ||
| - | ===== Example: | + | ===== Multiple Selection Matrix ======= |
| In an ordinary scale you can easily check whether the participant has selected an option in each line. But if you use a [[: | In an ordinary scale you can easily check whether the participant has selected an option in each line. But if you use a [[: | ||
| Line 84: | Line 85: | ||
| - | ===== Example: | + | ===== All Items or None at All ====== |
| The following PHP code checks whether all items on a scale were answered -- or none at all. The question identifier (in this example '' | The following PHP code checks whether all items on a scale were answered -- or none at all. The question identifier (in this example '' | ||
| Line 99: | Line 100: | ||
| </ | </ | ||
| + | ===== Consistency check text input ===== | ||
| + | |||
| + | Open text inputs can be set to accept numbers only ([[: | ||
| + | |||
| + | * TX01_01 -- Number of people in the company | ||
| + | * TY02_01 -- Number of managers in the company | ||
| + | * TY02_02 -- Number of employees who are close to retirement | ||
| + | |||
| + | It should now be ensured that the values for TY02_01 and TY02_02 are not higher than the total number of employees (TX01_01). If they are, the text with identifier TX02 should be displayed as an error message. | ||
| + | |||
| + | The values retrieved by '' | ||
| + | |||
| + | |||
| + | <code php> | ||
| + | if ( | ||
| + | (value(' | ||
| + | (value(' | ||
| + | ) { | ||
| + | repeatPage(' | ||
| + | } | ||
| + | </ | ||