mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-63015' of https://github.com/paulholden/moodle
This commit is contained in:
commit
9b1d50a039
@ -242,6 +242,15 @@ class mod_feedback_complete_form extends moodleform {
|
||||
return $this->mode == self::MODE_VIEW_RESPONSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the form is considered read-only (e.g. when previewing it)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function is_readonly(): bool {
|
||||
return $this->mode === self::MODE_PRINT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current course module
|
||||
* @return cm_info
|
||||
@ -327,6 +336,11 @@ class mod_feedback_complete_form extends moodleform {
|
||||
$element->freeze();
|
||||
}
|
||||
|
||||
// For read-only forms, just disable each added element.
|
||||
if ($this->is_readonly()) {
|
||||
$this->_form->disabledIf($element->getName(), 'id');
|
||||
}
|
||||
|
||||
// Add red asterisks on required fields.
|
||||
if ($item->required) {
|
||||
$required = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'), 'moodle', ['class' => 'ml-2']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user