Gitlab CSE Unil

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

- display pdf inline/footnote au choix du correcteur

- lien dans le fichier pdf entre annotation et texte
parent 303964cb
...@@ -90,6 +90,9 @@ class annotation { ...@@ -90,6 +90,9 @@ class annotation {
/** @var string studentanswer */ /** @var string studentanswer */
public $studentanswer = ""; public $studentanswer = "";
/** @var string pdfdisplay */
public $pdfdisplay = "footnote";
/** /**
* Convert a compatible stdClass into an instance of this class. * Convert a compatible stdClass into an instance of this class.
* @param stdClass $record * @param stdClass $record
......
...@@ -730,7 +730,7 @@ EOD; ...@@ -730,7 +730,7 @@ EOD;
//add feedback by annotation //add feedback by annotation
$pdf->SetAutoPageBreak(true); $pdf->SetAutoPageBreak(true);
$pdf->AddPage(); $pdf->AddPage('P', 'A4');
$pdf->SetTextColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0);
$pdf->Write(10, "", '', false, 'L', true); $pdf->Write(10, "", '', false, 'L', true);
$pdf->SetFontSize(14); $pdf->SetFontSize(14);
...@@ -750,7 +750,16 @@ EOD; ...@@ -750,7 +750,16 @@ EOD;
if (!$annot->hasReadableComment()) { if (!$annot->hasReadableComment()) {
continue; continue;
} }
$pdf->Write(5, $index, '', false, 'L', false);
//set link target to annotation's text
$pdf->SetLink($pdf->arrayLinks[$index], -1);
//create link source for annotation's display
$pdf->SetTextColor(0, 0, 255);
$pdf->SetFont('', 'U');
$pdf->Write(5, $index, $pdf->arrayLinksOrigi[$index], false, 'L', false);
$pdf->SetFont('', '');
$pdf->SetTextColor(0, 0, 0);
if ($annot->studentstatus === "2") { if ($annot->studentstatus === "2") {
$pdf->SetTextColor(255, 0, 0); $pdf->SetTextColor(255, 0, 0);
$pdf->Write(5, '*', '', false, 'L', false); $pdf->Write(5, '*', '', false, 'L', false);
......
...@@ -50,6 +50,8 @@ class pdf extends Fpdi { ...@@ -50,6 +50,8 @@ class pdf extends Fpdi {
/** @var string the path to the PDF currently being processed */ /** @var string the path to the PDF currently being processed */
protected $filename = null; protected $filename = null;
public $arrayLinks = array();
public $arrayLinksOrigi = array();
/** No errors */ /** No errors */
const GSPATH_OK = 'ok'; const GSPATH_OK = 'ok';
...@@ -256,7 +258,7 @@ class pdf extends Fpdi { ...@@ -256,7 +258,7 @@ class pdf extends Fpdi {
if (!$this->filename) { if (!$this->filename) {
return false; return false;
} }
//check tcpdf cache directory, needed for image transformation //check tcpdf cache directory, needed for image transformation
if (!file_exists(K_PATH_CACHE)) { if (!file_exists(K_PATH_CACHE)) {
//try to create the directory //try to create the directory
...@@ -478,10 +480,32 @@ class pdf extends Fpdi { ...@@ -478,10 +480,32 @@ class pdf extends Fpdi {
if ($type == 'commentplus' || $type == 'stampcomment' || ($type == 'frame' && !$annotation->parent_annot) || $type == 'verticalline' || $type == 'highlightplus') { if ($type == 'commentplus' || $type == 'stampcomment' || ($type == 'frame' && !$annotation->parent_annot) || $type == 'verticalline' || $type == 'highlightplus') {
$cartouche = $toolObject->cartridge; $cartouche = $toolObject->cartridge;
if ($annotation->textannot) { if ($annotation->textannot) {
$cartouche .= ' [' . $annotation_index . ']'; if ($annotation->pdfdisplay === "inline") {
$cartouche .= ' | ' . $annotation->textannot;
}
$this->Write(5, $cartouche . ' [');
//create link source for annotation's text
$link = $this->addLink();
$this->SetTextColor(0, 0, 255);
$this->SetFont('', 'U');
$this->Write(5, $annotation_index, $link);
$this->SetTextColorArray($colourcartridgearray);
$this->SetFont('', '');
$this->arrayLinks[$annotation_index] = $link;
$this->Write(5, ']');
//create link target to go back to the annotation display
$linkorigi = $this->addLink();
$this->setLink($linkorigi, -1);
$this->arrayLinksOrigi[$annotation_index] = $linkorigi;
//$this->Annotation($sx + 50, $sy, 30, 30, $annotation->textannot, array('Subtype' => 'Text', 'Name' => 'Comment', 'T' => $toolObject->label, 'Subj' => 'example', 'C' => $colourarray)); //$this->Annotation($sx + 50, $sy, 30, 30, $annotation->textannot, array('Subtype' => 'Text', 'Name' => 'Comment', 'T' => $toolObject->label, 'Subj' => 'example', 'C' => $colourarray));
} }
$this->Write(5, $cartouche);
//$html = '&nbsp;<a href="#annot' . $annotation_index . '" style="color:red;">' . '[#annot' . $annotation_index . ']' . '</a>';
//$this->writeHTML($html);
} }
$this->SetDrawColor(0, 0, 0); $this->SetDrawColor(0, 0, 0);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<FIELD NAME="displayrotation" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/> <FIELD NAME="displayrotation" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="borderstyle" TYPE="char" LENGTH="20" NOTNULL="false" SEQUENCE="false"/> <FIELD NAME="borderstyle" TYPE="char" LENGTH="20" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="parent_annot" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/> <FIELD NAME="parent_annot" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="pdfdisplay" TYPE="char" LENGTH="20" NOTNULL="false"/>
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/> <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
......
...@@ -333,5 +333,18 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) { ...@@ -333,5 +333,18 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2019052400, 'assignfeedback', 'editpdfplus'); upgrade_plugin_savepoint(true, 2019052400, 'assignfeedback', 'editpdfplus');
} }
if ($oldversion < 2019053100) {
/* annotation table */
$table = new xmldb_table('assignfeedback_editpp_annot');
$field = new xmldb_field('pdfdisplay', XMLDB_TYPE_CHAR, '20', null,
XMLDB_NOTNULL, null, 'footnote', 'parent_annot');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Editpdfplus savepoint reached.
upgrade_plugin_savepoint(true, 2019053100, 'assignfeedback', 'editpdfplus');
}
return true; return true;
} }
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->version = 2019052400; $plugin->version = 2019053100;
$plugin->requires = 2019051100; // Moodle 3.7 $plugin->requires = 2019051100; // Moodle 3.7
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;
$plugin->release = "2.3.0 (Build: 2019052400)"; $plugin->release = "2.3.0 (Build: 2019052400)";
......
...@@ -751,6 +751,13 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -751,6 +751,13 @@ Y.extend(ANNOTATION, Y.Base, {
* @public * @public
*/ */
studentanswer: "", studentanswer: "",
/**
* pdf display for this annotation
* @property pdfdisplay
* @type String
* @public
*/
pdfdisplay: "footnote",
/** /**
* Initialise the annotation. * Initialise the annotation.
* *
...@@ -799,6 +806,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -799,6 +806,7 @@ Y.extend(ANNOTATION, Y.Base, {
this.path = config.path || ''; this.path = config.path || '';
this.toolid = config.toolid || this.editor.get_dialogue_element(TOOLTYPE.RECTANGLE); this.toolid = config.toolid || this.editor.get_dialogue_element(TOOLTYPE.RECTANGLE);
this.drawable = false; this.drawable = false;
this.pdfdisplay = config.pdfdisplay;
this.tooltypefamille = this.editor.typetools[this.tooltype.type]; this.tooltypefamille = this.editor.typetools[this.tooltype.type];
}, },
/** /**
...@@ -827,7 +835,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -827,7 +835,8 @@ Y.extend(ANNOTATION, Y.Base, {
borderstyle: this.borderstyle, borderstyle: this.borderstyle,
parent_annot: parseInt(this.parent_annot, 10), parent_annot: parseInt(this.parent_annot, 10),
divcartridge: this.divcartridge, divcartridge: this.divcartridge,
parent_annot_div: this.parent_annot_element.divcartridge parent_annot_div: this.parent_annot_element.divcartridge,
pdfdisplay: this.pdfdisplay
}; };
} }
return { return {
...@@ -850,7 +859,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -850,7 +859,8 @@ Y.extend(ANNOTATION, Y.Base, {
divcartridge: this.divcartridge, divcartridge: this.divcartridge,
parent_annot_div: '', parent_annot_div: '',
answerrequested: parseInt(this.answerrequested, 10), answerrequested: parseInt(this.answerrequested, 10),
studentstatus: parseInt(this.studentstatus, 10) studentstatus: parseInt(this.studentstatus, 10),
pdfdisplay: this.pdfdisplay
}; };
}, },
/** /**
...@@ -1141,6 +1151,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1141,6 +1151,7 @@ Y.extend(ANNOTATION, Y.Base, {
divconteneurdisplay.append(divinputdisplay); divconteneurdisplay.append(divinputdisplay);
divconteneurdisplay.append(inputonof); divconteneurdisplay.append(inputonof);
divconteneurdisplay.append(this.get_input_question()); divconteneurdisplay.append(this.get_input_question());
divconteneurdisplay.append(this.get_input_pdfdisplay());
return divconteneurdisplay; return divconteneurdisplay;
}, },
...@@ -1161,6 +1172,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1161,6 +1172,7 @@ Y.extend(ANNOTATION, Y.Base, {
if (this.tooltype.reply === 1) { if (this.tooltype.reply === 1) {
divtoolbardisplay.append(this.get_button_question()); divtoolbardisplay.append(this.get_button_question());
} }
divtoolbardisplay.append(this.get_button_pdfdisplay());
divtoolbardisplay.append(this.get_button_remove()); divtoolbardisplay.append(this.get_button_remove());
} else { } else {
divtoolbardisplay.append(this.get_button_student_status()); divtoolbardisplay.append(this.get_button_student_status());
...@@ -1287,6 +1299,21 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1287,6 +1299,21 @@ Y.extend(ANNOTATION, Y.Base, {
buttontrashdisplay.on('click', this.remove_by_trash, this); buttontrashdisplay.on('click', this.remove_by_trash, this);
return buttontrashdisplay; return buttontrashdisplay;
}, },
/**
* get the html node for the button to change display on pdf for the annotation
* @return node
*/
get_button_pdfdisplay: function () {
var buttontrash = "<button id='"
+ this.divcartridge
+ "_buttonpdfdisplay' style='display:none;margin-left:10px;' class='btn btn-sm btn-outline-dark' type='button'>"
+ "<i class='fa fa-file-pdf-o' aria-hidden='true'></i>&nbsp;"
+ "<i class='fa fa-arrow-circle-o-down' aria-hidden='true'></i>"
+ "</button>";
var buttontrashdisplay = Y.Node.create(buttontrash);
buttontrashdisplay.on('click', this.change_pdf_display, this);
return buttontrashdisplay;
},
/** /**
* get the html node for the hidden input to keep information about question state * get the html node for the hidden input to keep information about question state
* @return node * @return node
...@@ -1298,6 +1325,13 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1298,6 +1325,13 @@ Y.extend(ANNOTATION, Y.Base, {
} }
return Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_question' value='" + qst + "'/>"); return Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_question' value='" + qst + "'/>");
}, },
/**
* get the html node for the hidden input to keep information about question state
* @return node
*/
get_input_pdfdisplay: function () {
return Y.Node.create("<input type='hidden' id='" + this.divcartridge + "_pdfdisplay' value='" + this.pdfdisplay + "'/>");
},
/** /**
* get the final reference text value * get the final reference text value
* @return node * @return node
...@@ -1361,6 +1395,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1361,6 +1395,7 @@ Y.extend(ANNOTATION, Y.Base, {
buttonstatus.hide(); buttonstatus.hide();
} }
this.apply_question_status(); this.apply_question_status();
this.apply_pdfdisplay();
}, },
/** /**
* get the html node for the text to display for the annotation, according to parameters * get the html node for the text to display for the annotation, according to parameters
...@@ -1403,6 +1438,22 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1403,6 +1438,22 @@ Y.extend(ANNOTATION, Y.Base, {
this.apply_visibility_annot(); this.apply_visibility_annot();
this.editor.save_current_page(); this.editor.save_current_page();
}, },
/**
* change question status of the annotation (with or not)
*/
change_pdf_display: function () {
var pdfdisplayvalue = this.editor.get_dialogue_element('#' + this.divcartridge + "_pdfdisplay");
var value = pdfdisplayvalue.get('value');
if (value === "footnote") {
pdfdisplayvalue.set('value', "inline");
this.pdfdisplay = "inline";
} else {
pdfdisplayvalue.set('value', "footnote");
this.pdfdisplay = "footnote";
}
this.apply_pdfdisplay();
this.editor.save_current_page();
},
/** /**
* change question status of the annotation (with or not) * change question status of the annotation (with or not)
*/ */
...@@ -1463,6 +1514,25 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1463,6 +1514,25 @@ Y.extend(ANNOTATION, Y.Base, {
} }
return; return;
}, },
/**
* change pdf display mode set of the annotation
* @return null
*/
apply_pdfdisplay: function () {
var buttonpdf = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpdfdisplay");
var pdfdisplayvalue = this.editor.get_dialogue_element('#' + this.divcartridge + "_pdfdisplay");
var value = pdfdisplayvalue.get('value');
if (buttonpdf) {
if (value === 'footnote') {
buttonpdf.setHTML("<i class='fa fa-file-pdf-o' aria-hidden='true'></i>&nbsp;"
+ "<i class='fa fa-arrow-circle-o-down' aria-hidden='true'></i>");
} else {
buttonpdf.setHTML("<i class='fa fa-file-pdf-o' aria-hidden='true'></i>&nbsp;"
+ "<i class='fa fa-arrow-circle-o-right' aria-hidden='true'></i>");
}
}
return;
},
/** /**
* drag-and-drop start * drag-and-drop start
* @param {type} e * @param {type} e
...@@ -1515,7 +1585,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1515,7 +1585,7 @@ Y.extend(ANNOTATION, Y.Base, {
var divcartridge = this.editor.get_dialogue_element('#' + this.divcartridge); var divcartridge = this.editor.get_dialogue_element('#' + this.divcartridge);
divcartridge.setX(offsetcanvas[0] + this.x + this.cartridgex); divcartridge.setX(offsetcanvas[0] + this.x + this.cartridgex);
divcartridge.setY(offsetcanvas[1] + this.y + this.cartridgey); divcartridge.setY(offsetcanvas[1] + this.y + this.cartridgey);
window.console.log('move_cartridge_stop'); //window.console.log('move_cartridge_stop');
this.editor.save_current_page(); this.editor.save_current_page();
}, },
/** /**
...@@ -1583,6 +1653,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1583,6 +1653,7 @@ Y.extend(ANNOTATION, Y.Base, {
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel"); var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
var buttonquestion = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonquestion"); var buttonquestion = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonquestion");
var buttonrotation = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonrotation"); var buttonrotation = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonrotation");
var buttonpdfdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpdfdisplay");
var buttonremove = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonremove"); var buttonremove = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonremove");
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_editinput"); var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_editinput");
divdisplay.hide(); divdisplay.hide();
...@@ -1601,6 +1672,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1601,6 +1672,7 @@ Y.extend(ANNOTATION, Y.Base, {
if (buttonquestion) { if (buttonquestion) {
buttonquestion.show(); buttonquestion.show();
} }
buttonpdfdisplay.show();
buttonremove.show(); buttonremove.show();
divprincipale.setStyle('z-index', 1000); divprincipale.setStyle('z-index', 1000);
if (input) { if (input) {
...@@ -1640,7 +1712,6 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1640,7 +1712,6 @@ Y.extend(ANNOTATION, Y.Base, {
} }
} }
this.textannot = result; this.textannot = result;
window.console.log('save_annot');
this.editor.save_current_page(); this.editor.save_current_page();
if (result.length === 0) { if (result.length === 0) {
result = "&nbsp;&nbsp;"; result = "&nbsp;&nbsp;";
...@@ -1696,6 +1767,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1696,6 +1767,7 @@ Y.extend(ANNOTATION, Y.Base, {
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel"); var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
var buttonquestion = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonquestion"); var buttonquestion = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonquestion");
var buttonrotation = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonrotation"); var buttonrotation = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonrotation");
var buttonpdfdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpdfdisplay");
var buttonremove = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonremove"); var buttonremove = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonremove");
var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer"); var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer");
if (divdisplay) { if (divdisplay) {
...@@ -1716,6 +1788,9 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1716,6 +1788,9 @@ Y.extend(ANNOTATION, Y.Base, {
if (buttonquestion) { if (buttonquestion) {
buttonquestion.hide(); buttonquestion.hide();
} }
if (buttonpdfdisplay) {
buttonpdfdisplay.hide();
}
if (buttonremove) { if (buttonremove) {
buttonremove.hide(); buttonremove.hide();
} }
......
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",i={DIALOGUE:"assignfeedback_editpdfplus_widget"},s={PREVIOUSBUTTON:".navigate-previous-button",NEXTBUTTON:" .navigate-next-button",PAGESELECT:".navigate-page-select",LOADINGICON:".loading",PROGRESSBARCONTAINER:".progress-info.progress-striped",DRAWINGREGION:".drawingregion",DRAWINGCANVAS:".drawingcanvas",SAVE:".savebutton",ANNOTATIONCOLOURBUTTON:".annotationcolourbutton",DELETEANNOTATIONBUTTON:".deleteannotationbutton",WARNINGMESSAGECONTAINER:".warningmessages",ICONMESSAGECONTAINER:".infoicon",UNSAVEDCHANGESDIV:".assignfeedback_editpdf_warningmessages",UNSAVEDCHANGESINPUT:'input[name="assignfeedback_editpdfplus_haschanges"]',UNSAVEDCHANGESDIVEDIT:".assignfeedback_editpdfplus_unsavedchanges_edit",HELPMESSAGETITLE:"#afppHelpmessageTitle",HELPMESSAGE:"#afppHelpmessageBody",USERINFOREGION:'[data-region="user-info"]',ROTATELEFTBUTTON:".rotateleftbutton",ROTATERIGHTBUTTON:".rotaterightbutton",DIALOGUE:"."+i.DIALOGUE,CUSTOMTOOLBARID:"#toolbaraxis",CUSTOMTOOLBARS:".customtoolbar",AXISCUSTOMTOOLBAR:".menuaxisselection",CUSTOMTOOLBARBUTTONS:".costumtoolbarbutton",GENERICTOOLBARBUTTONS:".generictoolbarbutton",HELPBTNCLASS:".helpmessage",STATUTSELECTOR:"#menustatutselection",QUESTIONSELECTOR:"#menuquestionselection",STUDENTVALIDATION:"#student_valide_button"},o="rgba(200, 200, 255, 0.9)",u="rgba(200, 200, 255, 0.5)",a={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(0,0,255)",black:"rgb(51,51,51)"},f=300,l={select:".selectbutton",drag:".dragbutton"},c={HIGHLIGHTPLUS:1,LINEPLUS:2,STAMPPLUS:3,FRAME:4,VERTICALLINE:5,STAMPCOMMENT:6,COMMENTPLUS:7,PEN:8,LINE:9,RECTANGLE:10,OVAL:11,HIGHLIGHT:12},h={HIGHLIGHTPLUS:"highlightplus",LINEPLUS:"lineplus",STAMPPLUS:"stampplus",FRAME:"frame",VERTICALLINE:"verticalline",STAMPCOMMENT:"stampcomment",COMMENTPLUS:"commentplus",PEN:"pen",LINE:"line",RECTANGLE:"rectangle",OVAL:"oval",HIGHLIGHT:"highlight"},p=2,d=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=d;var v=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=v;var m=function(){this.start=!1,this.end=!1,this.starttime=0,this.annotationstart=!1,this.tool="drag",this.commentcolour="yellow",this.annotationcolour="red",this.path=[]};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.edit=m;var g=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,o;r=this.editor.get_dialogue_element(s.DRAWINGREGION),i=parseInt(r.get("scrollLeft"),10),o=parseInt(r.get("scrollTop"),10),e.setData("x",t+i),e.setData("y",n+o)}};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.drawable=g;var y=function(e){y.superclass.constructor.apply(this,[e])};y.NAME="annotation",y.ATTRS={},e.extend(y,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,studentanswer:"",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.cartridgex=parseInt(e.parent_annot_element.cartridgex,10)||0,this.cartridgey=parseInt(e.parent_annot_element.cartridgey,10)||0,this.colour=e.parent_annot_element.colour||"red",this.tooltype=e.tooltype,this.textannot=e.parent_annot_element.textannot,this.displaylock=parseInt(e.parent_annot_element.displaylock,10),this.displayrotation=e.parent_annot_element.displayrotation,this.borderstyle=e.parent_annot_element.borderstyle||"solid",this.parent_annot=parseInt(e.parent_annot_element.id,10),this.answerrequested=parseInt(e.parent_annot_element.answerrequested,10)||0,this.studentstatus=parseInt(e.parent_annot_element.studentstatus,10)||0,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.cartridgex=parseInt(e.cartridgex,10)||0,this.cartridgey=parseInt(e.cartridgey,10)||0,this.colour=e.colour||"red",this.tooltype=e.tooltype,this.textannot=e.textannot,this.displaylock=parseInt(e.displaylock,10),this.displayrotation=e.displayrotation,this.borderstyle=e.borderstyle||"solid",this.parent_annot=parseInt(e.parent_annot,10),this.answerrequested=parseInt(e.answerrequested,10)||0,this.studentstatus= 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",i={DIALOGUE:"assignfeedback_editpdfplus_widget"},s={PREVIOUSBUTTON:".navigate-previous-button",NEXTBUTTON:" .navigate-next-button",PAGESELECT:".navigate-page-select",LOADINGICON:".loading",PROGRESSBARCONTAINER:".progress-info.progress-striped",DRAWINGREGION:".drawingregion",DRAWINGCANVAS:".drawingcanvas",SAVE:".savebutton",ANNOTATIONCOLOURBUTTON:".annotationcolourbutton",DELETEANNOTATIONBUTTON:".deleteannotationbutton",WARNINGMESSAGECONTAINER:".warningmessages",ICONMESSAGECONTAINER:".infoicon",UNSAVEDCHANGESDIV:".assignfeedback_editpdf_warningmessages",UNSAVEDCHANGESINPUT:'input[name="assignfeedback_editpdfplus_haschanges"]',UNSAVEDCHANGESDIVEDIT:".assignfeedback_editpdfplus_unsavedchanges_edit",HELPMESSAGETITLE:"#afppHelpmessageTitle",HELPMESSAGE:"#afppHelpmessageBody",USERINFOREGION:'[data-region="user-info"]',ROTATELEFTBUTTON:".rotateleftbutton",ROTATERIGHTBUTTON:".rotaterightbutton",DIALOGUE:"."+i.DIALOGUE,CUSTOMTOOLBARID:"#toolbaraxis",CUSTOMTOOLBARS:".customtoolbar",AXISCUSTOMTOOLBAR:".menuaxisselection",CUSTOMTOOLBARBUTTONS:".costumtoolbarbutton",GENERICTOOLBARBUTTONS:".generictoolbarbutton",HELPBTNCLASS:".helpmessage",STATUTSELECTOR:"#menustatutselection",QUESTIONSELECTOR:"#menuquestionselection",STUDENTVALIDATION:"#student_valide_button"},o="rgba(200, 200, 255, 0.9)",u="rgba(200, 200, 255, 0.5)",a={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(0,0,255)",black:"rgb(51,51,51)"},f=300,l={select:".selectbutton",drag:".dragbutton"},c={HIGHLIGHTPLUS:1,LINEPLUS:2,STAMPPLUS:3,FRAME:4,VERTICALLINE:5,STAMPCOMMENT:6,COMMENTPLUS:7,PEN:8,LINE:9,RECTANGLE:10,OVAL:11,HIGHLIGHT:12},h={HIGHLIGHTPLUS:"highlightplus",LINEPLUS:"lineplus",STAMPPLUS:"stampplus",FRAME:"frame",VERTICALLINE:"verticalline",STAMPCOMMENT:"stampcomment",COMMENTPLUS:"commentplus",PEN:"pen",LINE:"line",RECTANGLE:"rectangle",OVAL:"oval",HIGHLIGHT:"highlight"},p=2,d=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=d;var v=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=v;var m=function(){this.start=!1,this.end=!1,this.starttime=0,this.annotationstart=!1,this.tool="drag",this.commentcolour="yellow",this.annotationcolour="red",this.path=[]};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.edit=m;var g=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,o;r=this.editor.get_dialogue_element(s.DRAWINGREGION),i=parseInt(r.get("scrollLeft"),10),o=parseInt(r.get("scrollTop"),10),e.setData("x",t+i),e.setData("y",n+o)}};M.assignfeedback_editpdfplus=M.assignfeedback_editpdfplus||{},M.assignfeedback_editpdfplus.drawable=g;var y=function(e){y.superclass.constructor.apply(this,[e])};y.NAME="annotation",y.ATTRS={},e.extend(y,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,studentanswer:"",pdfdisplay:"footnote",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.cartridgex=parseInt(e.parent_annot_element.cartridgex,10)||0,this.cartridgey=parseInt(e.parent_annot_element.cartridgey,10)||0,this.colour=e.parent_annot_element.colour||"red",this.tooltype=e.tooltype,this.textannot=e.parent_annot_element.textannot,this.displaylock=parseInt(e.parent_annot_element.displaylock,10),this.displayrotation=e.parent_annot_element.displayrotation,this.borderstyle=e.parent_annot_element.borderstyle||"solid",this.parent_annot=parseInt(e.parent_annot_element.id,10),this.answerrequested=parseInt(e.parent_annot_element.answerrequested,10)||0,this.studentstatus=parseInt(e.parent_annot_element.studentstatus,10)||0,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.cartridgex=parseInt(e.cartridgex,10)||0,this.cartridgey=parseInt(e.cartridgey,10)||0,this.colour=e.colour||"red",this.tooltype=e.tooltype,this.textannot=e.textannot,this.displaylock=parseInt(e.displaylock,10),this.displayrotation=e.displayrotation,this.borderstyle=e.borderstyle||"solid",this.parent_annot=parseInt(e.parent_annot,10),this.answerrequested=parseInt(e.answerrequested,10
parseInt(e.studentstatus,10)||0,this.studentanswer=e.studentanswer),this.id=e.id,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.path=e.path||"",this.toolid=e.toolid||this.editor.get_dialogue_element(c.RECTANGLE),this.drawable=!1,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:parseInt(this.parent_annot,10),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:parseInt(this.parent_annot,10),divcartridge:this.divcartridge,parent_annot_div:"",answerrequested:parseInt(this.answerrequested,10),studentstatus:parseInt(this.studentstatus,10)}},light_clean:function(){return{id:this.id,studentstatus:parseInt(this.studentstatus,10),studentanswer:this.studentanswer}},draw_highlight:function(){var t,n=this.editor.get_dialogue_element(s.DRAWINGREGION),r=this.editor.get_dialogue_element(s.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:p,color:o},fill:{color:u},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 a=e.Node.create('<i class="fa fa-trash" aria-hidden="true"></i>'),f=e.Node.create('<a href="#" role="button"></a>');a.setAttrs({alt:M.util.get_string("deleteannotation","assignfeedback_editpdfplus")}),a.setStyles({backgroundColor:"white"}),f.addClass("deleteannotationbutton"),f.append(a),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=a[this.colour];return e?(e=e.replace("rgb","rgba"),e=e.replace(")",",0.5)")):e=this.colour,e},get_color_cartridge:function(){var e=a[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 ";n+="id='"+this.divcartridge+"' ",n+="class='assignfeedback_editpdfplus_cartridge' ",n+="style='border-color: "+t+";'> ",n+="</div>";var r=e.Node.create(n);return this.editor.get("readonly")&&r.on("click",this.view_annot,this),r},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.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()+"\" class='form-control' style='margin-bottom:5px;' >"+this.get_valref()+"</textarea>",t+="</div>";var n=e.Node.create(t),r=this.tooltype.texts;if(r&&r.length>0){var i="<div class='btn-group-vertical aepp-toolbar-vertical'></div>",s=e.Node.create(i),o=r.split('","');for(var u=0;u<o.length;u++){var a="<button class='btn btn-outline-dark' type='button'>"+o[u].replace('"',"")+"</button>",f=e.Node.create(a);f.on("click",this.fill_input_edition,this,o[u].replace('"',"")),s.append(f),s.append("<br/>")}n.append(s)}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);if(this.answerrequested===1){var i=e.Node.create("<div></div>"),s=e.Node.create("<hr style='margin-bottom:0px;'/>"),o=e.Node.create("<label style='display:inline;'>"+M.util.get_string("student_answer_lib","assignfeedback_editpdfplus")+"</label>"),u="";this.studentanswer&&this.studentanswer!=="0"&&this.studentanswer!=="1"&&(u=this.studentanswer);var a=e.Node.create("<br/><textarea id='"+this.divcartridge+"_studentanswer' type='text' value=\""+u+"\" class='form-control'>"+ )||0,this.studentstatus=parseInt(e.studentstatus,10)||0,this.studentanswer=e.studentanswer),this.id=e.id,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.path=e.path||"",this.toolid=e.toolid||this.editor.get_dialogue_element(c.RECTANGLE),this.drawable=!1,this.pdfdisplay=e.pdfdisplay,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:parseInt(this.parent_annot,10),divcartridge:this.divcartridge,parent_annot_div:this.parent_annot_element.divcartridge,pdfdisplay:this.pdfdisplay}:{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:parseInt(this.parent_annot,10),divcartridge:this.divcartridge,parent_annot_div:"",answerrequested:parseInt(this.answerrequested,10),studentstatus:parseInt(this.studentstatus,10),pdfdisplay:this.pdfdisplay}},light_clean:function(){return{id:this.id,studentstatus:parseInt(this.studentstatus,10),studentanswer:this.studentanswer}},draw_highlight:function(){var t,n=this.editor.get_dialogue_element(s.DRAWINGREGION),r=this.editor.get_dialogue_element(s.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:p,color:o},fill:{color:u},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 a=e.Node.create('<i class="fa fa-trash" aria-hidden="true"></i>'),f=e.Node.create('<a href="#" role="button"></a>');a.setAttrs({alt:M.util.get_string("deleteannotation","assignfeedback_editpdfplus")}),a.setStyles({backgroundColor:"white"}),f.addClass("deleteannotationbutton"),f.append(a),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=a[this.colour];return e?(e=e.replace("rgb","rgba"),e=e.replace(")",",0.5)")):e=this.colour,e},get_color_cartridge:function(){var e=a[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 ";n+="id='"+this.divcartridge+"' ",n+="class='assignfeedback_editpdfplus_cartridge' ",n+="style='border-color: "+t+";'> ",n+="</div>";var r=e.Node.create(n);return this.editor.get("readonly")&&r.on("click",this.view_annot,this),r},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.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()+"\" class='form-control' style='margin-bottom:5px;' >"+this.get_valref()+"</textarea>",t+="</div>";var n=e.Node.create(t),r=this.tooltype.texts;if(r&&r.length>0){var i="<div class='btn-group-vertical aepp-toolbar-vertical'></div>",s=e.Node.create(i),o=r.split('","');for(var u=0;u<o.length;u++){var a="<button class='btn btn-outline-dark' type='button'>"+o[u].replace('"',"")+"</button>",f=e.Node.create(a);f.on("click",this.fill_input_edition,this,o[u].replace('"',"")),s.append(f),s.append("<br/>")}n.append(s)}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+