Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
|
Public Member Functions | |
build_editform ($item, $feedback, $cm) | |
Creates and returns an instance of the form for editing the item. | |
can_switch_require () | |
Wether this item can be set as both required and not. | |
compare_value ($item, $dbvalue, $dependvalue) | |
Compares the dbvalue with the dependvalue. | |
complete_form_element ($item, $form) | |
Adds an input element to the complete form. | |
create_value ($value) | |
Converts the value from complete_form data to the string value that is stored in the db. | |
edit_actions ($item, $feedback, $cm) | |
Returns the list of actions allowed on this item in the edit mode. | |
excelprint_item (&$worksheet, $row_offset, $xls_formats, $item, $groupid, $courseid=false) | |
Adds summary information about an item to the Excel export file. | |
get_analysed_for_external ($item, $groupid=false, $courseid=false) | |
Return the analysis data ready for external functions. | |
get_data () | |
Gets submitted data from the edit form and saves it in $this->item. | |
get_data_for_external ($item) | |
Return extra data for external functions. | |
get_display_name ($item, $withpostfix=true) | |
Returns the formatted name of the item for the complete form or response view. | |
get_display_name_postfix ($item) | |
Returns the postfix to be appended to the display name that is based on other settings. | |
get_hasvalue () | |
Wether this item type has a value that is expected from the user and saved in the stored values. | |
get_info ($item) | |
get_printval ($item, $value) | |
Prepares the value for exporting to Excel. | |
hidenoselect ($item) | |
ignoreempty ($item) | |
is_cancelled () | |
Checks if the editing form was cancelled. | |
prepare_presentation_values ($linesep1, $linesep2, $valuestring, $valuesep1, $valuesep2) | |
prepare_presentation_values_print ($valuestring, $valuesep1, $valuesep2) | |
prepare_presentation_values_save ($valuestring, $valuesep1, $valuesep2) | |
print_analysed ($item, $itemnr='', $groupid=false, $courseid=false) | |
Prints analysis for the current item. | |
save_item () | |
Saves item. | |
set_data ($itemdata) | |
Set the item data (to be used by data generators). | |
set_hidenoselect ($item, $hidenoselect=true) | |
set_ignoreempty ($item, $ignoreempty=true) | |
show_editform () | |
Displays the form for editing an item. | |
Protected Member Functions | |
get_analysed ($item, $groupid=false, $courseid=false) | |
Helper function for collected data, both for analysis page and export to excel. | |
get_options ($item) | |
Options for the multichoice element. | |
Protected Attributes | |
stdClass | $item |
feedback_item_form | $item_form |
$type = "multichoicerated" | |
feedback_item_multichoicerated::build_editform | ( | $item, | |
$feedback, | |||
$cm ) |
Creates and returns an instance of the form for editing the item.
stdClass | $item | |
stdClass | $feedback | |
cm_info | stdClass | $cm |
Reimplemented from feedback_item_base.
|
inherited |
Wether this item can be set as both required and not.
bool |
Reimplemented in feedback_item_captcha, feedback_item_info, feedback_item_label, and feedback_item_pagebreak.
feedback_item_multichoicerated::compare_value | ( | $item, | |
$dbvalue, | |||
$dependvalue ) |
Compares the dbvalue with the dependvalue.
stdClass | $item | |
string | $dbvalue | is the value input by user in the format as it is stored in the db |
string | $dependvalue | is the value that it needs to be compared against |
Reimplemented from feedback_item_base.
feedback_item_multichoicerated::complete_form_element | ( | $item, | |
$form ) |
Adds an input element to the complete form.
stdClass | $item | |
mod_feedback_complete_form | $form |
Reimplemented from feedback_item_base.
|
inherited |
Converts the value from complete_form data to the string value that is stored in the db.
mixed | $value | element from mod_feedback_complete_form\get_data() with the name $item->typ.'_'.$item->id |
string |
Reimplemented in feedback_item_captcha, feedback_item_info, feedback_item_multichoice, feedback_item_numeric, feedback_item_pagebreak, feedback_item_textarea, and feedback_item_textfield.
|
inherited |
Returns the list of actions allowed on this item in the edit mode.
stdClass | $item | |
stdClass | $feedback | |
cm_info | $cm |
action_menu_link[] |
Reimplemented in feedback_item_captcha, and feedback_item_pagebreak.
feedback_item_multichoicerated::excelprint_item | ( | & | $worksheet, |
$row_offset, | |||
$xls_formats, | |||
$item, | |||
$groupid, | |||
$courseid = false ) |
Adds summary information about an item to the Excel export file.
object | $worksheet | a reference to the pear_spreadsheet-object |
integer | $row_offset | |
stdClass | $xls_formats | see analysis_to_excel.php |
object | $item | the db-object from feedback_item |
integer | $groupid | |
integer | $courseid |
integer | the new row_offset |
Reimplemented from feedback_item_base.
|
protected |
Helper function for collected data, both for analysis page and export to excel.
stdClass | $item | the db-object from feedback_item |
int | $groupid | |
int | $courseid |
array|null |
feedback_item_multichoicerated::get_analysed_for_external | ( | $item, | |
$groupid = false, | |||
$courseid = false ) |
Return the analysis data ready for external functions.
stdClass | $item | the item (question) information |
int | $groupid | the group id to filter data (optional) |
int | $courseid | the course id (optional) |
array | an array of data with non scalar types json encoded |
Reimplemented from feedback_item_base.
|
inherited |
Gets submitted data from the edit form and saves it in $this->item.
bool |
Reimplemented in feedback_item_captcha, and feedback_item_pagebreak.
|
inherited |
Return extra data for external functions.
Some items may have additional configuration data or default values that should be returned for external functions:
stdClass | $item | the item object |
str | the data, may be json_encoded for large structures |
Reimplemented in feedback_item_captcha, and feedback_item_info.
|
inherited |
Returns the formatted name of the item for the complete form or response view.
stdClass | $item | |
bool | $withpostfix |
string |
Reimplemented in feedback_item_captcha, and feedback_item_label.
|
inherited |
Returns the postfix to be appended to the display name that is based on other settings.
stdClass | $item |
string |
Reimplemented in feedback_item_numeric.
|
inherited |
Wether this item type has a value that is expected from the user and saved in the stored values.
int |
Reimplemented in feedback_item_captcha, feedback_item_label, and feedback_item_pagebreak.
|
protected |
Options for the multichoice element.
stdClass | $item |
array |
feedback_item_multichoicerated::get_printval | ( | $item, | |
$value ) |
Prepares the value for exporting to Excel.
object | $item | the db-object from feedback_item |
object | $value | object with item-related value from feedback_values in the 'value' property |
string |
Reimplemented from feedback_item_base.
|
inherited |
Checks if the editing form was cancelled.
bool |
Reimplemented in feedback_item_captcha, and feedback_item_pagebreak.
feedback_item_multichoicerated::print_analysed | ( | $item, | |
$itemnr = '', | |||
$groupid = false, | |||
$courseid = false ) |
Prints analysis for the current item.
$item | the db-object from feedback_item | |
string | $itemnr | |
integer | $groupid | |
integer | $courseid |
integer | the new itemnr |
Reimplemented from feedback_item_base.
feedback_item_multichoicerated::save_item | ( | ) |
|
inherited |
Set the item data (to be used by data generators).
stdClass | $itemdata | the item data to set |
|
inherited |
Displays the form for editing an item.
this function only can used after the call of build_editform()
Reimplemented in feedback_item_captcha, and feedback_item_pagebreak.