Merge branch 'wip-MDL-52203-master' of https://github.com/marinaglancy/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 19 Nov 2015 08:43:19 +0000 (09:43 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 19 Nov 2015 08:45:30 +0000 (09:45 +0100)
124 files changed:
admin/tool/customlang/db/upgrade.php
admin/tool/log/db/upgrade.php
admin/tool/log/store/database/db/upgrade.php
admin/tool/log/store/standard/db/upgrade.php
admin/tool/monitor/db/upgrade.php
auth/cas/db/upgrade.php
auth/ldap/db/upgrade.php
auth/manual/db/upgrade.php
auth/mnet/db/upgrade.php
backup/backup.class.php
blocks/badges/db/upgrade.php
blocks/calendar_month/db/upgrade.php
blocks/calendar_upcoming/db/upgrade.php
blocks/community/db/upgrade.php
blocks/completionstatus/db/upgrade.php
blocks/course_summary/db/upgrade.php
blocks/html/db/upgrade.php
blocks/navigation/db/upgrade.php
blocks/quiz_results/db/upgrade.php
blocks/recent_activity/db/upgrade.php
blocks/rss_client/db/upgrade.php
blocks/section_links/db/upgrade.php
blocks/selfcompletion/db/upgrade.php
blocks/settings/db/upgrade.php
enrol/database/db/upgrade.php
enrol/flatfile/db/upgrade.php
enrol/guest/db/upgrade.php
enrol/imsenterprise/db/upgrade.php
enrol/manual/db/upgrade.php
enrol/mnet/db/upgrade.php
enrol/paypal/db/upgrade.php
enrol/self/db/upgrade.php
filter/mathjaxloader/db/upgrade.php
filter/mediaplugin/db/upgrade.php
filter/tex/db/upgrade.php
grade/grading/form/rubric/db/upgrade.php
grade/report/overview/index.php
grade/report/user/db/upgrade.php
lib/behat/classes/behat_selectors.php
lib/db/upgrade.php
lib/editor/atto/db/upgrade.php
lib/editor/atto/plugins/equation/db/upgrade.php
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-min.js
lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js
lib/editor/atto/yui/src/editor/meta/editor.json
lib/editor/tinymce/db/upgrade.php
lib/editor/tinymce/plugins/spellchecker/db/upgrade.php
lib/enrollib.php
lib/flowplayer/lib.php
lib/phpunit/classes/util.php
message/output/email/db/upgrade.php
message/output/jabber/db/upgrade.php
message/output/popup/db/upgrade.php
mod/assign/db/upgrade.php
mod/assign/feedback/comments/db/upgrade.php
mod/assign/feedback/editpdf/db/upgrade.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/annotation.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotationstamp.js
mod/assign/feedback/editpdf/yui/src/editor/js/comment.js
mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js
mod/assign/feedback/editpdf/yui/src/editor/js/drawable.js
mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/globals.js
mod/assign/feedback/file/db/upgrade.php
mod/assign/submission/comments/db/upgrade.php
mod/assign/submission/file/db/upgrade.php
mod/assign/submission/onlinetext/db/upgrade.php
mod/assignment/db/upgrade.php
mod/book/db/upgrade.php
mod/chat/db/upgrade.php
mod/chat/lib.php
mod/choice/db/upgrade.php
mod/data/db/upgrade.php
mod/data/field/checkbox/field.class.php
mod/feedback/db/upgrade.php
mod/folder/db/upgrade.php
mod/forum/db/upgrade.php
mod/glossary/db/upgrade.php
mod/imscp/db/upgrade.php
mod/label/db/upgrade.php
mod/lesson/db/upgrade.php
mod/lti/db/upgrade.php
mod/page/db/upgrade.php
mod/quiz/db/upgrade.php
mod/quiz/report/overview/db/upgrade.php
mod/quiz/report/statistics/db/upgrade.php
mod/resource/db/upgrade.php
mod/scorm/db/upgrade.php
mod/survey/db/upgrade.php
mod/url/db/upgrade.php
mod/wiki/db/upgrade.php
mod/workshop/db/upgrade.php
mod/workshop/form/accumulative/db/upgrade.php
mod/workshop/form/comments/db/upgrade.php
mod/workshop/form/numerrors/db/upgrade.php
mod/workshop/form/rubric/db/upgrade.php
notes/tests/behat/participants_notes.feature [new file with mode: 0644]
portfolio/boxnet/db/upgrade.php
portfolio/googledocs/db/upgrade.php
portfolio/picasa/db/upgrade.php
question/behaviour/manualgraded/db/upgrade.php
question/type/calculated/db/upgrade.php
question/type/ddmarker/db/upgrade.php
question/type/essay/db/upgrade.php
question/type/match/db/upgrade.php
question/type/multianswer/db/upgrade.php
question/type/multichoice/db/upgrade.php
question/type/numerical/db/upgrade.php
question/type/random/db/upgrade.php
question/type/randomsamatch/db/upgrade.php
question/type/shortanswer/db/upgrade.php
report/participation/index.php
report/participation/tests/behat/message_participants.feature [new file with mode: 0644]
repository/alfresco/db/upgrade.php
repository/boxnet/db/upgrade.php
repository/dropbox/db/upgrade.php
repository/googledocs/db/upgrade.php
repository/picasa/db/upgrade.php
theme/more/db/upgrade.php
user/addnote.php

