Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | List of all members
mod_quiz_display_options Class Reference

An extension of question_display_options that includes the extra options used by the quiz. More...

Inheritance diagram for mod_quiz_display_options:
question_display_options

Public Member Functions

 hide_all_feedback ()
 Set all the feedback-related fields }, generalfeedback}, * rightanswer} and manualcomment to question_display_options::HIDDEN.
 

Static Public Member Functions

static get_dp_options ()
 Returns the valid choices for the number of decimal places for showing question marks. More...
 
static make_from_quiz ($quiz, $when)
 Set up the various options from the quiz settings, and a time constant. More...
 

Public Attributes

boolean $attempt = true
 #- More...
 
boolean $clearwrong = false
 whether the question type should output hidden form fields to reset any incorrect parts of the resonse to blank.
 
int $context
 the context the attempt being output belongs to.
 
integer $correctness = self::VISIBLE
 Should the student have what they got right and wrong clearly indicated. More...
 
array $editquestionparams = array()
 If not empty, then a link to edit the question will be included in the info box for the question. More...
 
string $extrahistorycontent = ''
 
string $extrainfocontent = ''
 
integer $feedback = self::VISIBLE
 Should the specific feedback be visible. More...
 
integer $flags = self::VISIBLE
 Should the flag this question UI element be visible, and if so, should the flag state be changable? }, * question_display_options::VISIBLE} or question_display_options::EDITABLE.
 
integer $generalfeedback = self::VISIBLE
 Should the general feedback be visible? } or * question_display_options::VISIBLE.
 
integer $history = self::HIDDEN
 Should the history of previous question states table be visible? } or * question_display_options::VISIBLE.
 
integer $manualcomment = self::VISIBLE
 Should the manually added marker's comment be visible. More...
 
string $manualcommentlink = null
 Should we show a 'Make comment or override grade' link? base URL for the edit comment script, which will be shown if $manualcomment = self::VISIBLE.
 
number $markdp = 2
 of decimal places to use when formatting marks for output.
 
integer $marks = self::MARK_AND_MAX
 The the mark and/or the maximum available mark for this question be visible? }, * question_display_options::MAX_ONLY} or question_display_options::MARK_AND_MAX.
 
integer $numpartscorrect = self::VISIBLE
 For questions with a number of sub-parts (like matching, or multiple-choice, multiple-reponse) display the number of sub-parts that were correct. More...
 
boolean $overallfeedback = self::VISIBLE
 if this is false, then the student is not allowed to review anything about the attempt.
 
moodle_url $questionreviewlink = null
 Used in places like the question history table, to show a link to review this question in a certain state. More...
 
boolean $readonly = false
 whether the question should be displayed as a read-only review, or in an active state where you can change the answer.
 
integer $rightanswer = self::VISIBLE
 Should the automatically generated display of what the correct answer is be visible? } or * question_display_options::VISIBLE.
 
const AFTER_CLOSE = 0x00010
 
integer const DURING = 0x10000
 #+ bits used to indicate various times in relation to a quiz attempt.
 
const EDITABLE = 2
 
integer const HIDDEN = 0
 #+ named constants for the values that most of the options take.
 
const IMMEDIATELY_AFTER = 0x01000
 
const LATER_WHILE_OPEN = 0x00100
 
const MARK_AND_MAX = 2
 
integer const MAX_DP = 7
 #- More...
 
integer const MAX_ONLY = 1
 #- More...
 
const VISIBLE = 1
 

Static Protected Member Functions

static extract ($bitmask, $bit, $whenset=self::VISIBLE, $whennotset=self::HIDDEN)
 

Detailed Description

An extension of question_display_options that includes the extra options used by the quiz.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_dp_options()

static question_display_options::get_dp_options ( )
staticinherited

Returns the valid choices for the number of decimal places for showing question marks.

For use in the user interface.

Calling code should probably use question_engine::get_dp_options() rather than calling this method directly.

Return values
arraysuitable for passing to html_writer::select() or similar.

◆ make_from_quiz()

static mod_quiz_display_options::make_from_quiz (   $quiz,
  $when 
)
static

Set up the various options from the quiz settings, and a time constant.

Parameters
object$quizthe quiz settings.
int$oneof the }, IMMEDIATELY_AFTER}, * LATER_WHILE_OPEN} or AFTER_CLOSE constants.
Return values
mod_quiz_display_optionsset up appropriately.

Member Data Documentation

◆ $attempt

boolean mod_quiz_display_options::$attempt = true

#-

if this is false, then the student is not allowed to review anything about the attempt.

◆ $correctness

integer question_display_options::$correctness = self::VISIBLE
inherited

Should the student have what they got right and wrong clearly indicated.

This includes the green/red hilighting of the bits of their response, whether the one-line summary of the current state of the question says correct/incorrect or just answered. } or * question_display_options::VISIBLE

◆ $editquestionparams

array question_display_options::$editquestionparams = array()
inherited

If not empty, then a link to edit the question will be included in the info box for the question.

If used, this array must contain an element courseid or cmid.

It shoudl also contain a parameter returnurl => moodle_url giving a sensible URL to go back to when the editing form is submitted or cancelled.

url parameter for the edit link. id => questiosnid will be added automatically.

◆ $extrahistorycontent

string question_display_options::$extrahistorycontent = ''
inherited
Since
2.9 extra HTML to include in the history box of the question display, if it is shown.

◆ $extrainfocontent

string question_display_options::$extrainfocontent = ''
inherited
Since
2.9 extra HTML to include at the end of the outcome (feedback) box of the question display.

This field is now badly named. The place it included is was changed (for the better) but the name was left unchanged for backwards compatibility.

◆ $feedback

integer question_display_options::$feedback = self::VISIBLE
inherited

Should the specific feedback be visible.

} or * question_display_options::VISIBLE

◆ $manualcomment

integer question_display_options::$manualcomment = self::VISIBLE
inherited

Should the manually added marker's comment be visible.

Should the link for adding/editing the comment be there. }, * question_display_options::VISIBLE}, or question_display_options::EDITABLE. Editable means that form fields are displayed inline.

◆ $numpartscorrect

integer question_display_options::$numpartscorrect = self::VISIBLE
inherited

For questions with a number of sub-parts (like matching, or multiple-choice, multiple-reponse) display the number of sub-parts that were correct.

} or * question_display_options::VISIBLE

◆ $questionreviewlink

moodle_url question_display_options::$questionreviewlink = null
inherited

Used in places like the question history table, to show a link to review this question in a certain state.

If blank, a link is not shown. base URL for a review question script.

◆ MAX_DP

integer const question_display_options::MAX_DP = 7
inherited

#-

maximum value for the $markpd option. This is effectively set by the database structure, which uses NUMBER(12,7) columns for question marks/fractions.

◆ MAX_ONLY

integer const question_display_options::MAX_ONLY = 1
inherited

#-

#+ named constants for the $marks option.


The documentation for this class was generated from the following file: