Jump to navigation

Class: QuestionDisplay

Numbas.display.QuestionDisplay

new QuestionDisplay(q)

Display properties of a question object.

Parameters:
Name Type Description
q Numbas.Question

the associated question object

Source:

Members

(static) adviceDisplayed :observable|boolean

Has the advice been shown?

Type:
Source:

(static) answered :observable|boolean

Has this question been answered?

Type:
Source:
See:

(static) anyAnswered :observable|boolean

Have any of this question's parts been answered?

Type:
Source:

(static) canReveal :observable|boolean

Is the student able to reveal the correct answers?

Type:
Source:

(static) credit :observable|number

Proportion of available marks awarded to the student.

Type:
Source:

(static) css_classes :Observable.<object>

CSS classes for this question's HTML element.

Type:
Source:

(static) currentPart :observable|Numbas.display.PartDisplay

The currently visible part, in explore mode.

Type:
Source:

(static) displayName :observable|string

The name to display for this question - in default locale, it's "Question {N}".

Type:
Source:

(static) doesMarking :observable|boolean

Does this question do any marking?

Type:
Source:

(static) firstPart :observable.<Numbas.display.PartDisplay>

The first part in the question.

Type:
Source:

(static) hasAdvice :observable|string

Does this question have non-empty advice text?

Type:
Source:

(static) hasStatement :observable|string

Does this question have non-empty statement text?

Type:
Source:

(static) html :Element

HTML representing the question.

Type:
Source:

(static) isDirty :observable|boolean

Has the student changed any of their answers since submitting?

Type:
Source:

(static) locked :observable|boolean

Has this question been locked?

Type:
Source:
See:

(static) marks :observable|number

Total marks available for this question.

Type:
Source:
See:

(static) numParts :observable|number

Number of parts in this question.

Type:
Source:

(static) objectives :Array.<object>

Explore mode objectives.

Type:
Source:

(static) parts :observable.<Array.<Numbas.display.PartDisplay>>

Display objects for all parts in this question.

Type:
Source:

(static) penalties :Array.<object>

Explore mode penalties.

Type:
Source:

(static) previousPart :observable|Numbas.display.PartDisplay

The part that created the current part.

Type:
Source:

(static) question :Numbas.Question

The associated question object.

Type:
Source:

(static) revealed :observable|boolean

Have the correct answers been revealed?

Type:
Source:
See:

(static) score :observable|number

Student's current score.

Type:
Source:
See:

(static) scoreFeedback :Object

Score feedback string.

Type:
Source:

(static) showPartsTree :Observable.<boolean>

Show the tree of parts for navigation?

Type:
Source:

(static) showScoreBreakdown :Observable.<boolean>

Should the score breakdown table be shown?

Type:
Source:

(static) submitMessage :observable|string

Text for the "submit all answers" button.

Type:
Source:

(static) this.html_promise :Promise

A promise resolving to the question's HTML element.

Type:
  • Promise
Source:
See:

(static) visible :observable|boolean

Is this question visible in the list?

Type:
Source:

(static) visited :observable|boolean

Has the student looked at this question?

Type:
Source:
See:

Methods

addPart(p)

Add a new part to the display.

Parameters:
Name Type Description
p Numbas.parts.Part
Source:

removePart(p)

Remove a part from the display.

Parameters:
Name Type Description
p Numbas.parts.Part
Source:

resume()

Called when the attempt is resumed.

Source:
See:

updateParts()

Update the list of parts.

Source:

(static) end()

Called when the exam ends.

Source:

(static) getPart(path) → {Numbas.display.PartDisplay}

Get the Numbas.display.PartDisplay object for the given path.

Parameters:
Name Type Description
path Numbas.parts.partpath
Returns:
Type Description
Numbas.display.PartDisplay
Source:

(static) init()

Initialise this question's display.

Source:

(static) leave()

Called when the student leaves the question.

Source:

(static) makeHTML()

Make the HTML to display the question.

Source:

(static) revealAnswer()

Reveal the answers to this question.

Source:

(static) review()

Show this question in review mode.

Source:

(static) scrollToError()

Scroll to the first part submission error.

Source:

(static) show()

Show the question.

Source:

(static) showAdvice()

Show this question's advice.

Source:

(static) showScore(noUpdate)

Display question score and answer state.

Parameters:
Name Type Description
noUpdate boolean
Source:

(static) this.htmlBound()

Called when Knockout has finished binding all the HTML for this question to the DOM.

Source: