mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
Merge branch 'MDL-81075-main' of https://github.com/cameron1729/moodle
This commit is contained in:
commit
f96778f74d
@ -544,6 +544,18 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
|
||||
$settings->add(new admin_setting_configselect('question_preview/history',
|
||||
get_string('responsehistory', 'question'), '', 0, $hiddenofvisible));
|
||||
|
||||
// Question editing settings.
|
||||
$settings = new admin_settingpage('qediting',
|
||||
get_string('questionediting', 'question'),
|
||||
'moodle/question:config');
|
||||
$ADMIN->add('qtypesettings', $settings);
|
||||
|
||||
$settings->add(new admin_setting_heading('qediting_options',
|
||||
'', get_string('questionediting_desc', 'question')));
|
||||
|
||||
$settings->add(new admin_setting_configcheckbox('questiondefaultssave',
|
||||
get_string('questiondefaultssave', 'question'), get_string('questiondefaultssave_desc', 'question'), 1));
|
||||
|
||||
// Settings for particular question types.
|
||||
$plugins = core_plugin_manager::instance()->get_plugins_of_type('qtype');
|
||||
core_collator::asort_objects_by_property($plugins, 'displayname');
|
||||
|
@ -449,6 +449,10 @@ $string['questionbehavioursdisabled'] = 'Question behaviours to disable';
|
||||
$string['questionbehavioursdisabledexplained'] = 'Enter a comma-separated list of behaviours you do not want to appear in the drop-down menu.';
|
||||
$string['questionbehavioursorder'] = 'Question behaviours order';
|
||||
$string['questionbehavioursorderexplained'] = 'Enter a comma-separated list of behaviours in the order you want them to appear in the drop-down menu.';
|
||||
$string['questiondefaultssave'] = 'Enable saving question defaults';
|
||||
$string['questiondefaultssave_desc'] = 'When enabled, the value of certain question form elements will be saved as user preferences when the question editing form is submitted. The value stored in the user preference will then be used as the default value the next time the form is viewed.';
|
||||
$string['questionediting'] = 'Question editing';
|
||||
$string['questionediting_desc'] = 'These settings control aspects of the question editing forms';
|
||||
$string['questionidmismatch'] = 'Question ids mismatch';
|
||||
$string['questionformtagheader'] = '{$a} tags';
|
||||
$string['questionname'] = 'Question name';
|
||||
|
@ -287,8 +287,8 @@ if ($mform->is_cancelled()) {
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a new question, save defaults for user in user_preferences table.
|
||||
if (empty($question->id)) {
|
||||
// If this is a new question and question defaults save is enabled, save defaults for user in user_preferences table.
|
||||
if (empty($question->id) && !empty($CFG->questiondefaultssave)) {
|
||||
$qtypeobj->save_defaults_for_new_questions($fromform);
|
||||
}
|
||||
$question = $qtypeobj->save_question($question, $fromform);
|
||||
|
@ -140,7 +140,12 @@ abstract class question_edit_form extends question_wizard_form {
|
||||
* @return string|null default value for a given form element.
|
||||
*/
|
||||
protected function get_default_value(string $name, $default): ?string {
|
||||
return question_bank::get_qtype($this->qtype())->get_default_value($name, $default);
|
||||
global $CFG;
|
||||
|
||||
if (!empty($CFG->questiondefaultssave)) {
|
||||
return question_bank::get_qtype($this->qtype())->get_default_value($name, $default);
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2024071200.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2024071600.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '4.5dev (Build: 20240712)'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user