A feedback action has a condition. The feedback is only given when the condition is satisfied. An empty condition is always true, so when you leave the condition empty the feedback is always given. For each condition there also is a switch Stop on match. If you switch this on, no further actions are performed after this one if the condition is met. This can for example be used to have default feedback when all other conditions fail.
- Use == for equal. Also you can use comparisons like <, <=, > and >=.
- Use && for and, || for or, and ! for not.
- You can also use parentheses.
For example, when you have a multiple choice question with four answers, labeled a, b, c, and d, and the correct answer is b and d, the following condition
!a && b && !c && d
could give feedback 'That is correct.' You can set Stop on match. Next you could add
(!a && !b && !c && d) || (!a && b && !c && !d)
could give the feedback 'You gave one correct answer but there is another correct answer as well.'. Note that these conditions can be much simpler; see below.
The most important variables that exist are:
|answer||The answer given by the student. When multiple answers, this is the first answer. For multiple choice the answer is the label. Note that for a numeric open question the answer is a number and for a text open question it is a string (between quotes).|
|correct||Whether the answer is correct, that is, exactly equal to (one of) the provided solution(s).|
|answerCount||The number of given answers. (for multiple choice)|
|correctAnswerCount|| The number of correct answers. (for multiple choice)
|wrongAnswerCount||The number of wrong answers. (for multiple choice)|
|label1, label2, ...||You can use the labels of the answers as variables. They are true when selected and false otherwise. (for multiple choice)|
|attemptCount||The number of the attempt to check the answer. The first time the student checks the answer this is 1, then 2,and so on. You can use this to make the feedback dependent on the attempt.|
|user.firstName||First name of the student.|
|Last name of the student.|
So, for example the two conditions used in the example above could also be written as
correctAnswerCount == 1 && wrongAnswerCount == 0
|str.length||The length of a string or of an array.|
|str.trim()||Trims all leading and trailing spaces and tabs.|
|str.toUpperCase()||Turns the string in all uppercase letters.|
|str.toLowerCase()||Turns the string in all lowercase letters.|
|str.includes(searchStr)||Returns whether the string includes the search string.|
and give as feedback: 'You should write something about Quarterfall.'