Gitlab CSE Unil

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

outil type 4 : display et changement de couleur / tour de cadre

parent 91e99405
......@@ -69,6 +69,9 @@ class annotation {
/** @var bool displaylock for displaying this annotation */
public $displaylock = 0;
/** @var string borderstyle */
public $borderstyle = '';
/**
* Convert a compatible stdClass into an instance of this class.
* @param stdClass $record
......
......@@ -41,14 +41,18 @@
<FIELD NAME="studentanswer" TYPE="char" LENGTH="500" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="studentstatus" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="displaylock" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="borderstyle" TYPE="char" LENGTH="20" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="parent_annot" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="true"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="gradeid" TYPE="foreign" FIELDS="gradeid" REFTABLE="assign_grades" REFFIELDS="id"/>
<KEY NAME="toolid" TYPE="foreign" FIELDS="toolid" REFTABLE="editpdfpp_tool" REFFIELDS="id"/>
<KEY NAME="parent_annot" TYPE="foreign" FIELDS="parent_annot" REFTABLE="editpdfpp_annot" REFFIELDS="id"/>
</KEYS>
<INDEXES>
<INDEX NAME="gradeid_pageno" UNIQUE="false" FIELDS="gradeid, pageno"/>
<INDEX NAME="parent_annot" UNIQUE="false" FIELDS="parent_annot"/>
</INDEXES>
</TABLE>
<TABLE NAME="assignfeedback_editpp_quick" COMMENT="Stores teacher specified quicklist comments">
......
......@@ -115,6 +115,7 @@ Y.extend(ANNOTATION, Y.Base, {
divcartridge: '',
textannot: '',
displaylock: 0,
borderstyle: '',
/**
* Initialise the annotation.
*
......@@ -136,6 +137,7 @@ Y.extend(ANNOTATION, Y.Base, {
this.tooltype = config.tooltype;
this.textannot = config.textannot;
this.displaylock = config.displaylock;
this.borderstyle = config.borderstyle || 'solid';
},
/**
* Clean a comment record, returning an oject with only fields that are valid.
......@@ -144,6 +146,7 @@ Y.extend(ANNOTATION, Y.Base, {
* @return {}
*/
clean: function () {
Y.log('clean : ' + this.borderstyle);
return {
gradeid: this.gradeid,
x: parseInt(this.x, 10),
......@@ -155,7 +158,8 @@ Y.extend(ANNOTATION, Y.Base, {
pageno: this.pageno,
colour: this.colour,
textannot: this.textannot,
displaylock: parseInt(this.displaylock, 10)
displaylock: parseInt(this.displaylock, 10),
borderstyle: this.borderstyle
};
},
/**
......
This diff is collapsed.
......@@ -995,26 +995,40 @@ EDITOR.prototype = {
} else if (data.tool === TOOLTYPE.HIGHLIGHT + '' || data.tool === TOOLTYPELIB.HIGHLIGHT) {
return new M.assignfeedback_editpdfplus.annotationhighlight(data);
} else {
if (toolobjet) {
//Y.log('create_annotation couleur origine : ' + toolobjet.colors);
if (toolobjet.colors && toolobjet.colors.indexOf(',') !== -1) {
data.colour = toolobjet.colors.substr(0, toolobjet.colors.indexOf(','));
} else {
data.colour = toolobjet.colors;
}
}
data.tooltype = toolobjet;
if (data.tool === TOOLTYPE.HIGHLIGHTPLUS + '' || data.tool === TOOLTYPELIB.HIGHLIGHTPLUS) {
if (toolobjet) {
if (toolobjet.colors && toolobjet.colors.indexOf(',') !== -1) {
data.colour = toolobjet.colors.substr(0, toolobjet.colors.indexOf(','));
} else {
data.colour = toolobjet.colors;
}
}
if (data.colour === "") {
data.colour = TOOLTYPEDEFAULTCOLOR.HIGHLIGHTPLUS;
}
return new M.assignfeedback_editpdfplus.annotationhighlightplus(data);
} else if (data.tool === TOOLTYPE.STAMPPLUS + '' || data.tool === TOOLTYPELIB.STAMPPLUS) {
if (toolobjet) {
if (toolobjet.colors && toolobjet.colors.indexOf(',') !== -1) {
data.colour = toolobjet.colors.substr(0, toolobjet.colors.indexOf(','));
} else {
data.colour = toolobjet.colors;
}
}
if (data.colour === "") {
data.colour = TOOLTYPEDEFAULTCOLOR.STAMPPLUS;
}
return new M.assignfeedback_editpdfplus.annotationstampplus(data);
} else if (data.tool === TOOLTYPE.FRAME + '' || data.tool === TOOLTYPELIB.FRAME) {
/*if (toolobjet && data.colour === '') {
if (toolobjet.colors && toolobjet.colors.indexOf(',') !== -1) {
data.colour = toolobjet.colors.substr(0, toolobjet.colors.indexOf(','));
} else {
data.colour = toolobjet.colors;
}
}*/
Y.log('create_annotation : ' + data.colour);
if (data.colour === "") {
data.colour = TOOLTYPEDEFAULTCOLOR.FRAME;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment