diff --git a/index.php b/index.php
index 7802d38..f98e367 100644
--- a/index.php
+++ b/index.php
@@ -2,6 +2,7 @@
require_once('../../../config.php');
require_once("{$CFG->libdir}/formslib.php");
require_once($CFG->libdir . '/adminlib.php');
+require_once($CFG->libdir.'/tablelib.php');
require_login();
diff --git a/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-coverage.js b/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-coverage.js
index a5f1879..741a19d 100644
--- a/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-coverage.js
+++ b/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-coverage.js
@@ -1,6 +1,6 @@
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/moodle-availability_examus-form/moodle-availability_examus-form.js']) {
- __coverage__['build/moodle-availability_examus-form/moodle-availability_examus-form.js'] = {"path":"build/moodle-availability_examus-form/moodle-availability_examus-form.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":62}}},"2":{"name":"(anonymous_2)","line":13,"loc":{"start":{"line":13,"column":39},"end":{"line":13,"column":50}}},"3":{"name":"(anonymous_3)","line":19,"loc":{"start":{"line":19,"column":37},"end":{"line":19,"column":52}}},"4":{"name":"(anonymous_4)","line":37,"loc":{"start":{"line":37,"column":37},"end":{"line":37,"column":49}}},"5":{"name":"(anonymous_5)","line":46,"loc":{"start":{"line":46,"column":39},"end":{"line":46,"column":61}}},"6":{"name":"(anonymous_6)","line":50,"loc":{"start":{"line":50,"column":40},"end":{"line":50,"column":63}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":59,"column":90}},"2":{"start":{"line":9,"column":0},"end":{"line":9,"column":52}},"3":{"start":{"line":11,"column":0},"end":{"line":11,"column":66}},"4":{"start":{"line":13,"column":0},"end":{"line":15,"column":2}},"5":{"start":{"line":17,"column":0},"end":{"line":17,"column":38}},"6":{"start":{"line":19,"column":0},"end":{"line":44,"column":2}},"7":{"start":{"line":20,"column":4},"end":{"line":20,"column":38}},"8":{"start":{"line":21,"column":4},"end":{"line":21,"column":40}},"9":{"start":{"line":23,"column":4},"end":{"line":23,"column":54}},"10":{"start":{"line":24,"column":4},"end":{"line":24,"column":43}},"11":{"start":{"line":26,"column":4},"end":{"line":26,"column":56}},"12":{"start":{"line":27,"column":4},"end":{"line":27,"column":70}},"13":{"start":{"line":28,"column":4},"end":{"line":28,"column":66}},"14":{"start":{"line":29,"column":4},"end":{"line":29,"column":56}},"15":{"start":{"line":30,"column":4},"end":{"line":32,"column":5}},"16":{"start":{"line":31,"column":8},"end":{"line":31,"column":69}},"17":{"start":{"line":34,"column":4},"end":{"line":41,"column":5}},"18":{"start":{"line":35,"column":8},"end":{"line":35,"column":54}},"19":{"start":{"line":36,"column":8},"end":{"line":36,"column":61}},"20":{"start":{"line":37,"column":8},"end":{"line":40,"column":56}},"21":{"start":{"line":39,"column":12},"end":{"line":39,"column":46}},"22":{"start":{"line":43,"column":4},"end":{"line":43,"column":16}},"23":{"start":{"line":46,"column":0},"end":{"line":48,"column":2}},"24":{"start":{"line":47,"column":4},"end":{"line":47,"column":73}},"25":{"start":{"line":50,"column":0},"end":{"line":57,"column":2}},"26":{"start":{"line":51,"column":4},"end":{"line":51,"column":19}},"27":{"start":{"line":52,"column":4},"end":{"line":52,"column":32}},"28":{"start":{"line":54,"column":4},"end":{"line":56,"column":5}},"29":{"start":{"line":55,"column":12},"end":{"line":55,"column":65}}},"branchMap":{"1":{"line":9,"type":"binary-expr","locations":[{"start":{"line":9,"column":24},"end":{"line":9,"column":45}},{"start":{"line":9,"column":49},"end":{"line":9,"column":51}}]},"2":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":4},"end":{"line":30,"column":4}},{"start":{"line":30,"column":4},"end":{"line":30,"column":4}}]},"3":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":34,"column":4}},{"start":{"line":34,"column":4},"end":{"line":34,"column":4}}]},"4":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":54,"column":4}},{"start":{"line":54,"column":4},"end":{"line":54,"column":4}}]},"5":{"line":54,"type":"binary-expr","locations":[{"start":{"line":54,"column":8},"end":{"line":54,"column":36}},{"start":{"line":54,"column":40},"end":{"line":54,"column":69}},{"start":{"line":54,"column":73},"end":{"line":54,"column":97}}]}},"code":["(function () { YUI.add('moodle-availability_examus-form', function (Y, NAME) {","","/*global M*/","/**"," * JavaScript for form editing profile conditions."," *"," * @module moodle-availability_examus-form"," */","M.availability_examus = M.availability_examus || {};","","M.availability_examus.form = Y.Object(M.core_availability.plugin);","","M.availability_examus.form.initInner = function() {"," // Nothing","};","","M.availability_examus.form.instId = 1;","","M.availability_examus.form.getNode = function(json) {"," var html, node, root, id, strings;"," strings = M.str.availability_examus;",""," id = 'examus' + M.availability_examus.form.instId;"," M.availability_examus.form.instId += 1;",""," html = '
';"," html += '';"," html += '';"," node = Y.Node.create(' ' + html + ' ');"," if (json.duration !== undefined) {"," node.one('input[name=duration]').set('value', json.duration);"," }",""," if (!M.availability_examus.form.addedEvents) {"," M.availability_examus.form.addedEvents = true;"," root = Y.one('#fitem_id_availabilityconditionsjson');"," root.delegate('valuechange', function () {"," // Trigger the updating of the hidden availability data whenever the password field changes."," M.core_availability.form.update();"," }, '.availability_examus input[name=duration]');"," }",""," return node;","};","","M.availability_examus.form.fillValue = function(value, node) {"," value.duration = node.one('input[name=duration').get('value').trim();","};","","M.availability_examus.form.fillErrors = function(errors, node) {"," var value = {};"," this.fillValue(value, node);",""," if (value.duration === undefined || !/^\\d+$/.test(value.duration) || value.duration % 30 != 0) {"," errors.push('availability_examus:error_setduration');"," }","};","","}, '@VERSION@', {\"requires\": [\"base\", \"node\", \"event\", \"moodle-core_availability-form\"]});","","}());"]};
+ __coverage__['build/moodle-availability_examus-form/moodle-availability_examus-form.js'] = {"path":"build/moodle-availability_examus-form/moodle-availability_examus-form.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":62}}},"2":{"name":"(anonymous_2)","line":13,"loc":{"start":{"line":13,"column":39},"end":{"line":13,"column":50}}},"3":{"name":"(anonymous_3)","line":19,"loc":{"start":{"line":19,"column":37},"end":{"line":19,"column":52}}},"4":{"name":"(anonymous_4)","line":38,"loc":{"start":{"line":38,"column":37},"end":{"line":38,"column":49}}},"5":{"name":"(anonymous_5)","line":46,"loc":{"start":{"line":46,"column":39},"end":{"line":46,"column":61}}},"6":{"name":"(anonymous_6)","line":50,"loc":{"start":{"line":50,"column":40},"end":{"line":50,"column":63}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":59,"column":90}},"2":{"start":{"line":9,"column":0},"end":{"line":9,"column":52}},"3":{"start":{"line":11,"column":0},"end":{"line":11,"column":66}},"4":{"start":{"line":13,"column":0},"end":{"line":15,"column":2}},"5":{"start":{"line":17,"column":0},"end":{"line":17,"column":38}},"6":{"start":{"line":19,"column":0},"end":{"line":44,"column":2}},"7":{"start":{"line":20,"column":4},"end":{"line":20,"column":38}},"8":{"start":{"line":21,"column":4},"end":{"line":21,"column":40}},"9":{"start":{"line":23,"column":4},"end":{"line":23,"column":54}},"10":{"start":{"line":24,"column":4},"end":{"line":24,"column":43}},"11":{"start":{"line":26,"column":4},"end":{"line":26,"column":56}},"12":{"start":{"line":27,"column":4},"end":{"line":27,"column":70}},"13":{"start":{"line":28,"column":4},"end":{"line":28,"column":66}},"14":{"start":{"line":29,"column":4},"end":{"line":29,"column":56}},"15":{"start":{"line":30,"column":4},"end":{"line":32,"column":5}},"16":{"start":{"line":31,"column":8},"end":{"line":31,"column":69}},"17":{"start":{"line":34,"column":4},"end":{"line":41,"column":5}},"18":{"start":{"line":35,"column":8},"end":{"line":35,"column":54}},"19":{"start":{"line":37,"column":8},"end":{"line":37,"column":44}},"20":{"start":{"line":38,"column":8},"end":{"line":40,"column":56}},"21":{"start":{"line":39,"column":12},"end":{"line":39,"column":46}},"22":{"start":{"line":43,"column":4},"end":{"line":43,"column":16}},"23":{"start":{"line":46,"column":0},"end":{"line":48,"column":2}},"24":{"start":{"line":47,"column":4},"end":{"line":47,"column":74}},"25":{"start":{"line":50,"column":0},"end":{"line":57,"column":2}},"26":{"start":{"line":51,"column":4},"end":{"line":51,"column":19}},"27":{"start":{"line":52,"column":4},"end":{"line":52,"column":32}},"28":{"start":{"line":54,"column":4},"end":{"line":56,"column":5}},"29":{"start":{"line":55,"column":12},"end":{"line":55,"column":65}}},"branchMap":{"1":{"line":9,"type":"binary-expr","locations":[{"start":{"line":9,"column":24},"end":{"line":9,"column":45}},{"start":{"line":9,"column":49},"end":{"line":9,"column":51}}]},"2":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":4},"end":{"line":30,"column":4}},{"start":{"line":30,"column":4},"end":{"line":30,"column":4}}]},"3":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":34,"column":4}},{"start":{"line":34,"column":4},"end":{"line":34,"column":4}}]},"4":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":54,"column":4}},{"start":{"line":54,"column":4},"end":{"line":54,"column":4}}]},"5":{"line":54,"type":"binary-expr","locations":[{"start":{"line":54,"column":8},"end":{"line":54,"column":36}},{"start":{"line":54,"column":40},"end":{"line":54,"column":69}},{"start":{"line":54,"column":73},"end":{"line":54,"column":98}}]}},"code":["(function () { YUI.add('moodle-availability_examus-form', function (Y, NAME) {","","/*global M*/","/**"," * JavaScript for form editing profile conditions."," *"," * @module moodle-availability_examus-form"," */","M.availability_examus = M.availability_examus || {};","","M.availability_examus.form = Y.Object(M.core_availability.plugin);","","M.availability_examus.form.initInner = function() {"," // Nothing","};","","M.availability_examus.form.instId = 1;","","M.availability_examus.form.getNode = function(json) {"," var html, node, root, id, strings;"," strings = M.str.availability_examus;",""," id = 'examus' + M.availability_examus.form.instId;"," M.availability_examus.form.instId += 1;",""," html = '
';"," html += '';"," html += '';"," node = Y.Node.create(' ' + html + ' ');"," if (json.duration !== undefined) {"," node.one('input[name=duration]').set('value', json.duration);"," }",""," if (!M.availability_examus.form.addedEvents) {"," M.availability_examus.form.addedEvents = true;",""," root = Y.one(\".availability-field\");"," root.delegate('valuechange', function () {"," M.core_availability.form.update();"," }, '.availability_examus input[name=duration]');"," }",""," return node;","};","","M.availability_examus.form.fillValue = function(value, node) {"," value.duration = node.one('input[name=duration]').get('value').trim();","};","","M.availability_examus.form.fillErrors = function(errors, node) {"," var value = {};"," this.fillValue(value, node);",""," if (value.duration === undefined || !/^\\d+$/.test(value.duration) || value.duration % 30 !== 0) {"," errors.push('availability_examus:error_setduration');"," }","};","","}, '@VERSION@', {\"requires\": [\"base\", \"node\", \"event\", \"moodle-core_availability-form\"]});","","}());"]};
}
var __cov_VkxrC3bnPgMAADDnSvyZqQ = __coverage__['build/moodle-availability_examus-form/moodle-availability_examus-form.js'];
-__cov_VkxrC3bnPgMAADDnSvyZqQ.s['1']++;YUI.add('moodle-availability_examus-form',function(Y,NAME){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['1']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['2']++;M.availability_examus=(__cov_VkxrC3bnPgMAADDnSvyZqQ.b['1'][0]++,M.availability_examus)||(__cov_VkxrC3bnPgMAADDnSvyZqQ.b['1'][1]++,{});__cov_VkxrC3bnPgMAADDnSvyZqQ.s['3']++;M.availability_examus.form=Y.Object(M.core_availability.plugin);__cov_VkxrC3bnPgMAADDnSvyZqQ.s['4']++;M.availability_examus.form.initInner=function(){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['2']++;};__cov_VkxrC3bnPgMAADDnSvyZqQ.s['5']++;M.availability_examus.form.instId=1;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['6']++;M.availability_examus.form.getNode=function(json){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['3']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['7']++;var html,node,root,id,strings;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['8']++;strings=M.str.availability_examus;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['9']++;id='examus'+M.availability_examus.form.instId;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['10']++;M.availability_examus.form.instId+=1;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['11']++;html='
';__cov_VkxrC3bnPgMAADDnSvyZqQ.s['12']++;html+='';__cov_VkxrC3bnPgMAADDnSvyZqQ.s['13']++;html+='';__cov_VkxrC3bnPgMAADDnSvyZqQ.s['14']++;node=Y.Node.create(' '+html+' ');__cov_VkxrC3bnPgMAADDnSvyZqQ.s['15']++;if(json.duration!==undefined){__cov_VkxrC3bnPgMAADDnSvyZqQ.b['2'][0]++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['16']++;node.one('input[name=duration]').set('value',json.duration);}else{__cov_VkxrC3bnPgMAADDnSvyZqQ.b['2'][1]++;}__cov_VkxrC3bnPgMAADDnSvyZqQ.s['17']++;if(!M.availability_examus.form.addedEvents){__cov_VkxrC3bnPgMAADDnSvyZqQ.b['3'][0]++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['18']++;M.availability_examus.form.addedEvents=true;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['19']++;root=Y.one('#fitem_id_availabilityconditionsjson');__cov_VkxrC3bnPgMAADDnSvyZqQ.s['20']++;root.delegate('valuechange',function(){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['4']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['21']++;M.core_availability.form.update();},'.availability_examus input[name=duration]');}else{__cov_VkxrC3bnPgMAADDnSvyZqQ.b['3'][1]++;}__cov_VkxrC3bnPgMAADDnSvyZqQ.s['22']++;return node;};__cov_VkxrC3bnPgMAADDnSvyZqQ.s['23']++;M.availability_examus.form.fillValue=function(value,node){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['5']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['24']++;value.duration=node.one('input[name=duration').get('value').trim();};__cov_VkxrC3bnPgMAADDnSvyZqQ.s['25']++;M.availability_examus.form.fillErrors=function(errors,node){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['6']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['26']++;var value={};__cov_VkxrC3bnPgMAADDnSvyZqQ.s['27']++;this.fillValue(value,node);__cov_VkxrC3bnPgMAADDnSvyZqQ.s['28']++;if((__cov_VkxrC3bnPgMAADDnSvyZqQ.b['5'][0]++,value.duration===undefined)||(__cov_VkxrC3bnPgMAADDnSvyZqQ.b['5'][1]++,!/^\d+$/.test(value.duration))||(__cov_VkxrC3bnPgMAADDnSvyZqQ.b['5'][2]++,value.duration%30!=0)){__cov_VkxrC3bnPgMAADDnSvyZqQ.b['4'][0]++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['29']++;errors.push('availability_examus:error_setduration');}else{__cov_VkxrC3bnPgMAADDnSvyZqQ.b['4'][1]++;}};},'@VERSION@',{'requires':['base','node','event','moodle-core_availability-form']});
+__cov_VkxrC3bnPgMAADDnSvyZqQ.s['1']++;YUI.add('moodle-availability_examus-form',function(Y,NAME){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['1']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['2']++;M.availability_examus=(__cov_VkxrC3bnPgMAADDnSvyZqQ.b['1'][0]++,M.availability_examus)||(__cov_VkxrC3bnPgMAADDnSvyZqQ.b['1'][1]++,{});__cov_VkxrC3bnPgMAADDnSvyZqQ.s['3']++;M.availability_examus.form=Y.Object(M.core_availability.plugin);__cov_VkxrC3bnPgMAADDnSvyZqQ.s['4']++;M.availability_examus.form.initInner=function(){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['2']++;};__cov_VkxrC3bnPgMAADDnSvyZqQ.s['5']++;M.availability_examus.form.instId=1;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['6']++;M.availability_examus.form.getNode=function(json){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['3']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['7']++;var html,node,root,id,strings;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['8']++;strings=M.str.availability_examus;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['9']++;id='examus'+M.availability_examus.form.instId;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['10']++;M.availability_examus.form.instId+=1;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['11']++;html='
';__cov_VkxrC3bnPgMAADDnSvyZqQ.s['12']++;html+='';__cov_VkxrC3bnPgMAADDnSvyZqQ.s['13']++;html+='';__cov_VkxrC3bnPgMAADDnSvyZqQ.s['14']++;node=Y.Node.create(' '+html+' ');__cov_VkxrC3bnPgMAADDnSvyZqQ.s['15']++;if(json.duration!==undefined){__cov_VkxrC3bnPgMAADDnSvyZqQ.b['2'][0]++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['16']++;node.one('input[name=duration]').set('value',json.duration);}else{__cov_VkxrC3bnPgMAADDnSvyZqQ.b['2'][1]++;}__cov_VkxrC3bnPgMAADDnSvyZqQ.s['17']++;if(!M.availability_examus.form.addedEvents){__cov_VkxrC3bnPgMAADDnSvyZqQ.b['3'][0]++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['18']++;M.availability_examus.form.addedEvents=true;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['19']++;root=Y.one('.availability-field');__cov_VkxrC3bnPgMAADDnSvyZqQ.s['20']++;root.delegate('valuechange',function(){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['4']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['21']++;M.core_availability.form.update();},'.availability_examus input[name=duration]');}else{__cov_VkxrC3bnPgMAADDnSvyZqQ.b['3'][1]++;}__cov_VkxrC3bnPgMAADDnSvyZqQ.s['22']++;return node;};__cov_VkxrC3bnPgMAADDnSvyZqQ.s['23']++;M.availability_examus.form.fillValue=function(value,node){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['5']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['24']++;value.duration=node.one('input[name=duration]').get('value').trim();};__cov_VkxrC3bnPgMAADDnSvyZqQ.s['25']++;M.availability_examus.form.fillErrors=function(errors,node){__cov_VkxrC3bnPgMAADDnSvyZqQ.f['6']++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['26']++;var value={};__cov_VkxrC3bnPgMAADDnSvyZqQ.s['27']++;this.fillValue(value,node);__cov_VkxrC3bnPgMAADDnSvyZqQ.s['28']++;if((__cov_VkxrC3bnPgMAADDnSvyZqQ.b['5'][0]++,value.duration===undefined)||(__cov_VkxrC3bnPgMAADDnSvyZqQ.b['5'][1]++,!/^\d+$/.test(value.duration))||(__cov_VkxrC3bnPgMAADDnSvyZqQ.b['5'][2]++,value.duration%30!==0)){__cov_VkxrC3bnPgMAADDnSvyZqQ.b['4'][0]++;__cov_VkxrC3bnPgMAADDnSvyZqQ.s['29']++;errors.push('availability_examus:error_setduration');}else{__cov_VkxrC3bnPgMAADDnSvyZqQ.b['4'][1]++;}};},'@VERSION@',{'requires':['base','node','event','moodle-core_availability-form']});
diff --git a/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-debug.js b/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-debug.js
index 0f2048d..aeed238 100644
--- a/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-debug.js
+++ b/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-debug.js
@@ -33,9 +33,9 @@ M.availability_examus.form.getNode = function(json) {
if (!M.availability_examus.form.addedEvents) {
M.availability_examus.form.addedEvents = true;
- root = Y.one('#fitem_id_availabilityconditionsjson');
+
+ root = Y.one(".availability-field");
root.delegate('valuechange', function () {
- // Trigger the updating of the hidden availability data whenever the password field changes.
M.core_availability.form.update();
}, '.availability_examus input[name=duration]');
}
@@ -44,14 +44,14 @@ M.availability_examus.form.getNode = function(json) {
};
M.availability_examus.form.fillValue = function(value, node) {
- value.duration = node.one('input[name=duration').get('value').trim();
+ value.duration = node.one('input[name=duration]').get('value').trim();
};
M.availability_examus.form.fillErrors = function(errors, node) {
var value = {};
this.fillValue(value, node);
- if (value.duration === undefined || !/^\d+$/.test(value.duration) || value.duration % 30 != 0) {
+ if (value.duration === undefined || !/^\d+$/.test(value.duration) || value.duration % 30 !== 0) {
errors.push('availability_examus:error_setduration');
}
};
diff --git a/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-min.js b/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-min.js
index f673249..e6326dd 100644
--- a/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-min.js
+++ b/yui/build/moodle-availability_examus-form/moodle-availability_examus-form-min.js
@@ -1 +1 @@
-YUI.add("moodle-availability_examus-form",function(e,t){M.availability_examus=M.availability_examus||{},M.availability_examus.form=e.Object(M.core_availability.plugin),M.availability_examus.form.initInner=function(){},M.availability_examus.form.instId=1,M.availability_examus.form.getNode=function(t){var n,r,i,s,o;return o=M.str.availability_examus,s="examus"+M.availability_examus.form.instId,M.availability_examus.form.instId+=1,n="
",n+='",n+='',r=e.Node.create(" "+n+" "),t.duration!==undefined&&r.one("input[name=duration]").set("value",t.duration),M.availability_examus.form.addedEvents||(M.availability_examus.form.addedEvents=!0,i=e.one("#fitem_id_availabilityconditionsjson"),i.delegate("valuechange",function(){M.core_availability.form.update()},".availability_examus input[name=duration]")),r},M.availability_examus.form.fillValue=function(e,t){e.duration=t.one("input[name=duration").get("value").trim()},M.availability_examus.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),(n.duration===undefined||!/^\d+$/.test(n.duration)||n.duration%30!=0)&&e.push("availability_examus:error_setduration")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
+YUI.add("moodle-availability_examus-form",function(e,t){M.availability_examus=M.availability_examus||{},M.availability_examus.form=e.Object(M.core_availability.plugin),M.availability_examus.form.initInner=function(){},M.availability_examus.form.instId=1,M.availability_examus.form.getNode=function(t){var n,r,i,s,o;return o=M.str.availability_examus,s="examus"+M.availability_examus.form.instId,M.availability_examus.form.instId+=1,n="
",n+='",n+='',r=e.Node.create(" "+n+" "),t.duration!==undefined&&r.one("input[name=duration]").set("value",t.duration),M.availability_examus.form.addedEvents||(M.availability_examus.form.addedEvents=!0,i=e.one(".availability-field"),i.delegate("valuechange",function(){M.core_availability.form.update()},".availability_examus input[name=duration]")),r},M.availability_examus.form.fillValue=function(e,t){e.duration=t.one("input[name=duration]").get("value").trim()},M.availability_examus.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),(n.duration===undefined||!/^\d+$/.test(n.duration)||n.duration%30!==0)&&e.push("availability_examus:error_setduration")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
diff --git a/yui/build/moodle-availability_examus-form/moodle-availability_examus-form.js b/yui/build/moodle-availability_examus-form/moodle-availability_examus-form.js
index 0f2048d..aeed238 100644
--- a/yui/build/moodle-availability_examus-form/moodle-availability_examus-form.js
+++ b/yui/build/moodle-availability_examus-form/moodle-availability_examus-form.js
@@ -33,9 +33,9 @@ M.availability_examus.form.getNode = function(json) {
if (!M.availability_examus.form.addedEvents) {
M.availability_examus.form.addedEvents = true;
- root = Y.one('#fitem_id_availabilityconditionsjson');
+
+ root = Y.one(".availability-field");
root.delegate('valuechange', function () {
- // Trigger the updating of the hidden availability data whenever the password field changes.
M.core_availability.form.update();
}, '.availability_examus input[name=duration]');
}
@@ -44,14 +44,14 @@ M.availability_examus.form.getNode = function(json) {
};
M.availability_examus.form.fillValue = function(value, node) {
- value.duration = node.one('input[name=duration').get('value').trim();
+ value.duration = node.one('input[name=duration]').get('value').trim();
};
M.availability_examus.form.fillErrors = function(errors, node) {
var value = {};
this.fillValue(value, node);
- if (value.duration === undefined || !/^\d+$/.test(value.duration) || value.duration % 30 != 0) {
+ if (value.duration === undefined || !/^\d+$/.test(value.duration) || value.duration % 30 !== 0) {
errors.push('availability_examus:error_setduration');
}
};
diff --git a/yui/src/form/js/form.js b/yui/src/form/js/form.js
index b20d3b0..c5cd3f9 100644
--- a/yui/src/form/js/form.js
+++ b/yui/src/form/js/form.js
@@ -31,9 +31,8 @@ M.availability_examus.form.getNode = function(json) {
if (!M.availability_examus.form.addedEvents) {
M.availability_examus.form.addedEvents = true;
- root = Y.one('#fitem_id_availabilityconditionsjson');
+ root = Y.one(".availability-field");
root.delegate('valuechange', function () {
- // Trigger the updating of the hidden availability data whenever the password field changes.
M.core_availability.form.update();
}, '.availability_examus input[name=duration]');
}
@@ -42,14 +41,14 @@ M.availability_examus.form.getNode = function(json) {
};
M.availability_examus.form.fillValue = function(value, node) {
- value.duration = node.one('input[name=duration').get('value').trim();
+ value.duration = node.one('input[name=duration]').get('value').trim();
};
M.availability_examus.form.fillErrors = function(errors, node) {
var value = {};
this.fillValue(value, node);
- if (value.duration === undefined || !/^\d+$/.test(value.duration) || value.duration % 30 != 0) {
+ if (value.duration === undefined || !/^\d+$/.test(value.duration) || value.duration % 30 !== 0) {
errors.push('availability_examus:error_setduration');
}
};
\ No newline at end of file