index 489f887..01f87e9 100644 (file)
@@ -54,5 +54,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index da2a60c..2a4eab3 100644 (file)
@@ -52,5 +52,8 @@ function xmldb_tool_log_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index f12d844..565efed 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 0fa6a8f..9b4247b 100644 (file)
@@ -120,5 +120,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index ffb1750..f02556d 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index f3abc34..bca88a4 100644 (file)
@@ -74,5 +74,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index e73f929..3a320e3 100644 (file)
@@ -64,5 +64,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index e306b6a..3039953 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 5d2cb16..0090939 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 894aebd..0b2ed3f 100644 (file)
@@ -135,7 +135,7 @@ abstract class backup implements checksumable {
     /**
      * Usually same than major release zero version, mainly for informative/historic purposes.
      */
-    const RELEASE = '3.0';
+    const RELEASE = '3.1';
 }
 
 /*
index 64c2e5d..a9ff3a1 100644 (file)
@@ -79,5 +79,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 589c706..c83b12a 100644 (file)
@@ -79,5 +79,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index f3c8e4e..0836409 100644 (file)
@@ -79,5 +79,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c6002aa..bcc82dc 100644 (file)
@@ -69,5 +69,8 @@ function xmldb_block_community_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index bce3229..070ebcc 100644 (file)
@@ -76,5 +76,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
\ No newline at end of file
index b7c389a..0c1549e 100644 (file)
@@ -80,5 +80,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
\ No newline at end of file
index 24776ae..ff87abf 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_block_html_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 2f7240b..6ea9268 100644 (file)
@@ -81,5 +81,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
\ No newline at end of file
index d7edead..ec753c9 100644 (file)
@@ -104,5 +104,8 @@ function xmldb_block_quiz_results_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
\ No newline at end of file
index 6a12a7a..8d0f893 100644 (file)
@@ -90,5 +90,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index afc2b80..cf8294e 100644 (file)
@@ -50,5 +50,8 @@ function xmldb_block_rss_client_upgrade($oldversion) {
         upgrade_block_savepoint(true, 2015071700, 'rss_client');
     }
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 16d38de..057f275 100644 (file)
@@ -92,5 +92,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 79721a1..e79331c 100644 (file)
@@ -80,5 +80,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
\ No newline at end of file
index 584ed9d..b1cf6f8 100644 (file)
@@ -81,5 +81,8 @@ function xmldb_block_settings_upgrade($oldversion, $block) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
\ No newline at end of file
index 450eaef..d1eb164 100644 (file)
@@ -53,5 +53,8 @@ function xmldb_enrol_database_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8ad41f9..ebe5dd7 100644 (file)
@@ -54,5 +54,8 @@ function xmldb_enrol_flatfile_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index ccd51b1..8ae2004 100644 (file)
@@ -63,6 +63,9 @@ function xmldb_enrol_guest_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index eb1f8ed..7fb9ea3 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_enrol_imsenterprise_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index db7d182..7b98f19 100644 (file)
@@ -72,6 +72,9 @@ function xmldb_enrol_manual_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2015091500, 'enrol', 'manual');
     }
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index dea1555..e66d6ec 100644 (file)
@@ -55,5 +55,8 @@ function xmldb_enrol_mnet_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 01a1291..faf51dc 100644 (file)
@@ -70,5 +70,8 @@ function xmldb_enrol_paypal_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index eac4712..62cb0df 100644 (file)
@@ -71,6 +71,9 @@ function xmldb_enrol_self_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 68a9316..eb1e4cd 100644 (file)
@@ -109,5 +109,8 @@ MathJax.Hub.Config({
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index adfa7db..3e37445 100644 (file)
@@ -78,5 +78,8 @@ function xmldb_filter_mediaplugin_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index b08a9e5..703a7d4 100644 (file)
@@ -74,5 +74,8 @@ function xmldb_filter_tex_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8194960..a40da47 100644 (file)
@@ -62,5 +62,8 @@ function xmldb_gradingform_rubric_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 15954dc..a367aee 100644 (file)
@@ -36,6 +36,7 @@ if (!$course = $DB->get_record('course', array('id' => $courseid))) {
     print_error('nocourseid');
 }
 require_login(null, false);
+$PAGE->set_course($course);
 
 $context = context_course::instance($course->id);
 $systemcontext = context_system::instance();
index b4627ef..f79d0d1 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_gradereport_user_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index add2130..4b85386 100644 (file)
@@ -131,7 +131,7 @@ XPATH
     [./descendant::*[self::h2][normalize-space(.) = %locator%] or %locator% = 'frontpage']
 XPATH
         , 'table' => <<<XPATH
-.//table[(./@id = %locator% or contains(.//caption, %locator%) or contains(concat(' ', normalize-space(@class), ' '), %locator% ))]
+.//table[(./@id = %locator% or contains(.//caption, %locator%) or contains(.//th, %locator%) or contains(concat(' ', normalize-space(@class), ' '), %locator% ))]
 XPATH
         , 'table_row' => <<<XPATH
 .//tr[contains(normalize-space(.), %locator%) and not(.//tr[contains(normalize-space(.), %locator%)])]
index 3b343c0..40b21c7 100644 (file)
@@ -4606,5 +4606,8 @@ function xmldb_main_upgrade($oldversion) {
         upgrade_main_savepoint(true, 2015100800.01);
     }
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 86e2944..547bbad 100644 (file)
@@ -102,5 +102,8 @@ function xmldb_editor_atto_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 3f8efdb..63a1c85 100644 (file)
@@ -39,5 +39,8 @@ function xmldb_atto_equation_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2015083100, 'atto', 'equation');
     }
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
\ No newline at end of file
index da400f2..41e53ad 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js and b/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-debug.js differ
index e49012e..040eb14 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-min.js and b/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin-min.js differ
index 6cedbfa..e436da5 100644 (file)
Binary files a/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js and b/lib/editor/atto/yui/build/moodle-editor_atto-plugin/moodle-editor_atto-plugin.js differ
index c990715..a8f9ff3 100644 (file)
@@ -27,7 +27,8 @@
             "event-outside",
             "handlebars",
             "event-custom",
-            "timers"
+            "timers",
+            "moodle-editor_atto-menu"
         ]
     },
     "moodle-editor_atto-menu": {
index 73127cd..6323f52 100644 (file)
@@ -184,5 +184,8 @@ fontselect,fontsizeselect,wrap,code,search,replace,wrap,nonbreaking,charmap,tabl
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 0998976..021ab45 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_tinymce_spellchecker_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c69fb39..426c9a2 100644 (file)
@@ -452,7 +452,7 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
             }
         }
         // Check role permissions
-        if (has_any_capability(array('moodle/role:assign', 'moodle/role:safeoverride','moodle/role:override', 'moodle/role:assign'), $coursecontext)) {
+        if (has_any_capability(array('moodle/role:assign', 'moodle/role:safeoverride', 'moodle/role:override'), $coursecontext)) {
             $url = new moodle_url('/admin/roles/check.php', array('contextid'=>$coursecontext->id));
             $permissionsnode->add(get_string('checkpermissions', 'role'), $url, navigation_node::TYPE_SETTING, null, 'permissions', new pix_icon('i/checkpermissions', ''));
         }
index fa15b38..f9206c4 100644 (file)
@@ -36,7 +36,7 @@ function flowplayer_send_flash_content($filename) {
     // Note: Do not use any fancy APIs here, this must work in all supported versions.
 
     // No url params.
-    if (!empty($_GET) or !empty($_POST) or !empty($_REQUEST)) {
+    if (!empty($_GET) or !empty($_POST)) {
         header("HTTP/1.1 404 Not Found");
         die;
     }
index a3d7233..2321e4a 100644 (file)
@@ -131,6 +131,7 @@ class phpunit_util extends testing_util {
         }
 
         $resetdb = self::reset_database();
+        $localename = self::get_locale_name();
         $warnings = array();
 
         if ($detectchanges === true) {
@@ -163,14 +164,8 @@ class phpunit_util extends testing_util {
                 $warnings[] = 'Warning: unexpected change of $COURSE';
             }
 
-            if ($CFG->ostype === 'WINDOWS') {
-                if (setlocale(LC_TIME, 0) !== 'English_Australia.1252') {
-                    $warnings[] = 'Warning: unexpected change of locale';
-                }
-            } else {
-                if (setlocale(LC_TIME, 0) !== 'en_AU.UTF-8') {
-                    $warnings[] = 'Warning: unexpected change of locale';
-                }
+            if (setlocale(LC_TIME, 0) !== $localename) {
+                $warnings[] = 'Warning: unexpected change of locale';
             }
         }
 
@@ -262,11 +257,7 @@ class phpunit_util extends testing_util {
         core_date::phpunit_reset();
 
         // Make sure the time locale is consistent - that is Australian English.
-        if ($CFG->ostype === 'WINDOWS') {
-            setlocale(LC_TIME, 'English_Australia.1252');
-        } else {
-            setlocale(LC_TIME, 'en_AU.UTF-8');
-        }
+        setlocale(LC_TIME, $localename);
 
         // verify db writes just in case something goes wrong in reset
         if (self::$lastdbwrites != $DB->perf_get_writes()) {
@@ -362,6 +353,11 @@ class phpunit_util extends testing_util {
     public static function testing_ready_problem() {
         global $DB;
 
+        $localename = self::get_locale_name();
+        if (setlocale(LC_TIME, $localename) === false) {
+            return array(PHPUNIT_EXITCODE_CONFIGERROR, "Required locale '$localename' is not installed.");
+        }
+
         if (!self::is_test_site()) {
             // dataroot was verified in bootstrap, so it must be DB
             return array(PHPUNIT_EXITCODE_CONFIGERROR, 'Can not use database for testing, try different prefix');
@@ -798,4 +794,19 @@ class phpunit_util extends testing_util {
             self::$eventsink->add_event($event);
         }
     }
+
+    /**
+     * Gets the name of the locale for testing environment (Australian English)
+     * depending on platform environment.
+     *
+     * @return string the locale name.
+     */
+    protected static function get_locale_name() {
+        global $CFG;
+        if ($CFG->ostype === 'WINDOWS') {
+            return 'English_Australia.1252';
+        } else {
+            return 'en_AU.UTF-8';
+        }
+    }
 }
