Skip to content
Snippets Groups Projects
Commit 5c13b15a authored by Robin Mounié's avatar Robin Mounié
Browse files

minimification

parent b98642c9
Branches
No related tags found
No related merge requests found
define(["local_notemyprogress/vue","local_notemyprogress/vuetify","local_notemyprogress/axios","local_notemyprogress/alertify","local_notemyprogress/pageheader","local_notemyprogress/chartdynamic"],(function(Vue,Vuetify,Axios,Alertify,PageHeader,ChartDynamic){"use strict";function init(content){Vue.use(Vuetify),Vue.component("pageheader",PageHeader),Vue.component("chart",ChartDynamic);const app=new Vue({delimiters:["[[","]]"],el:"#student_gamification",vuetify:new Vuetify,data:{strings:content.strings,token:content.token,render_has:content.profile_render,indicators:content.indicators,levelInfo:content.indicators.levelInfo,activity:content.indicators.activity,courseid:content.indicators.cid,userid:content.indicators.uid,ranking:content.ranking,tab:null,levelsData:content.levels_data.levelsdata,settings:content.levels_data.settings,error_messages:[],save_successful:!1},beforeMount(){let data={courseid:this.courseid,userid:this.userid,action:"studentGamificationViewed"};Axios({method:"get",url:M.cfg.wwwroot+"/local/notemyprogress/ajax.php",params:data})},computed:{},methods:{get_help_content(){let help_contents=[],help=new Object;return help.title=this.strings.help_title,help.description=this.strings.help_description,help_contents.push(help),help_contents},update_dialog(value){this.dialog=value},update_help_dialog(value){this.help_dialog=value},openHelpSectionModalEvent(){this.saveInteraction(this.pluginSectionName,"viewed","section_help_dialog",3)},get_timezone(){let information;return`${this.strings.change_timezone} ${this.timezone}`},saveInteraction(component,interaction,target,interactiontype){let data={action:"saveinteraction",pluginsection:this.pluginSectionName,component:component,interaction:interaction,target:target,url:window.location.href,interactiontype:interactiontype,token:content.token};Axios({method:"post",url:`${M.cfg.wwwroot}/local/notemyprogress/ajax.php`,data:data}).then(r=>{}).catch(e=>{})},table_headers(){let headers;return[{text:this.strings.ranking_text,value:"ranking"},{text:this.strings.level,value:"level"},{text:this.strings.student,value:"student"},{text:this.strings.total,value:"total"},{text:this.strings.progress,value:"progress_percentage"}]},activateRanking(){location.reload();let data={action:"rankable",pluginsection:this.pluginSectionName,url:window.location.href,token:content.token,courseid:this.courseid,userid:this.userid};Axios({method:"post",url:`${M.cfg.wwwroot}/local/notemyprogress/ajax.php?courseid=`+this.courseid+"&userid="+this.userid,params:data}).then(r=>{}).catch(e=>{})},chart_spread(){let chart=new Object;return chart.chart={type:"column",backgroundColor:null},chart.title={text:this.strings.chartTitle},chart.colors=["#118AB2"],chart.xAxis={type:"category",labels:{rotation:-45,style:{fontSize:"13px",fontFamily:"Verdana, sans-serif"}}},chart.yAxis={min:0,title:{text:this.strings.chartYaxis}},chart.legend={enabled:!1},chart.series=[{name:null,data:this.strings.chart_data,dataLabels:{enabled:!0,rotation:-90,color:"#FFFFFF",align:"right",format:"{point.y:.1f}",y:10,style:{fontSize:"13px",fontFamily:"Verdana, sans-serif"}}}],console.log("series: "),console.log(this.chart_data),chart},setGraphicsEventListeners(){console.log("Listeners set");let graphics=document.querySelectorAll(".highcharts-container");graphics.length<1?setTimeout(app.setGraphicsEventListeners,500):(graphics[0].id="SpreadChart",graphics.forEach(graph=>{graph.addEventListener("mouseenter",app.addLogsViewGraphic)}))},addLogsViewGraphic(e){event.stopPropagation();var action="",objectName="",objectType="",objectDescription="";switch(e.target.id){case"SpreadChart":action="viewed",objectName="spreading_chart",objectType="chart",objectDescription="Bar chart that shows the level repartition in gamification";break;default:action="viewed",objectName="",objectType="chart",objectDescription="A chart"}app.addLogsIntoDB(action,objectName,objectType,objectDescription)},addLogsIntoDB(action,objectName,objectType,objectDescription){let data={courseid:content.courseid,userid:content.userid,action:"addLogs",sectionname:"STUDENTS_GAMIFICATION",actiontype:action,objectType:objectType,objectName:objectName,currentUrl:document.location.href,objectDescription:objectDescription};Axios({method:"get",url:M.cfg.wwwroot+"/local/notemyprogress/ajax.php",params:data}).then(response=>{200==response.status&&response.data.ok}).catch(e=>{})}}})}return{init:init}}));
\ No newline at end of file
...@@ -149,7 +149,7 @@ function xmldb_local_notemyprogress_install() ...@@ -149,7 +149,7 @@ function xmldb_local_notemyprogress_install()
//* fliplearning_weeks -> notemyprogress_weeks //* fliplearning_weeks -> notemyprogress_weeks
//? Algorithm idea : //? Algorithm idea :
//? Initial state : table generated normally and old tables potentially present //? Initial state : table generated normally and old tables potentially present
//? 1 : vefrifier if exist the old tables (Fliplearning) //? 1 : Check if exist the old tables (Fliplearning)
//? 2 : If they exist drop the new similar tables //? 2 : If they exist drop the new similar tables
//? 3 : rename the old tables like the news that we have just deleted //? 3 : rename the old tables like the news that we have just deleted
try{ try{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment