Jump to navigation

Namespace: marking

Numbas.marking

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.

Source:

(static) feedback :Object.<function()>

Constructors for feedback items.

Type:
Source:
See:

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
Source:
See:

(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
Source:
See:

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 Numbas.marking.FeedbackOps

credit number <optional>

Parameter to change the credit awarded. The exact meaning depends on op.

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 MULTIPLY_CREDIT items, the factor to multiply the current credit by.

scale number <optional>

For CONCAT items, the amount to scale the credit awarded by the concatenated messages by.

messages Array.<Numbas.marking.feedback_item> <optional>

For CONCAT items, the items to add to the state.

invalid boolean <optional>

For END items, does this item represent a decision that the answer is invalid?

Source:

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.

Source:

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 Numbas.marking.StatefulScope#state_valid.

state_errors Object.<Error>

See Numbas.marking.StatefulScope#state_errors.

Source: