new PartDisplay(p)
Display methods for a generic question part.
Parameters:
Name | Type | Description |
---|---|---|
p |
Numbas.parts.Part | The associated part object. |
Members
(static) answered :observable|boolean
Has the student answered this part?
Type:
(static) controls :object
Control functions.
Type:
Properties:
Name | Type | Description |
---|---|---|
submit |
function | Submit the student's answers for marking. |
showSteps |
function | Show the steps. |
hideSteps |
function | Hide the steps. |
(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:
(static) doesMarking :observable|boolean
Does this part do any marking?
Type:
(static) feedbackMessages :observable
Feedback messages.
Type:
(static) feedbackShown :observable.<boolean>
Is the box containing the feedback messages open?
Type:
(static) feedbackToggleText :observable|string
Text for the button to toggle the display of the feedback messages.
Type:
(static) hasFeedbackMessages :observable.<boolean>
Does this part have any shown feedback messages?
Type:
(static) inputEvents :object
Event bindings.
Type:
(static) input_title :observable.<string>
Title text for this part's answer input.
Type:
(static) isDirty :observable|boolean
Has the student changed their answer since the last submission?
Type:
(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:
(static) locked :observable|boolean
Has this part been locked?
Type:
(static) locked :observable|boolean
Is this part disabled? True if revealed or locked.
Type:
(static) madeNextParts :observableArray.<Numbas.display.PartDisplay>
Next parts that have been made.
Type:
- observableArray.<Numbas.display.PartDisplay>
(static) marks :observable|number
The total marks available for this part.
Type:
(static) name :observable|string
The display name of this part.
Type:
(static) nextParts :observable
Options for the next part.
Type:
(static) partTreeCSS :observable.<object>
CSS classes for the parts tree display.
Type:
(static) pd.html_promise :Promise
A promise resolving to the part's HTML element.
Type:
- Promise
(static) reachedDeadEnd :observable.<boolean>
Is this part a dead end? True if answered or doesn't do marking, and there are no next parts.
Type:
(static) revealed :observable|boolean
Have the correct answers been revealed?
Type:
(static) score :observable|number
The student's current score.
Type:
(static) scoreFeedback :observable|Numbas.display.scoreFeedback
Display of this parts's current score / answered status.
Type:
- observable | Numbas.display.scoreFeedback
(static) showCorrectAnswer :observable|boolean
Should the correct answer be shown? True if revealed and Numbas.parts.Part#settings.showCorrectAnswer
) is true.
Type:
(static) showFeedbackBox :observable|boolean
Should the box containing part marks and the submit and feedback buttons be shown?
Type:
(static) showFeedbackIcon :observable|boolean
Should feedback icons be shown for this part?
Type:
(static) showFeedbackMessages :observable|boolean
Should the feedback messages be shown?
Type:
(static) showFeedbackMessages :observable|boolean
Has the feedback changed since it was last looked at?
Type:
(static) showMarks :observable|boolean
Show the marks feedback?
Type:
(static) showName :observable|boolean
Should the name of this part be displayed?
Type:
(static) showNextParts :observable.<boolean>
Should the list of next parts be shown?
Type:
(static) showSubmitPart :observable|boolean
Show the "submit part" button?
Type:
(static) shownFeedbackMessages :observable.<Array>
Feedback messages that are shown to the student. If all feedback should be shown, then returns the entire list. If not, then only messages relating to invalid input are shown.
Type:
(static) stepsOpen :observable|boolean
Are the steps currently open?
Type:
(static) stepsPenaltyMessage :observable|string
Text to describe the state of the steps penalty.
Type:
(static) stepsShown :observable|boolean
Have the steps ever been shown?
Type:
(static) visible :boolean
Should this part be shown?
Type:
(static) waiting_for_pre_submit :observable|boolean
Is this part waiting for some pre-submit tasks to finish before submitting?
Type:
(static) warnings :observable|Array.<Object.<string>>
Warnings based on the student's answer.
Type:
- observable | Array.<Object.<string>>
(static) warningsShown :observable|boolean
Should the warning box be shown?
Type:
(static) whatNextMessage :observable.<string>
Header for the menu of next parts.
Type:
Methods
(static) end()
Called when the exam ends.
(static) hideWarnings()
Hide the warnings.
(static) init()
Initialise this part's display.
(static) removeWarnings()
Remove all previously displayed warnings.
(abstract, static) restoreAnswer(studentAnswer)
Fill the student's last submitted answer into inputs.
Parameters:
Name | Type | Description |
---|---|---|
studentAnswer |
object |
(static) revealAnswer()
Show the correct answers to this part.
(static) setWarnings(warnings)
Set the list of warnings.
Parameters:
Name | Type | Description |
---|---|---|
warnings |
Array.<string> |
(static) show()
Called when the part is displayed (basically when question is changed).
(static) showScore(valid, noUpdate)
Show/update the student's score and answer status on this part.
Parameters:
Name | Type | Description |
---|---|---|
valid |
boolean | |
noUpdate |
boolean |
(static) showSteps()
Called when 'show steps' button is pressed, or coming back to a part after steps shown.
(static) showWarnings()
Show the warnings.
(static) this.htmlBound()
Called when Knockout has finished binding the HTML for this part to the DOM.
(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 |
* |
(static) updateNextParts()
Update the list of next parts. Called when an instance of a next part is created or removed.
(static) warning(warning)
Show a warning message about this part.
Parameters:
Name | Type | Description |
---|---|---|
warning |
string |