Merge branch 'MDL-56820-master' of https://github.com/snake/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 10 Nov 2016 04:20:17 +0000 (12:20 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 10 Nov 2016 04:20:17 +0000 (12:20 +0800)
12 files changed:
admin/settings/appearance.php
admin/tool/lpimportcsv/classes/form/import.php
admin/tool/lpimportcsv/lang/en/tool_lpimportcsv.php
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
mod/assign/locallib.php
mod/assign/tests/behat/group_submission.feature
mod/lesson/lib.php
theme/boost/lang/en/theme_boost.php
theme/boost/templates/core/block.mustache

index 398c777..95ab246 100644 (file)
@@ -236,8 +236,11 @@ preferences,moodle|/user/preferences.php|preferences',
     $temp->add(new admin_setting_configcheckbox('modchooserdefault', new lang_string('modchooserdefault', 'admin'), new lang_string('configmodchooserdefault', 'admin'), 1));
     $ADMIN->add('appearance', $temp);
 
-    // link to tag management interface
-    $ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $CFG->wwwroot.'/tag/manage.php', 'moodle/tag:manage'));
+    // Link to tag management interface.
+    $url = new moodle_url('/tag/manage.php');
+    $hidden = empty($CFG->usetags);
+    $page = new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $url, 'moodle/tag:manage', $hidden);
+    $ADMIN->add('appearance', $page);
 
     $temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin'));
     $temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin')));
index d2c8071..d0d8d11 100644 (file)
@@ -52,6 +52,7 @@ class import extends moodleform {
         $mform = $this->_form;
         $element = $mform->createElement('filepicker', 'importfile', get_string('importfile', 'tool_lpimportcsv'));
         $mform->addElement($element);
+        $mform->addHelpButton('importfile', 'importfile', 'tool_lpimportcsv');
         $mform->addRule('importfile', null, 'required');
         $mform->addElement('hidden', 'confirm', 0);
         $mform->setType('confirm', PARAM_BOOL);
@@ -65,12 +66,10 @@ class import extends moodleform {
         } else {
             $mform->setDefault('delimiter_name', 'comma');
         }
-        $mform->addHelpButton('delimiter_name', 'csvdelimiter', 'tool_lpimportcsv');
 
         $choices = core_text::get_encodings();
         $mform->addElement('select', 'encoding', get_string('encoding', 'tool_lpimportcsv'), $choices);
         $mform->setDefault('encoding', 'UTF-8');
-        $mform->addHelpButton('encoding', 'encoding', 'tool_lpimportcsv');
 
         $this->add_action_buttons(false, get_string('import', 'tool_lpimportcsv'));
     }
index 9064eb2..8c10b04 100644 (file)
@@ -27,16 +27,16 @@ $string['competencyscaledescription'] = 'Competency scale created by import';
 $string['confirmcolumnmappings'] = 'Confirm the column mappings';
 $string['confirm'] = 'Confirm';
 $string['csvdelimiter'] = 'CSV delimiter';
-$string['csvdelimiter_help'] = 'The CSV delimiter is normally a comma.';
 $string['description'] = 'Description';
 $string['descriptionformat'] = 'Description format';
 $string['encoding'] = 'Encoding';
-$string['encoding_help'] = 'The CSV file encoding is usually UTF-8.';
 $string['export'] = 'Export';
 $string['exportid'] = 'Exported ID (optional)';
 $string['exportnavlink'] = 'Export competency framework';
 $string['idnumber'] = 'ID number';
 $string['importfile'] = 'CSV framework description file';
+$string['importfile_help'] = 'A competency framework may be imported via text file. The format of the file can be determined by creating a new competency framework on the site and then exporting it.';
+$string['importfile_link'] = 'admin/tool/lpimportcsv';
 $string['import'] = 'Import';
 $string['invalidimportfile'] = 'File format is invalid.';
 $string['isframework'] = 'Is framework';
index 3392041..b4b4e60 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js differ
index 965e762..2d30f99 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js differ
index 3392041..b4b4e60 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js differ
index 032370a..ee5ff91 100644 (file)
@@ -460,7 +460,9 @@ EDITOR.prototype = {
                             }
 
                             // New ajax request delayed of a second.
