Gitlab CSE Unil

Commit 8827c726 authored by M. Chardon's avatar M. Chardon
Browse files

pb comment avec guillemet

parent ad10e43b
define(["jquery","mod_audioannotation/justWave","mod_audioannotation/editor","mod_audioannotation/rightMenu"],function(a,b,c,d){function e(a){e.currentUser="userid"in a?a.userid:null,e.courseid="course"in a?a.course:null,e.audioannotation="audioannotation"in a?a.audioannotation:null,e.eval="eval"in a?a.eval:0,e.iswriting="iswriting"in a?a.iswriting:0,e.pairing="pairing"in a?a.pairing:0;var f="repo"in a?a.repo:null,g="assignparts"in a?a.assignparts:null,h=null;g&&(h=JSON.parse(g));var i="tags"in a?a.tags:null,j=null;if(i&&(j=JSON.parse(i)),e.wavePlayer=new b(this),e.editors=[],h)for(var k=0;k<h.length;k++){e.editors[h[k].id]=new c({controler:this,courseid:e.courseid,assignpart:h[k],audioannotation:e.audioannotation,tags:j,repo:f});var l=new b(this,e.editors[h[k].id]);e.editors[h[k].id].setWavePlayer(l),this.initWave(l,"justwave",h[k].id)}this.initTrigger(),e.rightMenu=new d({controler:this}),this.initDisplay()}return e.courseid=-1,e.audioannotation=-1,e.wavePlayer=null,e.prototype.editors=null,e.rightMenu=null,e.lastP=null,e.eval=0,e.iswriting=0,e.pairing=0,e.currentUser=null,e.prototype.initTrigger=function(){1!=e.eval&&1!=e.iswriting||a(".btn_add_annotation").on("click",function(){e.editors[a(this).data("assignpart")].notify("add")}),a(".select_tqs").on("change",function(){var b=a(this).data("assignpart");e.editors[b].notify("displaytqs",{tag:a("#select_tag"+b).val(),question:a("#select_question"+b).val(),statut:a("#select_statut"+b).val(),author:a("#select_author"+b).val()})}),a("li[data-annotation]").on("click",function(){var b=a(this).data("annotation"),c=a(this).parents(".annotationGroupAccordion").data("assignpart");b&&e.editors[c].notify("view",{annotation:b})})},e.prototype.initWave=function(b,c,d){b.init(c),b.drawWaveDisplay(a(".justwave"+d+" audio"))},e.prototype.initAnnotations=function(){for(var a=0;a<e.editors.length;a++)e.editors[a]&&e.editors[a].initAnnotationsDisplay()},e.prototype.initDisplay=function(){function b(){var b=a('input[name="remediation"]:checked').val();1==b?a('input[name="notification"]').parents("div.fitem").show():a('input[name="notification"]').parents("div.fitem").hide()}a("#id_grade").on("change",function(){a(this).val()?a("input[name=gradeempty]").val(0):a("input[name=gradeempty]").val(1)}),a("div[data-parent='#accordionAssignPart']").on("show.bs.collapse",function(){var b=a("div[data-target='#"+a(this).attr("id")+"']"),c=b.find("i.fa-caret-right");c.removeClass("fa-caret-right"),c.addClass("fa-caret-down")}),a("div[data-parent='#accordionAssignPart']").on("hide.bs.collapse",function(){var b=a("div[data-target='#"+a(this).attr("id")+"']"),c=b.find("i.fa-caret-down");c.removeClass("fa-caret-down"),c.addClass("fa-caret-right")}),b(),a('input[name="remediation"]').on("change",function(){b()})},e.prototype.notify=function(a,b,c){switch(a){case"loadedmetadata":this.initAnnotations();break;case"addannotation":for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].setEditorStatus("add");break;case"editannotation":for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].setEditorStatus("edit");break;case"viewannotation":for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].setEditorStatus("view");break;case"deleteannotation":if("rightMenu"===b)for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].notify("delete",c);else for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].setEditorStatus("delete")}},e.prototype.getEval=function(){return e.eval},e.prototype.isWriting=function(){return e.iswriting},e.prototype.getPairing=function(){return e.pairing},e.prototype.getCurrentUser=function(){return e.currentUser},e});
\ No newline at end of file
define(["jquery","mod_audioannotation/justWave","mod_audioannotation/editor","mod_audioannotation/rightMenu"],function(a,b,c,d){function e(a){e.currentUser="userid"in a?a.userid:null,e.courseid="course"in a?a.course:null,e.audioannotation="audioannotation"in a?a.audioannotation:null,e.eval="eval"in a?a.eval:0,e.iswriting="iswriting"in a?a.iswriting:0,e.pairing="pairing"in a?a.pairing:0;var f="repo"in a?a.repo:null,g="assignparts"in a?a.assignparts:null,h=null;if(g)try{h=JSON.parse(g)}catch(i){window.console.error(i)}var j="tags"in a?a.tags:null,k=null;if(j)try{k=JSON.parse(j)}catch(i){window.console.error(i)}if(e.wavePlayer=new b(this),e.editors=[],h)for(var l=0;l<h.length;l++){e.editors[h[l].id]=new c({controler:this,courseid:e.courseid,assignpart:h[l],audioannotation:e.audioannotation,tags:k,repo:f});var m=new b(this,e.editors[h[l].id]);e.editors[h[l].id].setWavePlayer(m),this.initWave(m,"justwave",h[l].id)}this.initTrigger(),e.rightMenu=new d({controler:this}),this.initDisplay()}return e.courseid=-1,e.audioannotation=-1,e.wavePlayer=null,e.prototype.editors=null,e.rightMenu=null,e.lastP=null,e.eval=0,e.iswriting=0,e.pairing=0,e.currentUser=null,e.prototype.initTrigger=function(){1!=e.eval&&1!=e.iswriting||a(".btn_add_annotation").on("click",function(){e.editors[a(this).data("assignpart")].notify("add")}),a(".select_tqs").on("change",function(){var b=a(this).data("assignpart");e.editors[b].notify("displaytqs",{tag:a("#select_tag"+b).val(),question:a("#select_question"+b).val(),statut:a("#select_statut"+b).val(),author:a("#select_author"+b).val()})}),a("li[data-annotation]").on("click",function(){var b=a(this).data("annotation"),c=a(this).parents(".annotationGroupAccordion").data("assignpart");b&&e.editors[c].notify("view",{annotation:b})})},e.prototype.initWave=function(b,c,d){b.init(c),b.drawWaveDisplay(a(".justwave"+d+" audio"))},e.prototype.initAnnotations=function(){for(var a=0;a<e.editors.length;a++)e.editors[a]&&e.editors[a].initAnnotationsDisplay()},e.prototype.initDisplay=function(){function b(){var b=a('input[name="remediation"]:checked').val();1==b?a('input[name="notification"]').parents("div.fitem").show():a('input[name="notification"]').parents("div.fitem").hide()}a("#id_grade").on("change",function(){a(this).val()?a("input[name=gradeempty]").val(0):a("input[name=gradeempty]").val(1)}),a("div[data-parent='#accordionAssignPart']").on("show.bs.collapse",function(){var b=a("div[data-target='#"+a(this).attr("id")+"']"),c=b.find("i.fa-caret-right");c.removeClass("fa-caret-right"),c.addClass("fa-caret-down")}),a("div[data-parent='#accordionAssignPart']").on("hide.bs.collapse",function(){var b=a("div[data-target='#"+a(this).attr("id")+"']"),c=b.find("i.fa-caret-down");c.removeClass("fa-caret-down"),c.addClass("fa-caret-right")}),b(),a('input[name="remediation"]').on("change",function(){b()})},e.prototype.notify=function(a,b,c){switch(a){case"loadedmetadata":this.initAnnotations();break;case"addannotation":for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].setEditorStatus("add");break;case"editannotation":for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].setEditorStatus("edit");break;case"viewannotation":for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].setEditorStatus("view");break;case"deleteannotation":if("rightMenu"===b)for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].notify("delete",c);else for(var d=0;d<e.editors.length;d++)e.editors[d]&&e.editors[d].setEditorStatus("delete")}},e.prototype.getEval=function(){return e.eval},e.prototype.isWriting=function(){return e.iswriting},e.prototype.getPairing=function(){return e.pairing},e.prototype.getCurrentUser=function(){return e.currentUser},e});
\ No newline at end of file
......@@ -69,12 +69,20 @@ define(['jquery', 'mod_audioannotation/justWave', 'mod_audioannotation/editor',
var assignPartsRaw = 'assignparts' in data ? data['assignparts'] : null;
var assignParts = null;
if (assignPartsRaw) {
assignParts = JSON.parse(assignPartsRaw);
try {
assignParts = JSON.parse(assignPartsRaw);
} catch (e) {
window.console.error(e); // error in the above string (in this case, yes)!
}
}
var tagsRaw = 'tags' in data ? data['tags'] : null;
var tags = null;
if (tagsRaw) {
tags = JSON.parse(tagsRaw);
try {
tags = JSON.parse(tagsRaw);
} catch (e) {
window.console.error(e); // error in the above string (in this case, yes)!
}
}
//init composants
Controler.wavePlayer = new JustwavePlayer(this);
......
......@@ -979,6 +979,8 @@ class audioannotation_assignement {
$tagsRendu[] = clone $tag;
}
$renduO = new assignement_part($rendu);
$renduO->comment = str_replace('"', '&quot;', $renduO->comment);
$renduO->name = str_replace('"', '&quot;', $renduO->name);
$files = $fs->get_area_files($this->context->id, AUDIOANNOT_MODNAME_COMPLETE, $this::ATTACHMENT, $rendu->id);
foreach ($files as $file) {
if ($file->get_filesize() == 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment