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 { ...@@ -86,6 +86,9 @@ class annotation {
/** @var int studentstatus */ /** @var int studentstatus */
public $studentstatus = 0; public $studentstatus = 0;
/** @var string studentanswer */
public $studentanswer = "";
/** /**
* Convert a compatible stdClass into an instance of this class. * Convert a compatible stdClass into an instance of this class.
......
...@@ -302,9 +302,10 @@ class page_editor { ...@@ -302,9 +302,10 @@ class page_editor {
$record = page_editor::get_annotation($recordtmp->id); $record = page_editor::get_annotation($recordtmp->id);
$old = $record->studentstatus; $old = $record->studentstatus;
$record->studentstatus = $recordtmp->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); $DB->update_record('assignfeedback_editpp_annot', $record);
$added++; $added++;
debugging($recordtmp->id . ' - ' . $record->id . ' - ' .$old. ' - ' . $recordtmp->studentstatus . ' - ' . $record->studentstatus);
} }
return $added; return $added;
...@@ -352,11 +353,19 @@ class page_editor { ...@@ -352,11 +353,19 @@ class page_editor {
$DB->delete_records('assignfeedback_editpp_annot', array('gradeid' => $gradeid, 'draft' => 0)); $DB->delete_records('assignfeedback_editpp_annot', array('gradeid' => $gradeid, 'draft' => 0));
// Copy all the draft annotations and comments to non-drafts. // Copy all the draft annotations and comments to non-drafts.
$parentlink = [];
$records = $DB->get_records('assignfeedback_editpp_annot', array('gradeid' => $gradeid, 'draft' => 1)); $records = $DB->get_records('assignfeedback_editpp_annot', array('gradeid' => $gradeid, 'draft' => 1));
foreach ($records as $record) { foreach ($records as $record) {
$oldid = $record->id;
unset($record->id); unset($record->id);
$record->draft = 0; $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)); $records = $DB->get_records('assignfeedback_editpp_cmnt', array('gradeid' => $gradeid, 'draft' => 1));
foreach ($records as $record) { foreach ($records as $record) {
......
...@@ -669,6 +669,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -669,6 +669,7 @@ Y.extend(ANNOTATION, Y.Base, {
cartridgey: 0, cartridgey: 0,
answerrequested: 0, answerrequested: 0,
studentstatus: 0, studentstatus: 0,
studentanswer: "",
/** /**
* Initialise the annotation. * Initialise the annotation.
* *
...@@ -680,48 +681,43 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -680,48 +681,43 @@ Y.extend(ANNOTATION, Y.Base, {
this.editor = config.parent_annot_element.editor || null; this.editor = config.parent_annot_element.editor || null;
this.gradeid = parseInt(config.parent_annot_element.gradeid, 10) || 0; this.gradeid = parseInt(config.parent_annot_element.gradeid, 10) || 0;
this.pageno = parseInt(config.parent_annot_element.pageno, 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.cartridgex = parseInt(config.parent_annot_element.cartridgex, 10) || 0;
this.cartridgey = parseInt(config.parent_annot_element.cartridgey, 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.colour = config.parent_annot_element.colour || 'red';
this.drawable = false;
this.tooltype = config.tooltype; this.tooltype = config.tooltype;
this.textannot = config.parent_annot_element.textannot; this.textannot = config.parent_annot_element.textannot;
this.displaylock = parseInt(config.parent_annot_element.displaylock); this.displaylock = parseInt(config.parent_annot_element.displaylock);
this.displayrotation = config.parent_annot_element.displayrotation; this.displayrotation = config.parent_annot_element.displayrotation;
this.borderstyle = config.parent_annot_element.borderstyle || 'solid'; 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; this.parent_annot_element = config.parent_annot_element;
//config.parent_annot_element.children.push(this); //config.parent_annot_element.children.push(this);
} else { } else {
this.editor = config.editor || null; this.editor = config.editor || null;
this.gradeid = parseInt(config.gradeid, 10) || 0; this.gradeid = parseInt(config.gradeid, 10) || 0;
this.pageno = parseInt(config.pageno, 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.cartridgex = parseInt(config.cartridgex, 10) || 0;
this.cartridgey = parseInt(config.cartridgey, 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.colour = config.colour || 'red';
this.drawable = false;
this.tooltype = config.tooltype; this.tooltype = config.tooltype;
this.textannot = config.textannot; this.textannot = config.textannot;
this.displaylock = parseInt(config.displaylock); this.displaylock = parseInt(config.displaylock);
this.displayrotation = config.displayrotation; this.displayrotation = config.displayrotation;
this.borderstyle = config.borderstyle || 'solid'; this.borderstyle = config.borderstyle || 'solid';
this.parent_annot = config.parent_annot; this.parent_annot = parseInt(config.parent_annot);
this.id = config.id;
this.answerrequested = parseInt(config.answerrequested, 10) || 0; this.answerrequested = parseInt(config.answerrequested, 10) || 0;
this.studentstatus = parseInt(config.studentstatus, 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]; this.tooltypefamille = this.editor.typetools[this.tooltype.type];
}, },
/** /**
...@@ -748,7 +744,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -748,7 +744,7 @@ Y.extend(ANNOTATION, Y.Base, {
displaylock: parseInt(this.displaylock, 10), displaylock: parseInt(this.displaylock, 10),
displayrotation: parseInt(this.displayrotation, 10), displayrotation: parseInt(this.displayrotation, 10),
borderstyle: this.borderstyle, borderstyle: this.borderstyle,
parent_annot: this.parent_annot, 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
}; };
...@@ -769,7 +765,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -769,7 +765,7 @@ Y.extend(ANNOTATION, Y.Base, {
displaylock: parseInt(this.displaylock, 10), displaylock: parseInt(this.displaylock, 10),
displayrotation: parseInt(this.displayrotation, 10), displayrotation: parseInt(this.displayrotation, 10),
borderstyle: this.borderstyle, borderstyle: this.borderstyle,
parent_annot: this.parent_annot, parent_annot: parseInt(this.parent_annot, 10),
divcartridge: this.divcartridge, divcartridge: this.divcartridge,
parent_annot_div: '', parent_annot_div: '',
answerrequested: parseInt(this.answerrequested), answerrequested: parseInt(this.answerrequested),
...@@ -779,7 +775,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -779,7 +775,8 @@ Y.extend(ANNOTATION, Y.Base, {
light_clean: function () { light_clean: function () {
return { return {
id: this.id, id: this.id,
studentstatus: parseInt(this.studentstatus) studentstatus: parseInt(this.studentstatus),
studentanswer: this.studentanswer
}; };
}, },
/** /**
...@@ -883,7 +880,11 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -883,7 +880,11 @@ Y.extend(ANNOTATION, Y.Base, {
div += "class='assignfeedback_editpdfplus_cartridge' "; div += "class='assignfeedback_editpdfplus_cartridge' ";
div += "style='border-color: " + colorcartridge + ";'> "; div += "style='border-color: " + colorcartridge + ";'> ";
div += "</div>"; 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) { get_div_cartridge_label: function (colorcartridge, draggable) {
var divcartridge = "<div "; var divcartridge = "<div ";
...@@ -916,7 +917,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -916,7 +917,7 @@ Y.extend(ANNOTATION, Y.Base, {
if (!this.editor.get('readonly')) { if (!this.editor.get('readonly')) {
divinputdisplay.on('click', this.edit_annot, this); divinputdisplay.on('click', this.edit_annot, this);
} else { } else {
divinputdisplay.on('click', this.view_annot, this); //divinputdisplay.on('click', this.view_annot, this);
} }
return divinputdisplay; return divinputdisplay;
}, },
...@@ -951,6 +952,27 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -951,6 +952,27 @@ Y.extend(ANNOTATION, Y.Base, {
divvisu += this.get_valref().replace(/\n/g, "<br/>"); divvisu += this.get_valref().replace(/\n/g, "<br/>");
divvisu += "</div>"; divvisu += "</div>";
var divvisudisplay = Y.Node.create(divvisu); 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; return divvisudisplay;
}, },
get_div_container: function (colorcartridge) { get_div_container: function (colorcartridge) {
...@@ -1123,7 +1145,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1123,7 +1145,7 @@ Y.extend(ANNOTATION, Y.Base, {
} else if (valref !== '') { } else if (valref !== '') {
finalcontent = valref; finalcontent = valref;
} }
if (!this.editor.get('readonly') && this.answerrequested === 1) { if (this.answerrequested === 1) {
finalcontent += '&nbsp;<span style="color:red;">[?]</span>'; finalcontent += '&nbsp;<span style="color:red;">[?]</span>';
} }
return finalcontent; return finalcontent;
...@@ -1155,6 +1177,14 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1155,6 +1177,14 @@ Y.extend(ANNOTATION, Y.Base, {
}, },
change_status: function (e, idclick) { change_status: function (e, idclick) {
this.studentstatus = 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.editor.save_current_page_edited();
this.hide_edit(); this.hide_edit();
}, },
...@@ -1189,28 +1219,35 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1189,28 +1219,35 @@ Y.extend(ANNOTATION, Y.Base, {
draw_catridge: function (edit) { draw_catridge: function (edit) {
return true; return true;
}, },
view_annot: function (e) { view_annot: function (e, clickType) {
if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) { if (!clickType || !(clickType === 'click')) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) {
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divvisu = this.editor.get_dialogue_element('#' + this.divcartridge + "_visu"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer"); var divvisu = this.editor.get_dialogue_element('#' + this.divcartridge + "_visu");
var studentstatusinput = Y.all("[name=" + this.divcartridge + "_status]"); var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer");
divdisplay.hide(); var studentstatusinput = Y.all("[name=" + this.divcartridge + "_status]");
divvisu.show(); divdisplay.hide();
for (var i = 0; i < studentstatusinput.size(); i++) { divvisu.show();
var tmp = studentstatusinput.item(i); if (this.answerrequested === 1) {
if (parseInt(tmp.get('value')) === this.studentstatus) { var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_studentanswer");
tmp.set('checked', true); input.set(this.studentanswer);
} else {
tmp.set('checked', false);
} }
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) { edit_annot: function (e) {
...@@ -1271,6 +1308,14 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1271,6 +1308,14 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit(); this.hide_edit();
this.apply_visibility_annot(); 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) { cancel_edit: function (e, clickType) {
if (!(clickType === 'clickoutside' && this.editor.currentannotation === this)) { if (!(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref"); var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref");
...@@ -1288,49 +1333,54 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1288,49 +1333,54 @@ Y.extend(ANNOTATION, Y.Base, {
} }
return; return;
}, },
hide_edit: function () { hide_edit: function (e, clickType) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); if (!clickType || !(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divvisu = this.editor.get_dialogue_element('#' + this.divcartridge + "_visu"); var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var buttonsave = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonsave"); var divvisu = this.editor.get_dialogue_element('#' + this.divcartridge + "_visu");
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel"); var buttonsave = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonsave");
var buttonquestion = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonquestion"); var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
var buttonrotation = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonrotation"); var buttonquestion = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonquestion");
var buttonremove = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonremove"); var buttonrotation = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonrotation");
var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer"); var buttonremove = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonremove");
if (divdisplay) { var buttonstatus = this.editor.get_dialogue_element('#' + this.divcartridge + "_radioContainer");
divdisplay.show(); if (divdisplay) {
divdisplay.set('style', 'display:inline;color:' + this.get_color_cartridge() + ';'); divdisplay.show();
} divdisplay.set('style', 'display:inline;color:' + this.get_color_cartridge() + ';');
if (buttonrotation) { }
buttonrotation.show(); if (buttonrotation) {
} buttonrotation.show();
if (divedit) { }
divedit.hide(); if (divedit) {
buttonsave.hide(); divedit.hide();
buttoncancel.hide(); buttonsave.hide();
} buttoncancel.hide();
if (divvisu) { }
divvisu.hide(); if (divvisu) {
} divvisu.hide();
if (buttonquestion) { }
buttonquestion.hide(); if (buttonquestion) {
} buttonquestion.hide();
if (buttonremove) { }
buttonremove.hide(); if (buttonremove) {
} buttonremove.hide();
if (divprincipale) { }
divprincipale.setStyle('z-index', 1); if (divprincipale) {
} divprincipale.setStyle('z-index', 1);
if (divedit) { if (this.editor.get('readonly')) {
this.enabled_canvas_event(); divprincipale.detach();
} divprincipale.on('click', this.view_annot, this, 'click');
if (buttonstatus){ }
buttonstatus.hide(); }
if (divedit) {
this.enabled_canvas_event();
}
if (buttonstatus) {
buttonstatus.hide();
}
} }
} },
,
/** /**
* Delete an annotation * Delete an annotation
* @protected * @protected
...@@ -2689,7 +2739,7 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, { ...@@ -2689,7 +2739,7 @@ Y.extend(ANNOTATIONSTAMPCOMMENT, M.assignfeedback_editpdfplus.annotation, {
node, node,
position; 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)); 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 = Y.Node.create('<div id="' + this.shape_id + '"/>');
node.setStyles({ node.setStyles({
...@@ -5911,7 +5961,8 @@ EDITOR.prototype = { ...@@ -5911,7 +5961,8 @@ EDITOR.prototype = {
var parentannot = []; var parentannot = [];
for (j = 0; j < this.pages[i].annotations.length; j++) { for (j = 0; j < this.pages[i].annotations.length; j++) {
data = this.pages[i].annotations[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]; 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]); var newannot = this.create_annotation(this.typetools[this.tools[data.toolid].type].label, data.toolid, data, this.tools[data.toolid]);
......
...@@ -669,6 +669,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -669,6 +669,7 @@ Y.extend(ANNOTATION, Y.Base, {
cartridgey: 0, cartridgey: 0,
answerrequested: 0, answerrequested: 0,
studentstatus: 0, studentstatus: 0,
studentanswer: "",
/** /**
* Initialise the annotation. * Initialise the annotation.
* *
...@@ -680,48 +681,43 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -680,48 +681,43 @@ Y.extend(ANNOTATION, Y.Base, {
this.editor = config.parent_annot_element.editor || null; this.editor = config.parent_annot_element.editor || null;
this.gradeid = parseInt(config.parent_annot_element.gradeid, 10) || 0; this.gradeid = parseInt(config.parent_annot_element.gradeid, 10) || 0;
this.pageno = parseInt(config.parent_annot_element.pageno, 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.cartridgex = parseInt(config.parent_annot_element.cartridgex, 10) || 0;
this.cartridgey = parseInt(config.parent_annot_element.cartridgey, 10) || 0;