Gitlab CSE Unil

Commit a98f26a2 authored by M. Chardon's avatar M. Chardon
Browse files

bug visu etudiant + question/reponse

parent f95ac835
......@@ -86,6 +86,9 @@ class annotation {
/** @var int studentstatus */
public $studentstatus = 0;
/** @var string studentanswer */
public $studentanswer = "";
/**
* Convert a compatible stdClass into an instance of this class.
......
......@@ -302,9 +302,10 @@ class page_editor {
$record = page_editor::get_annotation($recordtmp->id);
$old = $record->studentstatus;
$record->studentstatus = $recordtmp->studentstatus;
$record->studentanswer = $recordtmp->studentanswer;
debugging($recordtmp->id . ' - ' . $record->id . ' - ' . $old . ' | ' . $recordtmp->studentstatus . ' - ' . $record->studentstatus. ' | ' . $recordtmp->studentanswer . ' - ' . $record->studentanswer);
$DB->update_record('assignfeedback_editpp_annot', $record);
$added++;
debugging($recordtmp->id . ' - ' . $record->id . ' - ' .$old. ' - ' . $recordtmp->studentstatus . ' - ' . $record->studentstatus);
}
return $added;
......@@ -352,11 +353,19 @@ class page_editor {
$DB->delete_records('assignfeedback_editpp_annot', array('gradeid' => $gradeid, 'draft' => 0));
// Copy all the draft annotations and comments to non-drafts.
$parentlink = [];
$records = $DB->get_records('assignfeedback_editpp_annot', array('gradeid' => $gradeid, 'draft' => 1));
foreach ($records as $record) {
$oldid = $record->id;
unset($record->id);
$record->draft = 0;
$DB->insert_record('assignfeedback_editpp_annot', $record);
$oldparentrecord = $record->parent_annot;
if ($record->parent_annot > 0) {
$record->parent_annot = $parentlink[$record->parent_annot];
}
$newid = $DB->insert_record('assignfeedback_editpp_annot', $record);
$parentlink[$oldid] = $newid;
//debugging("release_drafts : " . $oldid . ' - ' . $newid . ' | ' . $oldparentrecord . ' - ' . $record->parent_annot);
}
$records = $DB->get_records('assignfeedback_editpp_cmnt', array('gradeid' => $gradeid, 'draft' => 1));
foreach ($records as $record) {
......
......@@ -669,6 +669,7 @@ Y.extend(ANNOTATION, Y.Base, {
cartridgey: 0,
answerrequested: 0,
studentstatus: 0,
studentanswer: "",
/**
* Initialise the annotation.
*
......@@ -680,48 +681,43 @@ Y.extend(ANNOTATION, Y.Base, {
this.editor = config.parent_annot_element.editor || null;
this.gradeid = parseInt(config.parent_annot_element.gradeid, 10) || 0;
this.pageno = parseInt(config.parent_annot_element.pageno, 10) || 0;
this.x = parseInt(config.x, 10) || 0;
this.y = parseInt(config.y, 10) || 0;
this.endx = parseInt(config.endx, 10) || 0;
this.endy = parseInt(config.endy, 10) || 0;
this.cartridgex = parseInt(config.parent_annot_element.cartridgex, 10) || 0;
this.cartridgey = parseInt(config.parent_annot_element.cartridgey, 10) || 0;
this.path = config.path || '';
this.toolid = config.toolid || this.editor.get_dialogue_element(TOOLTYPE.RECTANGLE);
this.colour = config.parent_annot_element.colour || 'red';
this.drawable = false;
this.tooltype = config.tooltype;
this.textannot = config.parent_annot_element.textannot;
this.displaylock = parseInt(config.parent_annot_element.displaylock);
this.displayrotation = config.parent_annot_element.displayrotation;
this.borderstyle = config.parent_annot_element.borderstyle || 'solid';
this.parent_annot = config.parent_annot_element.id;
this.parent_annot = parseInt(config.parent_annot_element.id);
this.studentstatus = parseInt(config.parent_annot_element.studentstatus, 10) || 0;
this.parent_annot_element = config.parent_annot_element;
//config.parent_annot_element.children.push(this);
} else {
this.editor = config.editor || null;
this.gradeid = parseInt(config.gradeid, 10) || 0;
this.pageno = parseInt(config.pageno, 10) || 0;
this.x = parseInt(config.x, 10) || 0;
this.y = parseInt(config.y, 10) || 0;
this.endx = parseInt(config.endx, 10) || 0;
this.endy = parseInt(config.endy, 10) || 0;
this.cartridgex = parseInt(config.cartridgex, 10) || 0;
this.cartridgey = parseInt(config.cartridgey, 10) || 0;
this.path = config.path || '';
this.toolid = config.toolid || this.editor.get_dialogue_element(TOOLTYPE.RECTANGLE);
this.colour = config.colour || 'red';
this.drawable = false;
this.tooltype = config.tooltype;
this.textannot = config.textannot;
this.displaylock = parseInt(config.displaylock);
this.displayrotation = config.displayrotation;
this.borderstyle = config.borderstyle || 'solid';
this.parent_annot = config.parent_annot;
this.id = config.id;
this.parent_annot = parseInt(config.parent_annot);
this.answerrequested = parseInt(config.answerrequested, 10) || 0;
this.studentstatus = parseInt(config.studentstatus, 10) || 0;
}
this.studentanswer = config.studentanswer;
}
this.id = config.id;
this.x = parseInt(config.x, 10) || 0;
this.y = parseInt(config.y, 10) || 0;
this.endx = parseInt(config.endx, 10) || 0;
this.endy = parseInt(config.endy, 10) || 0;
this.path = config.path || '';
this.toolid = config.toolid || this.editor.get_dialogue_element(TOOLTYPE.RECTANGLE);
this.drawable = false;
this.tooltypefamille = this.editor.typetools[this.tooltype.type];
},
/**
......@@ -748,7 +744,7 @@ Y.extend(ANNOTATION, Y.Base, {
displaylock: parseInt(this.displaylock, 10),
displayrotation: parseInt(this.displayrotation, 10),
borderstyle: this.borderstyle,
parent_annot: this.parent_annot,
parent_annot: parseInt(this.parent_annot, 10),
divcartridge: this.divcartridge,
parent_annot_div: this.parent_annot_element.divcartridge
};
......@@ -769,7 +765,7 @@ Y.extend(ANNOTATION, Y.Base, {
displaylock: parseInt(this.displaylock, 10),
displayrotation: parseInt(this.displayrotation, 10),
borderstyle: this.borderstyle,
parent_annot: this.parent_annot,
parent_annot: parseInt(this.parent_annot, 10),
divcartridge: this.divcartridge,
parent_annot_div: '',
answerrequested: parseInt(this.answerrequested),
......@@ -779,7 +775,8 @@ Y.extend(ANNOTATION, Y.Base, {
light_clean: function () {
return {
id: this.id,
studentstatus: parseInt(this.studentstatus)
studentstatus: parseInt(this.studentstatus),
studentanswer: this.studentanswer
};
},
/**
......@@ -883,7 +880,11 @@ Y.extend(ANNOTATION, Y.Base, {
div += "class='assignfeedback_editpdfplus_cartridge' ";
div += "style='border-color: " + colorcartridge + ";'> ";
div += "</div>";
return Y.Node.create(div);
var divdisplay = Y.Node.create(div);
if (this.editor.get('readonly')) {
divdisplay.on('click', this.view_annot, this);
}
return divdisplay;
},
get_div_cartridge_label: function (colorcartridge, draggable) {
var divcartridge = "<div ";
......@@ -916,7 +917,7 @@ Y.extend(ANNOTATION, Y.Base, {
if (!this.editor.get('readonly')) {
divinputdisplay.on('click', this.edit_annot, this);
} else {
divinputdisplay.on('click', this.view_annot, this);
//divinputdisplay.on('click', this.view_annot, this);
}
return divinputdisplay;
},
......@@ -951,6 +952,27 @@ Y.extend(ANNOTATION, Y.Base, {
divvisu += this.get_valref().replace(/\n/g, "<br/>");
divvisu += "</div>";
var divvisudisplay = Y.Node.create(divvisu);
if (this.answerrequested === 1) {
var divinput = Y.Node.create("<div></div>");
var hr = Y.Node.create("<hr style='margin-bottom:0px;'/>");
var label = Y.Node.create("<label style='display:inline;'>Réponse</label>");
var rep = "";
if (this.studentanswer && this.studentanswer !== "0" && this.studentanswer !== "1") {
rep = this.studentanswer;
}
var textarea = Y.Node.create("<br/><textarea id='" + this.divcartridge + "_studentanswer' type='text' value=\"" + rep + "\" >" + rep + "</textarea>");
rep = this.studentanswer;
var buttonsave = "<button id='" + this.divcartridge + "_buttonsavestudentanswer' style='margin-left:110px;'><img src='" + M.util.image_url('e/save', 'core') + "' /></button>";
var buttonsavedisplay = Y.Node.create(buttonsave);
buttonsavedisplay.on('click', this.save_studentanswer, this, null);
divinput.append(hr);
divinput.append(label);
divinput.append(buttonsavedisplay);
divinput.append(textarea);
divvisudisplay.append(divinput);
}
return divvisudisplay;
},
get_div_container: function (colorcartridge) {
......@@ -1123,7 +1145,7 @@ Y.extend(ANNOTATION, Y.Base, {
} else if (valref !== '') {
finalcontent = valref;
}
if (!this.editor.get('readonly') && this.answerrequested === 1) {
if (this.answerrequested === 1) {
finalcontent += '&nbsp;<span style="color:red;">[?]</span>';
}
return finalcontent;
......@@ -1155,6 +1177,14 @@ Y.extend(ANNOTATION, Y.Base, {
},
change_status: function (e, idclick) {
this.studentstatus = idclick;
var shapesChildren = this.editor.annotationsparent[this.id];
if (shapesChildren) {
for (var i = 0; i < shapesChildren.length; i++) {
shapesChildren[i].studentstatus = idclick;
}
}
this.editor.save_current_page_edited();
this.hide_edit();
},
......@@ -1189,28 +1219,35 @@ Y.extend(ANNOTATION, Y.Base, {
draw_catridge: function (edit) {
return true;
},
view_annot: function (e) {
if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divvisu = this.editor.get_dialogue_element('#' + this.divcartridge + "_visu");
var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer");
var studentstatusinput = Y.all("[name=" + this.divcartridge + "_status]");
divdisplay.hide();
divvisu.show();
for (var i = 0; i < studentstatusinput.size(); i++) {
var tmp = studentstatusinput.item(i);
if (parseInt(tmp.get('value')) === this.studentstatus) {
tmp.set('checked', true);
} else {
tmp.set('checked', false);
view_annot: function (e, clickType) {
if (!clickType || !(clickType === 'click')) {
if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divvisu = this.editor.get_dialogue_element('#' + this.divcartridge + "_visu");
var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer");
var studentstatusinput = Y.all("[name=" + this.divcartridge + "_status]");
divdisplay.hide();
divvisu.show();
if (this.answerrequested === 1) {
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_studentanswer");
input.set(this.studentanswer);
}
for (var i = 0; i < studentstatusinput.size(); i++) {
var tmp = studentstatusinput.item(i);
if (parseInt(tmp.get('value')) === this.studentstatus) {
tmp.set('checked', true);
} else {
tmp.set('checked', false);
}
}
buttonstatus.show();
buttonstatus.set('style', 'display:inline;color:' + this.get_color_cartridge() + ';');
divprincipale.setStyle('z-index', 1000);
this.disabled_canvas_event();
divprincipale.detach();
divprincipale.on('clickoutside', this.hide_edit, this, 'clickoutside');
}
buttonstatus.show();
buttonstatus.set('style', 'display:inline;color:' + this.get_color_cartridge() + ';');
divprincipale.setStyle('z-index', 1000);
this.disabled_canvas_event();
divprincipale.on('clickoutside', this.hide_edit, this);
}
},
edit_annot: function (e) {
......@@ -1271,6 +1308,14 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit();
this.apply_visibility_annot();
},
save_studentanswer: function (e) {
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_studentanswer");
this.studentanswer = input.get('value');
Y.log('save_studentanswer : ' + this.studentanswer);
this.editor.save_current_page_edited();
this.hide_edit();
this.apply_visibility_annot();
},
cancel_edit: function (e, clickType) {
if (!(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref");
......@@ -1288,49 +1333,54 @@ Y.extend(ANNOTATION, Y.Base, {
}
return;
},
hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var divvisu = this.editor.get_dialogue_element('#' + this.divcartridge + "_visu");
var buttonsave = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonsave");
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
var buttonquestion = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonquestion");
var buttonrotation = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonrotation");
var buttonremove = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonremove");
var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer");
if (divdisplay) {
divdisplay.show();
divdisplay.set('style', 'display:inline;color:' + this.get_color_cartridge() + ';');
}
if (buttonrotation) {
buttonrotation.show();
}
if (divedit) {
divedit.hide();
buttonsave.hide();
buttoncancel.hide();
}
if (divvisu) {
divvisu.hide();
}
if (buttonquestion) {
buttonquestion.hide();
}
if (buttonremove) {
buttonremove.hide();
}
if (divprincipale) {
divprincipale.setStyle('z-index', 1);
}
if (divedit) {
this.enabled_canvas_event();
}
if (buttonstatus){
buttonstatus.hide();
hide_edit: function (e, clickType) {
if (!clickType || !(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var divvisu = this.editor.get_dialogue_element('#' + this.divcartridge + "_visu");
var buttonsave = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonsave");
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
var buttonquestion = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonquestion");
var buttonrotation = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonrotation");
var buttonremove = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonremove");
var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer");
if (divdisplay) {
divdisplay.show();
divdisplay.set('style', 'display:inline;color:' + this.get_color_cartridge() + ';');
}
if (buttonrotation) {
buttonrotation.show();
}
if (divedit) {
divedit.hide();
buttonsave.hide();
buttoncancel.hide();
}
if (divvisu) {
divvisu.hide();
}
if (buttonquestion) {
buttonquestion.hide();
}
if (buttonremove) {
buttonremove.hide();
}
if (divprincipale) {
divprincipale.setStyle('z-index', 1);
if (this.editor.get('readonly')) {
divprincipale.detach();
divprincipale.on('click', this.view_annot, this, 'click');
}
}
if (divedit) {
this.enabled_canvas_event();
}
if (buttonstatus) {
buttonstatus.hide();
}
}
}
,
},
/**
* Delete an annotation
* @protected
......@@ -2689,7 +2739,7 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
node,
position;
this.shape_id = 'ct_frame_' + (new Date().toJSON()).replace(/:/g, '').replace(/\./g, '');
this.shape_id = 'ct_stampcomment_' + (new Date().toJSON()).replace(/:/g, '').replace(/\./g, '');
position = this.editor.get_window_coordinates(new M.assignfeedback_editpdfplus.point(this.x, this.y));
node = Y.Node.create('<div id="' + this.shape_id + '"/>');
node.setStyles({
......@@ -5911,7 +5961,8 @@ EDITOR.prototype = {
var parentannot = [];
for (j = 0; j < this.pages[i].annotations.length; j++) {
data = this.pages[i].annotations[j];
if (data.parent_annot) {
Y.log('all_pages_loaded : ' + data.id + " - " +data.parent_annot);
if (data.parent_annot && parseInt(data.parent_annot) !== 0) {
data.parent_annot_element = parentannot[data.parent_annot];
}
var newannot = this.create_annotation(this.typetools[this.tools[data.toolid].type].label, data.toolid, data, this.tools[data.toolid]);
......
YUI.add("moodle-assignfeedback_editpdfplus-editor",function(e,t){var n=M.cfg.wwwroot+"/mod/assign/feedback/editpdfplus/ajax.php",r=M.cfg.wwwroot+"/mod/assign/feedback/editpdfplus/ajax_progress.php",s={DIALOGUE:"assignfeedback_editpdfplus_widget"},o={PREVIOUSBUTTON:".navigate-previous-button",NEXTBUTTON:" .navigate-next-button",SEARCHCOMMENTSBUTTON:".searchcommentsbutton",SEARCHFILTER:".assignfeedback_editpdfplus_commentsearch input",SEARCHCOMMENTSLIST:".assignfeedback_editpdfplus_commentsearch ul",PAGESELECT:".navigate-page-select",LOADINGICON:".loading",PROGRESSBARCONTAINER:".progress-info.progress-striped",DRAWINGREGION:".drawingregion",DRAWINGCANVAS:".drawingcanvas",SAVE:".savebutton",COMMENTCOLOURBUTTON:".commentcolourbutton",COMMENTMENU:".commentdrawable a",ANNOTATIONCOLOURBUTTON:".annotationcolourbutton",DELETEANNOTATIONBUTTON:".deleteannotationbutton",UNSAVEDCHANGESDIV:".assignfeedback_editpdfplus_unsavedchanges",UNSAVEDCHANGESINPUT:'input[name="assignfeedback_editpdfplus_haschanges"]',UNSAVEDCHANGESDIVEDIT:".assignfeedback_editpdfplus_unsavedchanges_edit",STAMPSBUTTON:".currentstampbutton",DIALOGUE:"."+s.DIALOGUE,CUSTOMTOOLBARID:"#toolbaraxis",CUSTOMTOOLBARS:".customtoolbar",AXISCUSTOMTOOLBAR:".menuaxisselection",CUSTOMTOOLBARBUTTONS:".costumtoolbarbutton",STATUTSELECTOR:"#menustatutselection"},u="rgba(200, 200, 255, 0.9)",a="rgba(200, 200, 255, 0.5)",f="rgb(51, 51, 51)",l={white:"rgb(255,255,255)",yellowlemon:"rgb(255,255,0)",yellow:"rgb(255,236,174)",red:"rgb(249,181,179)",green:"rgb(214,234,178)",blue:"rgb(203,217,237)",clear:"rgba(255,255,255, 0)"},c={white:"rgb(255,255,255)",yellowlemon:"rgb(255,255,0)",yellow:"rgb(255,207,53)",red:"rgb(239,69,64)",green:"rgb(152,202,62)",blue:"rgb(125,159,211)",black:"rgb(51,51,51)"},h=300,p={pen:".penbutton",line:".linebutton",rectangle:".rectanglebutton",oval:".ovalbutton",select:".selectbutton",drag:".dragbutton",highlight:".highlightbutton"},d={HIGHLIGHTPLUS:1,LINEPLUS:2,STAMPPLUS:3,FRAME:4,VERTICALLINE:5,STAMPCOMMENT:6,COMMENTPLUS:7,PEN:8,LINE:9,RECTANGLE:10,OVAL:11,HIGHLIGHT:12},v={HIGHLIGHTPLUS:"highlightplus",LINEPLUS:"lineplus",STAMPPLUS:"stampplus",FRAME:"frame",VERTICALLINE:"verticalline",STAMPCOMMENT:"stampcomment",COMMENTPLUS:"commentplus",PEN:"pen",LINE:"line",RECTANGLE:"rectangle",OVAL:"oval",HIGHLIGHT:"highlight"},m=2,g=function(e,t){this.x=parseInt(e,10),this.y=parseInt(t,10),this.clip=function(e){return this.x<e.x&&(this.x=e.x),this.x>e.x+e.width&&(this.x=e.x+e.width),this.y<e.y&&(this.y=e.y),this.y>e.y+e.height&&(this.y=e.y+e.height),this}};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.point=g;var y=function(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r,this.bound=function(e){var t=0,n=0,r=0,i=0,s=0,o;for(s=0;s<e.length;s++){o=e[s];if(o.x<t||s===0)t=o.x;if(o.x>n||s===0)n=o.x;if(o.y<r||s===0)r=o.y;if(o.y>i||s===0)i=o.y}return this.x=t,this.y=r,this.width=n-t,this.height=i-r,this},this.has_min_width=function(){return this.width>=5},this.has_min_height=function(){return this.height>=5},this.set_min_width=function(){this.width=5},this.set_min_height=function(){this.height=5}};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.rect=y;var b=function(){this.start=!1,this.end=!1,this.starttime=0,this.annotationstart=!1,this.tool="drag",this.commentcolour="yellow",this.annotationcolour="red",this.stamp="",this.path=[]};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.edit=b;var w=function(e){this.editor=e,this.shapes=[],this.nodes=[],this.erase=function(){if(this.shapes)while(this.shapes.length>0)this.editor.graphic.removeShape(this.shapes.pop());if(this.nodes)while(this.nodes.length>0)this.nodes.pop().remove()},this.scroll_update=function(e,t){var n,r,i;for(n=0;n<this.nodes.length;n++)r=this.nodes[n].getData("x"),i=this.nodes[n].getData("y"),r!==undefined&&i!==undefined&&(this.nodes[n].setX(parseInt(r,10)-e),this.nodes[n].setY(parseInt(i,10)-t))},this.store_position=function(e,t,n){var r,i,s;r=this.editor.get_dialogue_element(o.DRAWINGREGION),i=parseInt(r.get("scrollLeft"),10),s=parseInt(r.get("scrollTop"),10),e.setData("x",t+i),e.setData("y",n+s)}};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.drawable=w;var E=function(e){E.superclass.constructor.apply(this,[e])};E.NAME="annotation",E.ATTRS={},e.extend(E,e.Base,{editor:null,gradeid:0,pageno:0,x:0,y:0,endx:0,endy:0,path:"",toolid:0,colour:"red",drawable:!1,tooltype:null,tooltypefamille:null,divcartridge:"",textannot:"",displaylock:1,displayrotation:0,borderstyle:"",parent_annot:0,parent_annot_element:null,id:0,shape_id:"",cartridgex:0,cartridgey:0,answerrequested:0,studentstatus:0,initializer:function(e){e.parent_annot_element?(this.editor=e.parent_annot_element.editor||null,this.gradeid=parseInt(e.parent_annot_element.gradeid,10)||0,this.pageno=parseInt(e.parent_annot_element.pageno,10)||0,this.x=parseInt(e.x,10)||0,this.y=parseInt(e.y,10)||0,this.endx=parseInt(e.endx,10)||0,this.endy=parseInt(e.endy,10)||0,this.cartridgex=parseInt(e.parent_annot_element.cartridgex,10)||0,this.cartridgey=parseInt(e.parent_annot_element.cartridgey,10)||0,this.path=e.path||"",this.toolid=e.toolid||this.editor.get_dialogue_element(d.RECTANGLE),this.colour=e.parent_annot_element.colour||"red",this.drawable=!1,this.tooltype=e.tooltype,this.textannot=e.parent_annot_element.textannot,this.displaylock=parseInt(e.parent_annot_element.displaylock),this.displayrotation=e.parent_annot_element.displayrotation,this.borderstyle=e.parent_annot_element.borderstyle||"solid",this.parent_annot=e.parent_annot_element.id,this.parent_annot_element=e.parent_annot_element):(this.editor=e.editor||null,this.gradeid=parseInt(e.gradeid,10)||0,this.pageno=parseInt(e.pageno,10)||0,this.x=parseInt(e.x,10)||0,this.y=parseInt(e.y,10)||0,this.endx=parseInt(e.endx,10)||0,this.endy=parseInt(e.endy,10)||0,this.cartridgex=parseInt(e.cartridgex,10)||0,this.cartridgey=
parseInt(e.cartridgey,10)||0,this.path=e.path||"",this.toolid=e.toolid||this.editor.get_dialogue_element(d.RECTANGLE),this.colour=e.colour||"red",this.drawable=!1,this.tooltype=e.tooltype,this.textannot=e.textannot,this.displaylock=parseInt(e.displaylock),this.displayrotation=e.displayrotation,this.borderstyle=e.borderstyle||"solid",this.parent_annot=e.parent_annot,this.id=e.id,this.answerrequested=parseInt(e.answerrequested,10)||0,this.studentstatus=parseInt(e.studentstatus,10)||0),this.tooltypefamille=this.editor.typetools[this.tooltype.type]},clean:function(){return this.parent_annot_element?{gradeid:this.gradeid,x:parseInt(this.x,10),y:parseInt(this.y,10),endx:parseInt(this.endx,10),endy:parseInt(this.endy,10),cartridgex:parseInt(this.cartridgex,10),cartridgey:parseInt(this.cartridgey,10),toolid:this.toolid,path:this.path,pageno:this.pageno,colour:this.colour,textannot:this.textannot,displaylock:parseInt(this.displaylock,10),displayrotation:parseInt(this.displayrotation,10),borderstyle:this.borderstyle,parent_annot:this.parent_annot,divcartridge:this.divcartridge,parent_annot_div:this.parent_annot_element.divcartridge}:{gradeid:this.gradeid,x:parseInt(this.x,10),y:parseInt(this.y,10),endx:parseInt(this.endx,10),endy:parseInt(this.endy,10),cartridgex:parseInt(this.cartridgex,10),cartridgey:parseInt(this.cartridgey,10),toolid:this.toolid,path:this.path,pageno:this.pageno,colour:this.colour,textannot:this.textannot,displaylock:parseInt(this.displaylock,10),displayrotation:parseInt(this.displayrotation,10),borderstyle:this.borderstyle,parent_annot:this.parent_annot,divcartridge:this.divcartridge,parent_annot_div:"",answerrequested:parseInt(this.answerrequested),studentstatus:parseInt(this.studentstatus)}},light_clean:function(){return{id:this.id,studentstatus:parseInt(this.studentstatus)}},draw_highlight:function(){var t,n=this.editor.get_dialogue_element(o.DRAWINGREGION),r=this.editor.get_dialogue_element(o.DRAWINGCANVAS).getXY(),i;if(this.editor.currentannotation===this){t=new M.assignfeedback_editpdfplus.rect,t.bound([new M.assignfeedback_editpdfplus.point(this.x-10,this.y-10),new M.assignfeedback_editpdfplus.point(this.endx+10,this.endy+10)]),i=this.editor.graphic.addShape({type:e.Rect,width:t.width,height:t.height,stroke:{weight:m,color:u},fill:{color:a},x:t.x,y:t.y}),this.drawable.shapes.push(i),i.editor=this.editor,i.on("clickoutside",e.rbind(this.editor.redraw_annotation,this.editor));var s=e.Node.create('<img src="'+M.util.image_url("trash","assignfeedback_editpdfplus")+'"/>'),f=e.Node.create('<a href="#" role="button"></a>');s.setAttrs({alt:M.util.get_string("deleteannotation","assignfeedback_editpdfplus")}),s.setStyles({backgroundColor:"white"}),f.addClass("deleteannotationbutton"),f.append(s),n.append(f),f.setData("annotation",this),f.setStyle("zIndex","200"),f.on("click",this.remove,this),f.on("key",this.remove,"space,enter",this),f.setX(r[0]+t.x+t.width-18),f.setY(r[1]+t.y+t.height-18),this.drawable.nodes.push(f)}return this.drawable},draw:function(){return this.draw_highlight(),this.drawable},get_color:function(){var e=c[this.colour];return e?(e=e.replace("rgb","rgba"),e=e.replace(")",",0.5)")):e=this.colour,e},get_color_cartridge:function(){var e=c[this.tooltype.cartridge_color];return e?(e=e.replace("rgb","rgba"),e=e.replace(")",",0.5)")):e=this.tooltype.cartridge_color,e===""?this.tooltypefamille.cartridge_color:e},init_div_cartridge_id:function(){var e=(new Date).toJSON().replace(/:/g,"").replace(/\./g,"");this.divcartridge="ct_"+this.tooltype.id+"_"+e},get_div_cartridge:function(t){var n="<div ";return n+="id='"+this.divcartridge+"' ",n+="class='assignfeedback_editpdfplus_cartridge' ",n+="style='border-color: "+t+";'> ",n+="</div>",e.Node.create(n)},get_div_cartridge_label:function(t,n){var r="<div ";r+="id='"+this.divcartridge+"_cartridge' ",r+="class='assignfeedback_editpdfplus_"+this.tooltypefamille.label+"_cartridge' ",this.editor.get("readonly")&&this.get_valref()===""?r+="style='border-right:none;padding-right:0px;color:"+t+";' ":r+="style='border-right-color: "+t+";color:"+t+";' ",r+="> ",r+=this.tooltype.cartridge,r+="</div>";var i=e.Node.create(r);return n&&!this.editor.get("readonly")?(i.on("mousedown",this.move_cartridge_begin,this),i):i},get_div_input:function(t){var n="<div ";n+="id='"+this.divcartridge+"_display' ",n+="style='color:"+t+"; ",this.editor.get("readonly")&&this.get_valref()===""&&(n+="padding:0px;"),n+="'></div>";var r=e.Node.create(n);return this.editor.get("readonly")?r.on("click",this.view_annot,this):r.on("click",this.edit_annot,this),r},get_div_edition:function(){var t="<div ";t+="id='"+this.divcartridge+"_edit' ",t+="class='assignfeedback_editpdfplus_"+this.tooltypefamille.label+"_edition' ",t+="style='display:none;'> ",t+="<textarea id='"+this.divcartridge+"_editinput' type='text' value=\""+this.get_valref()+'" >'+this.get_valref()+"</textarea>",t+="</div>";var n=e.Node.create(t),r=this.tooltype.texts;if(r&&r.length>0){var s="<div></div>",o=e.Node.create(s),u=r.split('","');for(i=0;i<u.length;i++){var a="<p class='btn btn-default'>"+u[i].replace('"',"")+"</p>",f=e.Node.create(a);f.on("click",this.fill_input_edition,this,u[i].replace('"',"")),o.append(f)}n.append(o)}return n},get_div_visu:function(t){var n="<div ";n+="id='"+this.divcartridge+"_visu' ",n+="class='assignfeedback_editpdfplus_"+this.tooltypefamille.label+"_visu' ",n+="style='display:none;color:"+t+";'> ",n+=this.get_valref().replace(/\n/g,"<br/>"),n+="</div>";var r=e.Node.create(n);return r},get_div_container:function(t){var n="<div ";n+="class='assignfeedback_editpdfplus_"+this.tooltypefamille.label+"_conteneur' >",n+="</div>";var r=e.Node.create(n),i=this.get_div_input(t);i.addClass("assignfeedback_editpdfplus_"+this.tooltypefamille.label+"_input");var s=this.get_input_valref(),o=1;this.displaylock&&(o=this.displaylock);var u=e.Node.create("<input type='hidden' id='"+this.divcartridge+"_onof' value="+o+" />"),a=this.editor.get("readonly");a||i.on("click",this.edit_annot,this
),r.append(i),r.append(s),r.append(u),r.append(this.get_input_question());var a=this.editor.get("readonly");return a?r.append(this.get_button_student_status()):(r.append(this.get_button_visibility_left()),r.append(this.get_button_visibility_right()),r.append(this.get_button_save()),r.append(this.get_button_cancel()),this.tooltype.reply===1&&r.append(this.get_button_question()),r.append(this.get_button_remove())),r},get_button_student_status:function(){var t='<label style="padding-left:20px;" class="radio-inline"><input type="radio" name="'+this.divcartridge+'_status" value=0 >non trait\u00e9</label>',n='<label class="radio-inline"><input type="radio" name="'+this.divcartridge+'_status" value=1 ><img style="width:15px;" src=\''+M.util.image_url("tick","assignfeedback_editpdfplus")+"' /></label>",r='<label class="radio-inline"><input type="radio" name="'+this.divcartridge+'_status" value=2 ><img style="width:15px;" src=\''+M.util.image_url("cross","assignfeedback_editpdfplus")+"' /></label> ",i=e.Node.create(t),s=e.Node.create(n),o=e.Node.create(r);i.on("click",this.change_status,this,0),s.on("click",this.change_status,this,1),o.on("click",this.change_status,this,2);var u=e.Node.create("<div id='"+this.divcartridge+"_radioContainer' style='display:inline;'></div>");return u.append(i),u.append(s),u.append(o),u},get_button_visibility_right:function(){var t="<button id='"+this.divcartridge+"_buttonedit_right' ";t+="><img src='",t+=M.util.image_url("t/right","core"),t+="' /></button>";var n=e.Node.create(t);return n.on("click",this.change_visibility_annot,this,"r"),n},get_button_visibility_left:function(){var t="<button id='"+this.divcartridge+"_buttonedit_left' ";t+="><img src='",t+=M.util.image_url("t/left","core"),t+="' /></button>";var n=e.Node.create(t);return n.on("click",this.change_visibility_annot,this,"l"),n},get_button_save:function(){var t="<button id='"+this.divcartridge+"_buttonsave' style='display:none;margin-left:110px;'><img src='"+M.util.image_url("t/check","core")+"' /></button>",n=e.Node.create(t);return n.on("click",this.save_annot,this,null),n},get_button_cancel:function(){var t="<button id='"+this.divcartridge+"_buttoncancel' style='display:none;'><img src='"+M.util.image_url("t/reset","core")+"' /></button>",n=e.Node.create(t);return n.on("click",this.cancel_edit,this),n},get_button_question:function(){var t="<button id='"+this.divcartridge+"_buttonquestion' style='display:none;margin-left:10px;'><img src='"+M.util.image_url("help_no","assignfeedback_editpdfplus")+"' /></button>",n=e.Node.create(t);return n.on("click",this.change_question_status,this),n},get_button_remove:function(){var t="<button id='"+this.divcartridge+"_buttonremove' style='display:none;margin-left:10px;'><img src='"+M.util.image_url("trash","assignfeedback_editpdfplus")+"' /></button>",n=e.Node.create(t);return n.on("click",this.remove,this),n},get_input_question:function(){var t=0;return this.answerrequested&&this.answerrequested===1&&(t=1),e.Node.create("<input type='hidden' id='"+this.divcartridge+"_question' value='"+t+"'/>")},get_valref:function(){return this.textannot&&this.textannot.length>0&&typeof this.textannot=="string"?this.textannot:""},get_input_valref:function(){return e.Node.create("<input type='hidden' id='"+this.divcartridge+"_valref' value=\""+this.get_valref()+'"/>')},apply_visibility_annot:function(){var e=this.editor.get_dialogue_element("#"+this.divcartridge+"_display"),t=this.editor.get_dialogue_element("#"+this.divcartridge+"_onof"),n=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonedit_right"),r=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonedit_left"),i=this.editor.get_dialogue_element("#"+this.divcartridge+"_radioContainer");t&&(t.get("value")==="1"?(n&&n.show(),r&&r.show()):t.get("value")==="0"?(n&&n.show(),r&&r.hide()):(n&&n.hide(),r&&r.show())),e&&e.setContent(this.get_text_to_diplay_in_cartridge()),this.tooltypefamille.label==="frame"&&n&&(n.hide(),r.hide()),i&&i.hide(),this.apply_question_status()},get_text_to_diplay_in_cartridge:function(){var e=this.editor.get_dialogue_element("#"+this.divcartridge+"_valref").get("value"),t=this.editor.get_dialogue_element("#"+this.divcartridge+"_onof"),n="";return e===""&&!this.editor.get("readonly")&&(n="&nbsp;&nbsp;&nbsp;&nbsp"),t.get("value")==="1"&&e!==""?n=e.substr(0,20):t.get("value")==="0"&&e!==""?n="...":e!==""&&(n=e),!this.editor.get("readonly")&&this.answerrequested===1&&(n+='&nbsp;<span style="color:red;">[?]</span>'),n},change_visibility_annot:function(e,t){var n=this.editor.get_dialogue_element("#"+this.divcartridge+"_onof"),r=parseInt(n.get("value"));t==="r"?r+=1:r-=1,n.set("value",r),this.displaylock=r,this.apply_visibility_annot(),this.editor.save_current_page()},change_question_status:function(){var e=this.editor.get_dialogue_element("#"+this.divcartridge+"_question"),t=parseInt(e.get("value")),n=0;t===0&&(n=1),e.set("value",n),this.answerrequested=n,this.apply_question_status(),this.editor.save_current_page()},change_status:function(e,t){this.studentstatus=t,this.editor.save_current_page_edited(),this.hide_edit()},apply_question_status:function(){var e=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonquestion"),t=this.editor.get_dialogue_element("#"+this.divcartridge+"_question"),n=0;t&&(n=parseInt(t.get("value"))),e&&(n===1?e.one("img").setAttribute("src",M.util.image_url("help","core")):e.one("img").setAttribute("src",M.util.image_url("help_no","assignfeedback_editpdfplus")));return},move_cartridge_begin:function(e){e.preventDefault();var t=this.editor.get_dialogue_element(o.DRAWINGCANVAS),n=new M.assignfeedback_editpdfplus.point(e.clientX+t.get("docScrollX"),e.clientY+t.get("docScrollY")),r=this.editor.get_canvas_coordinates(n);this.oldx=r.x,this.oldy=r.y;var i=this.editor.get_dialogue_element("#"+this.divcartridge+"_cartridge");i.on("mousemove",this.move_cartridge_continue,this),i.on("mouseup",this.move_cartridge_stop,this)},draw_catridge:function(e){return!0},view_annot
:function(t){if(this.tooltype.type<=d.COMMENTPLUS&&!this.parent_annot_element){var n=this.editor.get_dialogue_element("#"+this.divcartridge),r=this.editor.get_dialogue_element("#"+this.divcartridge+"_display"),i=this.editor.get_dialogue_element("#"+this.divcartridge+"_visu"),s=this.editor.get_dialogue_element("#"+this.divcartridge+"_radioContainer"),o=e.all("[name="+this.divcartridge+"_status]");r.hide(),i.show();for(var u=0;u<o.size();u++){var a=o.item(u);parseInt(a.get("value"))===this.studentstatus?a.set("checked",!0):a.set("checked",!1)}s.show(),s.set("style","display:inline;color:"+this.get_color_cartridge()+";"),n.setStyle("z-index",1e3),this.disabled_canvas_event(),n.on("clickoutside",this.hide_edit,this)}},edit_annot:function(e){if(this.tooltype.type<=d.COMMENTPLUS&&!this.parent_annot_element){var t=this.editor.get_dialogue_element("#"+this.divcartridge),n=this.editor.get_dialogue_element("#"+this.divcartridge+"_display"),r=this.editor.get_dialogue_element("#"+this.divcartridge+"_edit"),i=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonedit_right"),s=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonedit_left"),o=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonsave"),u=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttoncancel"),a=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonquestion"),f=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonrotation"),l=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonremove"),c=this.editor.get_dialogue_element("#"+this.divcartridge+"_editinput");n.hide(),i&&i.hide(),s&&s.hide(),f&&f.hide(),r.show(),o.show(),u.show(),a&&a.show(),l.show(),t.setStyle("z-index",1e3),c.set("focus","on"),this.disabled_canvas_event(),t.on("clickoutside",this.cancel_edit,this,"clickoutside")}},fill_input_edition:function(e,t){var n=this.editor.get_dialogue_element("#"+this.divcartridge+"_editinput");n&&n.set("value",t),this.save_annot(t)},save_annot:function(e){if(typeof e!="string"){var t=this.editor.get_dialogue_element("#"+this.divcartridge+"_editinput");e=t.get("value")}this.textannot=e,this.editor.save_current_page(),e.length===0&&(e="&nbsp;&nbsp;");var n=this.editor.get_dialogue_element("#"+this.divcartridge+"_valref");n.set("value",e),this.hide_edit(),this.apply_visibility_annot()},cancel_edit:function(e,t){if(t!=="clickoutside"||this.editor.currentannotation!==this){var n=this.editor.get_dialogue_element("#"+this.divcartridge+"_valref"),r=this.editor.get_dialogue_element("#"+this.divcartridge+"_editinput");if(n){var i=n.get("value");r.set("value",i)}this.hide_edit(),this.apply_visibility_annot();var s=this.editor.get_dialogue_element("#"+this.divcartridge);s&&s.detach()}return},hide_edit:function(){var e=this.editor.get_dialogue_element("#"+this.divcartridge),t=this.editor.get_dialogue_element("#"+this.divcartridge+"_display"),n=this.editor.get_dialogue_element("#"+this.divcartridge+"_edit"),r=this.editor.get_dialogue_element("#"+this.divcartridge+"_visu"),i=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonsave"),s=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttoncancel"),o=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonquestion"),u=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonrotation"),a=this.editor.get_dialogue_element("#"+this.divcartridge+"_buttonremove"),f=this.editor.get_dialogue_element("#"+this.divcartridge+"_radioContainer");t&&(t.show(),t.set("style","display:inline;color:"+this.get_color_cartridge()+";")),u&&u.show(),n&&(n.hide(),i.hide(),s.hide()),r&&r.hide(),o&&o.hide(),a&&a.hide(),e&&e.setStyle("z-index",1),n&&this.enabled_canvas_event(),f&&f.hide()},remove:function(e){var t,n;e.preventDefault(),t=this.editor.pages[this.editor.currentpage].annotations;for(n=0;n<t.length;n++)if(t[n]===this){t.splice(n,1),this.drawable&&this.drawable.erase(),this.editor.currentannotation=!1,this.editor.save_current_page();return}},move:function(t,n){var r=t-this.x,i=n-this.y,s,o,u,a,f;this.x+=r,this.y+=i,this.endx+=r,this.endy+=i,this.path&&(s=[],o=this.path.split(":"),e.each(o,function(e){u=e.split(","),a=parseInt(u[0],10),f=parseInt(u[1],10),s.push(a+r+","+(f+i))}),this.path=s.join(":")),this.drawable&&this.drawable.erase(),this.editor.drawables.push(this.draw())},draw_current_edit:function(e){var t=e&&!1;return t},init_from_edit:function(e){var t=new M.assignfeedback_editpdfplus.rect;return t.bound([e.start,e.end]),this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=t.x,this.y=t.y,this.endx=t.x+t.width,this.endy=t.y+t.height,this.colour=e.annotationcolour,this.path="",t.has_min_width()&&t.has_min_height()},disabled_canvas_event:function(){var e=this.editor.get_dialogue_element(o.DRAWINGCANVAS);e.detach()},enabled_canvas_event:function(){var e=this.editor.get_dialogue_element(o.DRAWINGCANVAS);e.on("gesturemovestart",this.editor.edit_start,null,this.editor),e.on("gesturemove",this.editor.edit_move,null,this.editor),e.on("gesturemoveend",this.editor.edit_end,null,this.editor)}}),M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.annotation=E;var S=function(e){S.superclass.constructor.apply(this,[e])};S.NAME="annotationline",S.ATTRS={},e.extend(S,M.assignfeedback_editpdfplus.annotation,{draw:function(){var t,n;return t=new M.assignfeedback_editpdfplus.drawable(this.editor),n=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:m,color:c[this.colour]}}),n.moveTo(this.x,this.y),n.lineTo(this.endx,this.endy),n.end(),t.shapes.push(n),this.drawable=t,S.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdfplus.drawable(this.editor),r;return r=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:m,color:c[t.annotationcolour]}}),r.moveTo(t.start.x,t.start.y),r.lineTo(t.end.x,t.end.y),r.end(),n.shapes.push(r),n},init_from_edit:function(e){return this.gradeid=this.editor.get("gradeid"),this.
pageno=this.editor.currentpage,this.x=e.start.x,this.y=e.start.y,this.endx=e.end.x,this.endy=e.end.y,this.colour=e.annotationcolour,this.path="",this.endx-this.x!==0||this.endy-this.y!==0}}),M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.annotationline=S;var x=function(e){x.superclass.constructor.apply(this,[e])};x.NAME="annotationrectangle",x.ATTRS={},e.extend(x,M.assignfeedback_editpdfplus.annotation,{draw:function(){var t,n,r;return t=new M.assignfeedback_editpdfplus.drawable(this.editor),n=new M.assignfeedback_editpdfplus.rect,n.bound([new M.assignfeedback_editpdfplus.point(this.x,this.y),new M.assignfeedback_editpdfplus.point(this.endx,this.endy)]),r=this.editor.graphic.addShape({type:e.Rect,width:n.width,height:n.height,stroke:{weight:m,color:c[this.colour]},x:n.x,y:n.y}),t.shapes.push(r),this.drawable=t,x.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdfplus.drawable(this.editor),r,i;return i=new M.assignfeedback_editpdfplus.rect,i.bound([new M.assignfeedback_editpdfplus.point(t.start.x,t.start.y),new M.assignfeedback_editpdfplus.point(t.end.x,t.end.y)]),i.has_min_width()||i.set_min_width(),i.has_min_height()||i.set_min_height(),r=this.editor.graphic.addShape({type:e.Rect,width:i.width,height:i.height,stroke:{weight:m,color:c[t.annotationcolour]},x:i.x,y:i.y}),n.shapes.push(r),n}}),M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.annotationrectangle=x;var T=function(e){T.superclass.constructor.apply(this,[e])};T.NAME="annotationoval",T.ATTRS={},e.extend(T,M.assignfeedback_editpdfplus.annotation,{draw:function(){var t,n,r;return t=new M.assignfeedback_editpdfplus.drawable(this.editor),n=new M.assignfeedback_editpdfplus.rect,n.bound([new M.assignfeedback_editpdfplus.point(this.x,this.y),new M.assignfeedback_editpdfplus.point(this.endx,this.endy)]),r=this.editor.graphic.addShape({type:e.Ellipse,width:n.width,height:n.height,stroke:{weight:m,color:c[this.colour]},x:n.x,y:n.y}),t.shapes.push(r),this.drawable=t,T.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdfplus.drawable(this.editor),r,i;return i=new M.assignfeedback_editpdfplus.rect,i.bound([new M.assignfeedback_editpdfplus.point(t.start.x,t.start.y),new M.assignfeedback_editpdfplus.point(t.end.x,t.end.y)]),i.has_min_width()||i.set_min_width(),i.has_min_height()||i.set_min_height(),r=this.editor.graphic.addShape({type:e.Ellipse,width:i.width,height:i.height,stroke:{weight:m,color:c[t.annotationcolour]},x:i.x,y:i.y}),n.shapes.push(r),n}}),M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.annotationoval=T;var N=function(e){N.superclass.constructor.apply(this,[e])};N.NAME="annotationpen",N.ATTRS={},e.extend(N,M.assignfeedback_editpdfplus.annotation,{draw:function(){var t,n,r,i,s;return t=new M.assignfeedback_editpdfplus.drawable(this.editor),n=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:m,color:c[this.colour]}}),r=!0,i=this.path.split(":"),e.each(i,function(e){s=e.split(","),r?(n.moveTo(s[0],s[1]),r=!1):n.lineTo(s[0],s[1])},this),n.end(),t.shapes.push(n),this.drawable=t,N.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdfplus.drawable(this.editor),r,i;return r=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:m,color:c[t.annotationcolour]}}),i=!0,e.each(t.path,function(e){i?(r.moveTo(e.x,e.y),i=!1):r.lineTo(e.x,e.y)},this),r.end(),n.shapes.push(r),n},init_from_edit:function(e){var t=new M.assignfeedback_editpdfplus.rect,n=[],r=0;t.bound(e.path);for(r=0;r<e.path.length;r++)n.push(parseInt(e.path[r].x,10)+","+parseInt(e.path[r].y,10));return this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=t.x,this.y=t.y,this.endx=t.x+t.width,this.endy=t.y+t.height,this.colour=e.annotationcolour,this.path=n.join(":"),t.has_min_width()||t.has_min_height()}}),M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.annotationpen=N;var C=function(e){C.superclass.constructor.apply(this,[e])};C.NAME="annotationhighlight",C.ATTRS={},e.extend(C,M.assignfeedback_editpdfplus.annotation,{draw:function(){var t,