This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
en:create:points [02.04.2015 15:45] – oezbf2012 | en:create:points [23.03.2021 22:47] – [Correct and Incorrect Answers] sophia.schauer | ||
---|---|---|---|
Line 18: | Line 18: | ||
The simplest way of keeping score is for a quiz or a knowledge test. These have a range of selection questions and one of the options is correct for each one. | The simplest way of keeping score is for a quiz or a knowledge test. These have a range of selection questions and one of the options is correct for each one. | ||
- | The following PHP code initially defines which questions will be evaluated and what the correct response is. An [[: | + | The following PHP code initially defines which questions will be evaluated and what the correct response is. An [[: |
Line 26: | Line 26: | ||
<code php> | <code php> | ||
// Define questions and the correct answers | // Define questions and the correct answers | ||
- | $questions = array( | + | $questions = [ |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | // and so on. | + | // and so on |
- | ); | + | ]; |
// Initialize counter variable | // Initialize counter variable | ||
Line 48: | Line 48: | ||
} | } | ||
- | // Show result | + | // Show result |
html('< | html('< | ||
+ | // ... or store in an internal variable | ||
+ | put(' | ||
</ | </ | ||