Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 296b602f2c | |||
| 76db660264 | |||
| e5381b67e9 | |||
| 8d4e07d86d | |||
| b37f9889d0 | |||
| c8900a5152 | |||
| 4c4d53ebaf | |||
| a26ce935c7 | |||
| 0df5893423 | |||
| dd818fdb44 | |||
| 1fd2bc4810 | |||
| 088c4fb280 | |||
| 0ed92e6a37 | |||
| afc8bd9672 | |||
| c2dd91bfef | |||
| b0ac83b82b | |||
| 272ad5b577 | |||
| 928497310e | |||
| 5755d70f2e | |||
| 21c633a8c6 | |||
| 25fe23f5f5 |
@@ -48,5 +48,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,14 @@ class update_langpacks_task extends \core\task\scheduled_task {
|
||||
* Run langpack update
|
||||
*/
|
||||
public function execute() {
|
||||
global $CFG;
|
||||
|
||||
if (!empty($CFG->skiplangupgrade)) {
|
||||
mtrace('Langpack update skipped. ($CFG->skiplangupgrade set)');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$controller = new \tool_langimport\controller();
|
||||
if ($controller->update_all_installed_languages()) {
|
||||
foreach ($controller->info as $message) {
|
||||
|
||||
@@ -46,5 +46,8 @@ function xmldb_tool_log_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -36,5 +36,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -114,5 +114,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,5 +50,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2014102000, 'tool', 'monitor');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,5 +45,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,5 +50,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,5 +50,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -73,5 +73,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
|
||||
upgrade_block_savepoint(true, 2014062600, $blockname);
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -73,5 +73,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
|
||||
upgrade_block_savepoint(true, 2014062600, $blockname);
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -73,5 +73,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
|
||||
upgrade_block_savepoint(true, 2014062600, $blockname);
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -63,5 +63,8 @@ function xmldb_block_community_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -70,5 +70,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -74,5 +74,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -50,5 +50,8 @@ function xmldb_block_html_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -75,5 +75,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -84,5 +84,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -86,5 +86,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,5 +74,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -75,5 +75,8 @@ function xmldb_block_settings_upgrade($oldversion, $block) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -47,5 +47,8 @@ function xmldb_enrol_database_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -111,9 +111,9 @@ if ($ADMIN->fulltree) {
|
||||
|
||||
$settings->add(new admin_setting_configtext('enrol_database/newcoursecategory', get_string('newcoursecategory', 'enrol_database'), '', ''));
|
||||
|
||||
if (!during_initial_install()) {
|
||||
$settings->add(new admin_setting_configselect('enrol_database/defaultcategory', get_string('defaultcategory', 'enrol_database'), get_string('defaultcategory_desc', 'enrol_database'), 1, make_categories_options()));
|
||||
}
|
||||
require_once($CFG->dirroot.'/enrol/database/settingslib.php');
|
||||
|
||||
$settings->add(new enrol_database_admin_setting_category('enrol_database/defaultcategory', get_string('defaultcategory', 'enrol_database'), get_string('defaultcategory_desc', 'enrol_database')));
|
||||
|
||||
$settings->add(new admin_setting_configtext('enrol_database/templatecourse', get_string('templatecourse', 'enrol_database'), get_string('templatecourse_desc', 'enrol_database'), ''));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Database enrolment plugin custom settings.
|
||||
*
|
||||
* @package enrol_database
|
||||
* @copyright 2013 Darko Miletic
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Class implements new specialized setting for course categories that are loaded
|
||||
* only when required
|
||||
* @author Darko Miletic
|
||||
*
|
||||
*/
|
||||
class enrol_database_admin_setting_category extends admin_setting_configselect {
|
||||
public function __construct($name, $visiblename, $description) {
|
||||
parent::__construct($name, $visiblename, $description, 1, null);
|
||||
}
|
||||
|
||||
public function load_choices() {
|
||||
if (is_array($this->choices)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->choices = make_categories_options();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -48,5 +48,8 @@ function xmldb_enrol_flatfile_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,9 @@ function xmldb_enrol_guest_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,5 +50,8 @@ function xmldb_enrol_imsenterprise_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -94,10 +94,7 @@ if ($ADMIN->fulltree) {
|
||||
$settings->add(new admin_setting_heading('enrol_ldap_autocreation_settings', get_string('autocreation_settings', 'enrol_ldap'), ''));
|
||||
$options = $yesno;
|
||||
$settings->add(new admin_setting_configselect('enrol_ldap/autocreate', get_string('autocreate_key', 'enrol_ldap'), get_string('autocreate', 'enrol_ldap'), 0, $options));
|
||||
if (!during_initial_install()) {
|
||||
$options = make_categories_options();
|
||||
$settings->add(new admin_setting_configselect('enrol_ldap/category', get_string('category_key', 'enrol_ldap'), get_string('category', 'enrol_ldap'), key($options), $options));
|
||||
}
|
||||
$settings->add(new enrol_ldap_admin_setting_category('enrol_ldap/category', get_string('category_key', 'enrol_ldap'), get_string('category', 'enrol_ldap')));
|
||||
$settings->add(new admin_setting_configtext_trim_lower('enrol_ldap/template', get_string('template_key', 'enrol_ldap'), get_string('template', 'enrol_ldap'), ''));
|
||||
|
||||
//--- course update settings ---
|
||||
|
||||
@@ -193,3 +193,25 @@ class admin_setting_ldap_rolemapping extends admin_setting {
|
||||
$this->description, true, '', '', $query);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class implements new specialized setting for course categories that are loaded
|
||||
* only when required
|
||||
* @author Darko Miletic
|
||||
*
|
||||
*/
|
||||
class enrol_ldap_admin_setting_category extends admin_setting_configselect {
|
||||
public function __construct($name, $visiblename, $description) {
|
||||
parent::__construct($name, $visiblename, $description, null, null);
|
||||
}
|
||||
|
||||
public function load_choices() {
|
||||
if (is_array($this->choices)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->choices = make_categories_options();
|
||||
$this->defaultsetting = key($this->choices);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,9 @@ function xmldb_enrol_manual_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,5 +49,8 @@ function xmldb_enrol_mnet_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -64,5 +64,8 @@ function xmldb_enrol_paypal_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,9 @@ function xmldb_enrol_self_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,5 +44,8 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2014081100, 'filter', 'mathjaxloader');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -72,5 +72,8 @@ function xmldb_filter_mediaplugin_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -68,5 +68,8 @@ function xmldb_filter_tex_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+30
-11
@@ -137,7 +137,7 @@ if (!$edit) {
|
||||
}
|
||||
|
||||
$letters = array();
|
||||
for($i=1; $i<$num+1; $i++) {
|
||||
for ($i=1; $i < $num+1; $i++) {
|
||||
$gradelettername = 'gradeletter'.$i;
|
||||
$gradeboundaryname = 'gradeboundary'.$i;
|
||||
|
||||
@@ -146,33 +146,52 @@ if (!$edit) {
|
||||
if ($letter == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$boundary = floatval($data->$gradeboundaryname);
|
||||
if ($boundary < 0 || $boundary > 100) {
|
||||
continue; // Skip if out of range.
|
||||
}
|
||||
|
||||
// The keys need to be strings so floats are not truncated.
|
||||
$letters[strval($data->$gradeboundaryname)] = $letter;
|
||||
$letters[number_format($boundary, 5)] = $letter;
|
||||
}
|
||||
}
|
||||
krsort($letters, SORT_NUMERIC);
|
||||
|
||||
$old_ids = array();
|
||||
if ($records = $DB->get_records('grade_letters', array('contextid' => $context->id), 'lowerboundary ASC', 'id')) {
|
||||
$old_ids = array_keys($records);
|
||||
$pool = array();
|
||||
if ($records = $DB->get_records('grade_letters', array('contextid' => $context->id), 'lowerboundary ASC')) {
|
||||
foreach ($records as $r) {
|
||||
// Will re-use the lowerboundary to avoid duplicate during the update process.
|
||||
$pool[number_format($r->lowerboundary, 5)] = $r;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($letters as $boundary=>$letter) {
|
||||
foreach ($letters as $boundary => $letter) {
|
||||
$record = new stdClass();
|
||||
$record->letter = $letter;
|
||||
$record->lowerboundary = $boundary;
|
||||
$record->contextid = $context->id;
|
||||
|
||||
if ($old_id = array_pop($old_ids)) {
|
||||
$record->id = $old_id;
|
||||
if (isset($pool[$boundary])) {
|
||||
// Re-use the existing boundary to avoid key constraint.
|
||||
if ($letter != $pool[$boundary]->letter) {
|
||||
// The letter has been assigned to another boundary, we update it.
|
||||
$record->id = $pool[$boundary]->id;
|
||||
$DB->update_record('grade_letters', $record);
|
||||
}
|
||||
unset($pool[$boundary]); // Remove the letter from the pool.
|
||||
} else if ($candidate = array_pop($pool)) {
|
||||
// The boundary is new, we update a random record from the pool.
|
||||
$record->id = $candidate->id;
|
||||
$DB->update_record('grade_letters', $record);
|
||||
} else {
|
||||
// No records were found, this must be a new letter.
|
||||
$DB->insert_record('grade_letters', $record);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($old_ids as $old_id) {
|
||||
$DB->delete_records('grade_letters', array('id' => $old_id));
|
||||
// Delete the unused records.
|
||||
foreach($pool as $leftover) {
|
||||
$DB->delete_records('grade_letters', array('id' => $leftover->id));
|
||||
}
|
||||
|
||||
redirect($returnurl);
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_gradingform_rubric_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
// General Strings.
|
||||
$string['all_grades'] = 'All grades';
|
||||
$string['assessmentname'] = 'Assessment Name';
|
||||
$string['assessmentname'] = 'Grade item';
|
||||
$string['blanks'] = 'Empty grades';
|
||||
$string['bulkappliesto'] = 'For';
|
||||
$string['bulkinsertvalue'] = 'Insert value';
|
||||
@@ -34,7 +34,7 @@ $string['bulkfor'] = 'Grades for {$a}';
|
||||
$string['exclude'] = 'Exclude';
|
||||
$string['excludeall'] = 'Exclude all grades';
|
||||
$string['excludefor'] = 'Exclude for {$a}';
|
||||
$string['excludenone'] = 'Exclude no grades';
|
||||
$string['excludenone'] = 'Do not exclude any grades';
|
||||
$string['eventgradereportviewed'] = 'Grade single view report viewed.';
|
||||
$string['feedbackfor'] = 'Feedback for {$a}';
|
||||
$string['filtergrades'] = 'Show grades for {$a}.';
|
||||
@@ -45,7 +45,7 @@ $string['notvalid'] = 'Not a valid Single view screen: {$a}';
|
||||
$string['override'] = 'Override';
|
||||
$string['overrideall'] = 'Override all grades';
|
||||
$string['overridefor'] = 'Override for {$a}';
|
||||
$string['overridenone'] = 'Override no grades';
|
||||
$string['overridenone'] = 'Do not override any grades';
|
||||
$string['pluginname'] = 'Single view';
|
||||
$string['savegrades'] = 'Saving grades';
|
||||
$string['savegradessuccess'] = 'Grades were set for {$a} items';
|
||||
|
||||
@@ -35,5 +35,9 @@ function xmldb_gradereport_user_upgrade($oldversion) {
|
||||
// User savepoint reached.
|
||||
upgrade_plugin_savepoint(true, 2014101500, 'gradereport', 'user');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -607,7 +607,7 @@ $string['showanalysisicon_help'] = 'If the activity module supports it, the grad
|
||||
$string['showaverage'] = 'Show average';
|
||||
$string['showaverage_help'] = 'Show the average column? Students may be able to estimate other student\'s grades if the average is calculated from a small number of grades. For performance reasons the average is approximate if it is dependent on any hidden items.';
|
||||
$string['showcontributiontocoursetotal'] = 'Show contribution to course total';
|
||||
$string['showcontributiontocoursetotal_help'] = 'Show an additional column containing the calculated contribution to the course total?';
|
||||
$string['showcontributiontocoursetotal_help'] = 'Whether to show a column of percentages indicating how much each grade item contributes to the user\'s course total percentage (after weighting is applied).';
|
||||
$string['showfeedback'] = 'Show feedback';
|
||||
$string['showfeedback_help'] = 'Show the feedback column?';
|
||||
$string['showgrade'] = 'Show grades';
|
||||
|
||||
+1
-1
@@ -822,7 +822,7 @@ $string['frontpagecourselist'] = 'List of courses';
|
||||
$string['frontpagecoursesearch'] = 'Course search box';
|
||||
$string['frontpageenrolledcourselist'] = 'Enrolled courses';
|
||||
$string['frontpagedescription'] = 'Front page summary';
|
||||
$string['frontpagedescriptionhelp'] = 'This summary can be displayed on the front page using the course/site summary block or by including a topic section on the front page.';
|
||||
$string['frontpagedescriptionhelp'] = 'This summary can be displayed on the front page using the course/site summary block.';
|
||||
$string['frontpageformat'] = 'Front page format';
|
||||
$string['frontpageformatloggedin'] = 'Front page format when logged in';
|
||||
$string['frontpagenews'] = 'News items';
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ function behat_clean_init_config() {
|
||||
'wwwroot', 'dataroot', 'dirroot', 'admin', 'directorypermissions', 'filepermissions',
|
||||
'umaskpermissions', 'dbtype', 'dblibrary', 'dbhost', 'dbname', 'dbuser', 'dbpass', 'prefix',
|
||||
'dboptions', 'proxyhost', 'proxyport', 'proxytype', 'proxyuser', 'proxypassword',
|
||||
'proxybypass', 'theme', 'pathtogs', 'pathtoclam', 'pathtodu', 'aspellpath', 'pathtodot'
|
||||
'proxybypass', 'theme', 'pathtogs', 'pathtoclam', 'pathtodu', 'aspellpath', 'pathtodot', 'skiplangupgrade'
|
||||
));
|
||||
|
||||
// Add extra allowed settings.
|
||||
|
||||
@@ -501,7 +501,8 @@ class manager {
|
||||
$plugininfo = $pluginmanager->get_plugin_info($task->get_component());
|
||||
|
||||
if ($plugininfo) {
|
||||
if (!$task->get_run_if_component_disabled() && !$plugininfo->is_enabled()) {
|
||||
if (($plugininfo->is_enabled() === false) && !$task->get_run_if_component_disabled()) {
|
||||
mtrace($task->get_name().' skipped - the component '.$task->get_component().' is disabled');
|
||||
$lock->release();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -4055,5 +4055,8 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2014110300.00);
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,6 +96,8 @@ function xmldb_editor_atto_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2014081900, 'editor', 'atto');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -178,5 +178,8 @@ fontselect,fontsizeselect,wrap,code,search,replace,wrap,nonbreaking,charmap,tabl
|
||||
upgrade_plugin_savepoint(true, 2014062900, 'editor', 'tinymce');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,5 +50,8 @@ function xmldb_tinymce_spellchecker_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+14
-4
@@ -1071,8 +1071,11 @@ OET;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// Formats .m4v and .mp4 are not supported in Firefox or Opera.
|
||||
if (core_useragent::is_firefox() || core_useragent::is_opera()) {
|
||||
// Formats .m4v and .mp4 are not supported in Opera, or in Firefox before 27.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
|
||||
// has the details.
|
||||
if (core_useragent::is_opera() || (core_useragent::is_firefox() &&
|
||||
!core_useragent::check_firefox_version(27))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1140,8 +1143,15 @@ OET;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// Formats .aac, .mp3, and .m4a are not supported in Firefox or Opera.
|
||||
if (core_useragent::is_firefox() || core_useragent::is_opera()) {
|
||||
// Formats .aac, .mp3, and .m4a are not supported in Opera.
|
||||
if (core_useragent::is_opera()) {
|
||||
continue;
|
||||
}
|
||||
// Formats .mp3 and .m4a were not reliably supported in Firefox before 27.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
|
||||
// has the details. .aac is still not supported.
|
||||
if (core_useragent::is_firefox() && ($ext === 'aac' ||
|
||||
!core_useragent::check_firefox_version(27))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
+29
-47
@@ -35,9 +35,6 @@ require_once(__DIR__ . '/fixtures/stats_events.php');
|
||||
* Test functions that affect daily stats.
|
||||
*/
|
||||
class core_statslib_testcase extends advanced_testcase {
|
||||
/** The student role ID **/
|
||||
const STID = 5;
|
||||
|
||||
/** The day to use for testing **/
|
||||
const DAY = 1272672000;
|
||||
|
||||
@@ -50,43 +47,13 @@ class core_statslib_testcase extends advanced_testcase {
|
||||
/** @var array The replacements to be used when loading XML files **/
|
||||
protected $replacements = null;
|
||||
|
||||
/**
|
||||
* Set up the database for tests.
|
||||
*
|
||||
* This function is needed so that daily_log_provider has the before-test set up from setUp()
|
||||
*/
|
||||
protected function set_up_db() {
|
||||
global $DB;
|
||||
|
||||
if ($DB->record_exists('user', array('username' => 'user1'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$datagen = self::getDataGenerator();
|
||||
|
||||
$user1 = $datagen->create_user(array('username'=>'user1'));
|
||||
$user2 = $datagen->create_user(array('username'=>'user2'));
|
||||
|
||||
$course1 = $datagen->create_course(array('shortname'=>'course1'));
|
||||
|
||||
$success = enrol_try_internal_enrol($course1->id, $user1->id, 5);
|
||||
|
||||
if (!$success) {
|
||||
trigger_error('User enrollment failed', E_USER_ERROR);
|
||||
}
|
||||
|
||||
$context = context_system::instance();
|
||||
role_assign(self::STID, $user2->id, $context->id);
|
||||
|
||||
$this->generate_replacement_list();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup function
|
||||
* - Allow changes to CFG->debug for testing purposes.
|
||||
*/
|
||||
protected function setUp() {
|
||||
global $CFG;
|
||||
global $CFG, $DB;
|
||||
parent::setUp();
|
||||
|
||||
// Settings to force statistic to run during testing.
|
||||
@@ -107,8 +74,22 @@ class core_statslib_testcase extends advanced_testcase {
|
||||
$CFG->statsruntimestarthour = $shour;
|
||||
$CFG->statsruntimestartminute = 0;
|
||||
|
||||
$this->set_up_db();
|
||||
if ($DB->record_exists('user', array('username' => 'user1'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set up the database.
|
||||
$datagen = self::getDataGenerator();
|
||||
|
||||
$user1 = $datagen->create_user(array('username'=>'user1'));
|
||||
$user2 = $datagen->create_user(array('username'=>'user2'));
|
||||
|
||||
$course1 = $datagen->create_course(array('shortname'=>'course1'));
|
||||
$datagen->enrol_user($user1->id, $course1->id);
|
||||
|
||||
$this->generate_replacement_list();
|
||||
|
||||
// Reset between tests.
|
||||
$this->resetAfterTest();
|
||||
}
|
||||
|
||||
@@ -172,6 +153,7 @@ class core_statslib_testcase extends advanced_testcase {
|
||||
$start = stats_get_base_daily(self::DAY + 3600);
|
||||
$startnolog = stats_get_base_daily(stats_get_start_from('daily'));
|
||||
$gr = get_guest_role();
|
||||
$studentrole = $DB->get_record('role', array('shortname' => 'student'));
|
||||
|
||||
$this->replacements = array(
|
||||
// Start and end times.
|
||||
@@ -195,7 +177,7 @@ class core_statslib_testcase extends advanced_testcase {
|
||||
// Role ids.
|
||||
'[frontpage_roleid]' => (int) $CFG->defaultfrontpageroleid,
|
||||
'[guest_roleid]' => $gr->id,
|
||||
'[student_roleid]' => self::STID,
|
||||
'[student_roleid]' => $studentrole->id,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -226,21 +208,18 @@ class core_statslib_testcase extends advanced_testcase {
|
||||
|
||||
/**
|
||||
* Provides the log data for test_statslib_cron_daily.
|
||||
*
|
||||
* @return array of fixture XML log file names.
|
||||
*/
|
||||
public function daily_log_provider() {
|
||||
global $CFG, $DB;
|
||||
$logfiles = array();
|
||||
$fileno = array('00', '01', '02', '03', '04', '05', '06', '07', '08');
|
||||
|
||||
$this->set_up_db();
|
||||
|
||||
$tests = array('00', '01', '02', '03', '04', '05', '06', '07', '08');
|
||||
|
||||
$dataset = array();
|
||||
|
||||
foreach ($tests as $test) {
|
||||
$dataset[] = $this->load_xml_data_file(__DIR__."/fixtures/statslib-test{$test}.xml");
|
||||
foreach ($fileno as $no) {
|
||||
$logfiles[] = array("statslib-test{$no}.xml");
|
||||
}
|
||||
|
||||
return $dataset;
|
||||
return $logfiles;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -691,9 +670,12 @@ class core_statslib_testcase extends advanced_testcase {
|
||||
* @depends test_statslib_temp_table_fill
|
||||
* @dataProvider daily_log_provider
|
||||
*/
|
||||
public function test_statslib_cron_daily($logs, $stats) {
|
||||
public function test_statslib_cron_daily($xmlfile) {
|
||||
global $CFG, $DB;
|
||||
|
||||
$dataset = $this->load_xml_data_file(__DIR__."/fixtures/{$xmlfile}");
|
||||
|
||||
list($logs, $stats) = $dataset;
|
||||
$this->prepare_db($logs, array('log'));
|
||||
|
||||
// Stats cron daily uses mtrace, turn on buffering to silence output.
|
||||
|
||||
@@ -54,6 +54,9 @@ function xmldb_message_email_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,9 @@ function xmldb_message_jabber_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,9 @@ function xmldb_message_popup_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -581,5 +581,8 @@ function xmldb_assign_upgrade($oldversion) {
|
||||
upgrade_mod_savepoint(true, 2014072405, 'assign');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,5 +44,8 @@ function xmldb_assignfeedback_comments_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -70,5 +70,8 @@ function xmldb_assignfeedback_editpdf_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,5 +44,8 @@ function xmldb_assignfeedback_file_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,9 @@ function xmldb_assignsubmission_comments_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ function xmldb_assignsubmission_file_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@ function xmldb_assignsubmission_onlinetext_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,9 +179,10 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
// Setup the assignment.
|
||||
$this->create_extra_users();
|
||||
$this->setUser($this->editingteachers[0]);
|
||||
$time = time();
|
||||
$assign = $this->create_instance(array(
|
||||
'assignsubmission_onlinetext_enabled'=>1,
|
||||
'duedate' => time() - 4 * 24 * 60 * 60,
|
||||
'duedate' => $time - 4 * 24 * 60 * 60,
|
||||
));
|
||||
$PAGE->set_url(new moodle_url('/mod/assign/view.php', array(
|
||||
'id' => $assign->get_course_module()->id,
|
||||
@@ -192,15 +193,17 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
$gradingtable = new assign_grading_table($assign, 1, '', 0, true);
|
||||
$output = $assign->get_renderer()->render($gradingtable);
|
||||
$this->assertContains(get_string('submissionstatus_', 'assign'), $output);
|
||||
$this->assertContains(get_string('overdue', 'assign', format_time(4*24*60*60)), $output);
|
||||
$difftime = time() - $time;
|
||||
$this->assertContains(get_string('overdue', 'assign', format_time(4*24*60*60 + $difftime)), $output);
|
||||
|
||||
// Grant an extension that is in the past.
|
||||
$assign->testable_save_user_extension($this->students[0]->id, time() - 2 * 24 * 60 * 60);
|
||||
$assign->testable_save_user_extension($this->students[0]->id, $time - 2 * 24 * 60 * 60);
|
||||
$gradingtable = new assign_grading_table($assign, 1, '', 0, true);
|
||||
$output = $assign->get_renderer()->render($gradingtable);
|
||||
$this->assertContains(get_string('submissionstatus_', 'assign'), $output);
|
||||
$this->assertContains(get_string('userextensiondate', 'assign', userdate(time() - 2*24*60*60)), $output);
|
||||
$this->assertContains(get_string('overdue', 'assign', format_time(2*24*60*60)), $output);
|
||||
$this->assertContains(get_string('userextensiondate', 'assign', userdate($time - 2*24*60*60)), $output);
|
||||
$difftime = time() - $time;
|
||||
$this->assertContains(get_string('overdue', 'assign', format_time(2*24*60*60 + $difftime)), $output);
|
||||
|
||||
// Simulate a submission.
|
||||
$this->setUser($this->students[0]);
|
||||
@@ -213,14 +216,17 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
'format'=>FORMAT_MOODLE);
|
||||
$plugin = $assign->get_submission_plugin_by_type('onlinetext');
|
||||
$plugin->save($submission, $data);
|
||||
$submittedtime = time();
|
||||
|
||||
// Verify output.
|
||||
$this->setUser($this->editingteachers[0]);
|
||||
$gradingtable = new assign_grading_table($assign, 1, '', 0, true);
|
||||
$output = $assign->get_renderer()->render($gradingtable);
|
||||
$this->assertContains(get_string('submissionstatus_submitted', 'assign'), $output);
|
||||
$this->assertContains(get_string('userextensiondate', 'assign', userdate(time() - 2*24*60*60)), $output);
|
||||
$this->assertContains(get_string('submittedlateshort', 'assign', format_time(2*24*60*60)), $output);
|
||||
$this->assertContains(get_string('userextensiondate', 'assign', userdate($time - 2*24*60*60)), $output);
|
||||
|
||||
$difftime = $submittedtime - $time;
|
||||
$this->assertContains(get_string('submittedlateshort', 'assign', format_time(2*24*60*60 + $difftime)), $output);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1025,11 +1031,12 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
$this->create_extra_users();
|
||||
// Now verify group assignments.
|
||||
$this->setUser($this->editingteachers[0]);
|
||||
$time = time();
|
||||
$assign = $this->create_instance(array('teamsubmission'=>1,
|
||||
'assignsubmission_onlinetext_enabled'=>1,
|
||||
'submissiondrafts'=>1,
|
||||
'requireallteammemberssubmit'=>0,
|
||||
'duedate' => time() - 2*24*60*60));
|
||||
'duedate' => $time - 2*24*60*60));
|
||||
$PAGE->set_url(new moodle_url('/mod/assign/view.php', array('id' => $assign->get_course_module()->id)));
|
||||
|
||||
$this->setUser($this->extrastudents[0]);
|
||||
@@ -1046,7 +1053,8 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
$output = $assign->view_student_summary($this->extrastudents[0], true);
|
||||
$this->assertContains(get_string('submitassignment', 'assign'), $output);
|
||||
$this->assertContains(get_string('timeremaining', 'assign'), $output);
|
||||
$this->assertContains(get_string('overdue', 'assign', format_time(2*24*60*60)), $output);
|
||||
$difftime = time() - $time;
|
||||
$this->assertContains(get_string('overdue', 'assign', format_time(2*24*60*60 + $difftime)), $output);
|
||||
|
||||
$submission = $assign->get_group_submission($this->extrastudents[0]->id, 0, true);
|
||||
$submission->status = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
|
||||
@@ -1063,7 +1071,8 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
|
||||
// Check that time remaining is not overdue.
|
||||
$this->assertContains(get_string('timeremaining', 'assign'), $output);
|
||||
$this->assertContains(get_string('submittedlate', 'assign', format_time(2*24*60*60)), $output);
|
||||
$difftime = time() - $time;
|
||||
$this->assertContains(get_string('submittedlate', 'assign', format_time(2*24*60*60 + $difftime)), $output);
|
||||
|
||||
$submission = $assign->get_group_submission($this->extrastudents[self::GROUP_COUNT]->id, 0, true);
|
||||
$submission->status = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
|
||||
|
||||
@@ -122,6 +122,9 @@ function xmldb_assignment_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -204,5 +204,8 @@ function xmldb_book_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ function xmldb_chat_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,9 @@ function xmldb_choice_upgrade($oldversion) {
|
||||
upgrade_mod_savepoint(true, 2014051201, 'choice');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,6 +134,9 @@ function xmldb_data_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ function xmldb_feedback_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,5 +119,8 @@ function xmldb_folder_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -237,5 +237,8 @@ function xmldb_forum_upgrade($oldversion) {
|
||||
upgrade_mod_savepoint(true, 2014110300, 'forum');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+8
-3
@@ -3675,7 +3675,7 @@ function forum_rating_validate($params) {
|
||||
function forum_print_discussion_header(&$post, $forum, $group=-1, $datestring="",
|
||||
$cantrack=true, $forumtracked=true, $canviewparticipants=true, $modcontext=NULL) {
|
||||
|
||||
global $USER, $CFG, $OUTPUT;
|
||||
global $COURSE, $USER, $CFG, $OUTPUT;
|
||||
|
||||
static $rowcount;
|
||||
static $strmarkalldread;
|
||||
@@ -3723,9 +3723,14 @@ function forum_print_discussion_header(&$post, $forum, $group=-1, $datestring=""
|
||||
if ($group !== -1) { // Groups are active - group is a group data object or NULL
|
||||
echo '<td class="picture group">';
|
||||
if (!empty($group->picture) and empty($group->hidepicture)) {
|
||||
print_group_picture($group, $forum->course, false, false, true);
|
||||
if ($canviewparticipants && $COURSE->groupmode) {
|
||||
$picturelink = true;
|
||||
} else {
|
||||
$picturelink = false;
|
||||
}
|
||||
print_group_picture($group, $forum->course, false, false, $picturelink);
|
||||
} else if (isset($group->id)) {
|
||||
if($canviewparticipants) {
|
||||
if ($canviewparticipants && $COURSE->groupmode) {
|
||||
echo '<a href="'.$CFG->wwwroot.'/user/index.php?id='.$forum->course.'&group='.$group->id.'">'.$group->name.'</a>';
|
||||
} else {
|
||||
echo $group->name;
|
||||
|
||||
@@ -62,6 +62,9 @@ function xmldb_glossary_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,5 +52,8 @@ function xmldb_imscp_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -87,6 +87,9 @@ function xmldb_label_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,5 +99,8 @@ function xmldb_lesson_upgrade($oldversion) {
|
||||
upgrade_mod_savepoint(true, 2014100600, 'lesson');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -188,6 +188,9 @@ function xmldb_lti_upgrade($oldversion) {
|
||||
upgrade_mod_savepoint(true, 2014100300, 'lti');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,5 +72,8 @@ function xmldb_page_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -803,6 +803,10 @@ function xmldb_quiz_upgrade($oldversion) {
|
||||
// Quiz savepoint reached.
|
||||
upgrade_mod_savepoint(true, 2014052801, 'quiz');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-126
@@ -149,140 +149,15 @@ if ((optional_param('addrandom', false, PARAM_BOOL)) && confirm_sesskey()) {
|
||||
}
|
||||
|
||||
if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey()) {
|
||||
$structure->check_can_be_edited();
|
||||
$deletepreviews = false;
|
||||
$recomputesummarks = false;
|
||||
|
||||
$rawdata = (array) data_submitted();
|
||||
$moveonpagequestions = array();
|
||||
$moveselectedonpage = optional_param('moveselectedonpagetop', 0, PARAM_INT);
|
||||
if (!$moveselectedonpage) {
|
||||
$moveselectedonpage = optional_param('moveselectedonpagebottom', 0, PARAM_INT);
|
||||
}
|
||||
|
||||
$newslotorder = array();
|
||||
foreach ($rawdata as $key => $value) {
|
||||
if (preg_match('!^g([0-9]+)$!', $key, $matches)) {
|
||||
// Parse input for question -> grades.
|
||||
$slotnumber = $matches[1];
|
||||
$newgrade = unformat_float($value);
|
||||
quiz_update_slot_maxmark($DB->get_record('quiz_slots',
|
||||
array('quizid' => $quiz->id, 'slot' => $slotnumber), '*', MUST_EXIST), $newgrade);
|
||||
$deletepreviews = true;
|
||||
$recomputesummarks = true;
|
||||
|
||||
} else if (preg_match('!^o(pg)?([0-9]+)$!', $key, $matches)) {
|
||||
// Parse input for ordering info.
|
||||
$slotnumber = $matches[2];
|
||||
// Make sure two questions don't overwrite each other. If we get a second
|
||||
// question with the same position, shift the second one along to the next gap.
|
||||
$value = clean_param($value, PARAM_INT);
|
||||
while (array_key_exists($value, $newslotorder)) {
|
||||
$value++;
|
||||
}
|
||||
if ($matches[1]) {
|
||||
// This is a page-break entry.
|
||||
$newslotorder[$value] = 0;
|
||||
} else {
|
||||
$newslotorder[$value] = $slotnumber;
|
||||
}
|
||||
$deletepreviews = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($moveselectedonpage) {
|
||||
|
||||
// Make up a $newslotorder, then let the next if statement do the work.
|
||||
$oldslots = $DB->get_records('quiz_slots', array('quizid' => $quiz->id), 'slot');
|
||||
|
||||
$beforepage = array();
|
||||
$onpage = array();
|
||||
$afterpage = array();
|
||||
foreach ($oldslots as $oldslot) {
|
||||
if (in_array($oldslot->slot, $selectedslots)) {
|
||||
$onpage[] = $oldslot;
|
||||
} else if ($oldslot->page <= $moveselectedonpage) {
|
||||
$beforepage[] = $oldslot;
|
||||
} else {
|
||||
$afterpage[] = $oldslot;
|
||||
}
|
||||
}
|
||||
|
||||
$newslotorder = array();
|
||||
$currentpage = 1;
|
||||
$index = 10;
|
||||
foreach ($beforepage as $slot) {
|
||||
while ($currentpage < $slot->page) {
|
||||
$newslotorder[$index] = 0;
|
||||
$index += 10;
|
||||
$currentpage += 1;
|
||||
}
|
||||
$newslotorder[$index] = $slot->slot;
|
||||
$index += 10;
|
||||
}
|
||||
|
||||
while ($currentpage < $moveselectedonpage) {
|
||||
$newslotorder[$index] = 0;
|
||||
$index += 10;
|
||||
$currentpage += 1;
|
||||
}
|
||||
foreach ($onpage as $slot) {
|
||||
$newslotorder[$index] = $slot->slot;
|
||||
$index += 10;
|
||||
}
|
||||
|
||||
foreach ($afterpage as $slot) {
|
||||
while ($currentpage < $slot->page) {
|
||||
$newslotorder[$index] = 0;
|
||||
$index += 10;
|
||||
$currentpage += 1;
|
||||
}
|
||||
$newslotorder[$index] = $slot->slot;
|
||||
$index += 10;
|
||||
}
|
||||
}
|
||||
|
||||
// If ordering info was given, reorder the questions.
|
||||
if ($newslotorder) {
|
||||
ksort($newslotorder);
|
||||
$currentpage = 1;
|
||||
$currentslot = 1;
|
||||
$slotreorder = array();
|
||||
$slotpages = array();
|
||||
foreach ($newslotorder as $slotnumber) {
|
||||
if ($slotnumber == 0) {
|
||||
$currentpage += 1;
|
||||
continue;
|
||||
}
|
||||
$slotreorder[$slotnumber] = $currentslot;
|
||||
$slotpages[$currentslot] = $currentpage;
|
||||
$currentslot += 1;
|
||||
}
|
||||
$trans = $DB->start_delegated_transaction();
|
||||
update_field_with_unique_index('quiz_slots',
|
||||
'slot', $slotreorder, array('quizid' => $quiz->id));
|
||||
foreach ($slotpages as $slotnumber => $page) {
|
||||
$DB->set_field('quiz_slots', 'page', $page, array('quizid' => $quiz->id, 'slot' => $slotnumber));
|
||||
}
|
||||
$trans->allow_commit();
|
||||
$deletepreviews = true;
|
||||
}
|
||||
|
||||
// If rescaling is required save the new maximum.
|
||||
$maxgrade = unformat_float(optional_param('maxgrade', -1, PARAM_RAW));
|
||||
if ($maxgrade >= 0) {
|
||||
quiz_set_grade($maxgrade, $quiz);
|
||||
}
|
||||
|
||||
if ($deletepreviews) {
|
||||
quiz_delete_previews($quiz);
|
||||
}
|
||||
if ($recomputesummarks) {
|
||||
quiz_update_sumgrades($quiz);
|
||||
quiz_update_all_attempt_sumgrades($quiz);
|
||||
quiz_update_all_final_grades($quiz);
|
||||
quiz_update_grades($quiz, 0, true);
|
||||
}
|
||||
|
||||
redirect($afteractionurl);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_quiz_overview_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -136,6 +136,9 @@ function xmldb_quiz_statistics_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
@mod @mod_quiz
|
||||
Feature: In order to create a quiz that awards marks the way I want
|
||||
As a teacher
|
||||
I must be able to set the marks I want on the Edit quiz page (even after the quiz has been attempted).
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | T1 | Teacher1 | teacher1@moodle.com |
|
||||
| student1 | S1 | Student1 | student1@moodle.com |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And the following "activities" exist:
|
||||
| activity | name | course | idnumber | grade | decimalpoints | questiondecimalpoints |
|
||||
| quiz | Quiz 1 | C1 | quiz1 | 20 | 2 | -1 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I add a "True/False" question to the "Quiz 1" quiz with:
|
||||
| Question name | First question |
|
||||
| Question text | Answer me |
|
||||
| Default mark | 2.0 |
|
||||
And I add a "True/False" question to the "Quiz 1" quiz with:
|
||||
| Question name | Second question |
|
||||
| Question text | Answer again |
|
||||
| Default mark | 3.0 |
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Quiz 1"
|
||||
And I press "Attempt quiz now"
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Quiz 1"
|
||||
And I navigate to "Edit quiz" node in "Quiz administration"
|
||||
|
||||
@javascript
|
||||
Scenario: Set the max mark for a question.
|
||||
When I set the max mark for question "First question" to "7.0"
|
||||
Then I should see "7.00"
|
||||
And I should see "3.00"
|
||||
And I should see "Total of marks: 10.00"
|
||||
|
||||
When I follow "Edit maximum mark"
|
||||
And I wait until "li input[name=maxmark]" "css_element" exists
|
||||
And I take focus off "li input[name=maxmark]" "css_element"
|
||||
Then I should see "7.00"
|
||||
And I should see "3.00"
|
||||
And I should see "Total of marks: 10.00"
|
||||
And "li input[name=maxmark]" "css_element" should not exist
|
||||
|
||||
@javascript
|
||||
Scenario: Set the overall Maximum grade.
|
||||
When I set the field "maxgrade" to "10.0"
|
||||
And I press "savechanges"
|
||||
Then the field "maxgrade" matches value "10.00"
|
||||
And I should see "2.00"
|
||||
And I should see "3.00"
|
||||
And I should see "Total of marks: 5.00"
|
||||
|
||||
@javascript
|
||||
Scenario: Verify the number of decimal places shown is what the quiz settings say it should be.
|
||||
# Then the field "maxgrade" matches value "20.00" -- with exact match on decimal places.
|
||||
Then "//input[@name = 'maxgrade' and @value = '20.00']" "xpath_element" should exist
|
||||
And I should see "2.00"
|
||||
And I should see "3.00"
|
||||
And I should see "Total of marks: 5.00"
|
||||
And I should not see "2.000"
|
||||
And I should not see "3.000"
|
||||
And I should not see "Total of marks: 5.000"
|
||||
When I follow "Edit settings"
|
||||
And I set the following fields to these values:
|
||||
| Decimal places in grades | 3 |
|
||||
| Decimal places in question grades | 5 |
|
||||
And I press "Save and display"
|
||||
And I follow "Edit quiz"
|
||||
# Then the field "maxgrade" matches value "20.000" -- with exact match on decimal places.
|
||||
Then "//input[@name = 'maxgrade' and @value = '20.000']" "xpath_element" should exist
|
||||
And I should see "2.00000"
|
||||
And I should see "3.00000"
|
||||
And I should see "Total of marks: 5.000"
|
||||
And I should not see "2.000000"
|
||||
And I should not see "3.000000"
|
||||
And I should not see "Total of marks: 5.0000"
|
||||
@@ -72,5 +72,8 @@ function xmldb_resource_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -294,6 +294,9 @@ function xmldb_scorm_upgrade($oldversion) {
|
||||
upgrade_mod_savepoint(true, 2014072500, 'scorm');
|
||||
}
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,9 @@ function xmldb_survey_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,5 +72,8 @@ function xmldb_url_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ require_capability('mod/wiki:managewiki', $context);
|
||||
if (!empty($delete) && confirm_sesskey()) {
|
||||
if ($pageid != $delete) {
|
||||
// Validate that we are deleting from the same subwiki.
|
||||
$deletepage = wiki_get_page($delete)
|
||||
$deletepage = wiki_get_page($delete);
|
||||
if (!$deletepage || $deletepage->subwikiid != $page->subwikiid) {
|
||||
print_error('incorrectsubwikiid', 'wiki');
|
||||
}
|
||||
|
||||
@@ -84,5 +84,8 @@ function xmldb_wiki_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -160,5 +160,8 @@ function xmldb_workshop_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_workshopform_accumulative_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_workshopform_comments_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_workshopform_numerrors_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_workshopform_rubric_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -64,5 +64,8 @@ function xmldb_portfolio_boxnet_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -58,5 +58,8 @@ function xmldb_portfolio_googledocs_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -58,5 +58,8 @@ function xmldb_portfolio_picasa_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,6 +96,9 @@ function xmldb_qbehaviour_manualgraded_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ function xmldb_qtype_calculated_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -174,6 +174,9 @@ function xmldb_qtype_essay_upgrade($oldversion) {
|
||||
// Moodle v2.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v2.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user