Members
(static, readonly) FeedbackOps :string
Kinds of feedback item.
Type:
Properties:
Name | Type | Description |
---|---|---|
SET_CREDIT |
string | Set the credit to the given value. |
ADD_CREDIT |
string | Add the given amount of credit. |
MULTIPLY_CREDIT |
string | Multiply the current credit by the given amount. |
SUB_CREDIT |
string | Subtract the given amount of credit. |
END |
string | End marking. |
WARNING |
string | Give the student a warning next to the answer widget. |
FEEDBACK |
string | Give the student a message. |
CONCAT |
string | Add the given list of items to the end of the current list of feedback items. |
Methods
(static) compute_note(name, todo, scope) → {Numbas.jme.token}
Compute the marking note with the given name in the given scope.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
todo |
object | Dictionary of notes still to evaluate. |
scope |
Numbas.marking.StatefulScope |
Returns:
Type | Description |
---|---|
Numbas.jme.token |
(static) finalise_state(states) → {Numbas.marking.finalised_state}
Run through a sequence of state operations, accumulating credit.
It might look like this is duplicated in Numbas.parts.Part#apply_feedback
, but we need to be able to get a description of what a sequence of operations does in abstract so it can be reused in marking scripts for parent parts.
Parameters:
Name | Type | Description |
---|---|---|
states |
Array.<Numbas.marking.feedback_item> |
Returns:
Type | Description |
---|---|
Numbas.marking.finalised_state |
Type Definitions
feedback_item
A line of feedback to give to the student, produced while marking their answer. Can modify the credit awarded.
Type:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
op |
string | The operation to perform. See |
|
credit |
number |
<optional> |
Parameter to change the credit awarded. The exact meaning depends on |
reason |
string |
<optional> |
An extra note about why the op is being applied. For 'correct' and 'incorrect' feedback, this helps distinguish cases when the credit awarded doesn't change. 'invalid' means the answer could not be marked. |
message |
string |
<optional> |
A message to display to the student. |
factor |
number |
<optional> |
For |
scale |
number |
<optional> |
For |
messages |
Array.<Numbas.marking.feedback_item> |
<optional> |
For |
invalid |
boolean |
<optional> |
For |
finalised_state
The result of attempting to mark a part.
Type:
Properties:
Name | Type | Description |
---|---|---|
valid |
boolean | Can the answer be marked? |
credit |
number | Proportion of the credit to award. |
states |
Array.<object> | Feedback actions. |
marking_script_result
The result of a marking script.
Type:
Properties:
Name | Type | Description |
---|---|---|
states |
Object.<Array.<Numbas.marking.feedback_item>> | The feedback resulting from each of the notes. |
values |
Object.<Numbas.jme.token> | The values of each of the notes. |
state_valid |
Object.<boolean> | See |
state_errors |
Object.<Error> | See |