This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:create:functions:preset [21.12.2014 11:52]
alexander.ritter [Examples]
en:create:functions:preset [29.09.2015 20:31] (current)
admin [Examples] Update
Line 49: Line 49:
 <code php> <code php>
 preset('TE01_01', 'n/s'); preset('TE01_01', 'n/s');
 +In a question battery "SB01" with 20 scale items, the first option shall be pre-selected. Instead of typing 20 ''preset()'' commands, a FOREACH loop can be used.
 +<code php>
 +$items = getItems('SB01', 'all');
 +foreach ($items as $item) {
 +  $itemID = 'SB01_'.sprintf('%02d', $item);
 +  preset($itemID, 1);
 </code> </code>
en/create/functions/preset.txt · Last modified: 29.09.2015 20:31 by admin
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki