Merge branch 'MDL-80741-main' of https://github.com/mihailges/moodle
This commit is contained in:
@@ -87,9 +87,9 @@ class assign_submission_status implements \renderable {
|
||||
/** @var string gradingcontrollerpreview */
|
||||
public $gradingcontrollerpreview = '';
|
||||
/** @var string attemptreopenmethod */
|
||||
public $attemptreopenmethod = 'none';
|
||||
public $attemptreopenmethod;
|
||||
/** @var int maxattempts */
|
||||
public $maxattempts = -1;
|
||||
public $maxattempts;
|
||||
/** @var string gradingstatus */
|
||||
public $gradingstatus = '';
|
||||
/** @var bool preventsubmissionnotingroup */
|
||||
|
||||
@@ -675,7 +675,8 @@ class renderer extends \plugin_renderer_base {
|
||||
$this->add_table_row_tuple($t, $cell1content, $cell2content);
|
||||
}
|
||||
|
||||
if ($status->attemptreopenmethod != ASSIGN_ATTEMPT_REOPEN_METHOD_NONE) {
|
||||
// If multiple attempts are allowed.
|
||||
if ($status->maxattempts > 1 || $status->maxattempts == ASSIGN_UNLIMITED_ATTEMPTS) {
|
||||
$currentattempt = 1;
|
||||
if (!$status->teamsubmissionenabled) {
|
||||
if ($status->submission) {
|
||||
|
||||
Regular → Executable
+3
-3
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/assign/db" VERSION="20231115" COMMENT="XMLDB file for Moodle mod/assign"
|
||||
<XMLDB PATH="mod/assign/db" VERSION="20240327" COMMENT="XMLDB file for Moodle mod/assign"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@@ -30,8 +30,8 @@
|
||||
<FIELD NAME="blindmarking" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Hide student/grader identities until the reveal identities action is performed"/>
|
||||
<FIELD NAME="hidegrader" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Hide the grader's identity from students. The opposite of blind marking."/>
|
||||
<FIELD NAME="revealidentities" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Show identities for a blind marking assignment"/>
|
||||
<FIELD NAME="attemptreopenmethod" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="none" SEQUENCE="false" COMMENT="How to determine when students are allowed to open a new submission. Valid options are none, manual, untilpass"/>
|
||||
<FIELD NAME="maxattempts" TYPE="int" LENGTH="6" NOTNULL="true" DEFAULT="-1" SEQUENCE="false" COMMENT="What is the maximum number of student attempts allowed for this assignment? -1 means unlimited."/>
|
||||
<FIELD NAME="attemptreopenmethod" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="untilpass" SEQUENCE="false" COMMENT="How to determine when students are allowed to open a new submission. Valid options are manual and untilpass."/>
|
||||
<FIELD NAME="maxattempts" TYPE="int" LENGTH="6" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="What is the maximum number of student attempts allowed for this assignment? -1 means unlimited."/>
|
||||
<FIELD NAME="markingworkflow" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="If enabled, marking workflow features will be used in this assignment."/>
|
||||
<FIELD NAME="markingallocation" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="If enabled, marking allocation features will be used in this assignment"/>
|
||||
<FIELD NAME="markinganonymous" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="If enabled, marking anonymous features will be used in this assignment"/>
|
||||
|
||||
@@ -66,5 +66,48 @@ function xmldb_assign_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.4.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2024042201) {
|
||||
// The 'Never' ('none') option for the additional attempts (attemptreopenmethod) setting is no longer supported
|
||||
// and needs to be updated in all relevant instances.
|
||||
|
||||
// The default value for the 'attemptreopenmethod' field in the 'assign' database table is currently set to 'none',
|
||||
// This needs to be updated to 'untilpass' to ensure the system functions correctly. Additionally, the default
|
||||
// value for the 'maxattempts' field needs to be changed to '1' to prevent multiple attempts and maintain the
|
||||
// original behavior.
|
||||
$table = new xmldb_table('assign');
|
||||
$attemptreopenmethodfield = new xmldb_field('attemptreopenmethod', XMLDB_TYPE_CHAR, '10', null, XMLDB_NOTNULL,
|
||||
null, 'untilpass');
|
||||
$maxattemptsfield = new xmldb_field('maxattempts', XMLDB_TYPE_INTEGER, '6', null, XMLDB_NOTNULL,
|
||||
null, '1');
|
||||
$dbman->change_field_default($table, $attemptreopenmethodfield);
|
||||
$dbman->change_field_default($table, $maxattemptsfield);
|
||||
|
||||
// If the current value for the 'attemptreopenmethod' global configuration in the assignment is set to 'none'.
|
||||
if (get_config('assign', 'attemptreopenmethod') == 'none') {
|
||||
// Reset the value to 'untilpass'.
|
||||
set_config('attemptreopenmethod', 'untilpass', 'assign');
|
||||
// Also, setting the value for the 'maxattempts' global config in the assignment to '1' ensures that the
|
||||
// original behaviour is preserved by disallowing any additional attempts by default.
|
||||
set_config('maxattempts', 1, 'assign');
|
||||
}
|
||||
|
||||
// Update all the current assignment instances that have their 'attemptreopenmethod' set to 'none'.
|
||||
// By setting 'maxattempts' to 1, additional attempts are disallowed, preserving the original behavior.
|
||||
$DB->execute(
|
||||
'UPDATE {assign}
|
||||
SET attemptreopenmethod = :newattemptreopenmethod,
|
||||
maxattempts = :maxattempts
|
||||
WHERE attemptreopenmethod = :oldattemptreopenmethod',
|
||||
[
|
||||
'newattemptreopenmethod' => 'untilpass',
|
||||
'maxattempts' => 1,
|
||||
'oldattemptreopenmethod' => 'none',
|
||||
]
|
||||
);
|
||||
|
||||
// Assign savepoint reached.
|
||||
upgrade_mod_savepoint(true, 2024042201, 'assign');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ Feature: In an assignment, teacher can view the feedback for a previous attempt.
|
||||
| assignsubmission_file_maxsizebytes | 102400 |
|
||||
| assignfeedback_editpdf_enabled | 1 |
|
||||
| submissiondrafts | 0 |
|
||||
| maxattempts | -1 |
|
||||
| attemptreopenmethod | manual |
|
||||
And the following "mod_assign > submission" exists:
|
||||
| assign | Test assignment name |
|
||||
|
||||
@@ -62,7 +62,10 @@ class mod_assign_grading_batch_operations_form extends moodleform {
|
||||
if ($instance['duedate'] && has_capability('mod/assign:grantextension', $instance['context'])) {
|
||||
$options['grantextension'] = get_string('grantextension', 'assign');
|
||||
}
|
||||
if ($instance['attemptreopenmethod'] == ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL) {
|
||||
$multipleattemptsallowed = $instance['maxattempts'] > 1 ||
|
||||
$instance['maxattempts'] == ASSIGN_UNLIMITED_ATTEMPTS;
|
||||
|
||||
if ($multipleattemptsallowed && $instance['attemptreopenmethod'] == ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL) {
|
||||
$options['addattempt'] = get_string('addattempt', 'assign');
|
||||
}
|
||||
|
||||
|
||||
@@ -89,14 +89,12 @@ $string['attemptheading'] = 'Attempt {$a->attemptnumber}: {$a->submissionsummary
|
||||
$string['attempthistory'] = 'Previous attempts';
|
||||
$string['attemptnumber'] = 'Attempt number';
|
||||
$string['attemptsettings'] = 'Attempt settings';
|
||||
$string['attemptreopenmethod'] = 'Additional attempts';
|
||||
$string['attemptreopenmethod_help'] = 'This setting determines whether a student can make additional attempts at the assignment. For each attempt, the grade and feedback are saved, and can be viewed by the teacher and the student. The available options are:
|
||||
$string['attemptreopenmethod'] = 'Grant attempts';
|
||||
$string['attemptreopenmethod_help'] = 'This setting controls how students are granted attempts for this assignment. For each attempt, the grade and feedback are saved, and can be viewed by the teacher and the student. The available options are:
|
||||
|
||||
* Never - Only one attempt is possible.
|
||||
* Manually - Additional attempts may be allowed by a teacher.
|
||||
* Automatically until pass - Additional attempts are allowed automatically until the student achieves the grade to pass set in the gradebook for this assignment.';
|
||||
* Manually - After each attempt, you can grant the next one through the Submissions page or the Grader page.
|
||||
* Automatically until pass - After each attempt, the next will be granted automatically, until the student achieves the passing grade.';
|
||||
$string['attemptreopenmethod_manual'] = 'Manually';
|
||||
$string['attemptreopenmethod_none'] = 'Never';
|
||||
$string['attemptreopenmethod_untilpass'] = 'Automatically until pass';
|
||||
$string['availability'] = 'Availability';
|
||||
$string['back'] = 'Back';
|
||||
@@ -363,7 +361,7 @@ $string['markingworkflowstatenotmarked'] = 'Not marked';
|
||||
$string['markingworkflowstatereadyforreview'] = 'Marking completed';
|
||||
$string['markingworkflowstatereadyforrelease'] = 'Ready for release';
|
||||
$string['markingworkflowstatereleased'] = 'Released';
|
||||
$string['maxattempts'] = 'Maximum attempts';
|
||||
$string['maxattempts'] = 'Allowed attempts';
|
||||
$string['maxattempts_help'] = 'The maximum number of submission attempts that can be made by a student. After this number has been reached, the submission can no longer be reopened.';
|
||||
$string['maxgrade'] = 'Maximum grade';
|
||||
$string['maxgrade'] = 'Maximum Grade';
|
||||
@@ -666,3 +664,6 @@ $string['viewsubmissiongradingtable'] = 'View submission grading table.';
|
||||
$string['viewrevealidentitiesconfirm'] = 'View reveal student identities confirmation page.';
|
||||
$string['workflowfilter'] = 'Workflow filter';
|
||||
$string['xofy'] = '{$a->x} of {$a->y}';
|
||||
|
||||
// Deprecated since Moodle 4.4.
|
||||
$string['attemptreopenmethod_none'] = 'Never';
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
attemptreopenmethod_none,mod_assign
|
||||
+16
-18
@@ -45,6 +45,12 @@ define('ASSIGN_FILTER_DRAFT', 'draft');
|
||||
define('ASSIGN_MARKER_FILTER_NO_MARKER', -1);
|
||||
|
||||
// Reopen attempt methods.
|
||||
/**
|
||||
* ASSIGN_ATTEMPT_REOPEN_METHOD_NONE - Reopening attempts is not allowed.
|
||||
*
|
||||
* @deprecated since Moodle 4.4
|
||||
* @todo MDL-81977 This will be deleted in Moodle 4.8.
|
||||
*/
|
||||
define('ASSIGN_ATTEMPT_REOPEN_METHOD_NONE', 'none');
|
||||
define('ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL', 'manual');
|
||||
define('ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS', 'untilpass');
|
||||
@@ -756,13 +762,8 @@ class assign {
|
||||
if (isset($formdata->hidegrader)) {
|
||||
$update->hidegrader = $formdata->hidegrader;
|
||||
}
|
||||
$update->attemptreopenmethod = ASSIGN_ATTEMPT_REOPEN_METHOD_NONE;
|
||||
if (!empty($formdata->attemptreopenmethod)) {
|
||||
$update->attemptreopenmethod = $formdata->attemptreopenmethod;
|
||||
}
|
||||
if (!empty($formdata->maxattempts)) {
|
||||
$update->maxattempts = $formdata->maxattempts;
|
||||
}
|
||||
$update->maxattempts = $formdata->maxattempts ?? 1;
|
||||
$update->attemptreopenmethod = $formdata->attemptreopenmethod ?? ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS;
|
||||
if (isset($formdata->preventsubmissionnotingroup)) {
|
||||
$update->preventsubmissionnotingroup = $formdata->preventsubmissionnotingroup;
|
||||
}
|
||||
@@ -1531,13 +1532,8 @@ class assign {
|
||||
$update->hidegrader = $formdata->hidegrader;
|
||||
}
|
||||
$update->blindmarking = $formdata->blindmarking;
|
||||
$update->attemptreopenmethod = ASSIGN_ATTEMPT_REOPEN_METHOD_NONE;
|
||||
if (!empty($formdata->attemptreopenmethod)) {
|
||||
$update->attemptreopenmethod = $formdata->attemptreopenmethod;
|
||||
}
|
||||
if (!empty($formdata->maxattempts)) {
|
||||
$update->maxattempts = $formdata->maxattempts;
|
||||
}
|
||||
$update->maxattempts = $formdata->maxattempts ?? 1;
|
||||
$update->attemptreopenmethod = $formdata->attemptreopenmethod ?? ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS;
|
||||
if (isset($formdata->preventsubmissionnotingroup)) {
|
||||
$update->preventsubmissionnotingroup = $formdata->preventsubmissionnotingroup;
|
||||
}
|
||||
@@ -4522,6 +4518,7 @@ class assign {
|
||||
$batchformparams = array('cm'=>$cmid,
|
||||
'submissiondrafts'=>$this->get_instance()->submissiondrafts,
|
||||
'duedate'=>$this->get_instance()->duedate,
|
||||
'maxattempts' => $this->get_instance()->maxattempts,
|
||||
'attemptreopenmethod'=>$this->get_instance()->attemptreopenmethod,
|
||||
'feedbackplugins'=>$this->get_feedback_plugins(),
|
||||
'context'=>$this->get_context(),
|
||||
@@ -5003,6 +5000,7 @@ class assign {
|
||||
$batchformparams = array('cm'=>$this->get_course_module()->id,
|
||||
'submissiondrafts'=>$this->get_instance()->submissiondrafts,
|
||||
'duedate'=>$this->get_instance()->duedate,
|
||||
'maxattempts' => $this->get_instance()->maxattempts,
|
||||
'attemptreopenmethod'=>$this->get_instance()->attemptreopenmethod,
|
||||
'feedbackplugins'=>$this->get_feedback_plugins(),
|
||||
'context'=>$this->get_context(),
|
||||
@@ -7972,9 +7970,8 @@ class assign {
|
||||
}
|
||||
|
||||
// Do not show if we are editing a previous attempt.
|
||||
if (($attemptnumber == -1 ||
|
||||
($attemptnumber + 1) == count($this->get_all_submissions($userid))) &&
|
||||
$this->get_instance()->attemptreopenmethod != ASSIGN_ATTEMPT_REOPEN_METHOD_NONE) {
|
||||
if (($attemptnumber == -1 || ($attemptnumber + 1) == count($this->get_all_submissions($userid))) &&
|
||||
($this->get_instance()->maxattempts > 1 || $this->get_instance()->maxattempts == ASSIGN_UNLIMITED_ATTEMPTS)) {
|
||||
$mform->addElement('header', 'attemptsettings', get_string('attemptsettings', 'assign'));
|
||||
$attemptreopenmethod = get_string('attemptreopenmethod_' . $this->get_instance()->attemptreopenmethod, 'assign');
|
||||
$mform->addElement('static', 'attemptreopenmethod', get_string('attemptreopenmethod', 'assign'), $attemptreopenmethod);
|
||||
@@ -8946,7 +8943,8 @@ class assign {
|
||||
protected function add_attempt($userid) {
|
||||
require_capability('mod/assign:grade', $this->context);
|
||||
|
||||
if ($this->get_instance()->attemptreopenmethod == ASSIGN_ATTEMPT_REOPEN_METHOD_NONE) {
|
||||
// If additional attempts are disallowed.
|
||||
if ($this->get_instance()->maxattempts == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+12
-11
@@ -138,19 +138,18 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
'assign');
|
||||
$mform->setType('requiresubmissionstatement', PARAM_BOOL);
|
||||
|
||||
$options = array(
|
||||
ASSIGN_ATTEMPT_REOPEN_METHOD_NONE => get_string('attemptreopenmethod_none', 'mod_assign'),
|
||||
ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL => get_string('attemptreopenmethod_manual', 'mod_assign'),
|
||||
ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS => get_string('attemptreopenmethod_untilpass', 'mod_assign')
|
||||
);
|
||||
$mform->addElement('select', 'attemptreopenmethod', get_string('attemptreopenmethod', 'mod_assign'), $options);
|
||||
$mform->addHelpButton('attemptreopenmethod', 'attemptreopenmethod', 'mod_assign');
|
||||
|
||||
$options = array(ASSIGN_UNLIMITED_ATTEMPTS => get_string('unlimitedattempts', 'mod_assign'));
|
||||
$options = [ASSIGN_UNLIMITED_ATTEMPTS => get_string('unlimitedattempts', 'mod_assign')];
|
||||
$options += array_combine(range(1, 30), range(1, 30));
|
||||
$mform->addElement('select', 'maxattempts', get_string('maxattempts', 'mod_assign'), $options);
|
||||
$mform->addHelpButton('maxattempts', 'maxattempts', 'assign');
|
||||
$mform->hideIf('maxattempts', 'attemptreopenmethod', 'eq', ASSIGN_ATTEMPT_REOPEN_METHOD_NONE);
|
||||
|
||||
$options = [
|
||||
ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL => get_string('attemptreopenmethod_manual', 'mod_assign'),
|
||||
ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS => get_string('attemptreopenmethod_untilpass', 'mod_assign')
|
||||
];
|
||||
$mform->addElement('select', 'attemptreopenmethod', get_string('attemptreopenmethod', 'mod_assign'), $options);
|
||||
$mform->addHelpButton('attemptreopenmethod', 'attemptreopenmethod', 'mod_assign');
|
||||
$mform->hideIf('attemptreopenmethod', 'maxattempts', 'eq', 1);
|
||||
|
||||
$mform->addElement('header', 'groupsubmissionsettings', get_string('groupsubmissionsettings', 'assign'));
|
||||
|
||||
@@ -269,7 +268,9 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
$errors['gradingduedate'] = get_string('gradingdueduedatevalidation', 'assign');
|
||||
}
|
||||
}
|
||||
if ($data['blindmarking'] && $data['attemptreopenmethod'] == ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS) {
|
||||
$multipleattemptsallowed = $data['maxattempts'] > 1 || $data['maxattempts'] == ASSIGN_UNLIMITED_ATTEMPTS;
|
||||
if ($data['blindmarking'] && $multipleattemptsallowed &&
|
||||
$data['attemptreopenmethod'] == ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS) {
|
||||
$errors['attemptreopenmethod'] = get_string('reopenuntilpassincompatiblewithblindmarking', 'assign');
|
||||
}
|
||||
|
||||
|
||||
+14
-23
@@ -31,6 +31,8 @@ $ADMIN->add('modsettings', new admin_category('modassignfolder', new lang_string
|
||||
$settings = new admin_settingpage($section, get_string('settings', 'mod_assign'), 'moodle/site:config', $module->is_enabled() === false);
|
||||
|
||||
if ($ADMIN->fulltree) {
|
||||
require_once($CFG->dirroot . '/mod/assign/locallib.php');
|
||||
|
||||
$menu = array();
|
||||
foreach (core_component::get_plugin_list('assignfeedback') as $type => $notused) {
|
||||
$visible = !get_config('assignfeedback_' . $type, 'disabled');
|
||||
@@ -191,33 +193,22 @@ if ($ADMIN->fulltree) {
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
// Constants from "locallib.php".
|
||||
$options = array(
|
||||
'none' => get_string('attemptreopenmethod_none', 'mod_assign'),
|
||||
'manual' => get_string('attemptreopenmethod_manual', 'mod_assign'),
|
||||
'untilpass' => get_string('attemptreopenmethod_untilpass', 'mod_assign')
|
||||
);
|
||||
$name = new lang_string('attemptreopenmethod', 'mod_assign');
|
||||
$description = new lang_string('attemptreopenmethod_help', 'mod_assign');
|
||||
$setting = new admin_setting_configselect('assign/attemptreopenmethod',
|
||||
$name,
|
||||
$description,
|
||||
'none',
|
||||
$options);
|
||||
$options = [ASSIGN_UNLIMITED_ATTEMPTS => new lang_string('unlimitedattempts', 'mod_assign')];
|
||||
$options += array_combine(range(1, 30), range(1, 30));
|
||||
$name = new lang_string('maxattempts', 'mod_assign');
|
||||
$description = new lang_string('maxattempts_help', 'mod_assign');
|
||||
$setting = new admin_setting_configselect('assign/maxattempts', $name, $description, 1, $options);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
// Constants from "locallib.php".
|
||||
$options = array(-1 => get_string('unlimitedattempts', 'mod_assign'));
|
||||
$options += array_combine(range(1, 30), range(1, 30));
|
||||
$name = new lang_string('maxattempts', 'mod_assign');
|
||||
$description = new lang_string('maxattempts_help', 'mod_assign');
|
||||
$setting = new admin_setting_configselect('assign/maxattempts',
|
||||
$name,
|
||||
$description,
|
||||
-1,
|
||||
$options);
|
||||
$options = [
|
||||
ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL => new lang_string('attemptreopenmethod_manual', 'mod_assign'),
|
||||
ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS => new lang_string('attemptreopenmethod_untilpass', 'mod_assign'),
|
||||
];
|
||||
$name = new lang_string('attemptreopenmethod', 'mod_assign');
|
||||
$description = new lang_string('attemptreopenmethod_help', 'mod_assign');
|
||||
$setting = new admin_setting_configselect('assign/attemptreopenmethod', $name, $description, 'untilpass', $options);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
@@ -16,6 +16,7 @@ Feature: In an assignment, students start a new attempt based on their previous
|
||||
| intro | Submit your online text |
|
||||
| assignsubmission_onlinetext_enabled | 1 |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| maxattempts | -1 |
|
||||
| attemptreopenmethod | manual |
|
||||
| hidegrader | 1 |
|
||||
| submissiondrafts | 0 |
|
||||
|
||||
@@ -29,6 +29,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
|
||||
| assignsubmission_onlinetext_enabled | 1 |
|
||||
| assignfeedback_comments_enabled | 1 |
|
||||
| submissiondrafts | 0 |
|
||||
| maxattempts | -1 |
|
||||
| attemptreopenmethod | manual |
|
||||
And the following "mod_assign > submissions" exist:
|
||||
| assign | user | onlinetext |
|
||||
|
||||
@@ -154,6 +154,7 @@ Feature: Group assignment submissions
|
||||
| assignsubmission_onlinetext_enabled | 1 |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| teamsubmission | 1 |
|
||||
| maxattempts | -1 |
|
||||
| attemptreopenmethod | manual |
|
||||
| requireallteammemberssubmit | 0 |
|
||||
And the following "mod_assign > submissions" exist:
|
||||
|
||||
@@ -25,6 +25,7 @@ Feature: Submissions are unlocked when a new attempt is given
|
||||
| name | Test assignment name |
|
||||
| submissiondrafts | 0 |
|
||||
| assignsubmission_onlinetext_enabled | 1 |
|
||||
| maxattempts | -1 |
|
||||
| attemptreopenmethod | untilpass |
|
||||
| gradepass | 50 |
|
||||
| submissiondrafts | 0 |
|
||||
@@ -53,6 +54,7 @@ Feature: Submissions are unlocked when a new attempt is given
|
||||
| name | Test assignment name |
|
||||
| submissiondrafts | 0 |
|
||||
| assignsubmission_onlinetext_enabled | 1 |
|
||||
| maxattempts | -1 |
|
||||
| attemptreopenmethod | manual |
|
||||
And the following "mod_assign > submissions" exist:
|
||||
| assign | user | onlinetext |
|
||||
|
||||
@@ -58,6 +58,7 @@ abstract class externallib_advanced_testcase extends \externallib_advanced_testc
|
||||
'submissiondrafts' => 1,
|
||||
'assignfeedback_file_enabled' => 1,
|
||||
'assignfeedback_comments_enabled' => 1,
|
||||
'maxattempts' => ASSIGN_UNLIMITED_ATTEMPTS,
|
||||
'attemptreopenmethod' => ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL,
|
||||
'sendnotifications' => 0
|
||||
], $params);
|
||||
|
||||
@@ -614,6 +614,7 @@ class externallib_test extends \mod_assign\externallib_advanced_testcase {
|
||||
|
||||
$result = $this->create_assign_with_student_and_teacher([
|
||||
'assignsubmission_onlinetext_enabled' => 1,
|
||||
'maxattempts' => ASSIGN_UNLIMITED_ATTEMPTS,
|
||||
'attemptreopenmethod' => 'manual',
|
||||
'teamsubmission' => 1,
|
||||
]);
|
||||
|
||||
@@ -145,6 +145,7 @@ class mod_assign_testable_assign extends assign {
|
||||
$formparams = array();
|
||||
$formparams['submissiondrafts'] = 1;
|
||||
$formparams['duedate'] = 1;
|
||||
$formparams['maxattempts'] = ASSIGN_UNLIMITED_ATTEMPTS;
|
||||
$formparams['attemptreopenmethod'] = ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL;
|
||||
$formparams['feedbackplugins'] = array();
|
||||
$formparams['markingworkflow'] = 1;
|
||||
|
||||
@@ -36,7 +36,7 @@ class mod_assign_generator extends testing_module_generator {
|
||||
public function create_instance($record = null, array $options = null) {
|
||||
$record = (object)(array)$record;
|
||||
|
||||
$defaultsettings = array(
|
||||
$defaultsettings = [
|
||||
'alwaysshowdescription' => 1,
|
||||
'submissiondrafts' => 1,
|
||||
'requiresubmissionstatement' => 0,
|
||||
@@ -52,15 +52,15 @@ class mod_assign_generator extends testing_module_generator {
|
||||
'requireallteammemberssubmit' => 0,
|
||||
'teamsubmissiongroupingid' => 0,
|
||||
'blindmarking' => 0,
|
||||
'attemptreopenmethod' => 'none',
|
||||
'maxattempts' => -1,
|
||||
'attemptreopenmethod' => 'untilpass',
|
||||
'maxattempts' => 1,
|
||||
'markingworkflow' => 0,
|
||||
'markingallocation' => 0,
|
||||
'markinganonymous' => 0,
|
||||
'activityformat' => 0,
|
||||
'timelimit' => 0,
|
||||
'submissionattachments' => 0,
|
||||
);
|
||||
];
|
||||
|
||||
if (property_exists($record, 'teamsubmissiongroupingid')) {
|
||||
$record->teamsubmissiongroupingid = $this->get_grouping_id($record->teamsubmissiongroupingid);
|
||||
|
||||
@@ -3746,6 +3746,7 @@ Anchor link 2:<a title=\"bananas\" href=\"../logo-240x60.gif\">Link text</a>
|
||||
$teacher->ignoresesskey = true;
|
||||
$this->setUser($teacher);
|
||||
$assign = $this->create_instance($course, [
|
||||
'maxattempts' => ASSIGN_UNLIMITED_ATTEMPTS,
|
||||
'attemptreopenmethod' => ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL,
|
||||
]);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class markerallocation_test extends \advanced_testcase {
|
||||
$record = new \stdClass();
|
||||
$record->course = $this->course;
|
||||
|
||||
$modulesettings = array(
|
||||
$modulesettings = [
|
||||
'alwaysshowdescription' => 1,
|
||||
'submissiondrafts' => 1,
|
||||
'requiresubmissionstatement' => 0,
|
||||
@@ -64,11 +64,11 @@ class markerallocation_test extends \advanced_testcase {
|
||||
'requireallteammemberssubmit' => 0,
|
||||
'teamsubmissiongroupingid' => 0,
|
||||
'blindmarking' => 0,
|
||||
'attemptreopenmethod' => 'none',
|
||||
'maxattempts' => -1,
|
||||
'attemptreopenmethod' => 'untilpass',
|
||||
'maxattempts' => 1,
|
||||
'markingworkflow' => 1,
|
||||
'markingallocation' => 1,
|
||||
);
|
||||
];
|
||||
|
||||
$assignelement = $this->getDataGenerator()->create_module('assign', $record, $modulesettings);
|
||||
|
||||
|
||||
@@ -5,6 +5,13 @@ This file has been replaced by UPGRADING.md. See MDL-81125 for further informati
|
||||
===
|
||||
This files describes API changes in the assign code.
|
||||
|
||||
=== 4.4 ===
|
||||
|
||||
* The default option "Never" for "attemptreopenmethod" setting, which disallowed multiple attempts at the assignment,
|
||||
has been removed. This option was unnecessary because limiting attempts to 1 through the "maxattempts" setting achieves
|
||||
the same behavior. As a part of the removal process, the constant ASSIGN_ATTEMPT_REOPEN_METHOD_NONE has been deprecated,
|
||||
and a new default value for "attemptreopenmethod" has been set to "Automatically until pass".
|
||||
|
||||
=== 4.3 ===
|
||||
* The following deprecated methods have been removed and should not be used any more:
|
||||
- `assign::add_to_log`
|
||||
|
||||
@@ -25,5 +25,5 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->component = 'mod_assign'; // Full name of the plugin (used for diagnostics).
|
||||
$plugin->version = 2024042200; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2024042201; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2024041600; // Requires this Moodle version.
|
||||
|
||||
Reference in New Issue
Block a user