Jump to navigation

Class: PartDisplay

Numbas.display.PartDisplay

new PartDisplay(p)

Display methods for a generic question part

Parameters:
Name Type Description
p Numbas.parts.Part

the associated part object

Source:

Members

(static) answered :observable|Boolean

Has the student answered this part?

Type:
Source:

(static) controls :Object

Control functions

Type:
Properties:
Name Type Description
toggleFeedback function

Toggle the display of the marking feedback messages

submit function

Submit the student's answers for marking

showSteps function

Show the steps

hideSteps function

Hide the steps

Source:

(static) credit :observable|Number

Proportion of available marks awarded to the student - i.e. score/marks. Penalties will affect this instead of the raw score, because of things like the steps marking algorithm.

Type:
Source:

(static) doesMarking :observable|Boolean

Does this part do any marking?

Type:
Source:
See:

(static) feedbackMessages :observable|Array.<String>

Feedback messages

Type:
Source:

(static) feedbackShown :observable|Boolean

Are the marking feedback messages visible?

Type:
Source:

(static) inputEvents :Object

Event bindings

Type:
Source:

(static) isDirty :observable|Boolean

Has the student changed their answer since the last submission?

Type:
Source:

(static) isNotOnlyPart :observable|Boolean

Are there other parts in line with this one? (Used to decide whether to show the submit button and feedback text) True if there's more than one part in the question, or this is a step.

Type:
Source:

(static) marks :observable|Number

The total marks available for this part (Numbas.parts.Part#marks)

Type:
Source:

(static) part :Numbas.parts.Part

The associated part object

Type:
Source:

(static) question :Numbas.Question

The question this part belongs to

Type:
Source:

(static) revealed :observable|Boolean

Have the correct answers been revealed?

Type:
Source:

(static) score :observable|Number

The student's current score (Numbas.parts.Part#score)

Type:
Source:

(static) scoreFeedback :observable|Numbas.display.scoreFeedback

Display of this parts's current score / answered status

Type:
Source:

(static) showCorrectAnswer :observable|Boolean

Should the correct answer be shown? True if revealed and Numbas.parts.Part#settings.showCorrectAnswer) is true

Type:
Source:

(static) showFeedbackBox :observable|Boolean

Should the box containing part marks and the submit and feedback buttons be shown?

Type:
Source:

(static) showFeedbackIcon :observable|Boolean

Should feedback icons be shown for this part?

Type:
Source:

(static) showFeedbackMessages :observable|Boolean

Should the feedback messages be shown?

Type:
Source:

(static) showMarks :observable|Boolean

Show the marks feedback?

Type:
Source:

(static) showSubmitPart :observable|Boolean

Show the "submit part" button?

Type:
Source:

(static) stepsOpen :observable|Boolean

Are the steps currently open? (Numbas.parts.Part#stepsOpen)

Type:
Source:

(static) stepsPenaltyMessage :observable|String

Text to describe the state of the steps penalty

Type:
Source:

(static) stepsShown :observable|Boolean

Have the steps ever been shown? (Numbas.parts.Part#stepsShown)

Type:
Source:

(static) toggleFeedbackText :observable|String

Text for the button to toggle the display of the feedback messages

Type:
Source:

(static) warnings :observable|Array.<Object.<String>>

Warnings based on the student's answer

Type:
Source:

(static) warningsShown :observable|Boolean

Should the warning box be shown?

Type:
Source:

Methods

(static) end()

Called when the exam ends

Source:

(static) hideSteps()

Hide the steps

Source:

(static) hideWarnings()

Hide the warnings

Source:

(static) init()

Initialise this part's display

Source:
See:

(static) removeWarnings()

Remove all previously displayed warnings

Source:

(abstract, static) restoreAnswer()

Fill the student's last submitted answer into inputs

Source:

(static) revealAnswer()

Show the correct answers to this part

Source:

(static) setWarnings(warnings)

Set the list of warnings

Parameters:
Name Type Description
warnings Array.<String>
Source:

(static) show()

Called when the part is displayed (basically when question is changed)

Source:
See:

(static) showScore()

Show/update the student's score and answer status on this part

Source:

(static) showSteps()

Called when 'show steps' button is pressed, or coming back to a part after steps shown

Source:

(static) showWarnings()

Show the warnings

Source:

(abstract, static) updateCorrectAnswer(answer)

Called when the correct answer to the question has changed (particularly when this part uses adaptive marking) The displayed correct answer should update.

Parameters:
Name Type Description
answer
Source:

(static) warning(warning)

Show a warning message about this part

Parameters:
Name Type Description
warning String
Source:

setName(name)

Set this part's name

Parameters:
Name Type Description
name String
Source: