|
Moodle PHP Documentation 4.1
Moodle 4.1dev (Build: 20220512) (5e5e12e0)
|
Public Member Functions | |
| __construct ($question) | |
| Constructor. More... | |
| get_url_params () | |
| Parameters needed in the URL when continuing this preview. More... | |
| hide_all_feedback () | |
| Set all the feedback-related fields $feedback, generalfeedback, rightanswer and manualcomment to question_display_options::HIDDEN. | |
| load_user_defaults () | |
| Load the value of the options from the user_preferences table. | |
| save_user_preview_options ($newoptions) | |
| Save a change to the user's preview options to the database. More... | |
| set_from_request () | |
| Set the value of any fields included in the request. | |
Static Public Member Functions | |
| static | get_dp_options () |
| Returns the valid choices for the number of decimal places for showing question marks. More... | |
Public Attributes | |
| string | $behaviour |
| the behaviour to use for this preview. | |
| boolean | $clearwrong = false |
| whether the question type should output hidden form fields to reset any incorrect parts of the resonse to blank. | |
| context | $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::HIDDEN, question_display_options::VISIBLE or question_display_options::EDITABLE. | |
| integer | $generalfeedback = self::VISIBLE |
| Should the general feedback be visible? question_display_options::HIDDEN or question_display_options::VISIBLE. | |
| integer | $history = self::HIDDEN |
| Should the history of previous question states table be visible? question_display_options::HIDDEN 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::HIDDEN, question_display_options::MAX_ONLY or question_display_options::MARK_AND_MAX. | |
| number | $maxmark |
| the maximum mark to use for this preview. | |
| 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... | |
| 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? question_display_options::HIDDEN or question_display_options::VISIBLE. | |
| int | $userinfoinhistory = self::HIDDEN |
| The option to show the action author in the response history. | |
| int | $variant |
| the variant of the question to preview. | |
| const | EDITABLE = 2 |
| const | HIDDEN = 0 |
| const | MARK_AND_MAX = 2 |
| integer const | MAX_DP = 7 |
| #- More... | |
| integer const | MAX_ONLY = 1 |
| #- More... | |
| string const | OPTIONPREFIX = 'question_preview_options_' |
| prefix to append to field names to get user_preference names. | |
| integer const | SHOW_ALL = -1 |
| #+ named constants for the values that most of the options take. | |
| const | VISIBLE = 1 |
Protected Member Functions | |
| get_field_types () | |
| Names and param types of the options we read from the request. More... | |
| get_user_pref_fields () | |
| Names of the options we store in the user preferences table. More... | |
| qbank_previewquestion\question_preview_options::__construct | ( | $question | ) |
Constructor.
| stdClass | $question |
|
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.
| array | suitable for passing to html_writer::select() or similar. |
|
protected |
Names and param types of the options we read from the request.
| array |
| qbank_previewquestion\question_preview_options::get_url_params | ( | ) |
Parameters needed in the URL when continuing this preview.
| array | URL fragment. |
|
protected |
Names of the options we store in the user preferences table.
| array |
| qbank_previewquestion\question_preview_options::save_user_preview_options | ( | $newoptions | ) |
Save a change to the user's preview options to the database.
| object | $newoptions |
|
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. question_display_options::HIDDEN or question_display_options::VISIBLE
|
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.
|
inherited |
|
inherited |
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.
|
inherited |
Should the specific feedback be visible.
question_display_options::HIDDEN or question_display_options::VISIBLE
|
inherited |
Should the manually added marker's comment be visible.
Should the link for adding/editing the comment be there. question_display_options::HIDDEN, question_display_options::VISIBLE, or question_display_options::EDITABLE. Editable means that form fields are displayed inline.
|
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.
question_display_options::HIDDEN or question_display_options::VISIBLE
|
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.
|
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.
|
inherited |
#-
#+ named constants for the $marks option.