moodle_local_treestudyplan/amd/build/report-viewer-components.min.js.map

1 line
No EOL
121 KiB
Text

{"version":3,"file":"report-viewer-components.min.js","sources":["../src/report-viewer-components.js"],"sourcesContent":["/*eslint no-var: \"error\"*/\n/*eslint no-console: \"off\"*/\n/*eslint no-unused-vars: warn */\n/*eslint max-len: [\"error\", { \"code\": 160 }] */\n/*eslint-disable no-trailing-spaces */\n/*eslint-env es6*/\n// Put this file in path/to/plugin/amd/src\n\nimport {SimpleLine} from './simpleline/simpleline';\nimport {get_strings} from 'core/str';\nimport {load_strings, format_date} from './util/string-helper';\nimport {call} from 'core/ajax';\nimport notification from 'core/notification';\nimport {svgarcpath} from './util/svgarc';\nimport Debugger from './util/debugger';\nimport Config from 'core/config';\n\n// Make π available as a constant\nconst π = Math.PI;\n// Gravity value for arrow lines - determines how much a line is pulled in the direction of the start/end before changing direction\nconst LINE_GRAVITY = 1.3;\n\nexport default {\n install(Vue/*,options*/){\n let debug = new Debugger(\"treestudyplan-viewer\");\n\n debug.warn(Config);\n let lastCaller = null;\n /**\n * Scroll current period into view\n * @param {*} handle A key to pass so subsequent calls with the same key won't trigger (always triggers when null or undefined)\n */\n function scrollCurrentIntoView(handle){\n const elScrollContainer = document.querySelector(\".r-studyplan-scrollable\");\n const elCurrentHeader = elScrollContainer.querySelector(\".s-studyline-header-period.current\");\n\n if(elCurrentHeader && ((!handle) || (handle != lastCaller))){\n lastCaller = handle;\n elCurrentHeader.scrollIntoView({\n behavior: \"smooth\",\n block: \"start\",\n inline: \"center\",\n });\n }\n }\n\n let strings = load_strings({\n invalid: {\n error: 'error',\n },\n grading: {\n ungraded: \"ungraded\",\n graded: \"graded\",\n allgraded: \"allgraded\",\n unsubmitted: \"unsubmitted\",\n nogrades: \"nogrades\",\n unknown: \"unknown\",\n },\n completion: {\n completed: \"completion_completed\",\n incomplete: \"completion_incomplete\",\n completed_pass: \"completion_passed\",\n completed_fail: \"completion_failed\",\n ungraded: \"ungraded\",\n aggregation_all: \"aggregation_all\",\n aggregation_any: \"aggregation_any\",\n aggregation_overall_all: \"aggregation_overall_all\",\n aggregation_overall_any: \"aggregation_overall_any\",\n completion_not_configured: \"completion_not_configured\",\n configure_completion: \"configure_completion\",\n view_completion_report: \"view_completion_report\",\n\n },\n badge: {\n share_badge: \"share_badge\",\n dateissued: \"dateissued\",\n dateexpire: \"dateexpire\",\n badgeinfo: \"badgeinfo\",\n badgeissuedstats: \"badgeissuedstats\",\n },\n course: {\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 view_feedback: \"view_feedback\",\n coursetiming_past: \"coursetiming_past\",\n coursetiming_present: \"coursetiming_present\",\n coursetiming_future: \"coursetiming_future\",\n required_goal: \"required_goal\",\n },\n teachercourse: {\n select_conditions: \"select_conditions\",\n select_grades: \"select_grades\",\n coursetiming_past: \"coursetiming_past\",\n coursetiming_present: \"coursetiming_present\",\n coursetiming_future: \"coursetiming_future\", \n grade_include: \"grade_include\", \n grade_require: \"grade_require\", \n required_goal: \"required_goal\",\n }\n\n });\n\n /************************************\n * *\n * Treestudyplan Viewer components *\n * *\n ************************************/\n\n /**\n * Check if element is visible\n * @param {Object} elem The element to check\n * @returns {boolean} True if visible\n */\n function isVisible(elem){\n return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n }\n\n // Create new eventbus for interaction between item components\n const ItemEventBus = new Vue();\n\n Vue.component('r-progress-circle',{\n props: {\n value: {\n type: Number,\n },\n max: {\n type: Number,\n default: 100,\n },\n min: {\n type: Number,\n default: 0,\n },\n stroke: {\n type: Number,\n default: 0.2,\n },\n bgopacity: {\n type: Number,\n default: 0.2,\n },\n title: {\n type: String,\n default: \"\",\n },\n icon: {\n type: String,\n }\n\n },\n data() {\n return {\n selectedstudyplan: null,\n };\n },\n computed: {\n range() {\n return this.max - this.min;\n },\n fraction(){\n if(this.max - this.min == 0){\n return 0;\n // 0 size is always empty :)\n } else {\n return (this.value - this.min)/(this.max - this.min);\n }\n },\n radius() {\n return 50 - (50*this.stroke);\n },\n arcpath() {\n let fraction = 0; \n const r = 50 - (50*this.stroke);\n if(this.max - this.min != 0){\n fraction = (this.value - this.min)/(this.max - this.min);\n }\n\n const Δ = fraction * 2*π;\n return svgarcpath([50,50],[r,r],[0,Δ], 1.5*π);\n },\n },\n methods: {\n },\n template: `\n <div style=\"display: inline-block; width: 1em; height: 1em; position:relative; padding: 0;\">\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 100 100\"\n style=\"position: absolute;top: 0;left: 0;\">\n <title>{{title}}</title>\n <circle v-if=\"fraction >= 1.0\" cx=\"50\" cy=\"50\" :r=\"radius\" \n :style=\"'opacity: 1; stroke-width: '+ (stroke*100)+'; stroke: currentcolor; fill: none;'\"/>\n <g v-else>\n <circle cx=\"50\" cy=\"50\" :r=\"radius\" \n :style=\"'opacity: ' + bgopacity + ';stroke-width: '+ (stroke*100)+'; stroke: currentcolor; fill: none;'\"/>\n <path :d=\"arcpath\" \n :style=\"'stroke-width: ' + (stroke*100) +'; stroke: currentcolor; fill: none;'\"/>\n </g>\n </svg>\n <i v-if='icon' :class=\"'fa fa-'+icon\" \n style=\" position: absolute; top: 0.42em; left: 0.43em; text-align:center; display: inline-block; \n width:1em; font-size: 0.55em; \"\n ></i>\n </div>\n `,\n });\n\n\n Vue.component('r-report', {\n props: {\n value: {\n type: Array,\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n teachermode: {\n type: Boolean,\n default: false,\n }\n },\n data() {\n return {\n selectedstudyplan: null,\n };\n },\n computed: {\n displayedstudyplan(){\n if(this.selectedstudyplan){\n return this.selectedstudyplan;\n } else if(this.value && this.value.length > 0){\n return this.value[0];\n } else {\n return null;\n }\n }\n },\n methods: {\n selectstudyplan(plan) {\n this.selectedstudyplan = plan;\n },\n },\n template: `\n <div class='t-studyplan-container'> \n <b-list-group horizontal\n class='r-report-tabs'>\n <b-list-group-item \n v-for=\"(studyplan,planindex) in value\"\n :key=\"studyplan.id\"\n :active=\"displayedstudyplan && studyplan.id == displayedstudyplan.id\"\n button\n @click=\"selectstudyplan(studyplan)\"\n >{{studyplan.name}}</b-list-group-item>\n </b-list-group>\n <r-studyplan v-if='displayedstudyplan' v-model='displayedstudyplan' :guestmode='guestmode' :teachermode='teachermode'></r-studyplan>\n </div>\n `,\n });\n\n Vue.component('r-studyplan', {\n props: {\n value: {\n type: Object,\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n teachermode: {\n type: Boolean,\n default: false,\n }\n },\n data() {\n return {\n };\n },\n computed: {\n columns() {\n return 1+ (this.page.periods * 2);\n },\n columns_stylerule() {\n // Uses css variables, so width for slots and filters can be configured in css\n let s = \"grid-template-columns: var(--studyplan-filter-width)\"; // use css variable here\n for(let i=0; i<this.page.periods;i++){\n s+= \" var(--studyplan-course-width) var(--studyplan-filter-width)\";\n }\n return s+\";\";\n },\n page() {\n //FIXME: Replace this when actual page management is implemented\n return this.value.pages[0];\n },\n },\n methods: {\n countLineLayers(line){\n let maxLayer = -1;\n for(let i = 0; i <= this.page.periods; i++){\n const slot = line.slots[i];\n // Determine the amount of used layers in a studyline slit\n for(const ix in line.slots[i].competencies){\n const item = line.slots[i].competencies[ix];\n if(item.layer > maxLayer){\n maxLayer = item.layer;\n }\n }\n for(const ix in line.slots[i].filters){\n const item = line.slots[i].filters[ix];\n if(item.layer > maxLayer){\n maxLayer = item.layer;\n }\n }\n }\n return (maxLayer >= 0)?(maxLayer+1):1;\n },\n showslot(line,index, layeridx, type){\n // check if the slot should be hidden because a previous slot has an item with a span\n // so big that it hides this slot\n const forGradable = (type == 'gradable')?true:false;\n const periods = this.page.periods;\n let show = true;\n for(let i = 0; i < periods; i++){\n if(line.slots[index-i] && line.slots[index-i].competencies){\n const list = line.slots[index-i].competencies;\n for(const ix in list){ // Really wish that 'for of' would work with the minifier moodle uses\n const item = list[ix];\n if(item.layer == layeridx){\n if(forGradable){\n if(i > 0 && (item.span - i) > 0){\n show = false;\n }\n } else {\n if((item.span - i) > 1){\n show = false;\n }\n }\n }\n }\n }\n }\n \n return show;\n }\n },\n mounted() {\n scrollCurrentIntoView(this.value.id);\n },\n updated() {\n scrollCurrentIntoView(this.value.id);\n ItemEventBus.$emit('lineHeightChange', null);\n\n },\n template: `\n <div class='r-studyplan-content'>\n <!-- First paint the headings-->\n <div class='r-studyplan-headings'\n ><s-studyline-header-heading></s-studyline-header-heading>\n <r-studyline-heading v-for=\"(line,lineindex) in page.studylines\"\n :key=\"line.id\"\n v-model=\"page.studylines[lineindex]\"\n :layers='countLineLayers(line)+1'\n :class=\" 't-studyline' + ((lineindex%2==0)?' odd ' :' even ' )\n + ((lineindex==0)?' first ':' ') \n + ((lineindex==page.studylines.length-1)?' last ':' ')\"\n ></r-studyline-heading\n ></div>\n <!-- Next, paint all the cells in the scrollable -->\n <div class=\"r-studyplan-scrollable\" >\n <div class=\"r-studyplan-timeline\" :style=\"columns_stylerule\">\n <!-- add period information -->\n <template v-for=\"(n,index) in (page.periods+1)\">\n <s-studyline-header-period \n v-if=\"index > 0\"\n v-model=\"page.perioddesc[index-1]\"\n ></s-studyline-header-period>\n <div class=\"s-studyline-header-filter\"></div>\n </template>\n \n <!-- Line by line add the items -->\n <!-- The grid layout handles putting it in rows and columns -->\n <template v-for=\"(line,lineindex) in page.studylines\"\n ><template v-for=\"(layernr,layeridx) in countLineLayers(line)\"\n ><template v-for=\"(n,index) in (page.periods+1)\"\n ><r-studyline-slot \n v-if=\"index > 0 && showslot(line, index, layeridx, 'gradable')\"\n type='gradable'\n v-model=\"line.slots[index].competencies\" \n :key=\"'c-'+lineindex+'-'+index+'-'+layernr\" \n :slotindex=\"index\" \n :line=\"line\"\n :plan=\"value\"\n :page=\"page\"\n :period=\"page.perioddesc[index-1]\"\n :guestmode='guestmode'\n :teachermode='teachermode'\n :layer=\"layeridx\"\n :class=\"'t-studyline ' + ((lineindex%2==0)?' odd ':' even ')\n + ((lineindex==0 && layernr==1)?' first ':' ')\n + ((lineindex==page.studylines.length-1)?' last ':' ')\"\n ></r-studyline-slot\n ><r-studyline-slot \n v-if=\"showslot(line, index, layeridx, 'gradable')\"\n type='filter'\n v-model=\"line.slots[index].filters\" \n :teachermode='teachermode'\n :key=\"'f-'+lineindex+'-'+index+'-'+layernr\" \n :slotindex=\"index\" \n :line=\"line\"\n :plan=\"value\"\n :page=\"page\"\n :layer=\"layeridx\"\n :class=\"'t-studyline ' + ((lineindex%2==0)?' odd ':' even ')\n + ((lineindex==0 && layernr==1)?' first ':'')\n + ((lineindex==page.studylines.length-1)?' last ':' ')\n + ((index==page.periods)?' rightmost':'')\"\n >\n </r-studyline-slot\n ></template\n ></template\n ></template\n ></div\n ></div\n ></div>\n `,\n });\n\n /*\n * R-STUDYLINE-HEADER\n */\n Vue.component('r-studyline-heading', {\n props: {\n value : {\n type: Object, // Studyline\n default: function(){ return {};},\n },\n layers: {\n type: Number,\n default: 1,\n },\n },\n data() {\n return {\n layerHeights: {}\n };\n },\n created() {\n // Listener for the signal that a new connection was made and needs to be drawn\n // Sent by the incoming item - By convention, outgoing items are responsible for drawing the lines\n ItemEventBus.$on('lineHeightChange', this.onLineHeightChange);\n },\n computed: {\n \n },\n methods: {\n onLineHeightChange(lineid){\n // All layers for this line have the first slot send an update message on layer height change.\n // When one of those updates is received, record the height and recalculate the total height of the \n // header\n if(this.$refs.mainEl && (lineid == this.value.id || lineid === null)){\n const items = document.querySelectorAll(\n `.r-studyline-slot-0[data-studyline='${this.value.id}']`);\n // determine the height of all the lines and add them up.\n let heightSum = 0;\n items.forEach((el) => {\n // getBoundingClientRect() Gets the actual fractional height instead of rounded to integer pixels\n const r = el.getBoundingClientRect();\n const height = r.height;\n heightSum += height;\n });\n\n const heightStyle=`${heightSum}px`;\n this.$refs.mainEl.style.height = heightStyle;\n }\n }\n },\n template: `\n <div class=\"r-studyline r-studyline-heading \" \n :data-studyline=\"value.id\" ref=\"mainEl\"\n ><div class=\"r-studyline-handle\" :style=\"'background-color: ' + value.color\"></div>\n <div class=\"r-studyline-title\">\n <abbr v-b-tooltip.hover :title=\"value.name\">{{ value.shortname }}</abbr>\n </div>\n </div>\n `,\n });\n\n Vue.component('r-studyline-slot', {\n props: {\n value: {\n type: Array, // item to display\n default(){ return [];},\n },\n type : {\n type: String,\n default: 'gradable',\n },\n slotindex : {\n type: Number,\n default: 0,\n },\n line : {\n type: Object,\n default(){ return null;},\n },\n layer : {\n type: Number,\n }, \n plan: {\n type: Object,\n default(){ return null;},\n },\n page: {\n type: Object,\n default(){ return null;},\n }, \n guestmode: {\n type: Boolean,\n default: false,\n },\n teachermode: {\n type: Boolean,\n default: false,\n },\n period: { \n type: Object,\n default(){ return null;},\n }\n },\n mounted() {\n const self=this;\n if(self.type == \"gradable\" && self.slotindex == 1){\n self.resizeListener = new ResizeObserver(() => {\n if(self.$refs.sizeElement){\n const height = self.$refs.sizeElement.getBoundingClientRect().height;\n ItemEventBus.$emit('lineHeightChange', self.line.id, self.layer, height);\n }\n }).observe(self.$refs.sizeElement);\n }\n },\n computed: {\n item(){\n for(const ix in this.value){\n const itm = this.value[ix];\n if(itm.layer == this.layer){\n return itm;\n }\n }\n return null;\n },\n current(){\n if( this.period && this.period.startdate && this.period.enddate){\n const now = new Date();\n const pstart = new Date(this.period.startdate);\n const pend = new Date(this.period.enddate);\n return (now >= pstart && now < pend);\n }\n else {\n return false;\n }\n },\n spanCss(){\n if(this.item && this.item.span > 1){\n const span = (2 * this.item.span) - 1;\n return `width: 100%; grid-column: span ${span};`;\n } else {\n return \"\";\n }\n }\n },\n data() {\n return {\n };\n },\n methods: {\n \n },\n template: `\n <div :class=\" 'r-studyline-slot ' + type + ' ' + (current?'current ':' ') \n + 'r-studyline-slot-' + slotindex + ' ' \n + ((slotindex==0)?'r-studyline-firstcolumn ':' ')\"\n :data-studyline=\"line.id\" ref=\"sizeElement\"\n :style='spanCss'\n ><div class=\"r-slot-item\" v-if=\"item\"\n ><r-item \n v-model=\"item\" \n :plan=\"plan\"\n :guestmode='guestmode'\n :teachermode='teachermode'></r-item\n ></div\n ></r-item\n ></div>\n `,\n });\n\n\n Vue.component('r-item', {\n props: {\n value :{\n type: Object,\n default: function(){ return null;},\n }, \n plan: {\n type: Object,\n default(){ return null;}\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n teachermode: {\n type: Boolean,\n default: false,\n }\n },\n data() {\n return {\n lines: [],\n };\n },\n methods: {\n lineColor(){\n if(this.teachermode){\n return \"var(--gray)\";\n }\n else{\n switch(this.value.completion){\n default: // \"incomplete\"\n return \"var(--gray)\";\n case \"failed\":\n return \"var(--danger)\";\n case \"progress\":\n return \"var(--warning)\";\n case \"completed\":\n return \"var(--success)\";\n case \"good\":\n return \"var(--info)\";\n case \"excellent\":\n return \"var(--blue)\";\n }\n }\n },\n redrawLine(conn){\n let lineColor = this.lineColor();\n\n // prepare lineinfo link or delete old line\n let lineinfo = this.lines[conn.to_id];\n if(lineinfo){\n if(lineinfo.line){\n lineinfo.line.remove();\n lineinfo.line = undefined;\n }\n } else {\n lineinfo = {};\n this.lines[conn.to_id] = lineinfo;\n }\n\n // draw new line...\n let start = document.getElementById('studyitem-'+conn.from_id);\n let end= document.getElementById('studyitem-'+conn.to_id);\n if(start !== null && end !== null && isVisible(start) && isVisible(end)){\n lineinfo.line = new SimpleLine(start,end,{\n color: lineColor,\n gravity: {\n start: LINE_GRAVITY,\n end: LINE_GRAVITY,\n },\n });\n }\n },\n redrawLines(){\n // Clean all old lines\n for(let ix in this.lines){\n let lineinfo = this.lines[ix];\n if(lineinfo && lineinfo.line){\n lineinfo.line.remove();\n lineinfo.line = undefined;\n }\n }\n\n // Create new lines\n for(let i in this.value.connections.out){\n let conn = this.value.connections.out[i];\n this.redrawLine(conn);\n }\n },\n onWindowResize(){\n this.redrawLines();\n }\n },\n computed: {\n hasConnectionsOut() {\n return !([\"finish\",].includes(this.value.type));\n },\n hasConnectionsIn() {\n return !([\"start\",].includes(this.value.type));\n },\n hasContext() {\n return ['start','junction','finish'].includes(this.value.type);\n }\n },\n created(){\n \n },\n mounted(){\n // Initialize connection lines when mounting\n\n this.redrawLines();\n setTimeout(()=>{\n this.redrawLines();\n },50);\n\n // Add resize event listener\n window.addEventListener('resize',this.onWindowResize);\n },\n beforeDestroy(){\n for(let i in this.value.connections.out){\n let conn = this.value.connections.out[i];\n let lineinfo = this.lines[conn.to_id];\n if(lineinfo){\n if(lineinfo.line){\n if(lineinfo.lineElm ){\n lineinfo.lineElm.parentNode.removeChild(lineinfo.lineElm);\n lineinfo.lineElm = undefined;\n } else {\n lineinfo.line.remove();\n }\n lineinfo.line = undefined;\n }\n } \n }\n // Remove resize event listener\n window.removeEventListener('resize',this.onWindowResize);\n },\n beforeUpdate(){\n },\n updated(){\n if(!this.dummy) {\n this.redrawLines();\n }\n },\n template: `\n <div class=\"r-item-base\" :id=\"'studyitem-'+value.id\" :data-x='value.type'>\n <r-item-competency v-if=\"value.type == 'competency'\"\n v-model=\"value\" :guestmode=\"guestmode\" :teachermode=\"teachermode\" ></r-item-competency>\n <r-item-course v-if=\"value.type == 'course' && !teachermode\" :plan=\"plan\"\n v-model=\"value\" :guestmode=\"guestmode\" :teachermode=\"teachermode\" ></r-item-course>\n <r-item-teachercourse v-if=\"value.type == 'course' && teachermode\" :plan=\"plan\"\n v-model=\"value\" :guestmode=\"guestmode\" :teachermode=\"teachermode\" ></r-item-teachercourse>\n <r-item-junction v-if=\"value.type == 'junction'\"\n v-model=\"value\" :guestmode=\"guestmode\" :teachermode=\"teachermode\" ></r-item-junction>\n <r-item-start v-if=\"value.type == 'start'\"\n v-model=\"value\" :guestmode=\"guestmode\" :teachermode=\"teachermode\" ></r-item-start>\n <r-item-finish v-if=\"value.type == 'finish'\"\n v-model=\"value\" :guestmode=\"guestmode\" :teachermode=\"teachermode\" ></r-item-finish>\n <r-item-badge v-if=\"value.type == 'badge'\"\n v-model=\"value\" :guestmode=\"guestmode\" :teachermode=\"teachermode\" ></r-item-badge>\n <r-item-invalid v-if=\"value.type == 'invalid' && teachermode\" \n v-model=\"value\" ></r-item-invalid>\n </div>\n `,\n });\n\n Vue.component('r-item-invalid', {\n props: {\n 'value' :{\n type: Object,\n default: function(){ return null;},\n },\n },\n data() {\n return {\n text: strings.invalid,\n };\n },\n methods: {\n },\n template: `\n <div class=\"r-item-invalid\">\n <b-card no-body class=\"r-item-invalid\">\n <b-row no-gutters>\n <b-col md=\"1\">\n <span class=\"r-timing-indicator timing-invalid\"></span>\n </b-col>\n <b-col md=\"11\">\n <b-card-body class=\"align-items-center\">\n <i class=\"fa fa-exclamation\"></i> {{ text.error }}\n </b-card-body>\n </b-col>\n </b-row>\n </b-card>\n </div>\n `,\n });\n\n //TAG: Item Course\n Vue.component('r-item-course', {\n props: {\n value :{\n type: Object,\n default(){ return null;},\n },\n guestmode: {\n type: Boolean,\n default(){ return false;}\n },\n teachermode: {\n type: Boolean,\n default(){ return false;}\n }, \n plan: {\n type: Object,\n default(){ return null;}\n }\n },\n data() {\n return {\n text: strings.course,\n };\n },\n computed: {\n startdate(){\n return format_date(this.value.course.startdate);\n },\n enddate(){\n if(this.value.course.enddate){\n return format_date(this.value.course.enddate);\n } \n else {\n return this.text.noenddate;\n }\n }\n },\n created(){\n const self = this;\n // Get text strings for condition settings\n let stringkeys = [];\n for(const key in this.text){\n stringkeys.push({ key: key, component: 'local_treestudyplan'});\n }\n get_strings(stringkeys).then(function(strings){\n let i = 0;\n for(const key in self.text){\n self.text[key] = strings[i];\n i++;\n }\n });\n },\n methods: {\n completion_icon(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 circle_icon(completion) {\n switch(completion){\n default: // case \"incomplete\"\n return null;\n case \"failed\":\n return \"times\"; \n case \"progress\":\n return \"exclamation\";\n case \"completed\":\n return \"check\";\n case \"good\":\n return \"check\";\n case \"excellent\":\n return \"check\";\n }\n },\n },\n template: `\n <div :class=\"'r-item-competency completion-'+value.completion\">\n <b-card no-body >\n <b-row no-gutters>\n <b-col md=\"1\">\n <span \n :title=\"text['coursetiming_'+value.course.timing]\" \n v-b-popover.hover.top=\"startdate+' - '+enddate\" \n :class=\"'r-timing-indicator timing-'+value.course.timing\"></span>\n </b-col>\n <b-col md=\"11\" class=\"align-items-center\">\n <b-card-body >\n <template v-if='value.course.completion'>\n <r-progress-circle v-if='[\"failed\", \"progress\",\"incomplete\"].includes(value.completion)'\n :value='value.course.completion.progress'\n :max='value.course.completion.count'\n :min='0'\n :class=\"'r-course-result r-completion-'+value.completion\"\n :icon='circle_icon(value.completion)'\n :title=\"text['completion_'+value.completion]\"\n ></r-progress-circle>\n <i v-else v-b-popover.top \n :class=\"'r-course-result fa fa-'+completion_icon(value.completion)+\n ' r-completion-'+value.completion\"\n :title=\"text['completion_'+value.completion]\"></i>\n </template>\n <template v-else>\n <i v-b-popover.top \n :class=\"'r-course-result fa fa-'+completion_icon(value.completion)+\n ' r-completion-'+value.completion\"\n :title=\"text['completion_'+value.completion]\"></i>\n </template>\n <a v-b-modal=\"'r-item-course-details-'+value.id\" \n :href=\"(!guestmode)?('/course/view.php?id='+value.course.id):'#'\"\n @click.prevent.stop=''\n >{{ value.course.displayname }}</i></a>\n </b-card-body>\n </b-col>\n </b-row>\n \n <b-modal\n :id=\"'r-item-course-details-'+value.id\" \n :title=\"value.course.displayname + ' - ' + value.course.fullname\" \n size=\"lg\"\n ok-only\n centered\n scrollable\n >\n <template #modal-header>\n <div>\n <h1><a :href=\"(!guestmode)?('/course/view.php?id='+value.course.id):undefined\" target=\"_blank\"\n ><i class=\"fa fa-graduation-cap\"></i> {{ value.course.fullname }}</a></h1>\n {{ value.course.context.path.join(\" / \")}}\n </div>\n <div class=\"r-course-detail-header-right\">\n <div class=\"r-completion-detail-header\">\n <template v-if='value.course.completion'>\n {{text['completion_'+value.completion]}}\n <r-progress-circle v-if='[\"failed\",\"progress\",\"incomplete\"].includes(value.completion)'\n :value='value.course.completion.progress'\n :max='value.course.completion.count'\n :min='0'\n :title=\"text['completion_'+value.completion]\"\n :class=\"'r-progress-circle-popup r-completion-'+value.completion\"\n :icon='circle_icon(value.completion)'\n ></r-progress-circle\n ><i v-else v-b-popover.top \n :class=\"'fa fa-'+completion_icon(value.completion)+\n ' r-progress-icon-popup r-completion-'+value.completion\"\n :title=\"text['completion_'+value.completion]\"></i>\n </template>\n <template v-else>\n {{text['completion_'+value.completion]}}\n <i :class=\"'fa fa-'+completion_icon(value.completion)+' r-completion-'+value.completion\"\n :title=\"text['completion_'+value.completion]\"></i>\n </template>\n </div>\n <div :class=\"'r-timing-'+value.course.timing\">\n {{text['coursetiming_'+value.course.timing]}}<br>\n {{ startdate }} - {{ enddate }}\n </div>\n </div>\n </template>\n <r-item-studentgrades \n v-if='!!value.course.grades && value.course.grades.length > 0' \n v-model='value'\n :guestmode='guestmode'></r-item-studentgrades>\n <r-item-studentcompletion\n v-if='!!value.course.completion' \n v-model='value.course.completion'\n :course='value.course'\n :guestmode='guestmode'></r-item-studentcompletion>\n </b-modal> \n </b-card></div>\n `,\n });\n\n //TAG: Selected activities dispaly\n Vue.component('r-item-studentgrades',{\n props: {\n value : {\n type: Object,\n default: function(){ return {};},\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n },\n data() {\n return {\n text: strings.course,\n };\n },\n computed: {\n pendingsubmission(){\n let result = false;\n for(const ix in this.value.course.grades){\n const g = this.value.course.grades[ix];\n if(g.pendingsubmission){\n result = true;\n break;\n }\n }\n return result;\n },\n useRequiredGrades() {\n if(this.plan && this.plan.aggregation_info && this.plan.aggregation_info.useRequiredGrades !== undefined){\n return this.plan.aggregation_info.useRequiredGrades;\n }\n else {\n return false;\n }\n }, \n },\n methods: {\n completion_icon(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 template: `\n <table class=\"r-item-course-grade-details\">\n <tr v-for=\"g in value.course.grades\">\n <td><span class=\"r-activity-icon\" :title=\"g.typename\" v-html=\"g.icon\"></span\n ><a\n :href=\"(!guestmode)?(g.link):undefined\" target=\"_blank\" :title=\"g.name\">{{g.name}}</a>\n <abbr v-if=\"useRequiredGrades && g.required\" :title=\"text.required_goal\"\n :class=\"'s-required ' + g.completion\"\n ><i class='fa fa-asterisk' ></i\n ></abbr>\n </td>\n <td><span :class=\"' r-completion-'+g.completion\">{{g.grade}}</span></td>\n <td><i :class=\"'fa fa-'+completion_icon(g.completion)+' r-completion-'+g.completion\"\n :title=\"text['completion_'+g.completion]\"></i>\n <i v-if='g.pendingsubmission' :title=\"text['completion_pending']\" \n class=\"r-pendingsubmission fa fa-clock-o\"></i></td>\n <td v-if=\"g.feedback\">\n <a v-b-modal=\"'r-grade-feedback-'+g.id\" \n href=\"#\" \n >{{ text[\"view_feedback\"]}}</a>\n <b-modal\n :id=\"'r-grade-feedback-'+g.id\" \n size=\"sm\"\n ok-only\n centered\n scrollable\n >\n <template #modal-header>\n <h2><i class=\"fa fa-graduation-cap\"></i>{{ value.course.fullname }}</h2><br>\n <span class=\"r-activity-icon\" :title=\"g.typename\" v-html=\"g.icon\"></span>{{g.name}}\n </template> \n <span v-html=\"g.feedback\"></span>\n </b-modal>\n </td>\n </tr>\n </table>\n `,\n });\n\n //TAG: Core completion version of student course info\n Vue.component('r-item-studentcompletion',{\n props: {\n value : {\n type: Object,\n default: function(){ return {};},\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n course: {\n type: Object,\n default: function(){ return {};},\n },\n },\n data() {\n return {\n text: {\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 view_feedback: \"view_feedback\",\n coursetiming_past: \"coursetiming_past\",\n coursetiming_present: \"coursetiming_present\",\n coursetiming_future: \"coursetiming_future\",\n required_goal: \"required_goal\",\n },\n };\n },\n created(){\n const self = this;\n // Get text strings for condition settings\n let stringkeys = [];\n for(const key in this.text){\n stringkeys.push({ key: key, component: 'local_treestudyplan'});\n }\n get_strings(stringkeys).then(function(strings){\n let i = 0;\n for(const key in self.text){\n self.text[key] = strings[i];\n i++;\n }\n });\n },\n computed: {\n },\n methods: {\n completion_icon(completion) {\n switch(completion){\n case \"progress\":\n return \"exclamation-circle\";\n case \"complete\":\n return \"check-circle\";\n case \"complete-pass\":\n return \"check-circle\";\n case \"complete-fail\":\n return \"times-circle\";\n default: // case \"incomplete\"\n return \"circle-o\";\n }\n },\n\n completion_tag(cgroup){\n return cgroup.completion?'completed':'incomplete';\n }\n },\n template: `\n <table class=\"r-item-course-grade-details\">\n <template v-for='cgroup in value.conditions'>\n <tr>\n <th colspan='2'>{{cgroup.title}}</th>\n <th><r-progress-circle v-if=\"cgroup.progress < cgroup.count\"\n :value='cgroup.progress'\n :max='cgroup.count'\n :class=\"'r-completion-'+cgroup.status\"\n :title=\"text['completion_'+cgroup.status]\"\n ></r-progress-circle>\n <i v-else :class=\"'fa fa-check-circle r-completion-'+cgroup.status\"></i>\n </th>\n </tr>\n <tr v-for='ci in cgroup.items'>\n <td><span v-if='guestmode'>{{ci.title}}</span>\n <span v-else v-html='ci.details.criteria'></span>\n <a href=\"#\" v-b-tooltip.click=\"{ customClass: 'r-tooltip ' + ci.status}\"\n :title=\"ci.details.requirement\"\n :class=\"'s-required ' + ci.status\"><i v-if=\"ci.details.requirement\" \n class='fa fa-question-circle' \n ></i></a>\n <td><span :class=\"' r-completion-'+ci.status\">{{ci.grade}}</span></td>\n <td><i :class=\"'fa fa-'+completion_icon(ci.status)+' r-completion-'+ci.status\"\n :title=\"text['completion_'+ci.status]\"></i>\n <i v-if='ci.pending' :title=\"text['completion_pending']\" \n class=\"r-pendingsubmission fa fa-clock-o\"></i>\n </td>\n <td v-if=\"ci.feedback\">\n <a v-b-modal=\"'r-grade-feedback-'+ci.id\" \n href=\"#\" \n >{{ text[\"view_feedback\"]}}</a>\n <b-modal\n :id=\"'r-grade-feedback-'+ci.id\" \n size=\"sm\"\n ok-only\n centered\n scrollable\n >\n <template #modal-header>\n <h2><i class=\"fa fa-graduation-cap\"></i>{{ course.fullname }}</h2><br>\n <span class=\"r-activity-icon\" :title=\"ci.typename\" v-html=\"ci.icon\"></span>{{ci.name}}\n </template>\n <span v-html=\"ci.feedback\"></span>\n </b-modal>\n </td>\n </tr>\n </template>\n </table>\n `,\n });\n\n //TAG: Teacher course\n Vue.component('r-item-teachercourse', {\n props: {\n value :{\n type: Object,\n default(){ return null;}\n },\n guestmode: {\n type: Boolean,\n default(){ return false;}\n },\n teachermode: {\n type: Boolean,\n default(){ return false;}\n },\n plan: {\n type: Object,\n default(){ return null;}\n }\n },\n data() {\n return {\n text: strings.teachercourse,\n txt: {\n grading: strings.grading,\n }\n };\n },\n computed: {\n course_grading_needed(){\n return this.course_grading_state();\n },\n course_grading_icon(){\n return this.determine_grading_icon(this.course_grading_state());\n },\n filtered_grades(){\n return this.value.course.grades.filter(g => g.selected);\n },\n useRequiredGrades() {\n if(this.plan && this.plan.aggregation_info && this.plan.aggregation_info.useRequiredGrades !== undefined){\n return this.plan.aggregation_info.useRequiredGrades;\n }\n else {\n return false;\n }\n },\n isCompletable() {\n let completable = false;\n if(this.value.course.completion){\n if(this.value.course.completion.conditions.length > 0){\n completable = true;\n }\n } else if (this.value.course.grades){\n if(this.value.course.grades.length > 0){\n completable = true;\n }\n }\n\n return completable;\n },\n progress_circle() { //INFO:\n const status = {\n students: 0,\n completed: 0,\n completed_pass: 0,\n completed_fail: 0,\n ungraded: 0,\n };\n\n if(this.value.course.completion){\n for(const cond of this.value.course.completion.conditions){\n for(const itm of cond.items){\n if(itm.progress){\n status.students += itm.progress.students;\n status.completed += itm.progress.completed;\n status.completed_pass += itm.progress.completed_pass;\n status.completed_fail += itm.progress.completed_fail;\n status.ungraded += itm.progress.completed;\n }\n }\n }\n\n } else if (this.value.course.grades){\n for( const g of this.value.course.grades){\n if(g.grading){\n status.students += g.grading.students;\n status.completed += g.grading.completed;\n status.completed_pass += g.grading.completed_pass;\n status.completed_fail += g.grading.completed_fail;\n status.ungraded += g.grading.ungraded;\n }\n }\n }\n\n return status;\n },\n startdate(){\n return format_date(this.value.course.startdate);\n },\n enddate(){\n if(this.value.course.enddate){\n return format_date(this.value.course.enddate);\n } \n else {\n return this.text.noenddate;\n }\n }\n },\n created(){\n const self = this;\n // Get text strings for condition settings\n let stringkeys = [];\n for(const key in this.text){\n stringkeys.push({ key: key, component: 'local_treestudyplan'});\n }\n get_strings(stringkeys).then(function(strings){\n let i = 0;\n for(const key in self.text){\n self.text[key] = strings[i];\n i++;\n }\n });\n },\n methods: {\n course_grading_state(){\n let ungraded = 0;\n let unknown = 0;\n let graded = 0;\n let allgraded = 0;\n const grades = this.filtered_grades;\n\n if(!Array.isArray(grades) || grades == 0){\n return 'nogrades';\n }\n\n for(const ix in grades){\n const grade = grades[ix];\n if(grade.grading){\n if(Number(grade.grading.ungraded) > 0){\n ungraded++;\n }\n else if(Number(grade.grading.graded) > 0) {\n if(Number(grade.grading.graded) == Number(grade.grading.students)){\n allgraded++; \n } else {\n graded++;\n }\n }\n } else {\n unknown = true;\n }\n }\n \n if(ungraded > 0){\n return 'ungraded';\n } else if(unknown) {\n return 'unknown';\n } else if(graded){\n return 'graded';\n } else if(allgraded){\n return 'allgraded';\n } else {\n return 'unsubmitted';\n }\n },\n determine_grading_icon(gradingstate){\n switch(gradingstate){\n default: // \"nogrades\":\n return \"circle-o\";\n case \"ungraded\":\n return \"exclamation-circle\";\n case \"unknown\":\n return \"question-circle-o\";\n case \"graded\":\n return \"check\";\n case \"allgraded\":\n return \"check\";\n case \"unsubmitted\":\n return \"dot-circle-o\";\n }\n },\n },\n template: `\n <div :class=\"'r-item-competency '+ (value.course.amteacher?'r-course-am-teacher':'')\">\n <b-card no-body>\n <div class='d-flex flex-wrap mr-0 ml-0'>\n <div>\n <span \n :title=\"text['coursetiming_'+value.course.timing]\" \n v-b-popover.hover.top=\"startdate+' - '+enddate\" \n :class=\"'r-timing-indicator timing-'+value.course.timing\"></span>\n </div>\n <div class=\"flex-fill align-items-center\">\n <b-card-body>\n <a v-b-modal=\"'r-item-course-details-'+value.id\" \n :href=\"(!guestmode)?('/course/view.php?id='+value.course.id):'#'\"\n @click.prevent.stop=''\n >{{ value.course.displayname }}</i></a>\n <r-completion-circle class=\"r-course-graded\" :disabled=\"!isCompletable\"\n v-model=\"progress_circle\"></r-completion-circle>\n </b-card-body>\n </div>\n </div>\n <b-modal\n v-if=\"true\"\n :id=\"'r-item-course-details-'+value.id\" \n :title=\"value.course.displayname + ' - ' + value.course.fullname\" \n size=\"lg\"\n ok-only\n centered\n scrollable\n >\n <template #modal-header>\n <div>\n <h1><a :href=\"(!guestmode)?('/course/view.php?id='+value.course.id):undefined\" target=\"_blank\"\n ><i class=\"fa fa-graduation-cap\"></i> {{ value.course.fullname }}</a>\n <r-item-teacher-gradepicker v-model=\"value\"\n v-if=\"value.course.grades && value.course.grades.length > 0\"\n :useRequiredGrades=\"useRequiredGrades\"\n :plan=\"plan\"\n ></r-item-teacher-gradepicker>\n <a v-if='!!value.course.completion && value.course.amteacher' \n :href=\"'/course/completion.php?id='+value.course.id\" target=\"_blank\"\n :title=\"text.configure_completion\"><i class=\"fa fa-gear\"></i></a>\n </h1>\n {{ value.course.context.path.join(\" / \")}}\n </div>\n <div class=\"r-course-detail-header-right\">\n <div class=\"r-completion-detail-header\">\n <r-completion-circle class=\"r-progress-circle-popup\" :disabled=\"!isCompletable\"\n v-model=\"progress_circle\"></r-completion-circle>\n </div>\n <div :class=\"'r-timing-'+value.course.timing\">\n {{ text['coursetiming_'+value.course.timing] }}<br>\n {{ startdate }} - {{ enddate }}\n </div>\n </div>\n </template>\n <r-item-teachergrades \n v-if='!!value.course.grades && value.course.grades.length > 0' \n v-model='value.course'\n :useRequiredGrades=\"useRequiredGrades\"\n ></r-item-teachergrades>\n <r-item-teachercompletion\n v-if='!!value.course.completion' \n v-model='value.course.completion'\n :course='value.course'\n ></r-item-teachercompletion>\n </b-modal>\n \n </b-card>\n </div>\n `,\n });\n\n\n //TAG: Select activities to use in grade overview\n Vue.component('r-item-teacher-gradepicker', {\n props: {\n value : {\n type: Object, // Item\n default: function(){ return {};},\n },\n useRequiredGrades: {\n type: Boolean,\n default(){ return null;}\n }\n },\n data() {\n return {\n text: strings.teachercourse,\n };\n },\n computed: {\n },\n methods: {\n includeChanged(newValue,g){\n call([{\n methodname: 'local_treestudyplan_include_grade',\n args: { 'grade_id': g.id,\n 'item_id': this.value.id, \n 'include': newValue,\n 'required': g.required,\n }\n }])[0].fail(notification.exception);\n },\n requiredChanged(newValue,g){\n call([{\n methodname: 'local_treestudyplan_include_grade',\n args: { 'grade_id': g.id,\n 'item_id': this.value.id, \n 'include': g.selected,\n 'required': newValue,\n }\n }])[0].fail(notification.exception);\n }, \n },\n template: `\n <a v-if=\"value.course.canselectgradables\" href='#' \n v-b-modal=\"'r-item-course-config-'+value.id\" \n @click.prevent.stop=''\n ><i class='fa fa-cog'></i>\n <b-modal v-if='value.course.canselectgradables'\n :id=\"'r-item-course-config-'+value.id\" \n :title=\"value.course.displayname + ' - ' + value.course.fullname\" \n ok-only\n scrollable\n >\n <template #modal-header>\n <div>\n <h1><a :href=\"'/course/view.php?id='+value.course.id\" target=\"_blank\"\n ><i class=\"fa fa-graduation-cap\"></i> {{ value.course.fullname }}</a></h1>\n {{ value.course.context.path.join(\" / \")}} / {{value.course.displayname}}\n </div>\n <div class=\"r-course-detail-header-right\">\n <div :class=\"'r-timing-'+value.course.timing\">\n {{text['coursetiming_'+value.course.timing]}}<br>\n {{ value.course.startdate }} - {{ value.course.enddate }}\n </div>\n </div>\n </template>\n <b-form-group\n :label=\"text.select_grades\"\n ><ul class=\"t-item-module-children\">\n <li class=\"t-item-course-gradeinfo\">\n <span class='t-item-course-chk-lbl'>{{text.grade_include}}</span\n ><span v-if=\"useRequiredGrades\" class='t-item-course-chk-lbl'>{{text.grade_require}}</span>\n </li>\n <li class=\"t-item-course-gradeinfo\" v-for=\"g in value.course.grades\">\n <b-form-checkbox inline\n @change=\"includeChanged($event,g)\" v-model=\"g.selected\"\n ></b-form-checkbox>\n <b-form-checkbox v-if=\"useRequiredGrades\" inline :disabled=\"!g.selected\"\n @change=\"requiredChanged($event,g)\" v-model=\"g.required\"\n ></b-form-checkbox>\n <span :title=\"g.typename\" v-html=\"g.icon\"></span><a \n :href=\"g.link\" target=\"_blank\">{{g.name}}</a>\n <s-edit-mod \n :title=\"value.course.fullname\"\n @saved=\"(fd) => g.name = fd.get('name')\"\n v-if=\"g.cmid > 0\" \n :cmid=\"g.cmid\" \n :coursectxid=\"value.course.ctxid\"\n genericonly></s-edit-mod>\n </li>\n </ul>\n </b-form-group>\n </b-modal>\n </a>\n `,\n });\n\n\n\n //TAG: Selected activities dispaly\n Vue.component('r-item-teachergrades',{\n props: {\n value : {\n type: Object,\n default: function(){ return {};},\n },\n useRequiredGrades: {\n type: Boolean,\n default: false,\n },\n },\n data() {\n return {\n text: strings.teachercourse,\n txt: {\n grading: strings.grading,\n }\n };\n },\n computed: {\n pendingsubmission(){\n let result = false;\n for(const ix in this.value.grades){\n const g = this.value.grades[ix];\n if(g.pendingsubmission){\n result = true;\n break;\n }\n }\n return result;\n },\n filtered_grades(){\n return this.value.grades.filter(g => g.selected);\n },\n },\n methods: {\n determine_grading_icon(gradingstate){\n switch(gradingstate){\n default: // \"nogrades\":\n return \"circle-o\";\n case \"ungraded\":\n return \"exclamation-circle\";\n case \"unknown\":\n return \"question-circle-o\";\n case \"graded\":\n return \"check\";\n case \"allgraded\":\n return \"check\";\n case \"unsubmitted\":\n return \"dot-circle-o\";\n }\n },\n grading_icon(grade){\n return this.determine_grading_icon(this.is_grading_needed(grade));\n },\n is_grading_needed(grade){\n if(grade.grading){\n if(grade.grading.ungraded){\n return 'ungraded';\n } \n else if(grade.grading.completed_pass || grade.grading.completed || grade.grading.completed_fail) {\n if(Number(grade.grading.completed) + Number(grade.grading.completed_pass)\n + Number(grade.grading.completed_fail)\n == Number(grade.grading.students)){\n return 'allgraded';\n }\n else {\n return 'graded';\n }\n }\n else {\n return 'unsubmitted';\n }\n } else {\n return 'unknown';\n }\n },\n \n },\n template: `\n <div>\n <table class=\"r-item-course-grade-details\">\n <tr v-for=\"g in filtered_grades\">\n <td><span class=\"r-activity-icon\" :title=\"g.typename\" v-html=\"g.icon\"></span\n ><a\n :href=\"g.gradinglink\"\n target=\"_blank\" :title=\"g.name\">{{g.name}}</a>\n <s-edit-mod \n :title=\"value.fullname\"\n @saved=\"(fd) => g.name = fd.get('name')\"\n v-if=\"g.cmid > 0\" \n :cmid=\"g.cmid\" \n :coursectxid=\"value.ctxid\"\n genericonly></s-edit-mod>\n <abbr v-if=\"useRequiredGrades && g.required\" :title=\"text.required_goal\"\n :class=\"'s-required ' + is_grading_needed(g)\"\n ><i class='fa fa-asterisk' ></i\n ></abbr> \n </td>\n <td v-if='g.grading'\n ><i :class=\"'r-course-grading fa fa-'+grading_icon(g)+' r-graded-'+is_grading_needed(g)\"\n :title=\"txt.grading[is_grading_needed(g)]\"></i>\n </td>\n <td v-if='g.grading'>\n <r-completion-bar v-model=\"g.grading\" :width=\"150\" :height=\"15\"></r-completion-bar>\n </td>\n </tr>\n </table>\n </div>\n `,\n });\n\n //TAG: Core completion version of student course info\n Vue.component('r-item-teachercompletion',{\n props: {\n value : {\n type: Object,\n default: function(){ return {};},\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n course: {\n type: Object,\n default: function(){ return {};},\n },\n },\n data() {\n return {\n text: strings.completion,\n };\n },\n created(){\n const self = this;\n // Get text strings for condition settings\n let stringkeys = [];\n for(const key in this.text){\n stringkeys.push({ key: key, component: 'local_treestudyplan'});\n }\n get_strings(stringkeys).then(function(strings){\n let i = 0;\n for(const key in self.text){\n self.text[key] = strings[i];\n i++;\n }\n });\n },\n computed: {\n completionreport(){\n return `${Config.wwwroot}/report/completion/index.php?course=${this.course.id}`;\n }\n },\n methods: {\n hasCompletions() {\n if(this.value.conditions) {\n for(const cgroup of this.value.conditions){\n if(cgroup.items && cgroup.items.length > 0){\n return true;\n }\n }\n }\n return false;\n },\n },\n template: `\n <table class=\"r-item-course-grade-details\">\n <tr v-if=\"hasCompletions\">\n <td colspan='2'><span v-if=\"value.aggregation == 'all'\">{{ text.aggregation_overall_all}}</span\n ><span v-else>{{ text.aggregation_overall_any}}</span></td>\n </tr>\n <tr v-else>\n <td colspan='2'>{{text.completion_not_configured}}!\n <span v-if=\"course.amteacher\">\n <br><a :href=\"'/course/completion.php?id='+course.id\" target='_blank'>{{text.configure_completion}}</a>\n </span>\n </td>\n </tr>\n <template v-for='cgroup in value.conditions'>\n <tr>\n <th colspan='2'><span v-if=\"cgroup.items.length > 1\"\n ><span v-if=\"cgroup.aggregation == 'all'\">{{ text.aggregation_all}}</span\n ><span v-else>{{ text.aggregation_any}}</span></span>\n {{cgroup.title}}</th>\n </tr>\n <tr v-for='ci in cgroup.items'>\n <td><span v-html='ci.details.criteria'></span>\n <a href=\"#\" v-b-tooltip.click\n :title=\"ci.details.requirement\"\n class='text-info'><i v-if=\"ci.details.requirement\" \n class='fa fa-question-circle' \n ></i></a>\n </td>\n <td>\n <r-completion-bar v-model=\"ci.progress\" :width=\"150\" :height=\"15\"></r-completion-bar>\n </td>\n </tr>\n </template>\n <tr><td colspan='2' class='pt-2'>\n <a target=\"_blank\" :href='completionreport'>{{ text.view_completion_report}} \n <i class='fa fa-external-link'></i></a></td></tr>\n </table>\n `,\n });\n\n\n Vue.component('r-grading-bar',{\n props: {\n value : {\n type: Object,\n default: function(){ return {};},\n },\n width: {\n type: Number,\n default: 150,\n },\n height: {\n type: Number,\n default: 15,\n }\n },\n data() {\n return {\n text: strings.grading,\n };\n },\n computed: {\n width_unsubmitted() {\n return this.width * this.fraction_unsubmitted();\n },\n width_graded() {\n return this.width * this.fraction_graded();\n },\n width_ungraded() {\n return this.width * this.fraction_ungraded();\n },\n count_unsubmitted(){\n return (this.value.students - this.value.graded - this.value.ungraded);\n }\n },\n methods: {\n fraction_unsubmitted() {\n if(this.value.students > 0){\n return 1 - ((this.value.graded + this.value.ungraded) / this.value.students);\n } else {\n return 1;\n }\n },\n fraction_graded() {\n if(this.value.students > 0){\n return this.value.graded / this.value.students;\n } else {\n return 0;\n }\n },\n fraction_ungraded() {\n if(this.value.students > 0){\n return this.value.ungraded / this.value.students;\n } else {\n return 0;\n }\n },\n },\n template: `\n <span class=\"r-grading-bar\" :style=\"{height: height+'px'}\"\n ><span :style=\"{height: height+'px', width: width_ungraded+'px'}\"\n class='r-grading-bar-segment r-grading-bar-ungraded'\n :title=\"text.ungraded + ' (' + this.value.ungraded + ')'\" v-b-popover.hover.top\n ></span\n ><span :style=\"{height: height+'px', width: width_graded+'px'}\"\n class='r-grading-bar-segment r-grading-bar-graded'\n :title=\"text.graded+ ' (' + this.value.graded + ')'\" v-b-popover.hover.top\n ></span\n ><span :style=\"{height: height+'px', width: width_unsubmitted+'px'}\"\n class='r-grading-bar-segment r-grading-bar-unsubmitted'\n :title=\"text.unsubmitted + ' (' + count_unsubmitted + ')'\" v-b-popover.hover.top\n ></span\n ></span>\n `,\n });\n\n Vue.component('r-completion-bar',{\n props: {\n value : {\n type: Object,\n default: function(){ return {\n students: 0,\n completed: 0,\n completed_pass: 0,\n completed_fail: 0,\n ungraded: 0,\n };},\n },\n width: {\n type: Number,\n default: 150,\n },\n height: {\n type: Number,\n default: 15,\n }\n },\n data() {\n return {\n text: strings.completion,\n };\n },\n computed: {\n width_incomplete() {\n return this.width * this.fraction_incomplete();\n },\n width_completed() {\n return this.width * this.fraction_completed();\n },\n width_completed_pass() {\n return this.width * this.fraction_completed_pass();\n },\n width_completed_fail() {\n return this.width * this.fraction_completed_fail();\n },\n width_ungraded() {\n return this.width * this.fraction_ungraded();\n },\n count_incomplete(){\n return (this.value.students - this.value.completed - this.value.completed_pass\n - this.value.completed_fail - this.value.ungraded);\n }\n },\n methods: {\n fraction_incomplete() {\n if(this.value.students > 0){\n return 1 - (\n (this.value.completed + this.value.completed_pass +\n this.value.completed_fail + this.value.ungraded) / this.value.students);\n } else {\n return 1;\n }\n },\n fraction_completed() {\n if(this.value.students > 0){\n return this.value.completed / this.value.students;\n } else {\n return 0;\n }\n },\n fraction_completed_pass() {\n if(this.value.students > 0){\n return this.value.completed_pass / this.value.students;\n } else {\n return 0;\n }\n },\n fraction_completed_fail() {\n if(this.value.students > 0){\n return this.value.completed_fail / this.value.students;\n } else {\n return 0;\n }\n },\n fraction_ungraded() {\n if(this.value.students > 0){\n return this.value.ungraded / this.value.students;\n } else {\n return 0;\n }\n },\n },\n template: `\n <span class=\"r-grading-bar\" :style=\"{height: height+'px'}\"\n ><span :style=\"{height: height+'px', width: width_ungraded+'px'}\"\n class='r-grading-bar-segment r-completion-bar-ungraded'\n :title=\"text.ungraded + ' (' + this.value.ungraded + ')'\" v-b-popover.hover.top\n ></span\n ><span :style=\"{height: height+'px', width: width_completed+'px'}\"\n class='r-grading-bar-segment r-completion-bar-completed'\n :title=\"text.completed + ' (' + this.value.completed + ')'\" v-b-popover.hover.top\n ></span\n ><span :style=\"{height: height+'px', width: width_completed_pass+'px'}\"\n class='r-grading-bar-segment r-completion-bar-completed-pass'\n :title=\"text.completed_pass + ' (' + this.value.completed_pass + ')'\" v-b-popover.hover.top\n ></span\n ><span :style=\"{height: height+'px', width: width_completed_fail+'px'}\"\n class='r-grading-bar-segment r-completion-bar-completed-fail'\n :title=\"text.completed_fail + ' (' + this.value.completed_fail + ')'\" v-b-popover.hover.top\n ></span\n ><span :style=\"{height: height+'px', width: width_incomplete+'px'}\"\n class='r-grading-bar-segment r-completion-bar-incomplete'\n :title=\"text.incomplete + ' (' + count_incomplete + ')'\" v-b-popover.hover.top\n ></span\n ></span>\n `,\n });\n\n Vue.component('r-completion-circle',{\n props: {\n value : {\n type: Object,\n default: function(){ return {\n students: 10,\n completed: 2,\n completed_pass: 2,\n completed_fail: 2,\n ungraded: 2,\n };},\n },\n stroke: {\n type: Number,\n default: 0.2,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n title: {\n type: String,\n default: \"\",\n }\n },\n computed: {\n radius() {\n return 50 - (50*this.stroke);\n },\n\n arcpath_ungraded() {\n const begin = 0;\n return this.arcpath(begin,this.fraction_ungraded());\n },\n arcpath_completed() {\n const begin = this.fraction_ungraded();\n return this.arcpath(begin,this.fraction_completed());\n },\n arcpath_completed_pass() {\n const begin = this.fraction_ungraded()\n + this.fraction_completed();\n return this.arcpath(begin,this.fraction_completed_pass());\n },\n arcpath_completed_fail() {\n const begin = this.fraction_ungraded()\n + this.fraction_completed()\n + this.fraction_completed_pass();\n return this.arcpath(begin,this.fraction_completed_fail());\n },\n arcpath_incomplete() {\n const begin = this.fraction_ungraded() \n + this.fraction_completed()\n + this.fraction_completed_pass()\n + this.fraction_completed_fail();\n return this.arcpath(begin,this.fraction_incomplete());\n },\n\n },\n methods: {\n arcpath(start, end) {\n const r = 50 - (50*this.stroke);\n\n const t1 = start * 2*π;\n const Δ = end * 2*π;\n return svgarcpath([50,50],[r,r],[t1,Δ], 1.5*π);\n },\n fraction_incomplete() {\n if(this.value.students > 0){\n return 1 - (\n (this.value.completed + this.value.completed_pass +\n this.value.completed_fail + this.value.ungraded) / this.value.students);\n } else {\n return 1;\n }\n },\n fraction_completed() {\n if(this.value.students > 0){\n return this.value.completed / this.value.students;\n } else {\n return 0;\n }\n },\n fraction_completed_pass() {\n if(this.value.students > 0){\n return this.value.completed_pass / this.value.students;\n } else {\n return 0;\n }\n },\n fraction_completed_fail() {\n if(this.value.students > 0){\n return this.value.completed_fail / this.value.students;\n } else {\n return 0;\n }\n },\n fraction_ungraded() {\n if(this.value.students > 0){\n return this.value.ungraded / this.value.students;\n } else {\n return 0;\n }\n },\n },\n template: `\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 100 100\">\n <title>{{title}}</title>\n <circle cx=\"50\" cy=\"50\" :r=\"radius\" \n :style=\"'stroke-width: ' + (stroke*100)+'; stroke: #ccc; fill: none;'\"/>\n <path :d=\"arcpath_ungraded\" \n :style=\"'stroke-width: ' + (stroke*100) +'; stroke: var(--warning); fill: none;'\"/>\n <path :d=\"arcpath_completed\" \n :style=\"'stroke-width: ' + (stroke*100) +'; stroke: var(--info); fill: none;'\"/>\n <path :d=\"arcpath_completed_pass\" \n :style=\"'stroke-width: ' + (stroke*100) +'; stroke: var(--success); fill: none;'\"/>\n <path :d=\"arcpath_completed_fail\" \n :style=\"'stroke-width: ' + (stroke*100) +'; stroke: var(--danger); fill: none;'\"/>\n \n <circle v-if=\"disabled\" cx=\"50\" cy=\"50\" :r=\"radius/2\" \n :style=\"'fill: var(--dark);'\"/>\n <circle v-else-if=\"value.ungraded > 0\" cx=\"50\" cy=\"50\" :r=\"radius/2\" \n :style=\"'fill: var(--warning);'\"/>\n </g>\n </svg>\n `,\n });\n\n Vue.component('r-item-junction',{\n props: {\n value : {\n type: Object,\n default: function(){ return {};},\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n teachermode: {\n type: Boolean,\n default: false,\n }\n },\n data() {\n return {\n };\n },\n computed: {\n completion(){\n if(this.value.completion){\n return this.value.completion;\n } else {\n return \"incomplete\";\n }\n }\n },\n methods: {\n\n },\n template: `\n <div :class=\"'r-item-junction r-item-filter completion-'+completion\"> \n <i v-if=\"value.completion=='incomplete'\" class=\"fa fa-circle-o\"></i>\n <i v-else-if=\"value.completion=='failed'\" class=\"fa fa-times-circle\"></i>\n <i v-else-if=\"value.completion=='progress'\" class=\"fa fa-exclamation-circle\"></i>\n <i v-else class=\"fa fa-check-circle\"></i>\n </div>\n `,\n });\n\n Vue.component('r-item-finish',{\n props: {\n value : {\n type: Object,\n default: function(){ return {};},\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n teachermode: {\n type: Boolean,\n default: false,\n }\n },\n data() {\n return {\n };\n },\n computed: {\n completion(){\n if(this.value.completion){\n return this.value.completion;\n } else {\n return \"incomplete\";\n }\n }\n },\n methods: {\n },\n template: `\n <div :class=\"'r-item-finish r-item-filter completion-'+completion\"> \n <i class=\"fa fa-stop-circle\"></i>\n </div> \n `,\n });\n\n Vue.component('r-item-start',{\n props: {\n value : {\n type: Object,\n default: function(){ return {};},\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n teachermode: {\n type: Boolean,\n default: false,\n }\n },\n data() {\n return {\n };\n },\n computed: {\n completion(){\n if(this.value.completion){\n return this.value.completion;\n } else {\n return \"incomplete\";\n }\n }\n }, \n created(){\n \n },\n methods: {\n },\n template: `\n <div :class=\"'r-item-start r-item-filter completion-'+completion\">\n <i class=\"fa fa-play-circle\"></i>\n </div>\n `,\n });\n\n Vue.component('r-item-badge',{\n props: {\n value : {\n type: Object,\n default: function(){ return {};},\n },\n guestmode: {\n type: Boolean,\n default: false,\n },\n teachermode: {\n type: Boolean,\n default: false,\n }\n },\n data() {\n return {\n txt: strings\n };\n },\n computed: {\n completion() {\n return this.value.badge.issued?\"completed\":\"incomplete\";\n },\n issued_icon(){\n switch(this.value.badge.issued){\n default: // \"nogrades\":\n return \"circle-o\";\n case true:\n return \"check\";\n }\n },\n issuestats(){\n // so the r-completion-bar can be used to show issuing stats\n return {\n students: (this.value.badge.studentcount)?this.value.badge.studentcount:0,\n completed: (this.value.badge.issuedcount)?this.value.badge.issuedcount:0,\n completed_pass: 0,\n completed_fail: 0,\n ungraded: 0,\n };\n },\n arcpath_issued(){\n if(this.value.badge.studentcount){\n const fraction = this.value.badge.issuedcount/this.value.badge.studentcount;\n return this.arcpath(0,fraction);\n } else {\n return \"\"; // no path\n }\n }\n\n },\n methods: {\n arcpath(start, end) {\n const r = 44;\n\n const t1 = start * 2*π;\n const Δ = end * 2*π;\n return svgarcpath([50,50],[r,r],[t1,Δ], 1.5*π);\n },\n },\n template: `\n <div :class=\"'r-item-badge r-item-filter r-completion-'+completion\" v-b-tooltip.hover :title=\"value.badge.name\"> \n <a v-b-modal=\"'r-item-badge-details-'+value.id\" \n ><svg class=\"r-badge-backdrop \" width='50px' height='50px' viewBox=\"0 0 100 100\">\n <title>{{value.badge.name}}</title>\n <template v-if=\"teachermode\">\n <circle cx=\"50\" cy=\"50\" r=\"44\" \n style=\"stroke: #ccc; stroke-width: 8; fill: #ddd; fill-opacity: 0.8;\"/>\n <path :d=\"arcpath_issued\" \n :style=\"'stroke-width: 8; stroke: var(--info); fill: none;'\"/>\n </template>\n <circle v-else-if=\"value.badge.issued\" cx=\"50\" cy=\"50\" r=\"46\" \n style=\"stroke: currentcolor; stroke-width: 4; fill: currentcolor; fill-opacity: 0.5;\"/>\n <circle v-else cx=\"50\" cy=\"50\" r=\"46\" \n stroke-dasharray=\"6 9\"\n style=\"stroke: #999; stroke-width: 6; fill: #ddd; fill-opacity: 0.8;\"/>\n <image class=\"badge-image\" clip-path=\"circle() fill-box\"\n :href=\"value.badge.imageurl\" x=\"12\" y=\"12\" width=\"76\" height=\"76\"\n :style=\"(value.badge.issued||teachermode)?'':'opacity: 0.4;'\" />\n </svg></a>\n\n <b-modal\n :id=\"'r-item-badge-details-'+value.id\" \n :title=\"value.badge.name\" \n size=\"lg\"\n ok-only\n centered\n scrollable\n >\n <template #modal-header>\n <div>\n <h1><i class=\"fa fa-certificate\"></i>\n <a :href=\"(!guestmode)?(value.badge.infolink):undefined\" target=\"_blank\"\n >{{ value.badge.name }}</a\n ></h1>\n </div>\n <div class=\"r-course-detail-header-right\" v-if=\"!teachermode\">\n <div class=\"r-completion-detail-header\">\n {{ txt.completion['completion_'+completion] }}\n <i v-b-popover.hover :class=\"'fa fa-'+issued_icon+' r-completion-'+completion\"\n :title=\"txt.completion['completion_'+completion]\"></i>\n </div>\n </div>\n </template>\n <b-container fluid>\n <b-row><b-col cols=\"3\">\n <img :src=\"value.badge.imageurl\"/>\n </b-col><b-col cols=\"9\">\n <p>{{value.badge.description}}</p>\n <ul v-if=\"value.badge.issued\" class=\"list-unstyled pt-1 mb-1 border-grey border-top\">\n <li><strong><i class=\"fa fa-calendar-check-o r-completion-complete-pass\"></i>\n {{txt.badge.dateissued}}:</strong> {{ value.badge.dateissued }}</li>\n <li v-if='value.badge.dateexpired'\n ><strong><i class=\"fa fa-calendar-times-o r-completion-complete\"></i>\n {{txt.badge.dateexpired}}:</strong> {{ value.badge.dateexpired }}</li>\n <li><strong><i class=\"fa fa-share-alt r-completion-complete-pass\"></i>\n <a :href=\"value.badge.issuedlink\">{{txt.badge.share_badge}}</a></strong> </li>\n </ul>\n <ul class=\"list-unstyled w-100 border-grey border-top border-bottom pt-1 pb-1 mb-1\"\n v-if=\"value.badge.criteria\"><li v-for=\"crit in value.badge.criteria\"\n ><span v-html='crit'></span></li></ul>\n <p v-if=\"(!guestmode)\"><strong><i class=\"fa fa-link\"></i>\n <a :href=\"value.badge.infolink\" target=\"_blank\"\n >{{ txt.badge.badgeinfo }}</a></strong></p>\n <p v-if=\"teachermode && !guestmode\"\n >{{txt.badge.badgeissuedstats}}:<br>\n <r-completion-bar v-model=\"issuestats\" :width=\"150\" :height=\"15\"></r-completion-bar>\n </p>\n </b-col></b-row>\n </b-container>\n </b-modal>\n </div> \n\n `,\n });\n },\n};"],"names":["π","Math","PI","install","Vue","Debugger","warn","Config","lastCaller","scrollCurrentIntoView","handle","elCurrentHeader","document","querySelector","scrollIntoView","behavior","block","inline","strings","invalid","error","grading","ungraded","graded","allgraded","unsubmitted","nogrades","unknown","completion","completed","incomplete","completed_pass","completed_fail","aggregation_all","aggregation_any","aggregation_overall_all","aggregation_overall_any","completion_not_configured","configure_completion","view_completion_report","badge","share_badge","dateissued","dateexpire","badgeinfo","badgeissuedstats","course","completion_incomplete","completion_failed","completion_pending","completion_progress","completion_completed","completion_good","completion_excellent","view_feedback","coursetiming_past","coursetiming_present","coursetiming_future","required_goal","teachercourse","select_conditions","select_grades","grade_include","grade_require","isVisible","elem","offsetWidth","offsetHeight","getClientRects","length","ItemEventBus","component","props","value","type","Number","max","default","min","stroke","bgopacity","title","String","icon","data","selectedstudyplan","computed","range","this","fraction","radius","arcpath","r","Δ","methods","template","Array","guestmode","Boolean","teachermode","displayedstudyplan","selectstudyplan","plan","Object","columns","page","periods","columns_stylerule","s","i","pages","countLineLayers","line","maxLayer","slots","ix","competencies","item","layer","filters","showslot","index","layeridx","forGradable","show","list","span","mounted","id","updated","$emit","layers","layerHeights","created","$on","onLineHeightChange","lineid","$refs","mainEl","items","querySelectorAll","heightSum","forEach","el","height","getBoundingClientRect","heightStyle","style","slotindex","period","self","resizeListener","ResizeObserver","sizeElement","observe","itm","current","startdate","enddate","now","Date","pstart","pend","spanCss","lines","lineColor","redrawLine","conn","lineinfo","to_id","remove","undefined","start","getElementById","from_id","end","SimpleLine","color","gravity","redrawLines","connections","out","onWindowResize","hasConnectionsOut","includes","hasConnectionsIn","hasContext","setTimeout","_this","window","addEventListener","beforeDestroy","lineElm","parentNode","removeChild","removeEventListener","beforeUpdate","dummy","text","noenddate","stringkeys","key","push","then","completion_icon","circle_icon","pendingsubmission","result","grades","useRequiredGrades","aggregation_info","completion_tag","cgroup","txt","course_grading_needed","course_grading_state","course_grading_icon","determine_grading_icon","filtered_grades","filter","g","selected","isCompletable","completable","conditions","progress_circle","status","students","progress","isArray","grade","gradingstate","includeChanged","newValue","methodname","args","required","fail","notification","exception","requiredChanged","grading_icon","is_grading_needed","completionreport","wwwroot","hasCompletions","width","width_unsubmitted","fraction_unsubmitted","width_graded","fraction_graded","width_ungraded","fraction_ungraded","count_unsubmitted","width_incomplete","fraction_incomplete","width_completed","fraction_completed","width_completed_pass","fraction_completed_pass","width_completed_fail","fraction_completed_fail","count_incomplete","disabled","arcpath_ungraded","arcpath_completed","begin","arcpath_completed_pass","arcpath_completed_fail","arcpath_incomplete","t1","issued","issued_icon","issuestats","studentcount","issuedcount","arcpath_issued"],"mappings":"21DAkBMA,EAAIC,KAAKC,aAIA,CACXC,iBAAQC,KACQ,IAAIC,kBAAS,wBAEnBC,KAAKC,qBACPC,WAAa,cAKRC,sBAAsBC,YAErBC,gBADoBC,SAASC,cAAc,2BACPA,cAAc,uCAErDF,iBAAsBD,QAAYA,QAAUF,aAC3CA,WAAaE,OACbC,gBAAgBG,eAAe,CAC3BC,SAAU,SACVC,MAAO,QACPC,OAAQ,gBAKhBC,SAAU,8BAAa,CACvBC,QAAS,CACLC,MAAO,SAEXC,QAAS,CACLC,SAAU,WACVC,OAAQ,SACRC,UAAW,YACXC,YAAa,cACbC,SAAU,WACVC,QAAS,WAEbC,WAAY,CACRC,UAAW,uBACXC,WAAY,wBACZC,eAAgB,oBAChBC,eAAgB,oBAChBV,SAAU,WACVW,gBAAiB,kBACjBC,gBAAiB,kBACjBC,wBAAyB,0BACzBC,wBAAyB,0BACzBC,0BAA2B,4BAC3BC,qBAAsB,uBACtBC,uBAAwB,0BAG5BC,MAAO,CACHC,YAAa,cACbC,WAAY,aACZC,WAAY,aACZC,UAAW,YACXC,iBAAkB,oBAEtBC,OAAQ,CACJC,sBAAuB,wBACvBC,kBAAmB,oBACnBC,mBAAoB,qBACpBC,oBAAqB,sBACrBC,qBAAsB,uBACtBC,gBAAiB,kBACjBC,qBAAsB,uBACtBC,cAAe,gBACfC,kBAAmB,oBACnBC,qBAAsB,uBACtBC,oBAAqB,sBACrBC,cAAe,iBAEnBC,cAAe,CACXC,kBAAmB,oBACnBC,cAAe,gBACfN,kBAAmB,oBACnBC,qBAAsB,uBACtBC,oBAAqB,sBACrBK,cAAe,gBACfC,cAAe,gBACfL,cAAe,4BAgBdM,UAAUC,eACJA,KAAKC,aAAeD,KAAKE,cAAgBF,KAAKG,iBAAiBC,YAIxEC,aAAe,IAAIlE,IAEzBA,IAA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