// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
/**
* Usually same than major release zero version, mainly for informative/historic purposes.
*/
- const RELEASE = '3.0';
+ const RELEASE = '3.1';
}
/*
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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
// 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
// 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;
}
// 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
// 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
// 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;
}
upgrade_block_savepoint(true, 2015071700, 'rss_client');
}
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
// 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;
}
// 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
// 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
// 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;
}
// 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;
}
// 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;
}
// 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;
}
upgrade_plugin_savepoint(true, 2015091500, 'enrol', 'manual');
}
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
print_error('nocourseid');
}
require_login(null, false);
+$PAGE->set_course($course);
$context = context_course::instance($course->id);
$systemcontext = context_system::instance();
// 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;
}
[./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%)])]
upgrade_main_savepoint(true, 2015100800.01);
}
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
// 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;
}
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
"event-outside",
"handlebars",
"event-custom",
- "timers"
+ "timers",
+ "moodle-editor_atto-menu"
]
},
"moodle-editor_atto-menu": {
// 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;
}
// 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;
}
}
}
// 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', ''));
}
// 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;
}
}
$resetdb = self::reset_database();
+ $localename = self::get_locale_name();
$warnings = array();
if ($detectchanges === true) {
$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';
}
}
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()) {
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');
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';
+ }
+ }
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
*/
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) {
*/
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;
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;
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,
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);
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');
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);
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);
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'});
* @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],
// 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')) {
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.
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);
}
// 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');
// 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,
context: this
});
- annotationcolourbutton = Y.one(SELECTOR.ANNOTATIONCOLOURBUTTON);
+ annotationcolourbutton = this.get_dialogue_element(SELECTOR.ANNOTATIONCOLOURBUTTON);
picker = new M.assignfeedback_editpdf.colourpicker({
buttonNode: annotationcolourbutton,
iconprefix: 'colour_',
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,
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;
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
*/
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'),
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);
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;
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);
}
* @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');
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.
},
previousbutton,
nextbutton;
- pageselect = Y.one(SELECTOR.PAGESELECT);
+ pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT);
var options = pageselect.all('option');
if (options.size() <= 1) {
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);
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);
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)',
},
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;
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
$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;
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');
}
// 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;
}
upgrade_mod_savepoint(true, 2015092200, 'data');
}
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
} else {
$str .= html_writer::checkbox('f_'.$this->field->id.'[]', s($checkbox), false, $checkbox);
}
+ $str .= html_writer::empty_tag('br');
$found = true;
}
if (!$found) {
// 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;
}
// 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;
}
upgrade_mod_savepoint(true, 2015102900, 'forum');
}
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
upgrade_mod_savepoint(true, 2015060200, 'glossary');
}
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
// 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;
}
// 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;
}
// Lesson savepoint reached.
upgrade_mod_savepoint(true, 2015071803, 'lesson');
}
+
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
upgrade_mod_savepoint(true, 2015091400, 'scorm');
}
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
--- /dev/null
+@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"
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// Savepoint reached.
upgrade_plugin_savepoint(true, 2013053000, 'qtype', 'ddmarker');
}
+
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
// 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;
}
// 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;
}
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.
upgrade_plugin_savepoint(true, 2015100201, 'qtype', 'multianswer');
}
+ // Moodle v3.0.0 release upgrade line.
+ // Put any upgrade step following this.
+
return true;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
$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');
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.'&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);
}
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();
--- /dev/null
+@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"
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
$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);