{"version":3,"file":"exporter.min.js","sources":["https:\/\/e-learning.signwise.ch\/course\/format\/flextiles\/amd\/src\/local\/courseeditor\/exporter.js"],"sourcesContent":["\/\/ This file is part of Moodle - http:\/\/moodle.org\/\n\/\/\n\/\/ Moodle is free software: you can redistribute it and\/or modify\n\/\/ it under the terms of the GNU General Public License as published by\n\/\/ the Free Software Foundation, either version 3 of the License, or\n\/\/ (at your option) any later version.\n\/\/\n\/\/ Moodle is distributed in the hope that it will be useful,\n\/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\/\/ GNU General Public License for more details.\n\/\/\n\/\/ You should have received a copy of the GNU General Public License\n\/\/ along with Moodle. If not, see .\n\nimport Exporter from \"core_courseformat\/local\/courseeditor\/exporter\";\n\n\/**\n * Overriding default course format exporter\n *\n * @module format_flextiles\/local\/courseeditor\/exporter\n * @copyright 2022 Marina Glancy\n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\nexport default class extends Exporter {\n\n \/**\n * Generate a section export data from the state.\n *\n * @param {Object} state the current state.\n * @param {Object} sectioninfo the section state data.\n * @returns {Object}\n *\/\n section(state, sectioninfo) {\n const children = sectioninfo.children || [];\n\n \/\/ Basisdaten (Titel, Sichtbarkeit, Nummer, etc.)\n const section = super.section(state, sectioninfo);\n\n \/\/ \ud83d\udd39 Aktuelle Section anhand der URL ermitteln (?section=4)\n let currentSectionNumber = null;\n try {\n const params = new URLSearchParams(window.location.search);\n const sec = params.get('section');\n if (sec !== null) {\n currentSectionNumber = Number(sec);\n }\n } catch (e) {\n \/\/ Fallback: wenn irgendwas schiefgeht, ignorieren wir es leise\n }\n\n if (currentSectionNumber !== null) {\n \/\/ Die \"Nummer\" der Section \u2013 kommt aus dem Core-Exporter.\n const thisSectionNumber =\n section.number ??\n sectioninfo.number ??\n sectioninfo.section ??\n null;\n\n if (thisSectionNumber !== null &&\n Number(thisSectionNumber) === currentSectionNumber) {\n section.current = true;\n }\n }\n\n \/\/ Kinder rekursiv exportieren\n section.children = [];\n for (const child of children) {\n section.children.push(this.section(state, child));\n }\n\n return section;\n }\n\n \/**\n * @param {Object} state The current state.\n * @param {Object} cminfo The course module info.\n * @returns {Object}\n * Export a course module with additional draggable metadata.\n *\/\n cm(state, cminfo) {\n const cm = super.cm(state, cminfo);\n cm.draggabledata = {\n type: 'cm',\n id: cminfo.id,\n sectionid: cminfo.sectionid,\n name: cminfo.name,\n };\n return cm;\n }\n}"],"names":["Exporter","section","state","sectioninfo","children","super","currentSectionNumber","sec","URLSearchParams","window","location","search","get","Number","e","thisSectionNumber","number","current","child","push","this","cm","cminfo","draggabledata","type","id","sectionid","name"],"mappings":";;;;;;;wKAwB6BA,kBASzBC,QAAQC,MAAOC,mBACLC,SAAWD,YAAYC,UAAY,GAGnCH,QAAUI,MAAMJ,QAAQC,MAAOC,iBAGjCG,qBAAuB,eAGjBC,IADS,IAAIC,gBAAgBC,OAAOC,SAASC,QAChCC,IAAI,WACX,OAARL,MACAD,qBAAuBO,OAAON,MAEpC,MAAOO,OAIoB,OAAzBR,qBAA+B,sCAEzBS,qEACFd,QAAQe,kDACRb,YAAYa,8BACZb,YAAYF,6BACZ,KAEsB,OAAtBc,mBACAF,OAAOE,qBAAuBT,uBAC9BL,QAAQgB,SAAU,GAK1BhB,QAAQG,SAAW,OACd,MAAMc,SAASd,SAChBH,QAAQG,SAASe,KAAKC,KAAKnB,QAAQC,MAAOgB,eAGvCjB,QASXoB,GAAGnB,MAAOoB,cACAD,GAAKhB,MAAMgB,GAAGnB,MAAOoB,eAC3BD,GAAGE,cAAgB,CACfC,KAAM,KACNC,GAAIH,OAAOG,GACXC,UAAWJ,OAAOI,UAClBC,KAAML,OAAOK,MAEVN"}