Merge branch 'MDL-66360-master-fix' of git://github.com/lameze/moodle
This commit is contained in:
@@ -56,7 +56,7 @@ class forum {
|
||||
'assesstimefinish' => $forum->get_assess_time_finish(),
|
||||
'scale' => $forum->get_scale(),
|
||||
'grade_forum' => $forum->get_grade_for_forum(),
|
||||
'sendstudentnotifications_forum' => $forum->should_notify_students_default_when_grade_for_forum(),
|
||||
'grade_forum_notify' => $forum->should_notify_students_default_when_grade_for_forum(),
|
||||
'maxbytes' => $forum->get_max_bytes(),
|
||||
'maxattachments' => $forum->get_max_attachments(),
|
||||
'forcesubscribe' => $forum->get_subscription_mode(),
|
||||
|
||||
@@ -71,8 +71,8 @@ class forum {
|
||||
private $scale;
|
||||
/** @var int $gradeforum The grade for the forum when grading holistically */
|
||||
private $gradeforum;
|
||||
/** @var bool $sendstudentnotificationsforum Whether to notify students when the forum is graded holistically */
|
||||
private $sendstudentnotificationsforum;
|
||||
/** @var bool $gradeforumnotify Whether to notify students when the forum is graded holistically */
|
||||
private $gradeforumnotify;
|
||||
/** @var int $maxbytes Maximum attachment size */
|
||||
private $maxbytes;
|
||||
/** @var int $maxattachments Maximum number of attachments */
|
||||
@@ -126,7 +126,7 @@ class forum {
|
||||
* @param int $assesstimefinish Timestamp to end assessment
|
||||
* @param int $scale The rating scale
|
||||
* @param int $gradeforum The holistic grade
|
||||
* @param bool $sendstudentnotificationsforum Default for whether to notify students when grade holistically
|
||||
* @param bool $gradeforumnotify Default for whether to notify students when grade holistically
|
||||
* @param int $maxbytes Maximum attachment size
|
||||
* @param int $maxattachments Maximum number of attachments
|
||||
* @param int $forcesubscribe Does the forum force users to subscribe?
|
||||
@@ -161,7 +161,7 @@ class forum {
|
||||
int $assesstimefinish,
|
||||
int $scale,
|
||||
int $gradeforum,
|
||||
bool $sendstudentnotificationsforum,
|
||||
bool $gradeforumnotify,
|
||||
int $maxbytes,
|
||||
int $maxattachments,
|
||||
int $forcesubscribe,
|
||||
@@ -195,7 +195,7 @@ class forum {
|
||||
$this->assesstimefinish = $assesstimefinish;
|
||||
$this->scale = $scale;
|
||||
$this->gradeforum = $gradeforum;
|
||||
$this->sendstudentnotificationsforum = $sendstudentnotificationsforum;
|
||||
$this->gradeforumnotify = $gradeforumnotify;
|
||||
$this->maxbytes = $maxbytes;
|
||||
$this->maxattachments = $maxattachments;
|
||||
$this->forcesubscribe = $forcesubscribe;
|
||||
@@ -383,7 +383,7 @@ class forum {
|
||||
* @return bool
|
||||
*/
|
||||
public function should_notify_students_default_when_grade_for_forum(): bool {
|
||||
return $this->sendstudentnotificationsforum;
|
||||
return $this->gradeforumnotify;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,7 +87,7 @@ class entity {
|
||||
$record->assesstimefinish,
|
||||
$record->scale,
|
||||
$record->grade_forum,
|
||||
$record->sendstudentnotifications_forum,
|
||||
$record->grade_forum_notify,
|
||||
$record->maxbytes,
|
||||
$record->maxattachments,
|
||||
$record->forcesubscribe,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<FIELD NAME="assesstimefinish" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="scale" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="grade_forum" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="sendstudentnotifications_forum" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="grade_forum_notify" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="maxbytes" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="maxattachments" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Number of attachments allowed per post"/>
|
||||
<FIELD NAME="forcesubscribe" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
|
||||
@@ -258,5 +258,18 @@ function xmldb_forum_upgrade($oldversion) {
|
||||
upgrade_mod_savepoint(true, 2019100108, 'forum');
|
||||
}
|
||||
|
||||
if ($oldversion < 2019100109) {
|
||||
|
||||
$table = new xmldb_table('forum');
|
||||
$field = new xmldb_field('sendstudentnotifications_forum');
|
||||
if ($dbman->field_exists($table, $field)) {
|
||||
$field->set_attributes(XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'grade_forum');
|
||||
$dbman->rename_field($table, $field, 'grade_forum_notify');
|
||||
}
|
||||
|
||||
// Forum savepoint reached.
|
||||
upgrade_mod_savepoint(true, 2019100109, 'forum');
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class mod_forum_external extends external_api {
|
||||
'assesstimefinish' => new external_value(PARAM_INT, 'Assess finish time'),
|
||||
'scale' => new external_value(PARAM_INT, 'Scale'),
|
||||
'grade_forum' => new external_value(PARAM_INT, 'Whole forum grade'),
|
||||
'sendstudentnotifications_forum' => new external_value(PARAM_INT, 'Whether to send notifications to students upon grading by default'),
|
||||
'grade_forum_notify' => new external_value(PARAM_INT, 'Whether to send notifications to students upon grading by default'),
|
||||
'maxbytes' => new external_value(PARAM_INT, 'Maximum attachment size'),
|
||||
'maxattachments' => new external_value(PARAM_INT, 'Maximum number of attachments'),
|
||||
'forcesubscribe' => new external_value(PARAM_INT, 'Force users to subscribe'),
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2019100108; // The current module version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2019100109; // The current module version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2019051100; // Requires this Moodle version
|
||||
$plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
Reference in New Issue
Block a user