{"version":3,"file":"studyplan-report-components.min.js","sources":["../src/studyplan-report-components.js"],"sourcesContent":["/* eslint no-var: \"error\"*/\n/* eslint no-unused-vars: warn */\n/* eslint max-depth: [\"error\", 6] */\n/* eslint promise/no-nesting: \"off\" */\n/* eslint camelcase: \"off\" */\n/* eslint-env es6*/\n// Put this file in path/to/plugin/amd/src\n\nimport {loadStrings} from './util/string-helper';\nimport {call} from 'core/ajax';\nimport notification from 'core/notification';\nimport TSComponents from './treestudyplan-components';\nimport FitTextVue from './util/fittext-vue';\nimport {formatDatetime} from \"./util/date-helper\";\n\n\n/**\n * Strip tags from html\n * @param {*} html\n * @returns {string}\n */\nfunction striptags(html) {\n const tmp = document.createElement(\"DIV\");\n tmp.innerHTML = html;\n const text = tmp.textContent || tmp.innerText;\n tmp.remove();\n return text;\n}\n\n/**\n * Retrieve condition headers\n * @param {Object} item\n * @returns {Array}\n */\nfunction conditionHeaders(item) {\n const course = item.course;\n const list = [];\n if (course.competency) {\n for (const cmp of course.competency.competencies) {\n list.push({\n name: (cmp.details ? (`${cmp.title} - ${cmp.details}`) : cmp.title),\n tooltip: cmp.description,\n });\n }\n } else if (course.completion) {\n for (const cnd of course.completion.conditions) {\n for (const itm of cnd.items) {\n list.push({\n name: itm.title,\n tooltip: `${itm.details.type}: ${itm.details.requirement}`,\n });\n }\n }\n } else if (course.grades) {\n for (const g of course.grades) {\n if (g.selected) {\n list.push({\n name: g.name,\n tooltip: `${g.typename}: ${striptags(g.name)}`,\n });\n }\n }\n }\n return list;\n}\n\n/**\n * Retrieve conditions\n * @param {Object} item\n * @returns {Array}\n */\nfunction conditions(item) {\n const course = item.course;\n const list = [];\n if (course.competency) {\n for (const cmp of course.competency.competencies) {\n list.push(cmp);\n }\n } else if (course.completion) {\n for (const cnd of course.completion.conditions) {\n for (const itm of cnd.items) {\n list.push(itm);\n }\n }\n } else if (course.grades) {\n for (const g of course.grades) {\n if (g.selected) {\n list.push(g);\n }\n }\n }\n return list;\n}\n\n\nexport default {\n install(Vue /* ,options */) {\n Vue.use(TSComponents);\n Vue.use(FitTextVue);\n\n let strings = loadStrings({\n report: {\n loading: \"loadinghelp@core\",\n studyplan_past: \"studyplan_past\",\n studyplan_present: \"studyplan_present\",\n studyplan_future: \"studyplan_future\",\n back: \"back\",\n },\n\n invalid: {\n error: 'error',\n },\n header: {\n overall: 'overall',\n students: 'students@core',\n firstname: 'firstname@core',\n lastname: 'lastname@core',\n email: 'email@core',\n lastaccess: 'lastaccess@core',\n },\n studentresults: {\n completion_incomplete: \"completion_incomplete\",\n completion_failed: \"completion_failed\",\n completion_pending: \"completion_pending\",\n completion_progress: \"completion_progress\",\n completion_completed: \"completion_completed\",\n completion_good: \"completion_good\",\n completion_excellent: \"completion_excellent\",\n student_not_tracked: \"student_not_tracked\",\n never: \"never@core\",\n }\n });\n\n /* **********************************\n * *\n * Treestudyplan Viewer components *\n * *\n * **********************************/\n\n Vue.component('q-studyplanreport', {\n props: {\n structure: {\n type: Object,\n },\n },\n data() {\n return {\n students: [],\n studentresults: {},\n studentsloading: true,\n expansioninfo: {\n periods: {},\n lines: {},\n items: {},\n },\n groupinfo: {},\n\n sorting: {\n header: 'lastname',\n asc: true,\n }\n };\n },\n watch: {\n structure: {\n immediate: true,\n handler(structure) {\n this.loadStudents(); // Reload the student list\n // (Re)build expansion info structure\n let firstperiod = true;\n for (const period of structure.periods) {\n const pid = period.period.id;\n if (!this.expansioninfo.periods[pid]) {\n // Use this.$set to make sure the properties are reactive.\n this.$set(\n this.expansioninfo.periods,\n pid,\n {\n expanded: ((firstperiod && period.lines.length > 0) ? true : false),\n }\n );\n this.$set(\n this.expansioninfo.lines,\n period.period.id,\n {}\n );\n }\n for (const line of period.lines) {\n const lid = line.line.id;\n if (!this.expansioninfo.lines[lid]) {\n // Use this.$set to make sure the properties are reactive.\n this.$set(\n this.expansioninfo.lines[pid],\n lid,\n {\n expanded: true,\n }\n );\n }\n for (const item of line.items) {\n if (!this.expansioninfo.items[item.id]) {\n // Use this.$set to make sure the properties are reactive.\n this.$set(\n this.expansioninfo.items,\n item.id,\n {\n expanded: false,\n }\n );\n }\n }\n }\n firstperiod = false;\n }\n }\n }\n },\n computed: {\n sortedstudents() {\n // Probably could make a deep copy for purity's sake, but this works just as well.\n const students = this.students;\n for (const group of this.students) {\n group.users.sort((a, b) => {\n let d = a;\n let e = b;\n if (!this.sorting.asc) {\n d = b;\n e = a;\n }\n if (this.sorting.header == \"lastaccess\") {\n const dvalue = (d[this.sorting.header] ? d[this.sorting.header] : 0);\n const evalue = (e[this.sorting.header] ? e[this.sorting.header] : 0);\n return dvalue - evalue;\n } else {\n return String(d[this.sorting.header]).localeCompare(String(e[this.sorting.header]));\n }\n });\n }\n return students;\n },\n resultColCount() {\n let count = 0;\n for (const period of this.structure.periods) {\n const pid = period.period.id;\n if (!this.expansioninfo.periods[pid].expanded) {\n // This period is not expanded. Make it 3 units wide\n count += 2;\n } else {\n for (const line of period.lines) {\n const lid = line.line.id;\n if (!this.expansioninfo.lines[pid][lid].expanded) {\n count += 1;\n } else {\n for (const item of line.items) {\n if (!this.expansioninfo.items[item.id].expanded) {\n count += 1;\n } else {\n count += 1 + conditions(item).length;\n }\n }\n }\n }\n }\n }\n return count;\n }\n },\n methods: {\n loadStudents() {\n const self = this;\n self.studentsloading = true;\n call([{\n methodname: 'local_treestudyplan_all_associated_grouped',\n args: {'studyplan_id': this.structure.studyplan.id}\n }])[0].then((response) => {\n self.students = response;\n for (const group of self.students) {\n self.$set(\n self.groupinfo,\n group.id,\n {\n expanded: true,\n }\n );\n\n for (const student of group.users) {\n self.$set(\n self.studentresults,\n student.id,\n {\n loading: true,\n results: [],\n }\n );\n call([{\n methodname: 'local_treestudyplan_get_report_data',\n args: {\n pageid: self.structure.page.id,\n userid: student.id,\n firstperiod: self.structure.firstperiod,\n lastperiod: self.structure.lastperiod,\n }\n }])[0].then((response) => {\n self.studentresults[student.id].loading = false;\n self.studentresults[student.id].results = response;\n return;\n }).catch(notification.exception);\n }\n }\n self.studentsloading = false;\n return;\n }).catch(notification.exception);\n },\n expansionChanged(parm, id, val) {\n if (parm[0] == 'p') {\n parm = 'periods';\n } else if (parm[0] == 'l') {\n parm = 'lines';\n } else {\n parm = 'items';\n }\n\n if (parm == 'lines') {\n this.expansioninfo[parm][id[0]][id[1]].expanded = val;\n } else {\n this.expansioninfo[parm][id].expanded = val;\n }\n },\n groupExpansionChanged(group) {\n this.groupinfo[group.id].expanded = !this.groupinfo[group.id].expanded;\n },\n toggleSort(header) {\n if (this.sorting.header == header) {\n this.sorting.asc = !this.sorting.asc;\n } else {\n this.sorting.header = header;\n this.sorting.asc = true;\n }\n }\n },\n template: `\n \n \n \n \n \n \n \n \n \n \n
\n
\n `,\n });\n\n Vue.component('q-header', {\n props: {\n structure: {\n type: Object,\n },\n sorting: {\n type: Object,\n },\n expansion: {\n type: Object\n },\n },\n data() {\n return {\n text: strings.header,\n };\n },\n computed: {\n },\n methods: {\n conditions(item) {\n return conditionHeaders(item);\n },\n colspanPeriod(period) {\n const pid = period.period.id;\n if (this.expansion.periods[pid].expanded) {\n let sum = 0;\n for (const l of period.lines) {\n sum += this.colspanLine(period, l);\n }\n return sum;\n } else {\n return 2;\n }\n },\n colspanLine(period, line) {\n const pid = period.period.id;\n const lid = line.line.id;\n\n if (this.expansion.lines[pid][lid].expanded) {\n let sum = 0;\n for (const i of line.items) {\n sum += this.colspanItem(i);\n }\n return sum;\n } else {\n return 1;\n }\n },\n colspanItem(item) {\n if (this.expansion.items[item.id].expanded) {\n const cs = this.conditions(item);\n return 1 + cs.length;\n } else {\n return 1;\n }\n },\n togglePeriod(period, val) {\n if (val === undefined) {\n val = !(this.expansion.periods[period.id].expanded);\n }\n this.$emit('expansion', 'periods', period.id, val);\n },\n toggleLine(period, line, val) {\n if (val === undefined) {\n val = !(this.expansion.lines[period.id][line.id].expanded);\n }\n this.$emit('expansion', 'lines', [period.id, line.id], val);\n },\n toggleItem(item, val) {\n if (val === undefined) {\n val = !(this.expansion.items[item.id].expanded);\n }\n this.$emit('expansion', 'items', item.id, val);\n },\n toggleSort(heading) {\n this.$emit('togglesort', heading);\n }\n },\n /* TODO: https://css-tricks.com/position-sticky-and-table-headers/ */\n template: `\n \n \n {{text.students}}\n  {{ p.period.fullname}}{{ p.period.fullname}}\n \n \n \n \n \n \n \n \n \n \n \n \n {{text.firstname}}\n / {{text.lastname}}\n \n \n {{text.lastaccess}}\n \n \n \n `,\n });\n\n Vue.component('q-groupheading', {\n props: {\n group: {\n type: Object,\n },\n resultcolumns: {\n type: Number,\n 'default': 1\n },\n studentinfocolumns: {\n type: Number,\n 'default': 1\n },\n expanded: {\n type: Boolean,\n }\n },\n data() {\n return {\n\n };\n },\n computed: {\n },\n methods: {\n toggleGroup() {\n this.$emit('togglegroup', this.group);\n }\n },\n template: `\n \n  {{group.label}}\n \n \n `,\n });\n\n Vue.component('q-inforow', {\n props: {\n resultcolumns: {\n type: Number,\n 'default': 1\n },\n studentinfocolumns: {\n type: Number,\n 'default': 1\n },\n },\n data() {\n return {\n };\n },\n computed: {\n },\n methods: {\n },\n template: `\n \n \n \n \n `,\n });\n\n\n Vue.component('q-studentresults', {\n props: {\n student: {\n type: Object,\n },\n structure: {\n type: Object,\n },\n results: {\n type: Array,\n },\n loading: {\n type: Boolean,\n 'default': false\n },\n expansion: {\n type: Object,\n },\n even: {\n type: Boolean,\n 'default': false,\n }\n },\n data() {\n return {\n text: strings.studentresults,\n };\n },\n computed: {\n lastaccess() {\n if (this.student.lastaccess) {\n return formatDatetime(this.student.lastaccess); // Takes date in milliseconds\n } else {\n return this.text.never;\n }\n }\n },\n methods: {\n useritems(line) {\n const list = [];\n for (const item of line.items) {\n let newitm = item;\n for (const itm of this.results) {\n if (item.id == itm.id) {\n newitm = itm;\n break;\n }\n }\n list.push(newitm);\n }\n return list;\n },\n conditions(item) {\n return conditions(item);\n },\n },\n /* https://css-tricks.com/position-sticky-and-table-headers/ */\n template: `\n \n {{student.firstname}} {{student.lastname}}\n {{lastaccess}}\n \n \n `,\n });\n\n Vue.component('q-courseresult', {\n props: {\n student: {\n type: Object,\n },\n item: {\n type: Object,\n },\n loading: {\n type: Boolean,\n 'default': false\n },\n },\n data() {\n return {\n text: strings.studentresults,\n };\n },\n computed: {\n hasprogressinfo() {\n const course = this.item.course;\n if (!course.enrolled) {\n return false;\n } else {\n return (course.completion || course.competency || course.grades) ? true : false;\n }\n },\n completion_icon() {\n const completion = this.item.completion;\n switch (completion) {\n default: // Case \"incomplete\"\n return \"circle-o\";\n case \"pending\":\n return \"question-circle\";\n case \"failed\":\n return \"times-circle\";\n case \"progress\":\n return \"exclamation-circle\";\n case \"completed\":\n return \"check-circle\";\n case \"good\":\n return \"check-circle\";\n case \"excellent\":\n return \"check-circle\";\n }\n },\n },\n methods: {\n },\n template: `\n \n \n \n \n \n `,\n });\n\n Vue.component('q-conditionresult', {\n props: {\n student: {\n type: Object,\n },\n item: {\n type: Object,\n },\n loading: {\n type: Boolean,\n 'default': false\n },\n conditionidx: {\n type: Number,\n }\n },\n data() {\n return {\n text: strings.studentresults,\n };\n },\n computed: {\n conditions() {\n return conditions(this.item);\n },\n condition() {\n if (this.conditionidx >= 0 && this.conditionidx < this.conditions.length) {\n return this.conditions[this.conditionidx];\n } else {\n return null;\n }\n },\n hasprogressinfo() {\n const course = this.item.course;\n if (!course.enrolled) {\n return false;\n } else {\n return (course.completion || course.competency || course.grades);\n }\n },\n completion_icon() {\n const completion = this.condition_completion();\n switch (completion) {\n default: // Case \"incomplete\"\n return \"circle-o\";\n case \"pending\":\n return \"question-circle\";\n case \"failed\":\n return \"times-circle\";\n case \"progress\":\n return \"exclamation-circle\";\n case \"completed\":\n return \"check-circle\";\n case \"good\":\n return \"check-circle\";\n case \"excellent\":\n return \"check-circle\";\n }\n },\n condition_value() {\n const course = this.item.course;\n if (course.competency) {\n if (this.condition.grade) {\n // Return grade if possible.\n return this.condition.grade;\n }\n } else if (course.completion) {\n if (this.condition.grade) {\n // Return grade if possible.\n return this.condition.grade;\n }\n } else if (course.grades) {\n return this.condition.grade;\n }\n // Fallback to completion icon.\n const icon = this.completion_icon();\n return ``;\n },\n condition_completion() {\n // Unify completion information\n const course = this.item.course;\n if (course.competency) {\n const competency = this.condition;\n if (competency.proficient && competency.courseproficient) {\n return \"completed\";\n } else if (competency.proficient) {\n return \"completed\";\n } else if (competency.proficient === false) {\n return \"failed\";\n } else if (competency.progress) {\n return \"progress\";\n } else {\n return \"incomplete\";\n }\n } else if (course.completion) {\n return this.condition.status;\n } else if (course.grades) {\n return this.condition.completion;\n } else {\n return \"incomplete\";\n }\n }\n\n },\n methods: {\n },\n template: `\n \n \n \n \n \n \n \n `,\n });\n },\n};"],"names":["striptags","html","tmp","document","createElement","innerHTML","text","textContent","innerText","remove","conditions","item","course","list","competency","cmp","competencies","push","completion","cnd","itm","items","grades","g","selected","install","Vue","use","TSComponents","FitTextVue","strings","report","loading","studyplan_past","studyplan_present","studyplan_future","back","invalid","error","header","overall","students","firstname","lastname","email","lastaccess","studentresults","completion_incomplete","completion_failed","completion_pending","completion_progress","completion_completed","completion_good","completion_excellent","student_not_tracked","never","component","props","structure","type","Object","data","studentsloading","expansioninfo","periods","lines","groupinfo","sorting","asc","watch","immediate","handler","loadStudents","firstperiod","period","pid","id","this","$set","expanded","length","line","lid","computed","sortedstudents","group","users","sort","a","b","d","e","String","localeCompare","resultColCount","count","methods","self","methodname","args","studyplan","then","response","student","results","pageid","page","userid","lastperiod","catch","notification","exception","expansionChanged","parm","val","groupExpansionChanged","toggleSort","template","expansion","name","details","title","tooltip","description","requirement","typename","conditionHeaders","colspanPeriod","sum","l","colspanLine","i","colspanItem","togglePeriod","undefined","$emit","toggleLine","toggleItem","heading","resultcolumns","Number","studentinfocolumns","Boolean","toggleGroup","Array","even","useritems","newitm","hasprogressinfo","enrolled","completion_icon","conditionidx","condition","condition_completion","condition_value","grade","proficient","courseproficient","progress","status"],"mappings":"qYAqBSA,UAAUC,YACTC,IAAMC,SAASC,cAAc,OACnCF,IAAIG,UAA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