ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç PK\4))moodle-mod_quiz-util-page.jsnu[YUI.add('moodle-mod_quiz-util-page', function (Y, NAME) { /* global YUI */ /** * A collection of utility classes for use with pages. * * @module moodle-mod_quiz-util * @submodule moodle-mod_quiz-util-page */ Y.namespace('Moodle.mod_quiz.util.page'); /** * A collection of utility classes for use with pages. * * @class Moodle.mod_quiz.util.page * @static */ Y.Moodle.mod_quiz.util.page = { CSS: { PAGE: 'page' }, CONSTANTS: { ACTIONMENUIDPREFIX: 'action-menu-', ACTIONMENUBARIDSUFFIX: '-menubar', ACTIONMENUMENUIDSUFFIX: '-menu', PAGEIDPREFIX: 'page-', PAGENUMBERPREFIX: M.util.get_string('page', 'moodle') + ' ' }, SELECTORS: { ACTIONMENU: 'div.moodle-actionmenu', ACTIONMENUBAR: '.menubar', ACTIONMENUMENU: '.menu', ADDASECTION: '[data-action="addasection"]', PAGE: 'li.page', INSTANCENAME: '.instancename', NUMBER: 'h4' }, /** * Retrieve the page item from one of it's child Nodes. * * @method getPageFromComponent * @param pagecomponent {Node} The component Node. * @return {Node|null} The Page Node. */ getPageFromComponent: function(pagecomponent) { return Y.one(pagecomponent).ancestor(this.SELECTORS.PAGE, true); }, /** * Retrieve the page item from one of it's previous siblings. * * @method getPageFromSlot * @param pagecomponent {Node} The component Node. * @return {Node|null} The Page Node. */ getPageFromSlot: function(slot) { return Y.one(slot).previous(this.SELECTORS.PAGE); }, /** * Returns the page ID for the provided page. * * @method getId * @param page {Node} The page to find an ID for. * @return {Number|false} The ID of the page in question or false if no ID was found. */ getId: function(page) { // We perform a simple substitution operation to get the ID. var id = page.get('id').replace( this.CONSTANTS.PAGEIDPREFIX, ''); // Attempt to validate the ID. id = parseInt(id, 10); if (typeof id === 'number' && isFinite(id)) { return id; } return false; }, /** * Updates the page id for the provided page. * * @method setId * @param page {Node} The page to update the number for. * @param id int The id value. * @return void */ setId: function(page, id) { page.set('id', this.CONSTANTS.PAGEIDPREFIX + id); }, /** * Determines the page name for the provided page. * * @method getName * @param page {Node} The page to find a name for. * @return {string|false} The name of the page in question or false if no ID was found. */ getName: function(page) { var instance = page.one(this.SELECTORS.INSTANCENAME); if (instance) { return instance.get('firstChild').get('data'); } return null; }, /** * Determines the page number for the provided page. * * @method getNumber * @param page {Node} The page to find a number for. * @return {Number|false} The number of the page in question or false if no number was found. */ getNumber: function(page) { // We perform a simple substitution operation to get the number. var number = page.one(this.SELECTORS.NUMBER).get('text').replace( this.CONSTANTS.PAGENUMBERPREFIX, ''); // Attempt to validate the ID. number = parseInt(number, 10); if (typeof number === 'number' && isFinite(number)) { return number; } return false; }, /** * Updates the page number for the provided page. * * @method setNumber * @param page {Node} The page to update the number for. * @return void */ setNumber: function(page, number) { page.one(this.SELECTORS.NUMBER).set('text', this.CONSTANTS.PAGENUMBERPREFIX + number); }, /** * Returns a list of all page elements. * * @method getPages * @return {node[]} An array containing page nodes. */ getPages: function() { return Y.all(Y.Moodle.mod_quiz.util.slot.SELECTORS.PAGECONTENT + ' ' + Y.Moodle.mod_quiz.util.slot.SELECTORS.SECTIONUL + ' ' + this.SELECTORS.PAGE); }, /** * Is the given element a page element? * * @method isPage * @param page Page node * @return boolean */ isPage: function(page) { if (!page) { return false; } return page.hasClass(this.CSS.PAGE); }, /** * Does the page have atleast one slot? * * @method isEmpty * @param page Page node * @return boolean */ isEmpty: function(page) { var activity = page.next('li.activity'); if (!activity) { return true; } return !activity.hasClass('slot'); }, /** * Add a page and related elements to the list of slots. * * @method add * @param beforenode Int | Node | HTMLElement | String to add * @return page Page node */ add: function(beforenode) { var pagenumber = this.getNumber(this.getPageFromSlot(beforenode)) + 1; var pagehtml = M.mod_quiz.resource_toolbox.get('config').pagehtml; // Normalise the page number. pagehtml = pagehtml.replace(/%%PAGENUMBER%%/g, pagenumber); // Create the page node. var page = Y.Node.create(pagehtml); // Assign is as a drop target. YUI().use('dd-drop', function(Y) { var drop = new Y.DD.Drop({ node: page, groups: M.mod_quiz.dragres.groups }); page.drop = drop; }); // Insert in the correct place. beforenode.insert(page, 'after'); // Enhance the add menu to make if fully visible and clickable. if (typeof M.core.actionmenu !== "undefined") { M.core.actionmenu.newDOMNode(page); } return page; }, /** * Remove a page and related elements from the list of slots. * * @method remove * @param page Page node * @return void */ remove: function(page, keeppagebreak) { // Remove page break from previous slot. var previousslot = page.previous(Y.Moodle.mod_quiz.util.slot.SELECTORS.SLOT); if (!keeppagebreak && previousslot) { Y.Moodle.mod_quiz.util.slot.removePageBreak(previousslot); } page.remove(); }, /** * Reset the order of the numbers given to each page. * * @method reorderPages * @return void */ reorderPages: function() { // Get list of page nodes. var pages = this.getPages(); var currentpagenumber = 0; // Loop through pages incrementing the number each time. pages.each(function(page) { // Is the page empty? if (this.isEmpty(page)) { var keeppagebreak = page.next('li.slot') ? true : false; this.remove(page, keeppagebreak); return; } currentpagenumber++; // Set page number. this.setNumber(page, currentpagenumber); this.setId(page, currentpagenumber); }, this); // Reorder action menus this.reorderActionMenus(); }, /** * Reset the order of the numbers given to each action menu. * * @method reorderActionMenus * @return void */ reorderActionMenus: function() { // Get list of action menu nodes. var actionmenus = this.getActionMenus(); // Loop through pages incrementing the number each time. actionmenus.each(function(actionmenu, key) { var previousActionMenu = actionmenus.item(key - 1), previousActionMenunumber = 0; if (previousActionMenu) { previousActionMenunumber = this.getActionMenuId(previousActionMenu); } var id = previousActionMenunumber + 1; // Set menu id. this.setActionMenuId(actionmenu, id); // Update action-menu-1-menubar var menubar = actionmenu.one(this.SELECTORS.ACTIONMENUBAR); menubar.set('id', this.CONSTANTS.ACTIONMENUIDPREFIX + id + this.CONSTANTS.ACTIONMENUBARIDSUFFIX); // Update action-menu-1-menu var menumenu = actionmenu.one(this.SELECTORS.ACTIONMENUMENU); menumenu.set('id', this.CONSTANTS.ACTIONMENUIDPREFIX + id + this.CONSTANTS.ACTIONMENUMENUIDSUFFIX); // Update the URL of the add-section action. menumenu.one(this.SELECTORS.ADDASECTION).set('href', menumenu.one(this.SELECTORS.ADDASECTION).get('href').replace(/\baddsectionatpage=\d+\b/, 'addsectionatpage=' + id)); }, this); }, /** * Returns a list of all page elements. * * @method getActionMenus * @return {node[]} An array containing page nodes. */ getActionMenus: function() { return Y.all(Y.Moodle.mod_quiz.util.slot.SELECTORS.PAGECONTENT + ' ' + Y.Moodle.mod_quiz.util.slot.SELECTORS.SECTIONUL + ' ' + this.SELECTORS.ACTIONMENU); }, /** * Returns the ID for the provided action menu. * * @method getId * @param actionmenu {Node} The actionmenu to find an ID for. * @return {Number|false} The ID of the actionmenu in question or false if no ID was found. */ getActionMenuId: function(actionmenu) { // We perform a simple substitution operation to get the ID. var id = actionmenu.get('id').replace( this.CONSTANTS.ACTIONMENUIDPREFIX, ''); // Attempt to validate the ID. id = parseInt(id, 10); if (typeof id === 'number' && isFinite(id)) { return id; } return false; }, /** * Updates the page id for the provided page. * * @method setId * @param page {Node} The page to update the number for. * @param id int The id value. * @return void */ setActionMenuId: function(actionmenu, id) { actionmenu.set('id', this.CONSTANTS.ACTIONMENUIDPREFIX + id); } }; }, '@VERSION@', {"requires": ["node", "moodle-mod_quiz-util-base"]}); PK\4))"moodle-mod_quiz-util-page-debug.jsnu[YUI.add('moodle-mod_quiz-util-page', function (Y, NAME) { /* global YUI */ /** * A collection of utility classes for use with pages. * * @module moodle-mod_quiz-util * @submodule moodle-mod_quiz-util-page */ Y.namespace('Moodle.mod_quiz.util.page'); /** * A collection of utility classes for use with pages. * * @class Moodle.mod_quiz.util.page * @static */ Y.Moodle.mod_quiz.util.page = { CSS: { PAGE: 'page' }, CONSTANTS: { ACTIONMENUIDPREFIX: 'action-menu-', ACTIONMENUBARIDSUFFIX: '-menubar', ACTIONMENUMENUIDSUFFIX: '-menu', PAGEIDPREFIX: 'page-', PAGENUMBERPREFIX: M.util.get_string('page', 'moodle') + ' ' }, SELECTORS: { ACTIONMENU: 'div.moodle-actionmenu', ACTIONMENUBAR: '.menubar', ACTIONMENUMENU: '.menu', ADDASECTION: '[data-action="addasection"]', PAGE: 'li.page', INSTANCENAME: '.instancename', NUMBER: 'h4' }, /** * Retrieve the page item from one of it's child Nodes. * * @method getPageFromComponent * @param pagecomponent {Node} The component Node. * @return {Node|null} The Page Node. */ getPageFromComponent: function(pagecomponent) { return Y.one(pagecomponent).ancestor(this.SELECTORS.PAGE, true); }, /** * Retrieve the page item from one of it's previous siblings. * * @method getPageFromSlot * @param pagecomponent {Node} The component Node. * @return {Node|null} The Page Node. */ getPageFromSlot: function(slot) { return Y.one(slot).previous(this.SELECTORS.PAGE); }, /** * Returns the page ID for the provided page. * * @method getId * @param page {Node} The page to find an ID for. * @return {Number|false} The ID of the page in question or false if no ID was found. */ getId: function(page) { // We perform a simple substitution operation to get the ID. var id = page.get('id').replace( this.CONSTANTS.PAGEIDPREFIX, ''); // Attempt to validate the ID. id = parseInt(id, 10); if (typeof id === 'number' && isFinite(id)) { return id; } return false; }, /** * Updates the page id for the provided page. * * @method setId * @param page {Node} The page to update the number for. * @param id int The id value. * @return void */ setId: function(page, id) { page.set('id', this.CONSTANTS.PAGEIDPREFIX + id); }, /** * Determines the page name for the provided page. * * @method getName * @param page {Node} The page to find a name for. * @return {string|false} The name of the page in question or false if no ID was found. */ getName: function(page) { var instance = page.one(this.SELECTORS.INSTANCENAME); if (instance) { return instance.get('firstChild').get('data'); } return null; }, /** * Determines the page number for the provided page. * * @method getNumber * @param page {Node} The page to find a number for. * @return {Number|false} The number of the page in question or false if no number was found. */ getNumber: function(page) { // We perform a simple substitution operation to get the number. var number = page.one(this.SELECTORS.NUMBER).get('text').replace( this.CONSTANTS.PAGENUMBERPREFIX, ''); // Attempt to validate the ID. number = parseInt(number, 10); if (typeof number === 'number' && isFinite(number)) { return number; } return false; }, /** * Updates the page number for the provided page. * * @method setNumber * @param page {Node} The page to update the number for. * @return void */ setNumber: function(page, number) { page.one(this.SELECTORS.NUMBER).set('text', this.CONSTANTS.PAGENUMBERPREFIX + number); }, /** * Returns a list of all page elements. * * @method getPages * @return {node[]} An array containing page nodes. */ getPages: function() { return Y.all(Y.Moodle.mod_quiz.util.slot.SELECTORS.PAGECONTENT + ' ' + Y.Moodle.mod_quiz.util.slot.SELECTORS.SECTIONUL + ' ' + this.SELECTORS.PAGE); }, /** * Is the given element a page element? * * @method isPage * @param page Page node * @return boolean */ isPage: function(page) { if (!page) { return false; } return page.hasClass(this.CSS.PAGE); }, /** * Does the page have atleast one slot? * * @method isEmpty * @param page Page node * @return boolean */ isEmpty: function(page) { var activity = page.next('li.activity'); if (!activity) { return true; } return !activity.hasClass('slot'); }, /** * Add a page and related elements to the list of slots. * * @method add * @param beforenode Int | Node | HTMLElement | String to add * @return page Page node */ add: function(beforenode) { var pagenumber = this.getNumber(this.getPageFromSlot(beforenode)) + 1; var pagehtml = M.mod_quiz.resource_toolbox.get('config').pagehtml; // Normalise the page number. pagehtml = pagehtml.replace(/%%PAGENUMBER%%/g, pagenumber); // Create the page node. var page = Y.Node.create(pagehtml); // Assign is as a drop target. YUI().use('dd-drop', function(Y) { var drop = new Y.DD.Drop({ node: page, groups: M.mod_quiz.dragres.groups }); page.drop = drop; }); // Insert in the correct place. beforenode.insert(page, 'after'); // Enhance the add menu to make if fully visible and clickable. if (typeof M.core.actionmenu !== "undefined") { M.core.actionmenu.newDOMNode(page); } return page; }, /** * Remove a page and related elements from the list of slots. * * @method remove * @param page Page node * @return void */ remove: function(page, keeppagebreak) { // Remove page break from previous slot. var previousslot = page.previous(Y.Moodle.mod_quiz.util.slot.SELECTORS.SLOT); if (!keeppagebreak && previousslot) { Y.Moodle.mod_quiz.util.slot.removePageBreak(previousslot); } page.remove(); }, /** * Reset the order of the numbers given to each page. * * @method reorderPages * @return void */ reorderPages: function() { // Get list of page nodes. var pages = this.getPages(); var currentpagenumber = 0; // Loop through pages incrementing the number each time. pages.each(function(page) { // Is the page empty? if (this.isEmpty(page)) { var keeppagebreak = page.next('li.slot') ? true : false; this.remove(page, keeppagebreak); return; } currentpagenumber++; // Set page number. this.setNumber(page, currentpagenumber); this.setId(page, currentpagenumber); }, this); // Reorder action menus this.reorderActionMenus(); }, /** * Reset the order of the numbers given to each action menu. * * @method reorderActionMenus * @return void */ reorderActionMenus: function() { // Get list of action menu nodes. var actionmenus = this.getActionMenus(); // Loop through pages incrementing the number each time. actionmenus.each(function(actionmenu, key) { var previousActionMenu = actionmenus.item(key - 1), previousActionMenunumber = 0; if (previousActionMenu) { previousActionMenunumber = this.getActionMenuId(previousActionMenu); } var id = previousActionMenunumber + 1; // Set menu id. this.setActionMenuId(actionmenu, id); // Update action-menu-1-menubar var menubar = actionmenu.one(this.SELECTORS.ACTIONMENUBAR); menubar.set('id', this.CONSTANTS.ACTIONMENUIDPREFIX + id + this.CONSTANTS.ACTIONMENUBARIDSUFFIX); // Update action-menu-1-menu var menumenu = actionmenu.one(this.SELECTORS.ACTIONMENUMENU); menumenu.set('id', this.CONSTANTS.ACTIONMENUIDPREFIX + id + this.CONSTANTS.ACTIONMENUMENUIDSUFFIX); // Update the URL of the add-section action. menumenu.one(this.SELECTORS.ADDASECTION).set('href', menumenu.one(this.SELECTORS.ADDASECTION).get('href').replace(/\baddsectionatpage=\d+\b/, 'addsectionatpage=' + id)); }, this); }, /** * Returns a list of all page elements. * * @method getActionMenus * @return {node[]} An array containing page nodes. */ getActionMenus: function() { return Y.all(Y.Moodle.mod_quiz.util.slot.SELECTORS.PAGECONTENT + ' ' + Y.Moodle.mod_quiz.util.slot.SELECTORS.SECTIONUL + ' ' + this.SELECTORS.ACTIONMENU); }, /** * Returns the ID for the provided action menu. * * @method getId * @param actionmenu {Node} The actionmenu to find an ID for. * @return {Number|false} The ID of the actionmenu in question or false if no ID was found. */ getActionMenuId: function(actionmenu) { // We perform a simple substitution operation to get the ID. var id = actionmenu.get('id').replace( this.CONSTANTS.ACTIONMENUIDPREFIX, ''); // Attempt to validate the ID. id = parseInt(id, 10); if (typeof id === 'number' && isFinite(id)) { return id; } return false; }, /** * Updates the page id for the provided page. * * @method setId * @param page {Node} The page to update the number for. * @param id int The id value. * @return void */ setActionMenuId: function(actionmenu, id) { actionmenu.set('id', this.CONSTANTS.ACTIONMENUIDPREFIX + id); } }; }, '@VERSION@', {"requires": ["node", "moodle-mod_quiz-util-base"]}); PK\[I moodle-mod_quiz-util-page-min.jsnu[YUI.add("moodle-mod_quiz-util-page",function(n,e){n.namespace("Moodle.mod_quiz.util.page"),n.Moodle.mod_quiz.util.page={CSS:{PAGE:"page"},CONSTANTS:{ACTIONMENUIDPREFIX:"action-menu-",ACTIONMENUBARIDSUFFIX:"-menubar",ACTIONMENUMENUIDSUFFIX:"-menu",PAGEIDPREFIX:"page-",PAGENUMBERPREFIX:M.util.get_string("page","moodle")+" "},SELECTORS:{ACTIONMENU:"div.moodle-actionmenu",ACTIONMENUBAR:".menubar",ACTIONMENUMENU:".menu",ADDASECTION:'[data-action="addasection"]',PAGE:"li.page",INSTANCENAME:".instancename",NUMBER:"h4"},getPageFromComponent:function(e){return n.one(e).ancestor(this.SELECTORS.PAGE,!0)},getPageFromSlot:function(e){return n.one(e).previous(this.SELECTORS.PAGE)},getId:function(e){e=e.get("id").replace(this.CONSTANTS.PAGEIDPREFIX,"");return!("number"!=typeof(e=parseInt(e,10))||!isFinite(e))&&e},setId:function(e,t){e.set("id",this.CONSTANTS.PAGEIDPREFIX+t)},getName:function(e){e=e.one(this.SELECTORS.INSTANCENAME);return e?e.get("firstChild").get("data"):null},getNumber:function(e){e=e.one(this.SELECTORS.NUMBER).get("text").replace(this.CONSTANTS.PAGENUMBERPREFIX,"");return!("number"!=typeof(e=parseInt(e,10))||!isFinite(e))&&e},setNumber:function(e,t){e.one(this.SELECTORS.NUMBER).set("text",this.CONSTANTS.PAGENUMBERPREFIX+t)},getPages:function(){return n.all(n.Moodle.mod_quiz.util.slot.SELECTORS.PAGECONTENT+" "+n.Moodle.mod_quiz.util.slot.SELECTORS.SECTIONUL+" "+this.SELECTORS.PAGE)},isPage:function(e){return!!e&&e.hasClass(this.CSS.PAGE)},isEmpty:function(e){e=e.next("li.activity");return!e||!e.hasClass("slot")},add:function(e){var t=this.getNumber(this.getPageFromSlot(e))+1,i=M.mod_quiz.resource_toolbox.get("config").pagehtml,i=i.replace(/%%PAGENUMBER%%/g,t),o=n.Node.create(i);return YUI().use("dd-drop",function(e){e=new e.DD.Drop({node:o,groups:M.mod_quiz.dragres.groups});o.drop=e}),e.insert(o,"after"),"undefined"!=typeof M.core.actionmenu&&M.core.actionmenu.newDOMNode(o),o},remove:function(e,t){var i=e.previous(n.Moodle.mod_quiz.util.slot.SELECTORS.SLOT);!t&&i&&n.Moodle.mod_quiz.util.slot.removePageBreak(i),e.remove()},reorderPages:function(){var e=this.getPages(),i=0;e.each(function(e){var t;if(this.isEmpty(e))return t=!!e.next("li.slot"),void this.remove(e,t);i++,this.setNumber(e,i),this.setId(e,i)},this),this.reorderActionMenus()},reorderActionMenus:function(){var o=this.getActionMenus();o.each(function(e,t){var t=o.item(t-1),i=0;t&&(i=this.getActionMenuId(t)),this.setActionMenuId(e,t=i+1),e.one(this.SELECTORS.ACTIONMENUBAR).set("id",this.CONSTANTS.ACTIONMENUIDPREFIX+t+this.CONSTANTS.ACTIONMENUBARIDSUFFIX),(i=e.one(this.SELECTORS.ACTIONMENUMENU)).set("id",this.CONSTANTS.ACTIONMENUIDPREFIX+t+this.CONSTANTS.ACTIONMENUMENUIDSUFFIX),i.one(this.SELECTORS.ADDASECTION).set("href",i.one(this.SELECTORS.ADDASECTION).get("href").replace(/\baddsectionatpage=\d+\b/,"addsectionatpage="+t))},this)},getActionMenus:function(){return n.all(n.Moodle.mod_quiz.util.slot.SELECTORS.PAGECONTENT+" "+n.Moodle.mod_quiz.util.slot.SELECTORS.SECTIONUL+" "+this.SELECTORS.ACTIONMENU)},getActionMenuId:function(e){e=e.get("id").replace(this.CONSTANTS.ACTIONMENUIDPREFIX,"");return!("number"!=typeof(e=parseInt(e,10))||!isFinite(e))&&e},setActionMenuId:function(e,t){e.set("id",this.CONSTANTS.ACTIONMENUIDPREFIX+t)}}},"@VERSION@",{requires:["node","moodle-mod_quiz-util-base"]});PK\4))moodle-mod_quiz-util-page.jsnu[PK\4))"R)moodle-mod_quiz-util-page-debug.jsnu[PK\[I Rmoodle-mod_quiz-util-page-min.jsnu[PK_