index a8178e7..4d9e1d4 100644 (file)
@@ -60,6 +60,9 @@ function xmldb_message_email_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 80d88a1..a42641f 100644 (file)
@@ -60,6 +60,9 @@ function xmldb_message_jabber_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index df7ff9a..50353b6 100644 (file)
@@ -60,6 +60,9 @@ function xmldb_message_popup_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 2c51e85..2debb16 100644 (file)
@@ -646,5 +646,8 @@ function xmldb_assign_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 7255de7..30cb8e9 100644 (file)
@@ -50,5 +50,8 @@ function xmldb_assignfeedback_comments_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index d2742a2..89d6e74 100644 (file)
@@ -76,5 +76,8 @@ function xmldb_assignfeedback_editpdf_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 565dd2d..286c0f3 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 e5e4732..28d56f5 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 565dd2d..286c0f3 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 3ccb9ac..5415add 100644 (file)
@@ -170,8 +170,8 @@ Y.extend(ANNOTATION, Y.Base, {
      */
     draw_highlight : function() {
         var bounds,
-            drawingregion = Y.one(SELECTOR.DRAWINGREGION),
-            offsetcanvas = Y.one(SELECTOR.DRAWINGCANVAS).getXY(),
+            drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
+            offsetcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS).getXY(),
             shape;
 
         if (this.editor.currentannotation === this) {
index df1c0bf..d4597ec 100644 (file)
@@ -42,7 +42,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
      */
     draw : function() {
         var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
-            drawingregion = Y.one(SELECTOR.DRAWINGREGION),
+            drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
             node,
             position;
 
@@ -84,7 +84,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
     draw_current_edit : function(edit) {
         var bounds = new M.assignfeedback_editpdf.rect(),
             drawable = new M.assignfeedback_editpdf.drawable(this.editor),
-            drawingregion = Y.one(SELECTOR.DRAWINGREGION),
+            drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
             node,
             position;
 
index c37c8ca..bdb96f9 100644 (file)
@@ -159,7 +159,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
     this.draw = function(focus) {
         var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
             node,
-            drawingregion = Y.one(SELECTOR.DRAWINGREGION),
+            drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
             container,
             menu,
             position,
index 0dece81..73b2657 100644 (file)
@@ -52,7 +52,7 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
         commentlist = Y.Node.create('<ul role="menu" class="assignfeedback_editpdf_menu"/>');
         container.append(commentlist);
 
-        commentfilter.on('keyup', this.filter_search_comments, null, this);
+        commentfilter.on('keyup', this.filter_search_comments, this);
         commentlist.delegate('click', this.focus_on_comment, 'a', this);
         commentlist.delegate('key', this.focus_on_comment, 'enter,space', 'a', this);
 
@@ -71,10 +71,12 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
     filter_search_comments : function() {
         var filternode,
             commentslist,
-            filtertext;
+            filtertext,
+            dialogueid;
 
-        filternode = Y.one(SELECTOR.SEARCHFILTER);
-        commentslist = Y.one(SELECTOR.SEARCHCOMMENTSLIST);
+        dialogueid = this.get('id');
+        filternode = Y.one('#' + dialogueid + SELECTOR.SEARCHFILTER);
+        commentslist = Y.one('#' + dialogueid + SELECTOR.SEARCHCOMMENTSLIST);
 
         filtertext = filternode.get('value');
 
index 3daec87..21e368c 100644 (file)
@@ -100,7 +100,7 @@ var DRAWABLE = function(editor) {
     this.store_position = function(container, x, y) {
         var drawingregion, scrollx, scrolly;
 
-        drawingregion = Y.one(SELECTOR.DRAWINGREGION);
+        drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION);
         scrollx = parseInt(drawingregion.get('scrollLeft'), 10);
         scrolly = parseInt(drawingregion.get('scrollTop'), 10);
         container.setData('x', x + scrollx);
index 33c915a..4f38c87 100644 (file)
@@ -219,7 +219,7 @@ EDITOR.prototype = {
         var button, currenttoolnode, imgurl;
 
         // Initalise the colour buttons.
-        button = Y.one(SELECTOR.COMMENTCOLOURBUTTON);
+        button = this.get_dialogue_element(SELECTOR.COMMENTCOLOURBUTTON);
 
         imgurl = M.util.image_url('background_colour_' + this.currentedit.commentcolour, 'assignfeedback_editpdf');
         button.one('img').setAttribute('src', imgurl);
@@ -230,15 +230,15 @@ EDITOR.prototype = {
             button.one('img').setStyle('borderStyle', 'solid');
         }
 
-        button = Y.one(SELECTOR.ANNOTATIONCOLOURBUTTON);
+        button = this.get_dialogue_element(SELECTOR.ANNOTATIONCOLOURBUTTON);
         imgurl = M.util.image_url('colour_' + this.currentedit.annotationcolour, 'assignfeedback_editpdf');
         button.one('img').setAttribute('src', imgurl);
 
-        currenttoolnode = Y.one(TOOLSELECTOR[this.currentedit.tool]);
+        currenttoolnode = this.get_dialogue_element(TOOLSELECTOR[this.currentedit.tool]);
         currenttoolnode.addClass('assignfeedback_editpdf_selectedbutton');
         currenttoolnode.setAttribute('aria-pressed', 'true');
 
-        button = Y.one(SELECTOR.STAMPSBUTTON);
+        button = this.get_dialogue_element(SELECTOR.STAMPSBUTTON);
         button.one('img').setAttrs({'src': this.get_stamp_image_url(this.currentedit.stamp),
                                     'height': '16',
                                     'width': '16'});
@@ -249,7 +249,7 @@ EDITOR.prototype = {
      * @method get_canvas_bounds
      */
     get_canvas_bounds : function() {
-        var canvas = Y.one(SELECTOR.DRAWINGCANVAS),
+        var canvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
             offsetcanvas = canvas.getXY(),
             offsetleft = offsetcanvas[0],
             offsettop = offsetcanvas[1],
@@ -308,12 +308,12 @@ EDITOR.prototype = {
             // Add custom class for styling.
             this.dialogue.get('boundingBox').addClass(CSS.DIALOGUE);
 
-            this.loadingicon = Y.one(SELECTOR.LOADINGICON);
+            this.loadingicon = this.get_dialogue_element(SELECTOR.LOADINGICON);
 
-            drawingcanvas = Y.one(SELECTOR.DRAWINGCANVAS);
-            this.graphic = new Y.Graphic({render : SELECTOR.DRAWINGCANVAS});
+            drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS);
+            this.graphic = new Y.Graphic({render : drawingcanvas});
 
-            drawingregion = Y.one(SELECTOR.DRAWINGREGION);
+            drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
             drawingregion.on('scroll', this.move_canvas, this);
 
             if (!this.get('readonly')) {
@@ -393,7 +393,7 @@ EDITOR.prototype = {
                             var pagetotal = this.get('pagetotal');
 
                             // Update the progress bar.
-                            var progressbarcontainer = Y.one(SELECTOR.PROGRESSBARCONTAINER);
+                            var progressbarcontainer = this.get_dialogue_element(SELECTOR.PROGRESSBARCONTAINER);
                             var progressbar = progressbarcontainer.one('.bar');
                             if (progressbar) {
                                 // Calculate progress.
@@ -520,7 +520,7 @@ EDITOR.prototype = {
             picker,
             filename;
 
-        searchcommentsbutton = Y.one(SELECTOR.SEARCHCOMMENTSBUTTON);
+        searchcommentsbutton = this.get_dialogue_element(SELECTOR.SEARCHCOMMENTSBUTTON);
         searchcommentsbutton.on('click', this.open_search_comments, this);
         searchcommentsbutton.on('key', this.open_search_comments, 'down:13', this);
 
@@ -529,7 +529,7 @@ EDITOR.prototype = {
         }
         // Setup the tool buttons.
         Y.each(TOOLSELECTOR, function(selector, tool) {
-            toolnode = Y.one(selector);
+            toolnode = this.get_dialogue_element(selector);
             toolnode.on('click', this.handle_tool_button, this, tool);
             toolnode.on('key', this.handle_tool_button, 'down:13', this, tool);
             toolnode.setAttribute('aria-pressed', 'false');
@@ -537,7 +537,7 @@ EDITOR.prototype = {
 
         // Set the default tool.
 
-        commentcolourbutton = Y.one(SELECTOR.COMMENTCOLOURBUTTON);
+        commentcolourbutton = this.get_dialogue_element(SELECTOR.COMMENTCOLOURBUTTON);
         picker = new M.assignfeedback_editpdf.colourpicker({
             buttonNode: commentcolourbutton,
             colours: COMMENTCOLOUR,
@@ -553,7 +553,7 @@ EDITOR.prototype = {
             context: this
         });
 
-        annotationcolourbutton = Y.one(SELECTOR.ANNOTATIONCOLOURBUTTON);
+        annotationcolourbutton = this.get_dialogue_element(SELECTOR.ANNOTATIONCOLOURBUTTON);
         picker = new M.assignfeedback_editpdf.colourpicker({
             buttonNode: annotationcolourbutton,
             iconprefix: 'colour_',
@@ -575,11 +575,11 @@ EDITOR.prototype = {
 
         stampfiles = this.get('stampfiles');
         if (stampfiles.length <= 0) {
-            Y.one(TOOLSELECTOR.stamp).ancestor().hide();
+            this.get_dialogue_element(TOOLSELECTOR.stamp).ancestor().hide();
         } else {
             filename = stampfiles[0].substr(stampfiles[0].lastIndexOf('/') + 1);
             this.currentedit.stamp = filename;
-            currentstampbutton = Y.one(SELECTOR.STAMPSBUTTON);
+            currentstampbutton = this.get_dialogue_element(SELECTOR.STAMPSBUTTON);
 
             picker = new M.assignfeedback_editpdf.stamppicker({
                 buttonNode: currentstampbutton,
@@ -612,7 +612,7 @@ EDITOR.prototype = {
         e.preventDefault();
 
         // Change style of the pressed button.
-        currenttoolnode = Y.one(TOOLSELECTOR[this.currentedit.tool]);
+        currenttoolnode = this.get_dialogue_element(TOOLSELECTOR[this.currentedit.tool]);
         currenttoolnode.removeClass('assignfeedback_editpdf_selectedbutton');
         currenttoolnode.setAttribute('aria-pressed', 'false');
         this.currentedit.tool = tool;
@@ -673,6 +673,15 @@ EDITOR.prototype = {
         return drawable;
     },
 
+    /**
+     * Find an element within the dialogue.
+     * @protected
+     * @method get_dialogue_element
+     */
+    get_dialogue_element : function(selector) {
+        return this.dialogue.get('boundingBox').one(selector);
+    },
+
     /**
      * Redraw the active edit.
      * @protected
@@ -693,7 +702,7 @@ EDITOR.prototype = {
      */
     edit_start : function(e) {
         e.preventDefault();
-        var canvas = Y.one(SELECTOR.DRAWINGCANVAS),
+        var canvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
             offset = canvas.getXY(),
             scrolltop = canvas.get('docScrollY'),
             scrollleft = canvas.get('docScrollX'),
@@ -764,7 +773,7 @@ EDITOR.prototype = {
     edit_move : function(e) {
         e.preventDefault();
         var bounds = this.get_canvas_bounds(),
-            canvas = Y.one(SELECTOR.DRAWINGCANVAS),
+            canvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
             clientpoint = new M.assignfeedback_editpdf.point(e.clientX + canvas.get('docScrollX'),
                                                              e.clientY + canvas.get('docScrollY')),
             point = this.get_canvas_coordinates(clientpoint);
@@ -861,7 +870,7 @@ EDITOR.prototype = {
         if (drawregionheight < 100) {
             drawregionheight = 100;
         }
-        drawingregion = Y.one(SELECTOR.DRAWINGREGION);
+        drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
         drawingregion.setStyle('maxHeight', drawregionheight +'px');
         this.redraw();
         return true;
@@ -921,7 +930,8 @@ EDITOR.prototype = {
                         if (jsondata.error) {
                             return new M.core.ajaxException(jsondata);
                         }
-                        Y.one(SELECTOR.UNSAVEDCHANGESDIV).addClass('haschanges');
+                        Y.one('#' + this.get('linkid')).siblings(SELECTOR.UNSAVEDCHANGESDIV)
+                            .item(0).addClass('haschanges');
                     } catch (e) {
                         return new M.core.exception(e);
                     }
@@ -985,13 +995,13 @@ EDITOR.prototype = {
      * @method change_page
      */
     change_page : function() {
-        var drawingcanvas = Y.one(SELECTOR.DRAWINGCANVAS),
+        var drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
             page,
             previousbutton,
             nextbutton;
 
-        previousbutton = Y.one(SELECTOR.PREVIOUSBUTTON);
-        nextbutton = Y.one(SELECTOR.NEXTBUTTON);
+        previousbutton = this.get_dialogue_element(SELECTOR.PREVIOUSBUTTON);
+        nextbutton = this.get_dialogue_element(SELECTOR.NEXTBUTTON);
 
         if (this.currentpage > 0) {
             previousbutton.removeAttribute('disabled');
@@ -1011,7 +1021,7 @@ EDITOR.prototype = {
         drawingcanvas.setStyle('height', page.height + 'px');
 
         // Update page select.
-        Y.one(SELECTOR.PAGESELECT).set('value', this.currentpage);
+        this.get_dialogue_element(SELECTOR.PAGESELECT).set('value', this.currentpage);
 
         this.resize(); // Internally will call 'redraw', after checking the dialogue size.
     },
@@ -1029,7 +1039,7 @@ EDITOR.prototype = {
             previousbutton,
             nextbutton;
 
-        pageselect = Y.one(SELECTOR.PAGESELECT);
+        pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT);
 
         var options = pageselect.all('option');
         if (options.size() <= 1) {
@@ -1046,8 +1056,8 @@ EDITOR.prototype = {
             this.change_page();
         }, this);
 
-        previousbutton = Y.one(SELECTOR.PREVIOUSBUTTON);
-        nextbutton = Y.one(SELECTOR.NEXTBUTTON);
+        previousbutton = this.get_dialogue_element(SELECTOR.PREVIOUSBUTTON);
+        nextbutton = this.get_dialogue_element(SELECTOR.NEXTBUTTON);
 
         previousbutton.on('click', this.previous_page, this);
         previousbutton.on('key', this.previous_page, 'down:13', this);
@@ -1091,7 +1101,7 @@ EDITOR.prototype = {
     move_canvas: function() {
         var drawingregion, x, y, i;
 
-        drawingregion = Y.one(SELECTOR.DRAWINGREGION);
+        drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
         x = parseInt(drawingregion.get('scrollLeft'), 10);
         y = parseInt(drawingregion.get('scrollTop'), 10);
 
index 7eab77e..b3f6980 100644 (file)
@@ -24,23 +24,23 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php',
         DIALOGUE : 'assignfeedback_editpdf_widget'
     },
     SELECTOR = {
-        PREVIOUSBUTTON : '.' + CSS.DIALOGUE + ' .navigate-previous-button',
-        NEXTBUTTON : '.' + CSS.DIALOGUE + ' .navigate-next-button',
-        SEARCHCOMMENTSBUTTON : '.' + CSS.DIALOGUE + ' .searchcommentsbutton',
+        PREVIOUSBUTTON :  '.navigate-previous-button',
+        NEXTBUTTON :  ' .navigate-next-button',
+        SEARCHCOMMENTSBUTTON : '.searchcommentsbutton',
         SEARCHFILTER : '.assignfeedback_editpdf_commentsearch input',
         SEARCHCOMMENTSLIST : '.assignfeedback_editpdf_commentsearch ul',
-        PAGESELECT : '.' + CSS.DIALOGUE + ' .navigate-page-select',
-        LOADINGICON : '.' + CSS.DIALOGUE + ' .loading',
-        PROGRESSBARCONTAINER : '.' + CSS.DIALOGUE + ' .progress-info.progress-striped',
-        DRAWINGREGION : '.' + CSS.DIALOGUE + ' .drawingregion',
-        DRAWINGCANVAS : '.' + CSS.DIALOGUE + ' .drawingcanvas',
-        SAVE : '.' + CSS.DIALOGUE + ' .savebutton',
-        COMMENTCOLOURBUTTON : '.' + CSS.DIALOGUE + ' .commentcolourbutton',
-        COMMENTMENU : ' .commentdrawable a',
-        ANNOTATIONCOLOURBUTTON : '.' + CSS.DIALOGUE + ' .annotationcolourbutton',
-        DELETEANNOTATIONBUTTON : '.' + CSS.DIALOGUE + ' .deleteannotationbutton',
+        PAGESELECT : '.navigate-page-select',
+        LOADINGICON : '.loading',
+        PROGRESSBARCONTAINER : '.progress-info.progress-striped',
+        DRAWINGREGION : '.drawingregion',
+        DRAWINGCANVAS : '.drawingcanvas',
+        SAVE : '.savebutton',
+        COMMENTCOLOURBUTTON : '.commentcolourbutton',
+        COMMENTMENU : '.commentdrawable a',
+        ANNOTATIONCOLOURBUTTON :  '.annotationcolourbutton',
+        DELETEANNOTATIONBUTTON : '.deleteannotationbutton',
         UNSAVEDCHANGESDIV : '.assignfeedback_editpdf_unsavedchanges',
-        STAMPSBUTTON : '.' + CSS.DIALOGUE + ' .currentstampbutton',
+        STAMPSBUTTON : '.currentstampbutton',
         DIALOGUE : '.' + CSS.DIALOGUE
     },
     SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
@@ -64,13 +64,13 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdf/ajax.php',
     },
     CLICKTIMEOUT = 300,
     TOOLSELECTOR = {
-        'comment': '.' + CSS.DIALOGUE + ' .commentbutton',
-        'pen': '.' + CSS.DIALOGUE + ' .penbutton',
-        'line': '.' + CSS.DIALOGUE + ' .linebutton',
-        'rectangle': '.' + CSS.DIALOGUE + ' .rectanglebutton',
-        'oval': '.' + CSS.DIALOGUE + ' .ovalbutton',
-        'stamp': '.' + CSS.DIALOGUE + ' .stampbutton',
-        'select': '.' + CSS.DIALOGUE + ' .selectbutton',
-        'highlight': '.' + CSS.DIALOGUE + ' .highlightbutton'
+        'comment': '.commentbutton',
+        'pen': '.penbutton',
+        'line': '.linebutton',
+        'rectangle': '.rectanglebutton',
+        'oval': '.ovalbutton',
+        'stamp': '.stampbutton',
+        'select': '.selectbutton',
+        'highlight': '.highlightbutton'
     },
     STROKEWEIGHT = 4;
index 5379fad..1f50fac 100644 (file)
@@ -50,5 +50,8 @@ function xmldb_assignfeedback_file_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 2b637f9..b090b37 100644 (file)
@@ -49,6 +49,9 @@ function xmldb_assignsubmission_comments_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 802a5e7..13eeff0 100644 (file)
@@ -47,6 +47,9 @@ function xmldb_assignsubmission_file_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 3147508..ee9c2b7 100644 (file)
@@ -49,6 +49,9 @@ function xmldb_assignsubmission_onlinetext_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 3c2f1ab..a203094 100644 (file)
@@ -128,6 +128,9 @@ function xmldb_assignment_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 5a669a3..b430fef 100644 (file)
@@ -225,5 +225,8 @@ function xmldb_book_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index b712940..ace39f0 100644 (file)
@@ -51,6 +51,9 @@ function xmldb_chat_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 848fd47..14b8c30 100644 (file)
@@ -634,7 +634,7 @@ function chat_update_chat_times($chatid=0) {
         $event = new stdClass(); // Update calendar too.
 
         $cond = "modulename='chat' AND instance = :chatid AND timestart <> :chattime";
-        $params = array('chattime' => $chat->chattime, 'chatid' => $chatid);
+        $params = array('chattime' => $chat->chattime, 'chatid' => $chat->id);
 
         if ($event->id = $DB->get_field_select('event', 'id', $cond, $params)) {
             $event->timestart   = $chat->chattime;
@@ -1265,7 +1265,7 @@ function chat_extend_settings_navigation(settings_navigation $settings, navigati
     if ($chat->chattime && $chat->schedule) {
         $nextsessionnode = $chatnode->add(get_string('nextsession', 'chat').
                                           ': '.userdate($chat->chattime).
-                                          ' ('.usertimezone($USER->timezone));
+                                          ' ('.usertimezone($USER->timezone).')');
         $nextsessionnode->add_class('note');
     }
 
index f93befd..6f297c8 100644 (file)
@@ -98,6 +98,9 @@ function xmldb_choice_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index fd34e52..bde3b99 100644 (file)
@@ -168,5 +168,8 @@ function xmldb_data_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2015092200, 'data');
     }
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 5b3cbf7..0711292 100644 (file)
@@ -97,6 +97,7 @@ class data_field_checkbox extends data_field_base {
             } else {
                 $str .= html_writer::checkbox('f_'.$this->field->id.'[]', s($checkbox), false, $checkbox);
             }
+            $str .= html_writer::empty_tag('br');
             $found = true;
         }
         if (!$found) {
index 96cfa49..ea8d275 100644 (file)
@@ -67,6 +67,9 @@ function xmldb_feedback_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 8f33b07..05d297a 100644 (file)
@@ -125,5 +125,8 @@ function xmldb_folder_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index f68498f..4edc4b6 100644 (file)
@@ -250,5 +250,8 @@ function xmldb_forum_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2015102900, 'forum');
     }
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a4aebf9..6c1e1dc 100644 (file)
@@ -83,6 +83,9 @@ function xmldb_glossary_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2015060200, 'glossary');
     }
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index deb652a..16cc411 100644 (file)
@@ -57,5 +57,8 @@ function xmldb_imscp_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index ad54fc3..32f9332 100644 (file)
@@ -93,6 +93,9 @@ function xmldb_label_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index af9daaf..b0ca176 100644 (file)
@@ -349,5 +349,9 @@ function xmldb_lesson_upgrade($oldversion) {
         // Lesson savepoint reached.
         upgrade_mod_savepoint(true, 2015071803, 'lesson');
     }
+
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index fd75999..2128699 100644 (file)
@@ -194,6 +194,9 @@ function xmldb_lti_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 3179346..5a6d42b 100644 (file)
@@ -78,5 +78,8 @@ function xmldb_page_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8e4f805..c8cebfa 100644 (file)
@@ -904,5 +904,8 @@ function xmldb_quiz_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c950063..73ed1de 100644 (file)
@@ -62,5 +62,8 @@ function xmldb_quiz_overview_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index bdc5053..b589b21 100644 (file)
@@ -142,6 +142,9 @@ function xmldb_quiz_statistics_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 3dee4bd..972d232 100644 (file)
@@ -78,5 +78,8 @@ function xmldb_resource_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 204de1a..7d51db1 100644 (file)
@@ -335,6 +335,9 @@ function xmldb_scorm_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2015091400, 'scorm');
     }
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 4641fe0..1af7efc 100644 (file)
@@ -53,6 +53,9 @@ function xmldb_survey_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index cd2b5a1..ea2470e 100644 (file)
@@ -78,5 +78,8 @@ function xmldb_url_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 108d29b..2b1f1d0 100644 (file)
@@ -90,5 +90,8 @@ function xmldb_wiki_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 337c8a7..168f980 100644 (file)
@@ -166,5 +166,8 @@ function xmldb_workshop_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 816bb3b..7ea0333 100644 (file)
@@ -62,5 +62,8 @@ function xmldb_workshopform_accumulative_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 33f69cc..3f417b0 100644 (file)
@@ -62,5 +62,8 @@ function xmldb_workshopform_comments_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index b389467..f62e735 100644 (file)
@@ -62,5 +62,8 @@ function xmldb_workshopform_numerrors_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 2c46042..a011f32 100644 (file)
@@ -62,5 +62,8 @@ function xmldb_workshopform_rubric_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
diff --git a/notes/tests/behat/participants_notes.feature b/notes/tests/behat/participants_notes.feature
new file mode 100644 (file)
index 0000000..b14c55e
--- /dev/null
@@ -0,0 +1,51 @@
+@core @core_notes
+Feature: Add notes to course participants
+  In order to share information with other staff
+  As a teacher
+  I need to add notes from the course particpants list
+
+  Scenario: An teacher can add multiple notes
+    Given the following "users" exist:
+      | username | firstname | lastname | email |
+      | teacher1 | Teacher | 1 | teacher1@example.com |
+      | student1 | Student | 1 | student1@example.com |
+      | student2 | Student | 2 | student2@example.com |
+      | student3 | Student | 3 | student3@example.com |
+    And the following "courses" exist:
+      | fullname | shortname | format |
+      | Course 1 | C1 | topics |
+    And the following "course enrolments" exist:
+      | user | course | role |
+      | teacher1 | C1 | editingteacher |
+      | student1 | C1 | student |
+      | student2 | C1 | student |
+      | student3 | C1 | student |
+    And I log in as "teacher1"
+    And I follow "Course 1"
+    And I follow "Participants"
+    And I set the field with xpath "//tr[contains(normalize-space(.), 'Student 1')]//input[@type='checkbox']" to "1"
+    And I set the field with xpath "//tr[contains(normalize-space(.), 'Student 2')]//input[@type='checkbox']" to "1"
+    And I set the field with xpath "//tr[contains(normalize-space(.), 'Student 3')]//input[@type='checkbox']" to "1"
+    And I set the field "With selected users..." to "Add a new note"
+    And I press "OK"
+    # Add a note to student 1, but leave student 2 empty and student 3 with space.
+    When I set the field with xpath "//tr[contains(normalize-space(.), 'Student 1')]//textarea" to "Student 1 needs to pick up his game"
+    And I set the field with xpath "//tr[contains(normalize-space(.), 'Student 2')]//textarea" to ""
+    And I set the field with xpath "//tr[contains(normalize-space(.), 'Student 3')]//textarea" to "  "
+    And I press "Save changes"
+    And I follow "Student 1"
+    And I follow "Notes"
+    # Student 1 has note from Teacher
+    Then I should see "Teacher" in the "region-main" "region"
+    And I should see "Student 1 needs to pick up his game"
+    And I follow "Participants"
+    And I follow "Student 2"
+    And I follow "Notes"
+    And I follow "Course 1"
+    And I follow "Participants"
+    And I follow "Notes"
+    Then I should see "Student 1"
+    And I should see "Student 1 needs to pick up his game"
+    # Verify Student 2 does not have a note added.
+    And I should not see "Student 2"
+    And I should not see "Student 3"
index ca71a97..9bc76b8 100644 (file)
@@ -70,5 +70,8 @@ function xmldb_portfolio_boxnet_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index e7b4069..0e2a882 100644 (file)
@@ -64,5 +64,8 @@ function xmldb_portfolio_googledocs_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 92e4ba2..8b960c6 100644 (file)
@@ -64,5 +64,8 @@ function xmldb_portfolio_picasa_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 72cf5ff..36884f3 100644 (file)
@@ -102,6 +102,9 @@ function xmldb_qbehaviour_manualgraded_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 18ed092..4ad8a0f 100644 (file)
@@ -61,6 +61,9 @@ function xmldb_qtype_calculated_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 98d1c47..282aac5 100644 (file)
@@ -58,5 +58,9 @@ function xmldb_qtype_ddmarker_upgrade($oldversion) {
         // Savepoint reached.
         upgrade_plugin_savepoint(true, 2013053000, 'qtype', 'ddmarker');
     }
+
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index d33f5ec..f990fb3 100644 (file)
@@ -180,6 +180,9 @@ function xmldb_qtype_essay_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
 
index 6d9f058..e2f1004 100644 (file)
@@ -213,5 +213,8 @@ function xmldb_qtype_match_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index e5c3839..0cd685c 100644 (file)
@@ -26,8 +26,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-require_once($CFG->dirroot . '/question/type/multianswer/questiontype.php');
-
 /**
  * Upgrade code for the multi-answer question type.
  * @param int $oldversion the version we are upgrading from.
@@ -98,5 +96,8 @@ function xmldb_qtype_multianswer_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2015100201, 'qtype', 'multianswer');
     }
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a63feed..4d99e12 100644 (file)
@@ -145,5 +145,8 @@ function xmldb_qtype_multichoice_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c3777a6..c13ded8 100644 (file)
@@ -58,5 +58,8 @@ function xmldb_qtype_numerical_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 72dcd48..f88efa9 100644 (file)
@@ -70,5 +70,8 @@ function xmldb_qtype_random_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 5f578c3..decbd36 100644 (file)
@@ -196,5 +196,8 @@ function xmldb_qtype_randomsamatch_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8dda4f8..0d33004 100644 (file)
@@ -140,5 +140,8 @@ function xmldb_qtype_shortanswer_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 7cb63b7..07f2b99 100644 (file)
@@ -173,8 +173,15 @@ if (!empty($instanceid) && !empty($roleid)) {
     $table = new flexible_table('course-participation-'.$course->id.'-'.$cm->id.'-'.$roleid);
     $table->course = $course;
 
-    $table->define_columns(array('fullname','count','select'));
-    $table->define_headers(array(get_string('user'),((!empty($action)) ? get_string($action) : get_string('allactions')),get_string('select')));
+    $actionheader = !empty($action) ? get_string($action) : get_string('allactions');
+
+    if (empty($CFG->messaging)) {
+        $table->define_columns(array('fullname', 'count'));
+        $table->define_headers(array(get_string('user'), $actionheader));
+    } else {
+        $table->define_columns(array('fullname', 'count', 'select'));
+        $table->define_headers(array(get_string('user'), $actionheader, get_string('select')));
+    }
     $table->define_baseurl($baseurl);
 
     $table->set_attribute('cellpadding','5');
@@ -336,10 +343,14 @@ if (!empty($instanceid) && !empty($roleid)) {
     echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />'."\n";
 
     foreach ($users as $u) {
-        $data = array('<a href="'.$CFG->wwwroot.'/user/view.php?id='.$u->userid.'&amp;course='.$course->id.'">'.fullname($u,true).'</a>'."\n",
-                      ((!empty($u->count)) ? get_string('yes').' ('.$u->count.') ' : get_string('no')),
-                      '<input type="checkbox" class="usercheckbox" name="user'.$u->userid.'" value="'.$u->count.'" />'."\n",
-                      );
+        $data = array();
+        $data[] = html_writer::link(new moodle_url('/user/view.php', array('id' => $u->userid, 'course' => $course->id)),
+            fullname($u, true));
+        $data[] = !empty($u->count) ? get_string('yes').' ('.$u->count.') ' : get_string('no');
+
+        if (!empty($CFG->messaging)) {
+            $data[] = '<input type="checkbox" class="usercheckbox" name="user'.$u->userid.'" value="'.$u->count.'" />';
+        }
         $table->add_data($data);
     }
 
@@ -357,25 +368,27 @@ if (!empty($instanceid) && !empty($roleid)) {
         echo html_writer::end_div();
     }
 
-    echo '<div class="selectbuttons">';
-    echo '<input type="button" id="checkall" value="'.get_string('selectall').'" /> '."\n";
-    echo '<input type="button" id="checknone" value="'.get_string('deselectall').'" /> '."\n";
-    if ($perpage >= $matchcount) {
-        echo '<input type="button" id="checknos" value="'.get_string('selectnos').'" />'."\n";
+    if (!empty($CFG->messaging)) {
+        echo '<div class="selectbuttons">';
+        echo '<input type="button" id="checkall" value="'.get_string('selectall').'" /> '."\n";
+        echo '<input type="button" id="checknone" value="'.get_string('deselectall').'" /> '."\n";
+        if ($perpage >= $matchcount) {
+            echo '<input type="button" id="checknos" value="'.get_string('selectnos').'" />'."\n";
+        }
+        echo '</div>';
+        echo '<div>';
+        echo html_writer::label(get_string('withselectedusers'), 'formactionselect');
+        $displaylist['messageselect.php'] = get_string('messageselectadd');
+        echo html_writer::select($displaylist, 'formaction', '', array('' => 'choosedots'), array('id' => 'formactionselect'));
+        echo $OUTPUT->help_icon('withselectedusers');
+        echo '<input type="submit" value="' . get_string('ok') . '" />'."\n";
+        echo '</div>';
+        echo '</div>'."\n";
+        echo '</form>'."\n";
+        echo '</div>'."\n";
+
+        $PAGE->requires->js_init_call('M.report_participation.init');
     }
-    echo '</div>';
-    echo '<div>';
-    echo html_writer::label(get_string('withselectedusers'), 'formactionselect');
-    $displaylist['messageselect.php'] = get_string('messageselectadd');
-    echo html_writer::select($displaylist, 'formaction', '', array(''=>'choosedots'), array('id'=>'formactionselect'));
-    echo $OUTPUT->help_icon('withselectedusers');
-    echo '<input type="submit" value="' . get_string('ok') . '" />'."\n";
-    echo '</div>';
-    echo '</div>'."\n";
-    echo '</form>'."\n";
-    echo '</div>'."\n";
-
-    $PAGE->requires->js_init_call('M.report_participation.init');
 }
 
 echo $OUTPUT->footer();
diff --git a/report/participation/tests/behat/message_participants.feature b/report/participation/tests/behat/message_participants.feature
new file mode 100644 (file)
index 0000000..72da3f3
--- /dev/null
@@ -0,0 +1,69 @@
+@report @report_participation @javascript
+Feature: Use the particiaption report to message groups of students
+  In order to engage with students based on participation
+  As a teacher
+  I need to be able to message students who have not participated in an activity
+
+  Background:
+    Given the following "courses" exist:
+      | fullname | shortname | category | groupmode |
+      | Course 1 | C1 | 0 | 1 |
+    And the following "users" exist:
+      | username | firstname | lastname | email |
+      | teacher1 | Teacher | 1 | teacher1@example.com |
+      | student1 | Student | 1 | student1@example.com |
+      | student2 | Student | 2 | student2@example.com |
+      | student3 | Student | 3 | student3@example.com |
+    And the following "course enrolments" exist:
+      | user | course | role |
+      | teacher1 | C1 | editingteacher |
+      | student1 | C1 | student |
+      | student2 | C1 | student |
+      | student3 | C1 | student |
+    And I log in as "teacher1"
+    And I follow "Course 1"
+    And I turn editing mode on
+    And I add a "Book" to section "1" and I fill the form with:
+      | Name | Test book name |
+      | Description | Test book |
+    And I follow "Test book name"
+    And I set the following fields to these values:
+      | Chapter title | Test chapter |
+      | Content | Test chapter content |
+    And I log out
+    And I log in as "student1"
+    And I follow "Course 1"
+    And I follow "Test book name"
+    And I log out
+
+  Scenario: Message students who have not participated in book
+    Given I log in as "teacher1"
+    And I follow "Course 1"
+    And I navigate to "Course participation" node in "Course administration > Reports"
+    And I set the field "instanceid" to "Test book name"
+    And I set the field "roleid" to "Student"
+    And I press "Go"
+    And I should see "Yes (1)" in the "Student 1" "table_row"
+    And I should see "No" in the "Student 2" "table_row"
+    And I should see "No" in the "Student 3" "table_row"
+    When I press "Select all 'No'"
+    And I set the field "With selected users..." to "Send a message"
+    And I press "OK"
+    Then I should see "Added 2 new recipients"
+    And I should see "Student 2" in the "Currently selected users" "table"
+    And I should see "Student 3" in the "Currently selected users" "table"
+    And I should not see "Student 1" in the "Currently selected users" "table"
+
+  Scenario: Ensure no message options when messaging is disabled
+    Given I log in as "admin"
+    And I set the following administration settings values:
+      | messaging | 0 |
+    And I log out
+    And I log in as "teacher1"
+    And I follow "Course 1"
+    And I navigate to "Course participation" node in "Course administration > Reports"
+    When I set the field "instanceid" to "Test book name"
+    And I set the field "roleid" to "Student"
+    And I press "Go"
+    Then I should not see "With selected users..."
+    And I should not see "Select all"
index 6a39d96..7046b1e 100644 (file)
@@ -62,5 +62,8 @@ function xmldb_repository_alfresco_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 6926b32..a85a750 100644 (file)
@@ -83,5 +83,8 @@ function xmldb_repository_boxnet_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index e53aaba..c51ea5c 100644 (file)
@@ -55,5 +55,8 @@ function xmldb_repository_dropbox_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index bbc83a3..9a45f1b 100644 (file)
@@ -67,5 +67,8 @@ function xmldb_repository_googledocs_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index eb25006..2853786 100644 (file)
@@ -67,5 +67,8 @@ function xmldb_repository_picasa_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 32fdd5e..e9d043d 100644 (file)
@@ -79,5 +79,8 @@ function xmldb_theme_more_upgrade($oldversion) {
     // Moodle v2.9.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Moodle v3.0.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 540423a..4072718 100644 (file)
@@ -54,11 +54,13 @@ if (!empty($users) && confirm_sesskey()) {
     $note->courseid = $id;
     $note->format = FORMAT_PLAIN;
     foreach ($users as $k => $v) {
-        if (!$user = $DB->get_record('user', array('id' => $v)) || empty($contents[$k])) {
+        $user = $DB->get_record('user', array('id' => $v));
+        $content = trim($contents[$k]);
+        if (!$user || empty($content)) {
             continue;
         }
         $note->id = 0;
-        $note->content = $contents[$k];
+        $note->content = $content;
         $note->publishstate = $states[$k];
         $note->userid = $v;
         note_save($note);