+                            M.util.js_pending('checkconversionstatus');
                             Y.later(1000, this, function() {
+                                M.util.js_complete('checkconversionstatus');
                                 Y.io(AJAXBASEPROGRESS, checkconversionstatus);
                             });
                         }
@@ -470,7 +472,9 @@ EDITOR.prototype = {
                         // We only continue on error if the all pages were not generated,
                         // and if the ajax call did not produce 5 errors in the row.
                         if (this.pagecount === 0 && ajax_error_total < 5) {
+                            M.util.js_pending('checkconversionstatus');
                             Y.later(1000, this, function() {
+                                M.util.js_complete('checkconversionstatus');
                                 Y.io(AJAXBASEPROGRESS, checkconversionstatus);
                             });
                         }
@@ -480,8 +484,10 @@ EDITOR.prototype = {
             };
             // We start the AJAX "generated page total number" call a second later to give a chance to
             // the AJAX "combined pdf generation" call to clean the previous submission images.
+            M.util.js_pending('checkconversionstatus');
             Y.later(1000, this, function() {
                 ajax_error_total = 0;
+                M.util.js_complete('checkconversionstatus');
                 Y.io(AJAXBASEPROGRESS, checkconversionstatus);
             });
         }
index 8c4aace..4dae253 100644 (file)
@@ -1903,6 +1903,10 @@ class assign {
                         $count += 1;
                     }
                 }
