Commit 3da8ea46 authored by ilya's avatar ilya
Browse files

Merge branch...

Merge branch 'MDL-71902-add-site-level-settings-enforcement-for-browsersecurity-settings' of https://github.com/keevan/moodle
parents 8f9b534e 4141f883
......@@ -64,6 +64,7 @@ if ($ADMIN->fulltree) {
get_string('timelimit', 'quiz'), get_string('configtimelimitsec', 'quiz'),
'0', 60);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Delay to notify graded attempts.
......@@ -71,15 +72,18 @@ if ($ADMIN->fulltree) {
get_string('attemptgradeddelay', 'quiz'), get_string('attemptgradeddelay_desc', 'quiz'), 5 * HOURSECS, HOURSECS));
// What to do with overdue attempts.
$quizsettings->add(new mod_quiz_admin_setting_overduehandling('quiz/overduehandling',
$setting = new mod_quiz_admin_setting_overduehandling('quiz/overduehandling',
get_string('overduehandling', 'quiz'), get_string('overduehandling_desc', 'quiz'),
array('value' => 'autosubmit', 'adv' => false), null));
array('value' => 'autosubmit', 'adv' => false), null);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Grace period time.
$setting = new admin_setting_configduration('quiz/graceperiod',
get_string('graceperiod', 'quiz'), get_string('graceperiod_desc', 'quiz'),
'86400');
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Minimum grace period used behind the scenes.
......@@ -96,16 +100,21 @@ if ($ADMIN->fulltree) {
get_string('attemptsallowed', 'quiz'), get_string('configattemptsallowed', 'quiz'),
0, $options);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Grading method.
$quizsettings->add(new mod_quiz_admin_setting_grademethod('quiz/grademethod',
$setting = new mod_quiz_admin_setting_grademethod('quiz/grademethod',
get_string('grademethod', 'quiz'), get_string('configgrademethod', 'quiz'),
array('value' => QUIZ_GRADEHIGHEST, 'adv' => false), null));
array('value' => QUIZ_GRADEHIGHEST, 'adv' => false), null);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Maximum grade.
$quizsettings->add(new admin_setting_configtext('quiz/maximumgrade',
get_string('maximumgrade'), get_string('configmaximumgrade', 'quiz'), 10, PARAM_INT));
$setting = new admin_setting_configtext('quiz/maximumgrade',
get_string('maximumgrade'), get_string('configmaximumgrade', 'quiz'), 10, PARAM_INT);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Questions per page.
$perpage = array();
......@@ -118,6 +127,7 @@ if ($ADMIN->fulltree) {
get_string('newpageevery', 'quiz'), get_string('confignewpageevery', 'quiz'),
1, $perpage);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Navigation method.
......@@ -125,6 +135,7 @@ if ($ADMIN->fulltree) {
get_string('navmethod', 'quiz'), get_string('confignavmethod', 'quiz'),
QUIZ_NAVMETHOD_FREE, quiz_get_navigation_options());
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, true);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Shuffle within questions.
......@@ -132,12 +143,15 @@ if ($ADMIN->fulltree) {
get_string('shufflewithin', 'quiz'), get_string('configshufflewithin', 'quiz'),
1);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Preferred behaviour.
$quizsettings->add(new admin_setting_question_behaviour('quiz/preferredbehaviour',
$setting = new admin_setting_question_behaviour('quiz/preferredbehaviour',
get_string('howquestionsbehave', 'question'), get_string('howquestionsbehave_desc', 'quiz'),
'deferredfeedback'));
'deferredfeedback');
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Can redo completed questions.
$setting = new admin_setting_configselect('quiz/canredoquestions',
......@@ -145,6 +159,7 @@ if ($ADMIN->fulltree) {
0,
array(0 => get_string('no'), 1 => get_string('canredoquestionsyes', 'quiz')));
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, true);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Each attempt builds on last.
......@@ -153,6 +168,7 @@ if ($ADMIN->fulltree) {
get_string('configeachattemptbuildsonthelast', 'quiz'),
0);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, true);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Review options.
......@@ -172,9 +188,11 @@ if ($ADMIN->fulltree) {
}
// Show the user's picture.
$quizsettings->add(new mod_quiz_admin_setting_user_image('quiz/showuserpicture',
$setting = new mod_quiz_admin_setting_user_image('quiz/showuserpicture',
get_string('showuserpicture', 'quiz'), get_string('configshowuserpicture', 'quiz'),
array('value' => 0, 'adv' => false), null));
array('value' => 0, 'adv' => false), null);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Decimal places for overall grades.
$options = array();
......@@ -185,6 +203,7 @@ if ($ADMIN->fulltree) {
get_string('decimalplaces', 'quiz'), get_string('configdecimalplaces', 'quiz'),
2, $options);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Decimal places for question grades.
......@@ -197,6 +216,7 @@ if ($ADMIN->fulltree) {
get_string('configdecimalplacesquestion', 'quiz'),
-1, $options);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Show blocks during quiz attempts.
......@@ -204,6 +224,7 @@ if ($ADMIN->fulltree) {
get_string('showblocks', 'quiz'), get_string('configshowblocks', 'quiz'),
0);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, true);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Password.
......@@ -212,6 +233,7 @@ if ($ADMIN->fulltree) {
'');
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_required_flag_options(admin_setting_flag::ENABLED, false);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// IP restrictions.
......@@ -219,6 +241,7 @@ if ($ADMIN->fulltree) {
get_string('requiresubnet', 'quiz'), get_string('configrequiresubnet', 'quiz'),
'', PARAM_TEXT);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, true);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Enforced delay between attempts.
......@@ -226,17 +249,21 @@ if ($ADMIN->fulltree) {
get_string('delay1st2nd', 'quiz'), get_string('configdelay1st2nd', 'quiz'),
0, 60);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, true);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
$setting = new admin_setting_configduration('quiz/delay2',
get_string('delaylater', 'quiz'), get_string('configdelaylater', 'quiz'),
0, 60);
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, true);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
// Browser security.
$quizsettings->add(new mod_quiz_admin_setting_browsersecurity('quiz/browsersecurity',
$setting = new mod_quiz_admin_setting_browsersecurity('quiz/browsersecurity',
get_string('showinsecurepopup', 'quiz'), get_string('configpopup', 'quiz'),
array('value' => '-', 'adv' => true), null));
array('value' => '-', 'adv' => true), null);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$quizsettings->add($setting);
$quizsettings->add(new admin_setting_configtext('quiz/initialnumfeedbacks',
get_string('initialnumfeedbacks', 'quiz'), get_string('initialnumfeedbacks_desc', 'quiz'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment