MDL-55839 behat: Behat fixes for theme_noname

This is a squash of many small fixes.
The list of changes are:

Initial set of behat selectors overrides required for new theme.

set core behat selectors if not overridden by theme

Remove pause

Fix for checkboxes not saving properly

Custom override for click in the user menu

Fix for behat guessing the field type.

Behat fix for guessing the correct field type.

Fix for missing closeElementBefore mforms mess.

Fix for textareas not displaying their contents.

Fix availability form element

Fix action menu selectors for activities in a course page

Fix textareas not retaining their values

Fix selector for blocks

I had to change the single select template to use an input instead of a button because of a
behat bug we have not tracked down yet.

Fix for frozen attribute in form elements

Use input instead of button while behat is still broken

Fix for navigation selector override

Behat selector fixes and multi-select fixes for templated select

Fix for configure blocks selector + booleans for autocomplete

Fixes for course_summary behat tests

Allow optgroups in single_select

Behat fixes for block_navigation

Fixes for url form element and activity chooser selectors

blocks_social - fix specific selector for behat

Fix export_for_template for selectgroups element.

Dont set empty id on the form

Fix direct call to behat_navigation in backup context

Checkbox empty value fix

Fix for assign grading panel popouts

file picker overrides to find a file manager in the page

Fix chat tests to use element name

Make selectors in mod_data behat less specific

MDL-55839: recent activity behat test relies on time()

SQUASH Honour mform element "class" attribute on the container

SQUASH Fixes for behat in mod_forum

SQUASH search form template showing value as text next to the button

SQUASH undo double selectgroup fix

SQUASH - The slightly different structure to action menus breaks course drag and drop

SQUASH Wrap loading icon in a span so the selector still works.

SQUASH Fix fragile javascript in report_loglive

SQUASH Fix tabtree, and selectgroups for mod_feedback

Also - do-not enhance the action menu - we are dropping support for this.

SQUASH Fix filemanager selector and pix_icon template for mod_forum tests.

SQUASH Fixes to breadcrumb and add formid to single select (fixes mod_glossary tests)

SQUASH lesson behat fixes. 95% of lesson styles were rubbish so they were disgarded.

SQUASH Fix lti behat tests - they were cheating and using a context step from quiz

SQUASH Behat fixes for quiz with new theme

SQUASH behat fixes for mod_wiki

SQUASH Workshop behat fixes

SQUASH Frozen form elements cannot use a readonly form element because it screws with the form JS "disabledIf" stuff.

SQUASH Fixes for grades behat tests

SQUASH behat fixes for groups

SQUASH blacklist action menu tests

SQUASH Fix for tag form element missing "manage standard tags" link

SQUASH Incomplete fixes for course behat tests

SQUASH behat fixes for badges

SQUASH Tags fixes for behat

SQUASH filepicker fixes for behat

SQUASH Abort guessing field type when we hit 'html'

SQUASH Fix for admin/tool/behat tests

SQUASH fix for admin tool behat tests

SQUASH fix for availabilty conditions hiding "aria-hidden" elements

SQUASH give the blocks more room. We get behat files because nav tree nodes are not in view

SQUASH Blocks fixed

Fix behaviour of unchecked checkboxes

SQUASH Remove incorrect step in user test

SQUASH behat fixes for course tests

Part of MDL-55071
This commit is contained in:
Damyon Wiese
2016-09-23 10:55:16 +01:00
committed by Dan Poltawski
parent 428de3dcc3
commit 63e4df60f6
203 changed files with 2592 additions and 551 deletions
@@ -439,7 +439,7 @@ Feature: Set up contextual data for tests
And I follow "Edit Test Outcome Grade Item 1"
And the field "Outcome" matches value "Grade outcome 1"
And I expand all fieldsets
And "//div[contains(@class, 'fitem')]/div[contains(@class, 'fitemtitle')]/div[contains(@class, fstaticlabel) and contains(., 'Grade category')]/../../div[contains(@class, 'felement') and contains(., 'Grade category 1')]" "xpath_element" should exist
And I should see "Grade category 1" in the "Grade category" "form_row"
And I press "Cancel"
Scenario: Add a block
@@ -56,7 +56,7 @@ M.availability_completion.form.getNode = function(json) {
// Add event handlers (first time only).
if (!M.availability_completion.form.addedEvents) {
M.availability_completion.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// Whichever dropdown changed, just update the form.
M.core_availability.form.update();
@@ -1 +1 @@
YUI.add("moodle-availability_completion-form",function(e,t){M.availability_completion=M.availability_completion||{},M.availability_completion.form=e.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(t){var n=M.util.get_string("title","availability_completion")+' <span class="availability-group"><label>'+'<span class="accesshide">'+M.util.get_string("label_cm","availability_completion")+" </span>"+'<select name="cm" title="'+M.util.get_string("label_cm","availability_completion")+'">'+'<option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.cms.length;r++){var i=this.cms[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_completion","availability_completion")+' </span><select name="e" title="'+M.util.get_string("label_completion","availability_completion")+'">'+'<option value="1">'+M.util.get_string("option_complete","availability_completion")+"</option>"+'<option value="0">'+M.util.get_string("option_incomplete","availability_completion")+"</option>"+'<option value="2">'+M.util.get_string("option_pass","availability_completion")+"</option>"+'<option value="3">'+M.util.get_string("option_fail","availability_completion")+"</option>"+"</select></label></span>";var s=e.Node.create("<span>"+n+"</span>");t.cm!==undefined&&s.one("select[name=cm] > option[value="+t.cm+"]")&&s.one("select[name=cm]").set("value",""+t.cm),t.e!==undefined&&s.one("select[name=e]").set("value",""+t.e);if(!M.availability_completion.form.addedEvents){M.availability_completion.form.addedEvents=!0;var o=e.one("#fitem_id_availabilityconditionsjson");o.delegate("change",function(){M.core_availability.form.update()},".availability_completion select")}return s},M.availability_completion.form.fillValue=function(e,t){e.cm=parseInt(t.one("select[name=cm]").get("value"),10),e.e=parseInt(t.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(e,t){var n=parseInt(t.one("select[name=cm]").get("value"),10);n===0&&e.push("availability_completion:error_selectcmid")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_completion-form",function(e,t){M.availability_completion=M.availability_completion||{},M.availability_completion.form=e.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(t){var n=M.util.get_string("title","availability_completion")+' <span class="availability-group"><label>'+'<span class="accesshide">'+M.util.get_string("label_cm","availability_completion")+" </span>"+'<select name="cm" title="'+M.util.get_string("label_cm","availability_completion")+'">'+'<option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.cms.length;r++){var i=this.cms[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_completion","availability_completion")+' </span><select name="e" title="'+M.util.get_string("label_completion","availability_completion")+'">'+'<option value="1">'+M.util.get_string("option_complete","availability_completion")+"</option>"+'<option value="0">'+M.util.get_string("option_incomplete","availability_completion")+"</option>"+'<option value="2">'+M.util.get_string("option_pass","availability_completion")+"</option>"+'<option value="3">'+M.util.get_string("option_fail","availability_completion")+"</option>"+"</select></label></span>";var s=e.Node.create("<span>"+n+"</span>");t.cm!==undefined&&s.one("select[name=cm] > option[value="+t.cm+"]")&&s.one("select[name=cm]").set("value",""+t.cm),t.e!==undefined&&s.one("select[name=e]").set("value",""+t.e);if(!M.availability_completion.form.addedEvents){M.availability_completion.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_completion select")}return s},M.availability_completion.form.fillValue=function(e,t){e.cm=parseInt(t.one("select[name=cm]").get("value"),10),e.e=parseInt(t.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(e,t){var n=parseInt(t.one("select[name=cm]").get("value"),10);n===0&&e.push("availability_completion:error_selectcmid")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -56,7 +56,7 @@ M.availability_completion.form.getNode = function(json) {
// Add event handlers (first time only).
if (!M.availability_completion.form.addedEvents) {
M.availability_completion.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// Whichever dropdown changed, just update the form.
M.core_availability.form.update();
+1 -1
View File
@@ -54,7 +54,7 @@ M.availability_completion.form.getNode = function(json) {
// Add event handlers (first time only).
if (!M.availability_completion.form.addedEvents) {
M.availability_completion.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// Whichever dropdown changed, just update the form.
M.core_availability.form.update();
@@ -72,7 +72,7 @@ M.availability_date.form.getNode = function(json) {
if (!M.availability_date.form.addedEvents) {
M.availability_date.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// For the direction, just update the form fields.
M.core_availability.form.update();
@@ -1 +1 @@
YUI.add("moodle-availability_date-form",function(e,t){M.availability_date=M.availability_date||{},M.availability_date.form=e.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,t){this.html=e,this.defaultTime=t},M.availability_date.form.getNode=function(t){var n=M.util.get_string("direction_before","availability_date")+' <span class="availability-group">'+'<label><span class="accesshide">'+M.util.get_string("direction_label","availability_date")+" </span>"+'<select name="direction">'+'<option value="&gt;=">'+M.util.get_string("direction_from","availability_date")+"</option>"+'<option value="&lt;">'+M.util.get_string("direction_until","availability_date")+"</option>"+"</select></label></span> "+this.html,r=e.Node.create("<span>"+n+"</span>");if(t.t!==undefined){r.setData("time",t.t),r.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)});var i=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime"+"&time="+t.t;e.io(i,{on:{success:function(t,n){var i=e.JSON.parse(n.responseText);for(var s in i){var o=r.one("select[name=x\\["+s+"\\]]");o.set("value",""+i[s]),o.set("disabled",!1)}},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})}else r.setData("time",this.defaultTime);t.d!==undefined&&r.one("select[name=direction]").set("value",t.d);if(!M.availability_date.form.addedEvents){M.availability_date.form.addedEvents=!0;var s=e.one("#fitem_id_availabilityconditionsjson");s.delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),s.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")}if(r.one("a[href=#]")){M.form.dateselector.init_single_date_selector(r);var o=r.one("select[name=x\\[year\\]]"),u=o.set;o.set=function(e,t){u.call(o,e,t),e==="selectedIndex"&&setTimeout(function(){M.availability_date.form.updateTime(r)},0)}}return r},M.availability_date.form.updateTime=function(t){var n=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime"+"&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");e.io(n,{on:{success:function(e,n){t.setData("time",n.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})},M.availability_date.form.fillValue=function(e,t){e.d=t.one("select[name=direction]").get("value"),e.t=parseInt(t.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]});
YUI.add("moodle-availability_date-form",function(e,t){M.availability_date=M.availability_date||{},M.availability_date.form=e.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,t){this.html=e,this.defaultTime=t},M.availability_date.form.getNode=function(t){var n=M.util.get_string("direction_before","availability_date")+' <span class="availability-group">'+'<label><span class="accesshide">'+M.util.get_string("direction_label","availability_date")+" </span>"+'<select name="direction">'+'<option value="&gt;=">'+M.util.get_string("direction_from","availability_date")+"</option>"+'<option value="&lt;">'+M.util.get_string("direction_until","availability_date")+"</option>"+"</select></label></span> "+this.html,r=e.Node.create("<span>"+n+"</span>");if(t.t!==undefined){r.setData("time",t.t),r.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)});var i=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime"+"&time="+t.t;e.io(i,{on:{success:function(t,n){var i=e.JSON.parse(n.responseText);for(var s in i){var o=r.one("select[name=x\\["+s+"\\]]");o.set("value",""+i[s]),o.set("disabled",!1)}},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})}else r.setData("time",this.defaultTime);t.d!==undefined&&r.one("select[name=direction]").set("value",t.d);if(!M.availability_date.form.addedEvents){M.availability_date.form.addedEvents=!0;var s=e.one(".availability-field");s.delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),s.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")}if(r.one("a[href=#]")){M.form.dateselector.init_single_date_selector(r);var o=r.one("select[name=x\\[year\\]]"),u=o.set;o.set=function(e,t){u.call(o,e,t),e==="selectedIndex"&&setTimeout(function(){M.availability_date.form.updateTime(r)},0)}}return r},M.availability_date.form.updateTime=function(t){var n=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime"+"&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");e.io(n,{on:{success:function(e,n){t.setData("time",n.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})},M.availability_date.form.fillValue=function(e,t){e.d=t.one("select[name=direction]").get("value"),e.t=parseInt(t.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]});
@@ -72,7 +72,7 @@ M.availability_date.form.getNode = function(json) {
if (!M.availability_date.form.addedEvents) {
M.availability_date.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// For the direction, just update the form fields.
M.core_availability.form.update();
+1 -1
View File
@@ -70,7 +70,7 @@ M.availability_date.form.getNode = function(json) {
if (!M.availability_date.form.addedEvents) {
M.availability_date.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// For the direction, just update the form fields.
M.core_availability.form.update();
@@ -86,7 +86,7 @@ M.availability_grade.form.getNode = function(json) {
if (!M.availability_grade.form.addedEvents) {
M.availability_grade.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// For the grade item, just update the form fields.
M.core_availability.form.update();
@@ -1 +1 @@
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n="<label>"+M.util.get_string("title","availability_grade")+' <span class="availability-group">'+'<select name="id"><option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.grades.length;r++){var i=this.grades[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></span></label> <span class="availability-group"><label><input type="checkbox" name="min"/>'+M.util.get_string("option_min","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_min","availability_grade")+'</span><input type="text" name="minval" title="'+M.util.get_string("label_min","availability_grade")+'"/></label>%</span>'+'<span class="availability-group">'+'<label><input type="checkbox" name="max"/>'+M.util.get_string("option_max","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_max","availability_grade")+'</span><input type="text" name="maxval" title="'+M.util.get_string("label_max","availability_grade")+'"/></label>%</span>';var s=e.Node.create("<span>"+n+"</span>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(s.one("input[name=min]").set("checked",!0),s.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(s.one("input[name=max]").set("checked",!0),s.one("input[name=maxval]").set("value",t.max));var o=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};s.all("input[type=checkbox]").each(o);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var u=e.one("#fitem_id_availabilityconditionsjson");u.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),u.delegate("click",function(){o(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),u.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return s},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n="<label>"+M.util.get_string("title","availability_grade")+' <span class="availability-group">'+'<select name="id"><option value="0">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.grades.length;r++){var i=this.grades[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+='</select></span></label> <span class="availability-group"><label><input type="checkbox" name="min"/>'+M.util.get_string("option_min","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_min","availability_grade")+'</span><input type="text" name="minval" title="'+M.util.get_string("label_min","availability_grade")+'"/></label>%</span>'+'<span class="availability-group">'+'<label><input type="checkbox" name="max"/>'+M.util.get_string("option_max","availability_grade")+'</label> <label><span class="accesshide">'+M.util.get_string("label_max","availability_grade")+'</span><input type="text" name="maxval" title="'+M.util.get_string("label_max","availability_grade")+'"/></label>%</span>';var s=e.Node.create("<span>"+n+"</span>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(s.one("input[name=min]").set("checked",!0),s.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(s.one("input[name=max]").set("checked",!0),s.one("input[name=maxval]").set("value",t.max));var o=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};s.all("input[type=checkbox]").each(o);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var u=e.one(".availability-field");u.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),u.delegate("click",function(){o(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),u.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return s},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -86,7 +86,7 @@ M.availability_grade.form.getNode = function(json) {
if (!M.availability_grade.form.addedEvents) {
M.availability_grade.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// For the grade item, just update the form fields.
M.core_availability.form.update();
+1 -1
View File
@@ -84,7 +84,7 @@ M.availability_grade.form.getNode = function(json) {
if (!M.availability_grade.form.addedEvents) {
M.availability_grade.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// For the grade item, just update the form fields.
M.core_availability.form.update();
@@ -58,7 +58,7 @@ M.availability_group.form.getNode = function(json) {
// Add event handlers (first time only).
if (!M.availability_group.form.addedEvents) {
M.availability_group.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// Just update the form fields.
M.core_availability.form.update();
@@ -1 +1 @@
YUI.add("moodle-availability_group-form",function(e,t){M.availability_group=M.availability_group||{},M.availability_group.form=e.Object(M.core_availability.plugin),M.availability_group.form.groups=null,M.availability_group.form.initInner=function(e){this.groups=e},M.availability_group.form.getNode=function(t){var n="<label>"+M.util.get_string("title","availability_group")+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>"+'<option value="any">'+M.util.get_string("anygroup","availability_group")+"</option>";for(var r=0;r<this.groups.length;r++){var i=this.groups[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create("<span>"+n+"</span>");t.creating===undefined&&(t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")?s.one("select[name=id]").set("value",""+t.id):t.id===undefined&&s.one("select[name=id]").set("value","any"));if(!M.availability_group.form.addedEvents){M.availability_group.form.addedEvents=!0;var o=e.one("#fitem_id_availabilityconditionsjson");o.delegate("change",function(){M.core_availability.form.update()},".availability_group select")}return s},M.availability_group.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":n!=="any"&&(e.id=parseInt(n,10))},M.availability_group.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id&&n.id==="choose"&&e.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_group-form",function(e,t){M.availability_group=M.availability_group||{},M.availability_group.form=e.Object(M.core_availability.plugin),M.availability_group.form.groups=null,M.availability_group.form.initInner=function(e){this.groups=e},M.availability_group.form.getNode=function(t){var n="<label>"+M.util.get_string("title","availability_group")+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>"+'<option value="any">'+M.util.get_string("anygroup","availability_group")+"</option>";for(var r=0;r<this.groups.length;r++){var i=this.groups[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create("<span>"+n+"</span>");t.creating===undefined&&(t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")?s.one("select[name=id]").set("value",""+t.id):t.id===undefined&&s.one("select[name=id]").set("value","any"));if(!M.availability_group.form.addedEvents){M.availability_group.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_group select")}return s},M.availability_group.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":n!=="any"&&(e.id=parseInt(n,10))},M.availability_group.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id&&n.id==="choose"&&e.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -58,7 +58,7 @@ M.availability_group.form.getNode = function(json) {
// Add event handlers (first time only).
if (!M.availability_group.form.addedEvents) {
M.availability_group.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// Just update the form fields.
M.core_availability.form.update();
+1 -1
View File
@@ -56,7 +56,7 @@ M.availability_group.form.getNode = function(json) {
// Add event handlers (first time only).
if (!M.availability_group.form.addedEvents) {
M.availability_group.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// Just update the form fields.
M.core_availability.form.update();
@@ -53,7 +53,7 @@ M.availability_grouping.form.getNode = function(json) {
// Add event handlers (first time only).
if (!M.availability_grouping.form.addedEvents) {
M.availability_grouping.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// Just update the form fields.
M.core_availability.form.update();
@@ -1 +1 @@
YUI.add("moodle-availability_grouping-form",function(e,t){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=e.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(e){this.groupings=e},M.availability_grouping.form.getNode=function(t){var n="<label>"+M.util.get_string("title","availability_grouping")+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.groupings.length;r++){var i=this.groupings[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create("<span>"+n+"</span>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id);if(!M.availability_grouping.form.addedEvents){M.availability_grouping.form.addedEvents=!0;var o=e.one("#fitem_id_availabilityconditionsjson");o.delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")}return s},M.availability_grouping.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":e.id=parseInt(n,10)},M.availability_grouping.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id==="choose"&&e.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_grouping-form",function(e,t){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=e.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(e){this.groupings=e},M.availability_grouping.form.getNode=function(t){var n="<label>"+M.util.get_string("title","availability_grouping")+' <span class="availability-group">'+'<select name="id">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>";for(var r=0;r<this.groupings.length;r++){var i=this.groupings[r];n+='<option value="'+i.id+'">'+i.name+"</option>"}n+="</select></span></label>";var s=e.Node.create("<span>"+n+"</span>");t.id!==undefined&&s.one("select[name=id] > option[value="+t.id+"]")&&s.one("select[name=id]").set("value",""+t.id);if(!M.availability_grouping.form.addedEvents){M.availability_grouping.form.addedEvents=!0;var o=e.one(".availability-field");o.delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")}return s},M.availability_grouping.form.fillValue=function(e,t){var n=t.one("select[name=id]").get("value");n==="choose"?e.id="choose":e.id=parseInt(n,10)},M.availability_grouping.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id==="choose"&&e.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -53,7 +53,7 @@ M.availability_grouping.form.getNode = function(json) {
// Add event handlers (first time only).
if (!M.availability_grouping.form.addedEvents) {
M.availability_grouping.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// Just update the form fields.
M.core_availability.form.update();
+1 -1
View File
@@ -51,7 +51,7 @@ M.availability_grouping.form.getNode = function(json) {
// Add event handlers (first time only).
if (!M.availability_grouping.form.addedEvents) {
M.availability_grouping.form.addedEvents = true;
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
// Just update the form fields.
M.core_availability.form.update();
@@ -91,7 +91,7 @@ M.availability_profile.form.getNode = function(json) {
ancestorNode.one('input[name=value]').set('disabled', novalue);
M.core_availability.form.update();
};
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
updateForm(this);
}, '.availability_profile select');
@@ -1 +1 @@
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n='<span class="availability-group"><label>'+M.util.get_string("conditiontitle","availability_profile")+" "+'<select name="field">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>",r;for(var i=0;i<this.standardFields.length;i++)r=this.standardFields[i],n+='<option value="sf_'+r.field+'">'+r.display+"</option>";for(i=0;i<this.customFields.length;i++)r=this.customFields[i],n+='<option value="cf_'+r.field+'">'+r.display+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_operator","availability_profile")+' </span><select name="op" title="'+M.util.get_string("label_operator","availability_profile")+'">';var s=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(i=0;i<s.length;i++)n+='<option value="'+s[i]+'">'+M.util.get_string("op_"+s[i],"availability_profile")+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_value","availability_profile")+'</span><input name="value" type="text" style="width: 10em" title="'+M.util.get_string("label_value","availability_profile")+'"/></label></span>';var o=e.Node.create("<span>"+n+"</span>");t.sf!==undefined&&o.one("select[name=field] > option[value=sf_"+t.sf+"]")?o.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&o.one("select[name=field] > option[value=cf_"+t.cf+"]")&&o.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&o.one("select[name=op] > option[value="+t.op+"]")&&(o.one("select[name=op]").set("value",t.op),(t.op==="isempty"||t.op==="isnotempty")&&o.one("input[name=value]").set("disabled",!0)),t.v!==undefined&&o.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var u=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},a=e.one("#fitem_id_availabilityconditionsjson");a.delegate("change",function(){u(this)},".availability_profile select"),a.delegate("change",function(){u(this)},".availability_profile input[name=value]")}return o},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n='<span class="availability-group"><label>'+M.util.get_string("conditiontitle","availability_profile")+" "+'<select name="field">'+'<option value="choose">'+M.util.get_string("choosedots","moodle")+"</option>",r;for(var i=0;i<this.standardFields.length;i++)r=this.standardFields[i],n+='<option value="sf_'+r.field+'">'+r.display+"</option>";for(i=0;i<this.customFields.length;i++)r=this.customFields[i],n+='<option value="cf_'+r.field+'">'+r.display+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_operator","availability_profile")+' </span><select name="op" title="'+M.util.get_string("label_operator","availability_profile")+'">';var s=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(i=0;i<s.length;i++)n+='<option value="'+s[i]+'">'+M.util.get_string("op_"+s[i],"availability_profile")+"</option>";n+='</select></label> <label><span class="accesshide">'+M.util.get_string("label_value","availability_profile")+'</span><input name="value" type="text" style="width: 10em" title="'+M.util.get_string("label_value","availability_profile")+'"/></label></span>';var o=e.Node.create("<span>"+n+"</span>");t.sf!==undefined&&o.one("select[name=field] > option[value=sf_"+t.sf+"]")?o.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&o.one("select[name=field] > option[value=cf_"+t.cf+"]")&&o.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&o.one("select[name=op] > option[value="+t.op+"]")&&(o.one("select[name=op]").set("value",t.op),(t.op==="isempty"||t.op==="isnotempty")&&o.one("input[name=value]").set("disabled",!0)),t.v!==undefined&&o.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var u=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},a=e.one(".availability-field");a.delegate("change",function(){u(this)},".availability_profile select"),a.delegate("change",function(){u(this)},".availability_profile input[name=value]")}return o},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -91,7 +91,7 @@ M.availability_profile.form.getNode = function(json) {
ancestorNode.one('input[name=value]').set('disabled', novalue);
M.core_availability.form.update();
};
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
updateForm(this);
}, '.availability_profile select');
+1 -1
View File
@@ -89,7 +89,7 @@ M.availability_profile.form.getNode = function(json) {
ancestorNode.one('input[name=value]').set('disabled', novalue);
M.core_availability.form.update();
};
var root = Y.one('#fitem_id_availabilityconditionsjson');
var root = Y.one('.availability-field');
root.delegate('change', function() {
updateForm(this);
}, '.availability_profile select');
@@ -1154,4 +1154,14 @@ M.core_availability.DeleteIcon = function(toDelete) {
M.core_availability.DeleteIcon.prototype.span = null;
}, '@VERSION@', {"requires": ["base", "node", "event", "panel", "moodle-core-notification-dialogue", "json"]});
}, '@VERSION@', {
"requires": [
"base",
"node",
"event",
"event-delegate",
"panel",
"moodle-core-notification-dialogue",
"json"
]
});
File diff suppressed because one or more lines are too long
@@ -1154,4 +1154,14 @@ M.core_availability.DeleteIcon = function(toDelete) {
M.core_availability.DeleteIcon.prototype.span = null;
}, '@VERSION@', {"requires": ["base", "node", "event", "panel", "moodle-core-notification-dialogue", "json"]});
}, '@VERSION@', {
"requires": [
"base",
"node",
"event",
"event-delegate",
"panel",
"moodle-core-notification-dialogue",
"json"
]
});
+1
View File
@@ -4,6 +4,7 @@
"base",
"node",
"event",
"event-delegate",
"panel",
"moodle-core-notification-dialogue",
"json"
+2 -2
View File
@@ -31,7 +31,7 @@ Feature: Award badges
And I press "Enable access"
And I press "Continue"
And I click on "Admin User" "link"
And I follow "Profile" in the open menu
And I choose "Profile" in the open action menu
And I follow "Edit profile"
And I expand all fieldsets
And I set the field "Phone" to "123456789"
@@ -204,7 +204,7 @@ Feature: Award badges
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
And I press "Create badge"
And I set the field "type" to "Course completion"
And I set the field with xpath "//fieldset/input[1]" to "0"
And I set the field with xpath ".//*[contains(., 'Minimum grade required')]/ancestor::*[contains(concat(' ', @class, ' '), ' fitem ')]//input[1]" to "0"
And I press "Save"
And I press "Enable access"
When I press "Continue"
@@ -94,7 +94,7 @@ class behat_block_comments extends behat_base {
// Using xpath liternal to avoid possible problems with comments containing quotes.
$commentliteral = behat_context_helper::escape($comment);
$commentxpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' block_comments ')]" .
$commentxpath = "//*[contains(concat(' ', normalize-space(@class), ' '), ' block_comments ')]" .
"/descendant::div[@class='comment-message'][contains(., $commentliteral)]";
$commentnode = $this->find('xpath', $commentxpath, $exception);
@@ -35,7 +35,7 @@ Feature: Course summary block used in a course
And I turn editing mode on
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
And I should see "Course summary" in the "Course summary" "block"
And I click on "Edit" "link" in the "Course summary" "block"
And I click on ".editbutton a" "css_element" in the "Course summary" "block"
Then I should see "Edit course settings" in the "h2" "css_element"
Scenario: Teacher can not see edit icon when edit mode is off
@@ -26,7 +26,7 @@ Feature: Course summary block used on the frontpage
And I follow "Turn editing on"
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And I should not see "Course summary" in the "Course/site summary" "block"
And I click on "Edit" "link" in the "Course/site summary" "block"
And I click on ".editbutton a" "css_element" in the "Course/site summary" "block"
Then I should see "Front page settings" in the "h2" "css_element"
Scenario: Admin can not see edit icon when edit mode is off
@@ -151,6 +151,7 @@ Feature: View structural changes in recent activity block
Then I should see "Added Forum" in the "Recent activity" "block"
And I should see "ForumNew" in the "Recent activity" "block"
And I log out
And I wait "1" seconds
And I log in as "student1"
And I follow "Course 1"
And I should see "Added Forum" in the "Recent activity" "block"
@@ -158,6 +159,7 @@ Feature: View structural changes in recent activity block
And I log out
# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
And I wait "1" seconds
# Update forum as a teacher
And I log in as "teacher1"
And I follow "Course 1"
And I follow "ForumNew"
@@ -166,6 +168,7 @@ Feature: View structural changes in recent activity block
| name | ForumUpdated |
And I press "Save and return to course"
And I log out
And I wait "1" seconds
# Student 1 already saw that forum was created, now he can see that forum was updated
And I log in as "student1"
And I follow "Course 1"
@@ -174,6 +177,7 @@ Feature: View structural changes in recent activity block
And I should see "Updated Forum" in the "Recent activity" "block"
And I should see "ForumUpdated" in the "Recent activity" "block"
And I log out
And I wait "1" seconds
# Student 2 has bigger interval and he can see one entry that forum was created but with the new name
And I log in as "student2"
And I follow "Course 1"
@@ -182,12 +186,14 @@ Feature: View structural changes in recent activity block
And I should not see "Updated Forum" in the "Recent activity" "block"
And I should see "ForumUpdated" in the "Recent activity" "block"
And I log out
And I wait "1" seconds
# Delete forum as a teacher
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I delete "ForumUpdated" activity
And I log out
And I wait "1" seconds
# Students 1 and 2 see that forum was deleted
And I log in as "student1"
And I follow "Course 1"
@@ -197,6 +203,7 @@ Feature: View structural changes in recent activity block
And I should not see "ForumUpdated" in the "Recent activity" "block"
And I should see "Deleted Forum" in the "Recent activity" "block"
And I log out
And I wait "1" seconds
# Student 3 never knew that forum was created, so he does not see anything
And I log in as "student3"
And I follow "Course 1"
@@ -11,7 +11,7 @@ Feature: Edit activities in main menu block
And I navigate to "Turn editing on" node in "Front page settings"
When I add a "Forum" to section "0" and I fill the form with:
| Forum name | My forum name |
And I click on "Edit title" "link" in the "//div[contains(@class,'block_site_main_menu')]//li[contains(.,'My forum name')]" "xpath_element"
And I click on "Edit title" "link" in the "//*[contains(@class,'block_site_main_menu')]//li[contains(.,'My forum name')]" "xpath_element"
And I set the field "New name for activity My forum name" to "New forum name"
And I press key "13" in the field "New name for activity My forum name"
Then I should not see "My forum name"
@@ -21,7 +21,7 @@ Feature: Edit activities in social activities block
And I set the field "Add an activity to section 'section 0'" to "Forum"
And I set the field "Forum name" to "My forum name"
And I press "Save and return to course"
And I click on "Edit title" "link" in the "//div[contains(@class,'block_social_activities')]//li[contains(.,'My forum name')]" "xpath_element"
And I click on "Edit title" "link" in the "//*[contains(@class,'block_social_activities')]//li[contains(.,'My forum name')]" "xpath_element"
And I set the field "New name for activity My forum name" to "New forum name"
And I press key "13" in the field "New name for activity My forum name"
Then I should not see "My forum name" in the "Social activities" "block"
@@ -46,7 +46,7 @@ Feature: Add and configure blocks throughout the site
And I press "Save changes"
And I follow "Course 1"
# The first block matching the pattern should be top-left block
And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]" "xpath_element"
And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' block ')]" "xpath_element"
Scenario: Blocks on the dashboard page can have roles assigned to them
Given I log in as "manager1"
+1 -9
View File
@@ -52,7 +52,7 @@ Feature: Block appearances
And I follow "Test survey name"
And I should not see "Comments"
Scenario: Block settings can be modified so that a block can be hidden or moved
Scenario: Block settings can be modified so that a block can be hidden
When I follow "Test book name"
And I configure the "Comments" block
And I set the following fields to these values:
@@ -61,11 +61,3 @@ Feature: Block appearances
And I follow "Turn editing off"
And I follow "Test book name"
Then I should not see "Comments"
And I expand "Course administration" node
And I follow "Turn editing on"
And I configure the "Comments" block
And I set the following fields to these values:
| Visible | Yes |
| Region | Right |
And I press "Save changes"
And I should see "Comments" in the "//*[@id='region-post' or @id='block-region-side-post']" "xpath_element"
+49
View File
@@ -0,0 +1,49 @@
@core @core_block
Feature: Block region moving
In order to configure blocks appearance
As a teacher
I need to modify block region for the page
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I follow "Turn editing on"
And I add a "Survey" to section "1" and I fill the form with:
| Name | Test survey name |
| Survey type | ATTLS (20 item version) |
| Description | Test survey description |
And I add a "Book" to section "1" and I fill the form with:
| Name | Test book name |
| Description | Test book description |
And I follow "Test book name"
And I set the following fields to these values:
| Chapter title | Book title |
| Content | Book content test test |
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Turn editing on"
And I add the "Comments" block
And I configure the "Comments" block
And I set the following fields to these values:
| Display on page types | Any page |
And I press "Save changes"
Scenario: Block settings can be modified so that a block can be moved
When I follow "Test book name"
And I configure the "Comments" block
And I set the following fields to these values:
| Region | Right |
And I press "Save changes"
And I should see "Comments" in the "//*[@id='region-post' or @id='block-region-side-post']" "xpath_element"
+6
View File
@@ -369,6 +369,12 @@ class core_course_management_renderer extends plugin_renderer_base {
return $this->render($menu);
}
public function render_action_menu($menu) {
global $OUTPUT;
return $OUTPUT->render($menu);
}
/**
* Renders bulk actions for categories.
*
+2 -2
View File
@@ -39,7 +39,7 @@ Feature: Course activity controls works as expected
And I should see "Turn editing on"
And "Turn editing on" "button" should exist
And I turn editing mode on
And I click on "Actions" "link" in the "Recent activity" "block"
And I open the action menu in "Recent activity" "block"
And I click on "Delete Recent activity block" "link"
And I press "Yes"
And <belowpage> "section" <should_see_other_sections> exist
@@ -119,7 +119,7 @@ Feature: Course activity controls works as expected
And I should see "Turn editing on"
And "Turn editing on" "button" should exist
And I turn editing mode on
And I click on "Actions" "link" in the "Recent activity" "block"
And I open the action menu in "Recent activity" "block"
And I click on "Delete Recent activity block" "link"
And I press "Yes"
And <belowpage> "section" <should_see_other_sections> exist
+1 -1
View File
@@ -172,4 +172,4 @@ Feature: Test we can resort course in the management interface.
And I click to move course "C3" up one
And a new page should not have loaded since I started watching
And I should see course listing "Course 2" before "Course 3"
And I should see course listing "Course 3" before "Course 1"
And I should see course listing "Course 3" before "Course 1"
@@ -113,8 +113,8 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
moveup.next('br').remove();
}
if (moveup.ancestor('.section_action_menu')) {
moveup.ancestor('li').remove();
if (moveup.ancestor('.section_action_menu') && moveup.ancestor().get('nodeName').toLowerCase() == 'li') {
moveup.ancestor().remove();
} else {
moveup.remove();
}
@@ -126,8 +126,9 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
movedown.next('br').remove();
}
if (movedown.ancestor('.section_action_menu')) {
movedown.ancestor('li').remove();
var movedownParentType = movedown.ancestor().get('nodeName').toLowerCase();
if (movedown.ancestor('.section_action_menu') && movedownParentType == 'li') {
movedown.ancestor().remove();
} else {
movedown.remove();
}
File diff suppressed because one or more lines are too long
@@ -113,8 +113,8 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
moveup.next('br').remove();
}
if (moveup.ancestor('.section_action_menu')) {
moveup.ancestor('li').remove();
if (moveup.ancestor('.section_action_menu') && moveup.ancestor().get('nodeName').toLowerCase() == 'li') {
moveup.ancestor().remove();
} else {
moveup.remove();
}
@@ -126,8 +126,9 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
movedown.next('br').remove();
}
if (movedown.ancestor('.section_action_menu')) {
movedown.ancestor('li').remove();
var movedownParentType = movedown.ancestor().get('nodeName').toLowerCase();
if (movedown.ancestor('.section_action_menu') && movedownParentType == 'li') {
movedown.ancestor().remove();
} else {
movedown.remove();
}
@@ -10,7 +10,7 @@ var CSS = {
PAGECONTENT: 'body',
SECTION: null,
SECTIONMODCHOOSER: 'span.section-modchooser-link',
SITEMENU: 'div.block_site_main_menu',
SITEMENU: '.block_site_main_menu',
SITETOPIC: 'div.sitetopic'
};
@@ -1 +1 @@
YUI.add("moodle-course-modchooser",function(e,t){var n={PAGECONTENT:"body",SECTION:null,SECTIONMODCHOOSER:"span.section-modchooser-link",SITEMENU:"div.block_site_main_menu",SITETOPIC:"div.sitetopic"},r="course-modchooser",i=function(){i.superclass.constructor.apply(this,arguments)};e.extend(i,M.core.chooserdialogue,{sectionid:null,initializer:function(){var t=M.course.format.get_sectionwrapperclass();t&&(n.SECTION="."+t);var r=e.one(".chooserdialoguebody"),i=e.one(".choosertitle"),s={};this.setup_chooser_dialogue(r,i,s),this.setup_for_section(),M.course.coursebase.register_module(this)},setup_for_section:function(t){t||(t=n.PAGECONTENT),e.one(t).all(n.SITETOPIC).each(function(e){this._setup_for_section(e)},this),n.SECTION&&e.one(t).all(n.SECTION).each(function(e){this._setup_for_section(e)},this),e.one(t).all(n.SITEMENU).each(function(e){this._setup_for_section(e)},this)},_setup_for_section:function(t){var r=t.one(n.SECTIONMODCHOOSER);if(!r)return;var i=e.Node.create("<a href='#' />");r.get("children").each(function(e){i.appendChild(e)}),r.insertBefore(i),i.on("click",this.display_mod_chooser,this)},display_mod_chooser:function(e){if(e.target.ancestor(n.SITETOPIC))this.sectionid=1;else if(e.target.ancestor(n.SECTION)){var t=e.target.ancestor(n.SECTION);this.sectionid=t.get("id").replace("section-","")}else e.target.ancestor(n.SITEMENU)&&(this.sectionid=0);this.display_chooser(e)},option_selected:function(e){this.hiddenRadioValue.setAttrs({name:"jump",value:e.get("value")+"&section="+this.sectionid})}},{NAME:r,ATTRS:{maxheight:{value:800}}}),M.course=M.course||{},M.course.init_chooser=function(e){return new i(e)}},"@VERSION@",{requires:["moodle-core-chooserdialogue","moodle-course-coursebase"]});
YUI.add("moodle-course-modchooser",function(e,t){var n={PAGECONTENT:"body",SECTION:null,SECTIONMODCHOOSER:"span.section-modchooser-link",SITEMENU:".block_site_main_menu",SITETOPIC:"div.sitetopic"},r="course-modchooser",i=function(){i.superclass.constructor.apply(this,arguments)};e.extend(i,M.core.chooserdialogue,{sectionid:null,initializer:function(){var t=M.course.format.get_sectionwrapperclass();t&&(n.SECTION="."+t);var r=e.one(".chooserdialoguebody"),i=e.one(".choosertitle"),s={};this.setup_chooser_dialogue(r,i,s),this.setup_for_section(),M.course.coursebase.register_module(this)},setup_for_section:function(t){t||(t=n.PAGECONTENT),e.one(t).all(n.SITETOPIC).each(function(e){this._setup_for_section(e)},this),n.SECTION&&e.one(t).all(n.SECTION).each(function(e){this._setup_for_section(e)},this),e.one(t).all(n.SITEMENU).each(function(e){this._setup_for_section(e)},this)},_setup_for_section:function(t){var r=t.one(n.SECTIONMODCHOOSER);if(!r)return;var i=e.Node.create("<a href='#' />");r.get("children").each(function(e){i.appendChild(e)}),r.insertBefore(i),i.on("click",this.display_mod_chooser,this)},display_mod_chooser:function(e){if(e.target.ancestor(n.SITETOPIC))this.sectionid=1;else if(e.target.ancestor(n.SECTION)){var t=e.target.ancestor(n.SECTION);this.sectionid=t.get("id").replace("section-","")}else e.target.ancestor(n.SITEMENU)&&(this.sectionid=0);this.display_chooser(e)},option_selected:function(e){this.hiddenRadioValue.setAttrs({name:"jump",value:e.get("value")+"&section="+this.sectionid})}},{NAME:r,ATTRS:{maxheight:{value:800}}}),M.course=M.course||{},M.course.init_chooser=function(e){return new i(e)}},"@VERSION@",{requires:["moodle-core-chooserdialogue","moodle-course-coursebase"]});
@@ -10,7 +10,7 @@ var CSS = {
PAGECONTENT: 'body',
SECTION: null,
SECTIONMODCHOOSER: 'span.section-modchooser-link',
SITEMENU: 'div.block_site_main_menu',
SITEMENU: '.block_site_main_menu',
SITETOPIC: 'div.sitetopic'
};
+5 -4
View File
@@ -81,8 +81,8 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
moveup.next('br').remove();
}
if (moveup.ancestor('.section_action_menu')) {
moveup.ancestor('li').remove();
if (moveup.ancestor('.section_action_menu') && moveup.ancestor().get('nodeName').toLowerCase() == 'li') {
moveup.ancestor().remove();
} else {
moveup.remove();
}
@@ -94,8 +94,9 @@ Y.extend(DRAGSECTION, M.core.dragdrop, {
movedown.next('br').remove();
}
if (movedown.ancestor('.section_action_menu')) {
movedown.ancestor('li').remove();
var movedownParentType = movedown.ancestor().get('nodeName').toLowerCase();
if (movedown.ancestor('.section_action_menu') && movedownParentType == 'li') {
movedown.ancestor().remove();
} else {
movedown.remove();
}
+1 -1
View File
@@ -8,7 +8,7 @@ var CSS = {
PAGECONTENT: 'body',
SECTION: null,
SECTIONMODCHOOSER: 'span.section-modchooser-link',
SITEMENU: 'div.block_site_main_menu',
SITEMENU: '.block_site_main_menu',
SITETOPIC: 'div.sitetopic'
};
-1
View File
@@ -128,7 +128,6 @@ class grade_edit_tree {
$moveaction = '';
$actionsmenu = new action_menu();
$actionsmenu->initialise_js($PAGE);
$actionsmenu->set_menu_trigger(get_string('edit'));
$actionsmenu->set_owner_selector('grade-item-' . $eid);
$actionsmenu->set_alignment(action_menu::TL, action_menu::BL);
@@ -82,8 +82,8 @@ Feature: We can bulk insert grades for students in a course
And I press "Ok"
And I follow "Edit settings"
And I follow "View gradebook"
And I click on "input[title='Dock Navigation block']" "css_element"
And I click on "input[title='Dock Administration block']" "css_element"
# And I click on "input[title='Dock Navigation block']" "css_element"
# And I click on "input[title='Dock Administration block']" "css_element"
And I follow "Single view for Test assignment two"
And I select "Student 1" from the "Select user..." singleselect
Then the field "Grade for Test assignment two" matches value "50.00"
@@ -162,4 +162,4 @@ Feature: Calculated grade items can be used in the gradebook
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
| grade item 1 | 71.43 % | 65.00 | 0100 | 65.00 % | 46.43 % |
| calc item | 28.57 % | 32.50 | 040 | 81.25 % | 23.21 % |
| Course total | - | 97.50 | 0140 | 69.64 % | - |
| Course total | - | 97.50 | 0140 | 69.64 % | - |
@@ -163,4 +163,4 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
| grade item 1 | 50.00 % | 65.00 | 0100 | 65.00 % | 32.50 % |
| calc item | 50.00 % | 32.50 | 0100 | 32.50 % | 16.25 % |
| Course total | - | 97.50 | 0200 | 48.75 % | - |
| Course total | - | 97.50 | 0200 | 48.75 % | - |
@@ -77,7 +77,7 @@ Feature: Editing a grade item
And I click on "Edit" "link" in the "Cat 1" "table_row"
When I click on "Edit settings" "link" in the "Cat 1" "table_row"
Then I should see "This category has associated grade items which have been overridden. Therefore some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'fstatic') and contains(text(), 'Value')]" "xpath_element" should exist
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'Value')]" "xpath_element" should exist
Scenario: Attempting to change a category item's scale when overridden grades already exist
Given I click on "Edit" "link" in the "Cat 1" "table_row"
@@ -93,7 +93,7 @@ Feature: Editing a grade item
And I click on "Edit" "link" in the "Cat 1" "table_row"
When I click on "Edit settings" "link" in the "Cat 1" "table_row"
Then I should see "This category has associated grade items which have been overridden. Therefore some grades have already been awarded, so the grade type and scale cannot be changed."
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'fstatic') and contains(text(), 'ABCDEF')]" "xpath_element" should exist
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'ABCDEF')]" "xpath_element" should exist
Scenario: Attempting to change a category item's maximum grade when no rescaling option has been chosen
Given I navigate to "Grader report" node in "Grade administration"
@@ -62,7 +62,7 @@ Feature: Editing a grade item
And I click on "Edit" "link" in the "MI 1" "table_row"
When I click on "Edit settings" "link" in the "MI 1" "table_row"
Then I should see "Some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'fstatic') and contains(text(), 'Value')]" "xpath_element" should exist
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'Value')]" "xpath_element" should exist
Scenario: Attempting to change a manual item's scale when grades already exist
Given I click on "Edit" "link" in the "MI 1" "table_row"
@@ -78,7 +78,7 @@ Feature: Editing a grade item
And I click on "Edit" "link" in the "MI 1" "table_row"
When I click on "Edit settings" "link" in the "MI 1" "table_row"
Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed."
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'fstatic') and contains(text(), 'ABCDEF')]" "xpath_element" should exist
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'ABCDEF')]" "xpath_element" should exist
Scenario: Attempting to change a manual item's maximum grade when no rescaling option has been chosen
Given I navigate to "Grader report" node in "Grade administration"
@@ -40,4 +40,4 @@ Feature: We can customise the letter boundary of a course.
And I press "Turn editing off"
Then the following should exist in the "user-grades" table:
| -1- | -4- | -5- |
| Student 1 | D | D |
| Student 1 | D | D |
@@ -41,4 +41,4 @@ Feature: We can customise the letter boundary of a course.
And I press "Turn editing off"
Then the following should exist in the "user-grades" table:
| -1- | -4- | -5- |
| Student 1 | F | F |
| Student 1 | F | F |
+2 -2
View File
@@ -134,8 +134,8 @@ Feature: We can set the grade to pass value
| Submission grade to pass | 90 |
| gradinggrade | 20 |
| Assessment grade to pass | 30 |
Then "The grade to pass can not be greater than the maximum possible grade 80" "text" should exist in the "#fitem_id_submissiongradepass .error" "css_element"
Then "The grade to pass can not be greater than the maximum possible grade 20" "text" should exist in the "#fitem_id_gradinggradepass .error" "css_element"
Then "The grade to pass can not be greater than the maximum possible grade 80" "text" should exist in the "Submission grade to pass" "form_row"
Then "The grade to pass can not be greater than the maximum possible grade 20" "text" should exist in the "Assessment grade to pass" "form_row"
Scenario: Set a valid grade to pass for quiz activity
When I turn editing mode on
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -6
View File
@@ -248,25 +248,23 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
areaid, collid, isenabled;
if (ajaxreturn.component === 'core_tag' && ajaxreturn.itemtype === 'tagareaenable') {
areaid = $(this).attr('data-itemid');
$(".tag-collections-table ul[data-collectionid] li[data-areaid=" + areaid + "]").addClass('hidden');
$(".tag-collections-table ul[data-collectionid] li[data-areaid=" + areaid + "]").hide();
isenabled = ajaxreturn.value;
if (isenabled === '1') {
$(this).closest('tr').removeClass('dimmed_text');
collid = $(this).closest('tr').find('[data-itemtype="tagareacollection"]').attr("data-value");
$(".tag-collections-table ul[data-collectionid=" + collid + "] li[data-areaid=" + areaid + "]")
.removeClass('hidden');
$(".tag-collections-table ul[data-collectionid=" + collid + "] li[data-areaid=" + areaid + "]").show();
} else {
$(this).closest('tr').addClass('dimmed_text');
}
}
if (ajaxreturn.component === 'core_tag' && ajaxreturn.itemtype === 'tagareacollection') {
areaid = $(this).attr('data-itemid');
$(".tag-collections-table ul[data-collectionid] li[data-areaid=" + areaid + "]").addClass('hidden');
$(".tag-collections-table ul[data-collectionid] li[data-areaid=" + areaid + "]").hide();
collid = $(this).attr('data-value');
isenabled = $(this).closest('tr').find('[data-itemtype="tagareaenable"]').attr("data-value");
if (isenabled === "1") {
$(".tag-collections-table ul[data-collectionid=" + collid + "] li[data-areaid=" + areaid + "]")
.removeClass('hidden');
$(".tag-collections-table ul[data-collectionid=" + collid + "] li[data-areaid=" + areaid + "]").show();
}
}
});
+4
View File
@@ -783,6 +783,10 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
// Getting the debugging info and the backtrace.
$errorinfoboxes = $this->getSession()->getPage()->findAll('css', 'div.alert-error');
// If errorinfoboxes is empty, try find alert-danger (bootstrap4) class.
if (empty($errorinfoboxes)) {
$errorinfoboxes = $this->getSession()->getPage()->findAll('css', 'div.alert-danger');
}
// If errorinfoboxes is empty, try find notifytiny (original) class.
if (empty($errorinfoboxes)) {
$errorinfoboxes = $this->getSession()->getPage()->findAll('css', 'div.notifytiny');
+11 -4
View File
@@ -204,7 +204,6 @@ class behat_field_manager {
// We already waited when getting the NodeElement and we don't want an exception if it's not part of a moodleform.
$parentformfound = $fieldnode->find('xpath',
"/ancestor::fieldset" .
"/ancestor::form[contains(concat(' ', normalize-space(@class), ' '), ' mform ')]"
);
@@ -228,11 +227,19 @@ class behat_field_manager {
return 'availability';
}
// We look for a parent node with 'felement' class or data-fieldtype attribute.
if ($fieldtype = $fieldnode->getParent()->getAttribute('data-fieldtype')) {
return $fieldtype;
if ($fieldnode->getTagName() == 'html') {
return false;
}
// If the type is explictly set on the element pointed to by the label - use it.
if ($type = $fieldnode->getParent()->getAttribute('data-fieldtype')) {
if ($type == 'tags') {
return 'autocomplete';
}
return $type;
}
// We look for a parent node with 'felement' class.
if ($class = $fieldnode->getParent()->getAttribute('class')) {
if (strstr($class, 'felement') != false) {
+3 -2
View File
@@ -124,9 +124,10 @@ class behat_files extends behat_base {
if ($filemanagerelement) {
$containernode = $this->get_filepicker_node($filemanagerelement);
$exceptionmsg = 'The "'.$filemanagerelement.'" filemanager ' . $exceptionmsg;
$locatorprefix = "//div[@class='fp-content']";
$locatorprefix = "//div[contains(concat(' ', normalize-space(@class), ' '), ' fp-content ')]";
} else {
$locatorprefix = "//div[contains(concat(' ', normalize-space(@class), ' '), ' fp-repo-items ')]//descendant::div[@class='fp-content']";
$locatorprefix = "//div[contains(concat(' ', normalize-space(@class), ' '), ' fp-repo-items ')]" .
"//descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' fp-content ')]";
}
$exception = new ExpectationException($exceptionmsg, $this->getSession());
+10 -6
View File
@@ -50,6 +50,7 @@ class behat_selectors {
'table' => 'table',
'table_row' => 'table_row',
'xpath_element' => 'xpath_element',
'form_row' => 'form_row'
);
/**
@@ -79,7 +80,8 @@ class behat_selectors {
'table' => 'table',
'table_row' => 'table_row',
'text' => 'text',
'xpath_element' => 'xpath_element'
'xpath_element' => 'xpath_element',
'form_row' => 'form_row'
);
/**
@@ -95,10 +97,9 @@ class behat_selectors {
.//li[contains(concat(' ', normalize-space(@class), ' '), ' activity ')][normalize-space(.) = %locator% ]
XPATH
, 'block' => <<<XPATH
.//div[contains(concat(' ', normalize-space(@class), ' '), ' block ') and
(contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' ')) or
descendant::h2[normalize-space(.) = %locator%] or
@aria-label = %locator%)]
.//*[@data-block][contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' ')) or
descendant::*[self::h2|self::h3][normalize-space(.) = %locator%] or
@aria-label = %locator%]
XPATH
, 'dialogue' => <<<XPATH
.//div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue ') and
@@ -109,7 +110,7 @@ XPATH
normalize-space(descendant::div[@class='hd']) = %locator%]
XPATH
, 'filemanager' => <<<XPATH
.//div[@data-fieldtype = 'filemanager']
.//*[@data-fieldtype = 'filemanager' or @data-fieldtype = 'filepicker']
/descendant::input[@id = //label[contains(normalize-space(string(.)), %locator%)]/@for]
XPATH
, 'list_item' => <<<XPATH
@@ -137,6 +138,9 @@ XPATH
XPATH
, 'text' => <<<XPATH
.//*[contains(., %locator%) and not(.//*[contains(., %locator%)])]
XPATH
, 'form_row' => <<<XPATH
.//label[contains(., %locator%)]/ancestor::*[contains(concat(' ', @class, ' '), ' fitem ')]
XPATH
);
@@ -69,7 +69,8 @@ class behat_form_filemanager extends behat_form_field {
// Get the name of the current directory elements.
$xpath = "//label[contains(., '" . $fieldlabel . "')]" .
"/ancestor::div[@data-fieldtype = 'filemanager']" .
"/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' fitem ')]" .
"/descendant::div[@data-fieldtype = 'filemanager']" .
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' fp-filename ')]";
// We don't need to wait here, also we don't have access to protected
+13 -1
View File
@@ -41,7 +41,9 @@ require_once('templatable_form_element.php');
*/
class MoodleQuickForm_advcheckbox extends HTML_QuickForm_advcheckbox implements templatable {
use templatable_form_element;
use templatable_form_element {
export_for_template as export_for_template_base;
}
/** @var string html for help button, if empty then no help will icon will be dispalyed. */
var $_helpbutton='';
@@ -134,4 +136,14 @@ class MoodleQuickForm_advcheckbox extends HTML_QuickForm_advcheckbox implements
}
return $output;
}
public function export_for_template(renderer_base $output) {
$context = $this->export_for_template_base($output);
$context['selectedvalue'] = $this->_values[1];
$context['deselectedvalue'] = $this->_values[0];
return $context;
}
}
+3 -3
View File
@@ -210,11 +210,11 @@ class MoodleQuickForm_autocomplete extends MoodleQuickForm_select {
$this->_generateId();
$context = parent::export_for_template($output);
$context['tags'] = $this->tags;
$context['tags'] = !empty($this->tags);
$context['ajax'] = $this->ajax;
$context['placeholder'] = $this->placeholder;
$context['casesensitive'] = $this->casesensitive;
$context['showsuggestions'] = $this->showsuggestions;
$context['casesensitive'] = !empty($this->casesensitive);
$context['showsuggestions'] = !empty($this->showsuggestions);
$context['noselectionstring'] = $this->noselectionstring;
return $context;
-8
View File
@@ -110,12 +110,4 @@ class MoodleQuickForm_cancel extends MoodleQuickForm_submit
return HTML_QuickForm_submit::getFrozenHtml();
}
/**
* Freeze the element so that only its value is returned
*
* @return bool
*/
function freeze(){
return HTML_QuickForm_submit::freeze();
}
}
+2 -2
View File
@@ -408,8 +408,8 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element implements templatab
}
$context['hasformats'] = count($formats) > 1;
$context['formats'] = [];
foreach ($formats as $value => $text) {
$context['formats'][] = ['value' => $value, 'text' => $text, 'selected' => ($value == $format)];
foreach ($formats as $formatvalue => $formattext) {
$context['formats'][] = ['value' => $formatvalue, 'text' => $formattext, 'selected' => ($formatvalue == $format)];
}
$context['id'] = $id;
$context['value'] = $text;
+1 -1
View File
@@ -277,7 +277,7 @@ if (typeof M.form.dependencyManager === 'undefined') {
isFilePicker: function(el) {
if (!this._fileinputs) {
var fileinputs = {};
var els = this.get('form').all('.fitem.fitem_ffilepicker input,.fitem.fitem_ffilemanager input');
var els = this.get('form').all('.fitem [data-fieldtype="filepicker"] input,.fitem [data-fieldtype="filemanager"] input');
els.each(function(node) {
fileinputs[node.getAttribute('name')] = true;
});
+2 -2
View File
@@ -165,9 +165,8 @@ class MoodleQuickForm_group extends HTML_QuickForm_group implements templatable
include_once('HTML/QuickForm/Renderer/Default.php');
$elements = [];
$name = $this->getName();
foreach ($this->_elements as $key => $element) {
$element->_generateId();
$name = $this->getName();
$elementname = '';
if ($this->_appendName) {
$elementname = $element->getName();
@@ -177,6 +176,7 @@ class MoodleQuickForm_group extends HTML_QuickForm_group implements templatable
$element->setName($name);
}
}
$element->_generateId();
$out = $OUTPUT->mform_element($element, false, false, '', true);
+4
View File
@@ -213,6 +213,10 @@ class MoodleQuickForm_select extends HTML_QuickForm_select implements templatabl
}
$context['options'] = $options;
if ($this->getAttribute('multiple')) {
$context['name'] = $context['name'] . '[]';
}
return $context;
}
}
+13
View File
@@ -115,7 +115,9 @@ class MoodleQuickForm_tags extends MoodleQuickForm_autocomplete {
$attributes['showsuggestions'] = $this->showstandard;
}
parent::__construct($elementName, $elementLabel, $validoptions, $attributes);
$this->_type = 'tags';
}
/**
@@ -247,4 +249,15 @@ class MoodleQuickForm_tags extends MoodleQuickForm_autocomplete {
return parent::exportValue($submitValues, $assoc);
}
public function export_for_template(renderer_base $output) {
$context = parent::export_for_template($output);
if (has_capability('moodle/tag:manage', context_system::instance()) && $this->showstandard) {
$url = new moodle_url('/tag/manage.php', array('tc' => $this->get_tag_collection()));
$context['managestandardtagsurl'] = $url->out(false);
}
return $context;
}
}
+9 -3
View File
@@ -52,7 +52,7 @@ trait templatable_form_element {
// Not all elements have all of these attributes - but they are common enough to be valid for a few.
$standardattributes = ['id', 'name', 'label', 'multiple', 'checked', 'error', 'size', 'value'];
$standardproperties = ['frozen', 'helpbutton', 'hiddenLabel'];
$standardproperties = ['helpbutton', 'hiddenLabel'];
// Standard attributes.
foreach ($standardattributes as $attrname) {
@@ -65,16 +65,22 @@ trait templatable_form_element {
$classpropname = '_' . $propname;
$context[strtolower($propname)] = isset($this->$classpropname) ? $this->$classpropname : false;
}
$extraclasses = $this->getAttribute('class');
// Special wierd named property.
$context['frozen'] = !empty($this->_flagFrozen);
// Other attributes.
$otherattributes = [];
foreach ($this->getAttributes() as $attr => $value) {
if (!in_array($attr, $standardattributes)) {
if (!in_array($attr, $standardattributes) && $attr != 'class') {
$otherattributes[] = $attr . '="' . s($value) . '"';
}
}
$context['extraclasses'] = $extraclasses;
$context['type'] = $this->getType();
$context['attributes'] = implode(' ', $otherattributes);
return $context;
}
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
<div>
<textarea id="{{id}}" name="{{name}}[text]" rows="{{rows}}" cols="{{cols}}" spellcheck="true" {{#changelistener}} onblur="{{onblur}}"
onchange="{{onchange}}" {{/changelistener}}>{{text}}</textarea>
onchange="{{onchange}}" {{/changelistener}}>{{value}}</textarea>
</div>
<div>
{{^onlyoneformat}}
@@ -13,4 +13,4 @@
{{#onlyoneformat}}
<input name="{{name}}[format]" type="hidden" value="{{format}}"/>
{{/onlyoneformat}}
</div>
</div>
+10 -1
View File
@@ -39,7 +39,9 @@ require_once('templatable_form_element.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class MoodleQuickForm_textarea extends HTML_QuickForm_textarea implements templatable {
use templatable_form_element;
use templatable_form_element {
export_for_template as export_for_template_base;
}
/** @var string Need to store id of form as we may need it for helpbutton */
var $_formid = '';
@@ -166,4 +168,11 @@ class MoodleQuickForm_textarea extends HTML_QuickForm_textarea implements templa
public function set_force_ltr($value) {
$this->forceltr = (bool) $value;
}
public function export_for_template(renderer_base $output) {
$context = $this->export_for_template_base($output);
$context['value'] = $this->getValue();
return $context;
}
}
+1 -1
View File
@@ -186,7 +186,7 @@ EOD;
public function export_for_template(renderer_base $output) {
$context = $this->export_for_template_base($output);
$context['filepickerhtml'] = $this->toHtml();
$context['filepickerhtml'] = $this->getFilePickerHTML();
return $context;
}
+14 -8
View File
@@ -2692,15 +2692,15 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
*/
public function __construct() {
// switch next two lines for ol li containers for form items.
// $this->_elementTemplates=array('default'=>"\n\t\t".'<li class="fitem"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><div class="qfelement<!-- BEGIN error --> error<!-- END error --> {type}"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></li>');
// $this->_elementTemplates=array('default'=>"\n\t\t".'<li class="fitem"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><div class="qfelement<!-- BEGIN error --> error<!-- END error --> {typeclass}"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></li>');
$this->_elementTemplates = array(
'default'=>"\n\t\t".'<div id="{id}" data-fieldtype="{fieldtype}" class="fitem {advanced}<!-- BEGIN required --> required<!-- END required --> fitem_{type} {emptylabel} {class}" {aria-live}><div class="fitemtitle"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div><div class="felement {type}<!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error" tabindex="0">{error}</span><br /><!-- END error -->{element}</div></div>',
'default'=>"\n\t\t".'<div id="{id}" class="fitem {advanced}<!-- BEGIN required --> required<!-- END required --> fitem_{typeclass} {emptylabel} {class}" {aria-live}><div class="fitemtitle"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div><div class="felement {typeclass}<!-- BEGIN error --> error<!-- END error -->" data-fieldtype="{type}"><!-- BEGIN error --><span class="error" tabindex="0">{error}</span><br /><!-- END error -->{element}</div></div>',
'actionbuttons'=>"\n\t\t".'<div id="{id}" class="fitem fitem_actionbuttons fitem_{type} {class}"><div class="felement {type}">{element}</div></div>',
'actionbuttons'=>"\n\t\t".'<div id="{id}" class="fitem fitem_actionbuttons fitem_{typeclass} {class}"><div class="felement {typeclass}" data-fieldtype="{type}">{element}</div></div>',
'fieldset'=>"\n\t\t".'<div id="{id}" class="fitem {advanced} {class}<!-- BEGIN required --> required<!-- END required --> fitem_{type} {emptylabel}"><div class="fitemtitle"><div class="fgrouplabel"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div></div><fieldset class="felement {type}<!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error" tabindex="0">{error}</span><br /><!-- END error -->{element}</fieldset></div>',
'fieldset'=>"\n\t\t".'<div id="{id}" class="fitem {advanced} {class}<!-- BEGIN required --> required<!-- END required --> fitem_{typeclass} {emptylabel}"><div class="fitemtitle"><div class="fgrouplabel"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} </label>{help}</div></div><fieldset class="felement {typeclass}<!-- BEGIN error --> error<!-- END error -->" data-fieldtype="{type}"><!-- BEGIN error --><span class="error" tabindex="0">{error}</span><br /><!-- END error -->{element}</fieldset></div>',
'static'=>"\n\t\t".'<div id="{id}" class="fitem {advanced} {emptylabel} {class}"><div class="fitemtitle"><div class="fstaticlabel">{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} {help}</div></div><div class="felement fstatic <!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error" tabindex="0">{error}</span><br /><!-- END error -->{element}</div></div>',
'static'=>"\n\t\t".'<div id="{id}" class="fitem {advanced} {emptylabel} {class}"><div class="fitemtitle"><div class="fstaticlabel">{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg} {help}</div></div><div class="felement fstatic <!-- BEGIN error --> error<!-- END error -->" data-fieldtype="static"><!-- BEGIN error --><span class="error" tabindex="0">{error}</span><br /><!-- END error -->{element}</div></div>',
'warning'=>"\n\t\t".'<div id="{id}" class="fitem {advanced} {emptylabel} {class}">{element}</div>',
@@ -2825,7 +2825,8 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
}
$html = str_replace('{id}', $group->getAttribute('id'), $html);
$html = str_replace('{name}', $group->getName(), $html);
$html = str_replace('{type}', 'fgroup', $html);
$html = str_replace('{typeclass}', 'fgroup', $html);
$html = str_replace('{type}', 'group', $html);
$html = str_replace('{class}', $group->getAttribute('class'), $html);
$emptylabel = '';
if ($group->getLabel() == '') {
@@ -2888,7 +2889,8 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
$html = str_replace('{advancedimg}', '', $html);
}
$html = str_replace('{id}', 'fitem_' . $element->getAttribute('id'), $html);
$html = str_replace('{type}', 'f' . $element->getType(), $html);
$html = str_replace('{typeclass}', 'f' . $element->getType(), $html);
$html = str_replace('{type}', $element->getType(), $html);
$html = str_replace('{name}', $element->getName(), $html);
$html = str_replace('{class}', $element->getAttribute('class'), $html);
$emptylabel = '';
@@ -2914,7 +2916,11 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
if (!$fromtemplate) {
parent::renderElement($element, $required, $error);
} else { // CRAZZY!
} else {
if (in_array($element->getName(), $this->_stopFieldsetElements) && $this->_fieldsetsOpen > 0) {
$this->_html .= $this->_closeFieldsetTemplate;
$this->_fieldsetsOpen--;
}
$this->_html .= $html;
}
}
+2 -2
View File
@@ -283,7 +283,7 @@ M.util.show_confirm_dialog = function(e, args) {
} else if ((targetancestor = target.ancestor('a')) !== null) {
window.location = targetancestor.get('href');
} else if (target.test('input')) {
} else if (target.test('input') || target.test('button')) {
targetform = target.ancestor('form', true);
if (!targetform) {
return;
@@ -299,7 +299,7 @@ M.util.show_confirm_dialog = function(e, args) {
} else {
Y.log("Element of type " + target.get('tagName') +
" is not supported by the M.util.show_confirm_dialog function. Use A, INPUT, or FORM",
" is not supported by the M.util.show_confirm_dialog function. Use A, INPUT, BUTTON or FORM",
'warn', 'javascript-static');
}
}, this);
+25 -5
View File
@@ -936,6 +936,7 @@ class single_select implements renderable, templatable {
$data->label = $this->label;
$data->disabled = $this->disabled;
$data->title = $this->tooltip;
$data->formid = $this->formid;
$data->id = !empty($attributes['id']) ? $attributes['id'] : html_writer::random_id('single_select');
unset($attributes['id']);
@@ -971,11 +972,30 @@ class single_select implements renderable, templatable {
$data->nothingkey = $hasnothing ? key($nothing) : false;
foreach ($options as $value => $name) {
$data->options[] = [
'value' => $value,
'name' => $options[$value],
'selected' => $this->selected == $value
];
if (is_array($options[$value])) {
foreach ($options[$value] as $optgroupname => $optgroupvalues) {
$sublist = [];
foreach ($optgroupvalues as $optvalue => $optname) {
$sublist[] = [
'value' => $optvalue,
'name' => $optname,
'selected' => strval($this->selected) === strval($optvalue),
];
}
$data->options[] = [
'name' => $optgroupname,
'optgroup' => true,
'options' => $sublist
];
}
} else {
$data->options[] = [
'value' => $value,
'name' => $options[$value],
'selected' => strval($this->selected) === strval($value),
'optgroup' => false
];
}
}
// Label attributes.
+1 -1
View File
@@ -18,7 +18,7 @@
Action link.
}}
{{^disabled}}
<a href="{{url}}" id="{{id}}" class="{{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}}{{/attributes}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{{text}}}</a>
<a href="{{{url}}}" id="{{id}}" class="{{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}}{{/attributes}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{{text}}}</a>
{{#hasactions}}
{{> core/actions }}
{{/hasactions}}
+77
View File
@@ -0,0 +1,77 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Steps definitions to open and close action menus.
*
* @package core
* @category test
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
require_once(__DIR__ . '/../../behat/behat_base.php');
use Behat\Mink\Exception\ExpectationException as ExpectationException;
use Behat\Mink\Exception\DriverException as DriverException;
/**
* Steps definitions to open and close action menus.
*
* @package core
* @category test
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_action_menu extends behat_base {
/**
* Open the action menu in
*
* @Given /^I open the action menu in "(?P<element_string>(?:[^"]|\\")*)" "(?P<selector_string>[^"]*)"$/
* @param string $element
* @param string $selector
* @return void
*/
public function i_open_the_action_menu_in($element, $selectortype) {
if (!$this->running_javascript()) {
throw new DriverException('Open the action menu step is not available with Javascript disabled');
}
// Gets the node based on the requested selector type and locator.
$node = $this->get_node_in_container("css_element", "[role=menuitem][aria-haspopup=true]", $selectortype, $element);
$this->ensure_node_is_visible($node);
$node->click();
}
/**
* When an action menu is open, follow one of the items in it.
*
* @Given /^I choose "(?P<link_string>(?:[^"]|\\")*)" in the open action menu$/
* @param string $linkstring
* @return void
*/
public function i_choose_in_the_open_action_menu($linkstring) {
if (!$this->running_javascript()) {
throw new DriverException('Action menu steps are not available with Javascript disabled');
}
// Gets the node based on the requested selector type and locator.
$node = $this->get_node_in_container("link", $linkstring, "css_element", ".moodle-actionmenu [role=menu][aria-hidden=false]");
$this->ensure_node_is_visible($node);
$node->click();
}
}
+10
View File
@@ -287,6 +287,16 @@ class behat_deprecated extends behat_base {
$this->execute('behat_forms::i_set_the_field_to_multiline', array($field, $value));
}
/**
* Click on a given link in the moodle-actionmenu that is currently open.
* @Given /^I follow "(?P<link_string>(?:[^"]|\\")*)" in the open menu$/
* @param string $linkstring the text (or id, etc.) of the link to click.
*/
public function i_follow_in_the_open_menu($linkstring) {
$alternative = 'I choose "' . $this->escape($linkstring) . '" from the open action menu';
$this->deprecated_message($alternative, true);
}
/**
* Throws an exception if $CFG->behat_usedeprecated is not allowed.
*
+1 -1
View File
@@ -613,4 +613,4 @@ class behat_hooks extends behat_base {
* @copyright 2016 Rajesh Taneja <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_stop_exception extends \Exception{}
class behat_stop_exception extends \Exception{}
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -216,9 +216,9 @@ define(['jquery', 'core/notification', 'core/templates', 'core/fragment',
var region = $(selector);
templates.render('mod_assign/popout_button', {}).done(function(html) {
region.find('.fitem_ffilemanager .fitemtitle').append(html);
region.find('.fitem_feditor .fitemtitle').append(html);
region.find('.fitem_f .fitemtitle').append(html);
var parents = region.find('[data-fieldtype="filemanager"],[data-fieldtype="editor"],[data-fieldtype="grading"]')
.closest('.fitem');
parents.addClass('has-popout').find('label').parent().append(html);
region.on('click', '[data-region="popout-button"]', this._togglePopout.bind(this));
}.bind(this)).fail(notification.exception);
@@ -41,7 +41,7 @@ Feature: Chat reset
And I press "Save and display"
When I navigate to "Reset" node in "Course administration"
And I set the following fields to these values:
| id_reset_start_date_enabled | 1 |
| reset_start_date[enabled] | 1 |
| reset_start_date[day] | 1 |
| reset_start_date[month] | January |
| reset_start_date[year] | 2030 |
@@ -52,4 +52,4 @@ Feature: Chat reset
And I follow "Test chat name"
And I navigate to "Edit settings" node in "Chat administration"
And I expand all fieldsets
And the "id_chattime_year" select box should contain "2030"
And the "chattime[year]" select box should contain "2030"
+23 -23
View File
@@ -129,26 +129,26 @@ Feature: Users can be required to specify certain fields when adding entries to
And I add an entry to "Test database name" database with:
| Base Text input | Some input to allow us to submit the otherwise empty form |
And I press "Save and view"
Then ".alert.alert-error" "css_element" should exist in the "Required Checkbox" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required Two-Option Checkbox" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required Latlong" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required Menu" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required Number" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required Radio" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required Text input" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required Text area" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required URL" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required Multimenu" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Required Two-Option Multimenu" "table_row"
And ".alert.alert-error" "css_element" should not exist in the "Not required Checkbox" "table_row"
And ".alert.alert-error" "css_element" should not exist in the "Not required Latlong" "table_row"
And ".alert.alert-error" "css_element" should not exist in the "Not required Menu" "table_row"
And ".alert.alert-error" "css_element" should not exist in the "Not required Number" "table_row"
And ".alert.alert-error" "css_element" should not exist in the "Not required Radio" "table_row"
And ".alert.alert-error" "css_element" should not exist in the "Not required Text input" "table_row"
And ".alert.alert-error" "css_element" should not exist in the "Not required Text area" "table_row"
And ".alert.alert-error" "css_element" should not exist in the "Not required URL" "table_row"
And ".alert.alert-error" "css_element" should not exist in the "Not required Multimenu" "table_row"
Then ".alert" "css_element" should exist in the "Required Checkbox" "table_row"
And ".alert" "css_element" should exist in the "Required Two-Option Checkbox" "table_row"
And ".alert" "css_element" should exist in the "Required Latlong" "table_row"
And ".alert" "css_element" should exist in the "Required Menu" "table_row"
And ".alert" "css_element" should exist in the "Required Number" "table_row"
And ".alert" "css_element" should exist in the "Required Radio" "table_row"
And ".alert" "css_element" should exist in the "Required Text input" "table_row"
And ".alert" "css_element" should exist in the "Required Text area" "table_row"
And ".alert" "css_element" should exist in the "Required URL" "table_row"
And ".alert" "css_element" should exist in the "Required Multimenu" "table_row"
And ".alert" "css_element" should exist in the "Required Two-Option Multimenu" "table_row"
And ".alert" "css_element" should not exist in the "Not required Checkbox" "table_row"
And ".alert" "css_element" should not exist in the "Not required Latlong" "table_row"
And ".alert" "css_element" should not exist in the "Not required Menu" "table_row"
And ".alert" "css_element" should not exist in the "Not required Number" "table_row"
And ".alert" "css_element" should not exist in the "Not required Radio" "table_row"
And ".alert" "css_element" should not exist in the "Not required Text input" "table_row"
And ".alert" "css_element" should not exist in the "Not required Text area" "table_row"
And ".alert" "css_element" should not exist in the "Not required URL" "table_row"
And ".alert" "css_element" should not exist in the "Not required Multimenu" "table_row"
And I follow "View list"
And I should see "No entries in database"
@@ -221,8 +221,8 @@ Feature: Users can be required to specify certain fields when adding entries to
| Required Two-Option Multimenu | 1 |
And I set the field with xpath "//div[@title='Not required Latlong']//tr[td/label[normalize-space(.)='Latitude']]/td/input" to "20"
And I press "Save and view"
Then ".alert.alert-error" "css_element" should exist in the "Required Latlong" "table_row"
And ".alert.alert-error" "css_element" should exist in the "Not required Latlong" "table_row"
Then ".alert" "css_element" should exist in the "Required Latlong" "table_row"
And ".alert" "css_element" should exist in the "Not required Latlong" "table_row"
Scenario: A student filling in number and text fields with zero will not see an error.
Given I log in as "student1"
@@ -244,4 +244,4 @@ Feature: Users can be required to specify certain fields when adding entries to
And I press "Save and view"
And I follow "View list"
Then I should not see "No entries in database"
And I should see "Some input to allow us to submit the otherwise empty form"
And I should see "Some input to allow us to submit the otherwise empty form"
-1
View File
@@ -446,7 +446,6 @@ class mod_feedback_complete_form extends moodleform {
$menu->set_constraint('.feedback_form');
$menu->set_alignment(action_menu::TR, action_menu::BR);
$menu->set_menu_trigger(get_string('edit'));
$menu->do_not_enhance();
$menu->prioritise = true;
$itemobj = feedback_get_item_class($item->typ);
-86
View File
@@ -33,92 +33,6 @@
.path-mod-feedback #analysis-form label { display: inline; }
.path-mod-feedback .mform.feedback_form .fitem .fitemtitle {
display: block;
margin-top: 4px;
margin-bottom: 4px;
text-align: left;
width: 100%;
}
.path-mod-feedback .mform.feedback_form .fitem .felement {
margin-left: 0;
width: 100%;
float: left;
padding-left: 0;
padding-right: 0;
}
.path-mod-feedback .mform.feedback_form .fitem .fstatic:empty {
display: none;
}
.path-mod-feedback .mform.feedback_form .fitem .fcheckbox > span,
.path-mod-feedback .mform.feedback_form .fitem .fradio > span,
.path-mod-feedback .mform.feedback_form .fitem .fgroup > span {
margin-top: 4px;
}
body.path-mod-feedback #region-main .mform.feedback_form .femptylabel .fitemtitle {
display: inline-block;
width: auto;
margin-right: 0;
}
.path-mod-feedback .mform.feedback_form .femptylabel .felement {
display: inline-block;
margin-top: 4px;
padding-top: 5px;
width: auto;
}
body.path-mod-feedback #region-main .mform.feedback_form .feedback-item-pagebreak .felement {
width: 100%;
}
.path-mod-feedback .mform.feedback_form .fitem_fcheckbox .fitemtitle,
.path-mod-feedback .mform.feedback_form .fitem_fcheckbox .felement {
display: inline-block;
width: auto;
}
.path-mod-feedback .mform.feedback_form .fitem_fcheckbox .felement {
padding: 6px;
}
.path-mod-feedback .mform.feedback_form#feedback_viewresponse_form .fitem.feedback_hasvalue:not(.feedback-item-captcha) .felement {
background: #FBFBF1;
min-height: 1em;
box-sizing: border-box;
padding: 3px;
border: 1px solid #ddd
}
.path-mod-feedback .mform.feedback_form .fitem.feedback_hasvalue .fstatic:empty {
display: inherit;
}
.path-mod-feedback .mform.feedback_form#feedback_edit_form .fitem:hover {
background: #f5f5f5;
}
.path-mod-feedback .mform.feedback_form#feedback_edit_form .fitem .fitemtitle label {
width: 100%;
}
.path-mod-feedback .mform.feedback_form#feedback_edit_form .fitem .fitemtitle .itemtitle {
position: relative;
width: 100%;
}
.path-mod-feedback .mform.feedback_form#feedback_edit_form .fitem .fitemtitle .itemtitle .itemdd,
.path-mod-feedback .mform.feedback_form#feedback_edit_form .fitem .fitemtitle .itemtitle .itemname {
float: left;
}
.path-mod-feedback .mform.feedback_form#feedback_edit_form .fitem .fitemtitle .itemtitle .itemactions {
float: right;
}
.path-mod-feedback .templateslist td.cell.action,
.path-mod-feedback .templateslist th.header.action {
@@ -115,7 +115,7 @@ Feature: Mapping courses in a feedback
And I follow "Course feedback"
And I follow "Analysis"
And I should see "All courses" in the "#feedback_course_filter .fautocomplete .label" "css_element"
And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=listitem]" "css_element"
And I show chart data for the "multichoicerated" feedback
And I should see "1 (33.33 %)" in the "option a" "table_row"
And I should see "1 (33.33 %)" in the "option b" "table_row"
@@ -127,7 +127,7 @@ Feature: Mapping courses in a feedback
And I follow "Back"
And I set the field "Filter by course" to "Course 1"
And I press "Filter"
And I should see "Course 1" in the "#feedback_course_filter .fautocomplete .label" "css_element"
And I should see "Course 1" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=listitem]" "css_element"
And I show chart data for the "multichoicerated" feedback
And I should see "0" in the "option a" "table_row"
And I should see "1 (50.00 %)" in the "option b" "table_row"
@@ -198,7 +198,7 @@ Feature: Mapping courses in a feedback
And I am on site homepage
And I follow "Course feedback"
And I follow "Analysis"
And I should see "All courses" in the "#feedback_course_filter .fautocomplete .label" "css_element"
And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=listitem]" "css_element"
And I show chart data for the "multichoicerated" feedback
And I should see "0" in the "option a" "table_row"
And I should see "1 (33.33 %)" in the "option b" "table_row"
@@ -236,7 +236,7 @@ Feature: Mapping courses in a feedback
And I am on site homepage
And I follow "Turn editing on"
And I add the "Feedback" block
And I click on "Delete" "link" in the "//div[contains(@class,'block_site_main_menu')]//li[contains(.,'Course feedback')]" "xpath_element"
And I click on "Delete" "link" in the "//*[contains(@class,'block_site_main_menu')]//li[contains(.,'Course feedback')]" "xpath_element"
And I press "Yes"
And I follow "Turn editing off"
And I am on site homepage
+9 -6
View File
@@ -86,7 +86,7 @@ Feature: Testing multichoice questions in feedback
And I should not see "this is the third page of the feedback"
And I press "Next page"
# We are still on the second page because the field is required
And I should see "Required" in the ".error" "css_element"
And I should see "Required" in the "form" "css_element"
And I should see "this is the second page of the feedback"
And I set the field "option e" to "1"
And the following fields match these values:
@@ -158,7 +158,8 @@ Feature: Testing multichoice questions in feedback
And I should see "1 (100.00 %)" in the "option i" "table_row"
# Change the settings so we don't analyse empty submits
And I follow "Edit questions"
And I click on "Edit question" "link" in the "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
And I choose "Edit question" in the open action menu
And I set the field "Do not analyse empty submits" to "Yes"
And I press "Save changes to question"
And I follow "Analysis"
@@ -228,7 +229,7 @@ Feature: Testing multichoice questions in feedback
And I should not see "this is the third page of the feedback"
And I press "Next page"
# We are still on the second page because the field is required
And I should see "Required" in the ".error" "css_element"
And I should see "Required" in the "form" "css_element"
And I should see "this is the second page of the feedback"
And I set the field "option e" to "1"
And I set the field "option f" to "1"
@@ -301,7 +302,8 @@ Feature: Testing multichoice questions in feedback
And I should see "1 (100.00 %)" in the "option i" "table_row"
# Change the settings so we don't analyse empty submits
And I follow "Edit questions"
And I click on "Edit question" "link" in the "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
And I choose "Edit question" in the open action menu
And I set the field "Do not analyse empty submits" to "Yes"
And I press "Save changes to question"
And I follow "Analysis"
@@ -363,7 +365,7 @@ Feature: Testing multichoice questions in feedback
And I should not see "this is the third page of the feedback"
And I press "Next page"
# We are still on the second page because the field is required
And I should see "Required" in the ".error" "css_element"
And I should see "Required" in the "form" "css_element"
And I should see "this is the second page of the feedback"
And I set the field "this is a multiple choice 2" to "option e"
And I press "Next page"
@@ -423,7 +425,8 @@ Feature: Testing multichoice questions in feedback
And I should see "1 (100.00 %)" in the "option i" "table_row"
# Change the settings so we don't analyse empty submits
And I follow "Edit questions"
And I click on "Edit question" "link" in the "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element"
And I choose "Edit question" in the open action menu
And I set the field "Do not analyse empty submits" to "Yes"
And I press "Save changes to question"
And I follow "Analysis"
+2 -4
View File
@@ -4,8 +4,7 @@ YUI.add('moodle-mod_feedback-dragdrop', function(Y) {
DRAGAREA : '#feedback_dragarea',
DRAGITEMCLASS : 'feedback_itemlist',
DRAGITEM : 'div.feedback_itemlist',
DRAGLIST : '#feedback_dragarea form > fieldset > div',
ITEMBOX : '#feedback_item_box_',
DRAGLIST : '#feedback_dragarea form',
DRAGHANDLE : 'itemhandle'
};
@@ -29,8 +28,7 @@ YUI.add('moodle-mod_feedback-dragdrop', function(Y) {
basenode = Y.Node.one(CSS.DRAGLIST);
listitems = basenode.all(CSS.DRAGITEM).each(function(v) {
var item_id = this.get_node_id(v.get('id')); //Get the id of the feedback item.
var item_box = Y.Node.one(CSS.ITEMBOX + item_id); //Get the current item box so we can add the drag handle.
item_box.append(this.mydraghandle.cloneNode(true)); // Insert the new handle into the item box.
v.append(this.mydraghandle.cloneNode(true)); // Insert the new handle into the item box.
}, this);
//We use a delegate to make all items draggable
+1 -1
View File
@@ -536,7 +536,7 @@ function lesson_menu_block_contents($cmid, $lesson) {
return null;
}
$content = '<a href="#maincontent" class="skip">'.get_string('skip', 'lesson')."</a>\n<div class=\"menuwrapper\">\n<ul>\n";
$content = '<a href="#maincontent" class="accesshide">'.get_string('skip', 'lesson')."</a>\n<div class=\"menuwrapper\">\n<ul>\n";
while ($pageid != 0) {
$page = $pages[$pageid];
+1 -1
View File
@@ -396,7 +396,7 @@ class mod_lesson_mod_form extends moodleform_mod {
$group = array();
$group[] =& $mform->createElement('checkbox', 'completiontimespentenabled', '',
get_string('completiontimespent', 'lesson'));
$group[] =& $mform->createElement('duration', 'completiontimespent', array('optional' => true));
$group[] =& $mform->createElement('duration', 'completiontimespent', '', array('optional' => false));
$mform->addGroup($group, 'completiontimespentgroup', get_string('completiontimespentgroup', 'lesson'), array(' '), false);
$mform->disabledIf('completiontimespent[number]', 'completiontimespentenabled', 'notchecked');
$mform->disabledIf('completiontimespent[timeunit]', 'completiontimespentenabled', 'notchecked');
-79
View File
@@ -1,79 +0,0 @@
/** General styles (scope: all of lesson) **/
.path-mod-lesson .contents,
.path-mod-lesson .standardtable,
.path-mod-lesson .mform .box.contents,
.path-mod-lesson .invisiblefieldset.fieldsetfix tr {text-align: left;}
.path-mod-lesson #layout-table {width: 100%;}
.path-mod-lesson .edit_buttons form,
.path-mod-lesson .edit_buttons input {display: inline;}
.path-mod-lesson .userinfotable .cell,
.path-mod-lesson .userinfotable .userpicture {vertical-align: middle;}
.path-mod-lesson .invisiblefieldset.fieldsetfix {display: block;}
.path-mod-lesson .slideshow {overflow: auto;padding: 15px;}
.path-mod-lesson .menu .menuwrapper {max-height: 400px;overflow: auto;vertical-align: top;margin-bottom: 10px;}
.path-mod-lesson .menu ul {list-style: none;padding: 5px 0px 0px 5px;margin: 0px;}
.path-mod-lesson .menu ul li {padding-bottom: 5px;}
.path-mod-lesson .skip {position: absolute;top: -1000em;width: 20em;}
.path-mod-lesson .branchbuttoncontainer.horizontal div,
.path-mod-lesson .branchbuttoncontainer.horizontal form {display: inline;}
.path-mod-lesson .firstpageoptions {width:30%;margin-left:35%;margin-top:1em;}
.path-mod-lesson .progress_bar_table,
.path-mod-lesson .progress_bar_completed,
.path-mod-lesson .progress_bar_todo {padding: 0;margin: 0;}
.path-mod-lesson .progress_bar_token {height: 20px;width: 5px;padding: 0;margin: 0;}
.path-mod-lesson .edit_pages_box .addlinks {margin:0;margin-bottom:1em;}
.path-mod-lesson .progress_bar_completed {background-color:green; text-align:right; vertical-align:middle; color:#FFF;}
.path-mod-lesson .resourcecontent {text-align: center;}
.path-mod-lesson .answeroption .fcheckbox > span {
position: relative;
float: left;
}
.path-mod-lesson .answeroptiongroup .fgroup > span {
position: relative;
width: 100%;
}
.path-mod-lesson .answeroption .fcheckbox input,
.path-mod-lesson .answeroptiongroup input {
position: absolute;
top: 2px;
margin-top: 0px;
left: 0;
}
.path-mod-lesson .answeroption .fcheckbox label,
.path-mod-lesson .mform .fitem.answeroptiongroup fieldset.fgroup label {
padding-left: 20px;
float: left;
}
.path-mod-lesson .answeroption .felement label p:last-child,
.path-mod-lesson .answeroptiongroup .felement label p:last-child {
margin-bottom: 0px;
}
/**
* Style for view.php
**/
#page-mod-lesson-view .password-form .submitbutton {display: inline;}
.path-mod-lesson .reviewessay {width:40%; border:1px solid #DDDDDD; background-color: #EEEEEE;}
/* Countdown timer. */
#lesson-timer {
text-align: center;
}
.path-mod-lesson .essayungraded {
background-color: #efcfcf;
}
.path-mod-lesson .essaygraded {
background-color: #efefcf;
}
.path-mod-lesson .essaysent {
background-color: #cfefcf;
}
@@ -414,4 +414,4 @@ Feature: In a lesson activity a student should
| True | 1 |
And I press "Submit"
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I should see "Congratulations - end of lesson reached"
@@ -47,7 +47,7 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ
| id_score_2 | 0 |
# Atto needs focus to add image, select empty p tag to do so.
And I select the text in the "id_answer_editor_2" Atto editor
And I click on "Image" "button" in the "#fitem_id_answer_editor_2" "css_element"
And I click on "Image" "button" in the "//*[@data-fieldtype='editor']/*[descendant::*[@id='id_answer_editor_2']]" "xpath_element"
And I click on "Browse repositories..." "button"
And I click on "Private files" "link"
And I click on "moodle_logo.jpg" "link"
@@ -69,7 +69,7 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ
| id_jumpto_1 | This page |
# Atto needs focus to add image, select empty p tag to do so.
And I select the text in the "id_response_editor_0" Atto editor
And I click on "Image" "button" in the "#fitem_id_response_editor_0" "css_element"
And I click on "Image" "button" in the "//*[@data-fieldtype='editor']/*[descendant::*[@id='id_response_editor_0']]" "xpath_element"
And I click on "Browse repositories..." "button"
And I click on "Private files" "link"
And I click on "moodle_logo.jpg" "link"
+1 -1
View File
@@ -34,5 +34,5 @@ Feature: Add tools
| Activity name | Test tool activity 1 |
| Launch container | Embed |
And I open "Test tool activity 1" actions menu
And I follow "Edit settings" in the open menu
And I choose "Edit settings" in the open action menu
Then the field "Preconfigured tool" matches value "Teaching Tool 1"

Some files were not shown because too many files have changed in this diff Show More