Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
en:create:functions:getitems [28.11.2014 12:45] – [getItems()] alexander.ritter | en:create:functions:getitems [19.11.2015 10:30] – [getItems()] admin |
---|
|'''<'''|items with a valid answer that is less than the //answer code// specified.| | |'''<'''|items with a valid answer that is less than the //answer code// specified.| |
|'''==''', '''=''', '''is''' or '''equal'''|items with the exact //answer code// specified.| | |'''==''', '''=''', '''is''' or '''equal'''|items with the exact //answer code// specified.| |
|'''answered'''|items answered| | |'''answered'''|items answered. **Note:** The option is not applicable for multiple choice selections, as a respondent cannot not answer the options.| |
|'''missing'''|items not answered or missing.| | |'''missing'''|items not answered or missing.| |
|'''valid'''|items with a valid answer, and therefore have not been left empty or given an answer of "do not know". **Note:** In a multiple choice selection, 'no answer' selected is also a valid answer. Here, use '''==''' in conjunction with answer code ''2'' to determine the options selected.| | |'''valid'''|items with a valid answer, and therefore have not been left empty or given an answer of "do not know". **Note:** In a multiple choice selection, 'no answer' selected is also a valid answer. Here, use ' ''=='' ' in conjunction with answer code ''2'' to determine the options selected.| |
|'''invalid'''|items left empty or given an answer of "do not know".| | |'''invalid'''|items left empty or given an answer of "do not know".| |
| |
**Note:** As is the case with ''value()'', this function can only determine the answers of a participant on the page after the question. If the function is on the same page as the question, it does not work correctly because the answers will not have been transmitted to the server at all when the "continue" button is pressed. | **Note:** As is the case with ''value()'', this function can only determine the answers of a participant on the page after the question. If the function is on the same page as the question, it does not work correctly because the answers will not yet have been transmitted to the server when the "next" button is pressed. |
| |
===== Use Selected Items in Another Question ===== | ===== Use Selected Items in Another Question ===== |
In the following example, question ''AB01'' (a matrix question -- scale) is asked on page 1, in which the participant has to specify how often they read different magazines. | In the following example, question ''AB01'' (a matrix question -- scale) is asked on page 1, in which the participant has to specify how often they read different magazines. |
| |
On the following page 2, only items used no less frequently than "rarely" (answer code 2) should be displayed. | On the following page 2, only items used at least "rarely" (answer code 2) should be displayed. |
| |
This example assumes that ''AB02'' has just as many items as ''AB01''. In addition, matching items must also have the same ID. Thus, item 1 could be "mirror" in both questions, and item 2 could be "star". | This example assumes that ''AB02'' has just as many items as ''AB01''. In addition, matching items must also have the same ID. Thus, item 1 could be "mirror" in both questions, and item 2 could be "star". |
<code php> | <code php> |
// page 2 | // page 2 |
// determine items used no less frequently than "rarely" (2) | // determine items used at least "rarely" (2) |
$itemlist = getItems('AB01', 'min', 2); | $itemlist = getItems('AB01', 'min', 2); |
// only show these items in AB02 | // only show these items in AB02 |