Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:create:points [26.01.2015 09:56] – [Correct and Incorrect Answers] alexander.ritteren:create:points [06.12.2015 15:03] – [Correct and Incorrect Answers] admin
Line 27: Line 27:
 // Define questions and the correct answers // Define questions and the correct answers
 $questions = array( $questions = array(
-  'AB01' => 3),  // correct answer to question AB01 is 3 +  'AB01' => 3,  // correct answer to question AB01 is 3 
-  'AB02' => 1),  // correct answer to AB02 is code 1 +  'AB02' => 1,  // correct answer to AB02 is code 1 
-  'AB03' => 4),  // correct answer to AB03 is hidden behind code 4 +  'AB03' => 4,  // correct answer to AB03 is hidden behind code 4 
-  'AB04' => 2)+  'AB04' => 2, 
-  'AB05' => 1) +  'AB05' => 1 
-  // and so on+  // and so on
 ); );
  
Line 48: Line 48:
 } }
  
-// Show result or otherwise process+// Show result ...
 html('<p>You have scored'.$points.' points.</p>'); html('<p>You have scored'.$points.' points.</p>');
 +// ... or store in an internal variable
 +put('IV01_01', $points);
 </code> </code>
  
Line 151: Line 153:
  
  
-**Tip:** Define inverted items immediately like so: select item in the **List of Questions** -> //Invert answer codes for this item//. This saves you additional work.+**Tip:** Define inverted items immediately in the manner: select item in the **List of Questions** -> //Invert answer codes for this item//. This saves you additional work.
  
  
Line 196: Line 198:
 ===== Multiple Choice Response Pattern ===== ===== Multiple Choice Response Pattern =====
  
-Sometimes multiple conditions have to combined when checking an answer. For example, there is a multiple choice selection with 4 possible responses, and you want to check if the first two options were selected, but not the last two. You could solve this by using an IF construction as follows.+Sometimes multiple conditions have to combined when checking an answer. For example, in a multiple choice selection with 4 possible responses, you want to check if the first two options were selected, but not the last two. You could solve this by using an IF construction as shown below.
  
  
en/create/points.txt · Last modified: 30.03.2022 15:28 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