+            } else if ($activitygroup != 0 && empty($groups)) {
+                // Set count to 1 if $groups returns empty.
+                // It means the group is not part of $this->get_instance()->teamsubmissiongroupingid.
+                $count = 1;
             }
         } else {
             // It is faster to loop around participants if no grouping was specified.
@@ -2074,6 +2078,12 @@ class assign {
                                                 array_keys($participants),
                                                 $this->get_instance()->teamsubmissiongroupingid,
                                                 'DISTINCT g.id, g.name');
+                if (empty($groups)) {
+                    // If $groups is empty it means it is not part of $this->get_instance()->teamsubmissiongroupingid.
+                    // All submissions from students that do not belong to any of teamsubmissiongroupingid groups
+                    // count towards groupid = 0. Setting to true as only '0' key matters.
+                    $groups = [true];
+                }
                 list($groupssql, $groupsparams) = $DB->get_in_or_equal(array_keys($groups), SQL_PARAMS_NAMED);
                 $groupsstr = 's.groupid ' . $groupssql . ' AND';
                 $params = $params + $groupsparams;
index 4826a18..dc6a8d6 100644 (file)
@@ -135,3 +135,100 @@ Feature: Group assignment submissions
     And "Student 2" row "Status" column of "generaltable" table should contain "Submitted for grading"
     And "Student 3" row "Status" column of "generaltable" table should contain "Submitted for grading"
     And "Student 4" row "Status" column of "generaltable" table should contain "Submitted for grading"
+
+  Scenario: Confirm groups and submission counts are correct
+    Given the following "courses" exist:
+      | fullname | shortname | category | groupmode |
+      | Course 1 | C1 | 0 | 1 |
+    And the following "users" exist:
+      | username | firstname | lastname | email |
+      | student1 | Student | 1 | student1@example.com |
+      | student2 | Student | 2 | student2@example.com |
+      | student3 | Student | 3 | student3@example.com |
+      | student4 | Student | 4 | student4@example.com |
+      | student5 | Student | 5 | student5@example.com |
+      | student6 | Student | 6 | student6@example.com |
+    And the following "course enrolments" exist:
+      | user | course | role |
+      | student1 | C1 | student |
+      | student2 | C1 | student |
+      | student3 | C1 | student |
+      | student4 | C1 | student |
+      | student5 | C1 | student |
+      | student6 | C1 | student |
+    And the following "groups" exist:
+      | name | course | idnumber |
+      | Group 1 | C1 | G1 |
+      | Group 2 | C1 | G2 |
+      | Group 3 | C1 | G3 |
+    And the following "group members" exist:
+      | user | group |
+      | student1 | G1 |
+      | student2 | G1 |
+      | student3 | G2 |
+      | student4 | G2 |
+      | student5 | G3 |
+      | student6 | G3 |
+    And the following "groupings" exist:
+      | name | course | idnumber |
+      | Grouping 1 | C1 | GG1 |
+    And the following "grouping groups" exist:
+      | grouping | group |
+      | GG1      | G1    |
+      | GG1      | G2    |
+    And I log in as "admin"
+    And I am on site homepage
+    And I follow "Course 1"
+    And I turn editing mode on
+    And I add a "Assignment" to section "1" and I fill the form with:
+      | Assignment name | Test assignment name |
+      | Description | Test assignment description |
+      | assignsubmission_onlinetext_enabled | 1 |
+      | assignsubmission_file_enabled | 0 |
+      | Students submit in groups | Yes |
+      | Grouping for student groups | Grouping 1 |
+      | Group mode | Separate groups |
+      | Require group to make submission | No |
+    And I log out
+    And I log in as "student1"
+    And I follow "Course 1"
+    And I follow "Test assignment name"
+    And I press "Add submission"
+    And I set the following fields to these values:
+      | Online text | I'm the student's 1 submission |
+    And I press "Save changes"
+    And I log out
+    And I log in as "student3"
+    And I follow "Course 1"
+    And I follow "Test assignment name"
+    And I press "Add submission"
+    And I set the following fields to these values:
+      | Online text | I'm the student's 3 submission |
+    And I press "Save changes"
+    And I log out
+    And I log in as "student5"
+    And I follow "Course 1"
+    And I follow "Test assignment name"
+    And I press "Add submission"
+    And I set the following fields to these values:
+      | Online text | I'm the student's 5 submission |
+    And I press "Save changes"
+    And I log out
+    And I log in as "admin"
+    And I am on site homepage
+    And I follow "Course 1"
+    And I follow "Test assignment name"
+    And I should see "3" in the "Groups" "table_row"
+    And I should see "3" in the "Submitted" "table_row"
+    When I set the field "Separate groups" to "Group 1"
+    And I press "Go"
+    Then I should see "1" in the "Groups" "table_row"
+    And I should see "1" in the "Submitted" "table_row"
+    And I set the field "Separate groups" to "Group 2"
+    And I press "Go"
+    And I should see "1" in the "Groups" "table_row"
+    And I should see "1" in the "Submitted" "table_row"
+    And I set the field "Separate groups" to "Group 3"
+    And I press "Go"
+    And I should see "1" in the "Groups" "table_row"
+    And I should see "1" in the "Submitted" "table_row"
index 7590b83..33661b4 100644 (file)
@@ -107,6 +107,7 @@ function lesson_update_instance($data, $mform) {
 function lesson_update_events($lesson, $override = null) {
     global $CFG, $DB;
 
+    require_once($CFG->dirroot . '/mod/lesson/locallib.php');
     require_once($CFG->dirroot . '/calendar/lib.php');
 
     // Load the old events relating to this lesson.
index 3bae9c0..33c4f5f 100644 (file)
@@ -37,7 +37,7 @@ $string['presetfiles_desc'] = 'Preset files can be used to dramatically alter th
 $string['preset'] = 'Theme preset';
 $string['preset_desc'] = 'Pick a preset to broadly change the look of the theme.';
 $string['rawscss'] = 'Raw SCSS';
-$string['rawscss_desc'] = 'Use this field to provide SCSS code which will be injected at the end of the style sheet.';
+$string['rawscss_desc'] = 'Use this field to provide SCSS or CSS code which will be injected at the end of the style sheet.';
 $string['rawscsspre'] = 'Raw initial SCSS';
 $string['rawscsspre_desc'] = 'In this field you can provide initialising SCSS code, it will be injected before everything else. Most of the time you will use this setting to define variables.';
 $string['region-side-pre'] = 'Right';
index 1161373..bdde709 100644 (file)
     <div class="card-block">
 
         {{#hascontrols}}
-            <div class="block-controls pull-xs-right">
+            <div class="block-controls pull-xs-right header">
                 {{{controls}}}
             </div>
         {{/hascontrols}}
 
         {{! Block header }}
         {{#title}}
-            <h3 id="instance-{{blockinstanceid}}-header" class="card-title header">{{{title}}}</h3>
+            <h3 id="instance-{{blockinstanceid}}-header" class="card-title">{{{title}}}</h3>
         {{/title}}
 
         <div class="card-text content">