Gitlab CSE Unil

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

suppression validation enseignant

parent fc8f7420
define(["jquery"],function(a){function b(a){this.editor=a.editor,this.id=null,this.timeposition=null,this.isquestion=0,this.assignementpart=null,this.validation=0,this.statut=0,this.mainmessage=null,this.tag=-1,this.user=-1,this.typeuser=-1}return b.id=null,b.user=null,b.timeposition=null,b.isquestion=0,b.assignementpart=null,b.validation=0,b.statut=0,b.mainmessage=null,b.tag=-1,b.typeuser=-1,b.editor=null,b.divDisplay=null,b.DEFAULTCOLOR="yellow",b.prototype.init=function(a){a.timeposition&&(this.timeposition=a.timeposition),a.id&&(this.id=a.id),a.user&&(this.user=a.user),a.isquestion&&(this.isquestion=a.isquestion),a.assignementpart&&(this.assignementpart=a.assignementpart),a.validation&&(this.validation=a.validation),a.statut&&(this.statut=a.statut),a.mainmessage&&(this.mainmessage=a.mainmessage),a.tag&&(this.tag=a.tag),a.typeuser&&(this.typeuser=a.typeuser)},b.prototype.initListener=function(){if(this.divDisplay){var a=this,b=this.editor.getCurrentUser()==this.user,c=(this.editor.isWriting()>0||this.editor.getPairing()>0)&&b;this.divDisplay.on("click",function(){c?a.editor.notify("edit",a):a.editor.notify("view",a)})}},b.prototype.serialize=function(a,b,c){return{courseid:a,action:b,audioannotation:c,timeposition:this.timeposition,id:this.id,isquestion:this.isquestion,assignementpart:this.assignementpart,validation:this.validation,statut:this.statut,mainmessage:this.mainmessage,tag:this.tag}},b.prototype.displayDiv=function(a,b,c){return this.divDisplay&&!c||this.buildDiv(a,b),this.divDisplay},b.prototype.buildDiv=function(c,d){var e=this.editor.getTagColor();d&&(e=b.DEFAULTCOLOR),this.tag>-1&&(e=this.editor.getTagColor(this.tag));var f="<div style='background-color:"+e+";";f+="margin-left:"+c+"%; ",this.editor.getCurrentUser()!=this.user&&(f+="padding-top:10px; padding-left:2px;"),f+="' ",f+="class='audio_annotation' ",f+=d?"data-annotation='draft' ":"data-annotation='"+this.id+"' ",f+=">",this.editor.getCurrentUser()!=this.user&&(f+="<div style='background-color:white;height: 145px;width: 2px;cursor: pointer;'></div>"),f+="</div>",this.divDisplay=a(f)},b.prototype.hide=function(){this.divDisplay.hide()},b.prototype.show=function(){this.divDisplay.show()},b.prototype.refreshDiv=function(a){a?this.divDisplay.css("background-color",b.DEFAULTCOLOR):this.divDisplay.css("background-color",this.editor.getTagColor(this.tag)),this.divDisplay.data("annotation",this.id)},b.prototype.delDisplay=function(){this.divDisplay&&this.divDisplay.remove()},b});
\ No newline at end of file
define(["jquery"],function(a){function b(a){this.editor=a.editor,this.id=null,this.timeposition=null,this.isquestion=0,this.assignementpart=null,this.statut=0,this.mainmessage=null,this.tag=-1,this.user=-1,this.typeuser=-1}return b.id=null,b.user=null,b.timeposition=null,b.isquestion=0,b.assignementpart=null,b.statut=0,b.mainmessage=null,b.tag=-1,b.typeuser=-1,b.editor=null,b.divDisplay=null,b.DEFAULTCOLOR="yellow",b.prototype.init=function(a){a.timeposition&&(this.timeposition=a.timeposition),a.id&&(this.id=a.id),a.user&&(this.user=a.user),a.isquestion&&(this.isquestion=a.isquestion),a.assignementpart&&(this.assignementpart=a.assignementpart),a.statut&&(this.statut=a.statut),a.mainmessage&&(this.mainmessage=a.mainmessage),a.tag&&(this.tag=a.tag),a.typeuser&&(this.typeuser=a.typeuser)},b.prototype.initListener=function(){if(this.divDisplay){var a=this,b=this.editor.getCurrentUser()==this.user,c=(this.editor.isWriting()>0||this.editor.getPairing()>0)&&b;this.divDisplay.on("click",function(){c?a.editor.notify("edit",a):a.editor.notify("view",a)})}},b.prototype.serialize=function(a,b,c){return{courseid:a,action:b,audioannotation:c,timeposition:this.timeposition,id:this.id,isquestion:this.isquestion,assignementpart:this.assignementpart,statut:this.statut,mainmessage:this.mainmessage,tag:this.tag}},b.prototype.displayDiv=function(a,b,c){return this.divDisplay&&!c||this.buildDiv(a,b),this.divDisplay},b.prototype.buildDiv=function(c,d){var e=this.editor.getTagColor();d&&(e=b.DEFAULTCOLOR),this.tag>-1&&(e=this.editor.getTagColor(this.tag));var f="<div style='background-color:"+e+";";f+="margin-left:"+c+"%; ",this.editor.getCurrentUser()!=this.user&&(f+="padding-top:10px; padding-left:2px;"),f+="' ",f+="class='audio_annotation' ",f+=d?"data-annotation='draft' ":"data-annotation='"+this.id+"' ",f+=">",this.editor.getCurrentUser()!=this.user&&(f+="<div style='background-color:white;height: 145px;width: 2px;cursor: pointer;'></div>"),f+="</div>",this.divDisplay=a(f)},b.prototype.hide=function(){this.divDisplay.hide()},b.prototype.show=function(){this.divDisplay.show()},b.prototype.refreshDiv=function(a){a?this.divDisplay.css("background-color",b.DEFAULTCOLOR):this.divDisplay.css("background-color",this.editor.getTagColor(this.tag)),this.divDisplay.data("annotation",this.id)},b.prototype.delDisplay=function(){this.divDisplay&&this.divDisplay.remove()},b});
\ No newline at end of file
This diff is collapsed.
......@@ -40,7 +40,6 @@ define(['jquery'],
Annotation.timeposition = null;
Annotation.isquestion = 0;
Annotation.assignementpart = null;
Annotation.validation = 0;
Annotation.statut = 0;
Annotation.mainmessage = null;
Annotation.tag = -1;
......@@ -79,7 +78,6 @@ define(['jquery'],
this.timeposition = null;
this.isquestion = 0;
this.assignementpart = null;
this.validation = 0;
this.statut = 0;
this.mainmessage = null;
this.tag = -1;
......@@ -111,9 +109,6 @@ define(['jquery'],
if (opt.assignementpart) {
this.assignementpart = opt.assignementpart;
}
if (opt.validation) {
this.validation = opt.validation;
}
if (opt.statut) {
this.statut = opt.statut;
}
......@@ -158,8 +153,8 @@ define(['jquery'],
Annotation.prototype.serialize = function (courseid, action, audioannotation) {
return {'courseid': courseid, 'action': action, 'audioannotation': audioannotation,
'timeposition': this.timeposition, 'id': this.id, 'isquestion': this.isquestion,
'assignementpart': this.assignementpart, 'validation': this.validation,
'statut': this.statut, 'mainmessage': this.mainmessage, 'tag': this.tag};
'assignementpart': this.assignementpart, 'statut': this.statut,
'mainmessage': this.mainmessage, 'tag': this.tag};
};
/**
......
......@@ -519,10 +519,6 @@ define(['jquery', 'mod_audioannotation/annotation', 'mod_audioannotation/records
});
//message part
if ($("input[name=validationradio]").length > 0) {
$("input[name=validationradio][value='" + annotation.validation + "']").attr('checked', true);
}
$("#message_form_btn_valid").on("click", function () {
var form = $('form[name=mod_audioannotation_form_message_form]');
var data = form.serialize();
......@@ -537,9 +533,6 @@ define(['jquery', 'mod_audioannotation/annotation', 'mod_audioannotation/records
$("#annotationError").addClass("alert-danger");
return;
}
if ($("input[name=validationradio]:checked").val()) {
annotation.validation = $("input[name=validationradio]:checked").val();
}
closeEditForm(annotation);
}).fail(notification.exception);
......
......@@ -65,7 +65,7 @@ class backup_audioannotation_activity_structure_step extends backup_activity_str
// The annotation table
$annotation = new backup_nested_element('annot', array('id'), array(
'timeposition', 'validation', 'statut', 'isquestion',
'timeposition', 'statut', 'isquestion',
'tag', 'mainmessage', 'user'
));
......
......@@ -32,7 +32,6 @@ class annotation {
const TIMEPOSITION = "timeposition";
const ISQUESTION = "isquestion";
const ASSIGNEMENTPART = "assignementpart";
const VALIDATION = "validation";
const STATUT = "statut";
const MESSAGE = "mainmessage";
const TAG = "tag";
......@@ -42,7 +41,6 @@ class annotation {
public $timeposition;
public $isquestion;
public $assignementpart;
public $validation;
public $statut;
public $mainmessage;
public $tag;
......@@ -72,7 +70,6 @@ class annotation {
$this->mainmessage = array_key_exists(annotation::MESSAGE, $data) ? $data[annotation::MESSAGE] : null;
$this->statut = array_key_exists(annotation::STATUT, $data) ? $data[annotation::STATUT] : 0;
$this->tag = array_key_exists(annotation::TAG, $data) ? $data[annotation::TAG] : null;
$this->validation = array_key_exists(annotation::VALIDATION, $data) ? $data[annotation::VALIDATION] : 0;
$this->timeposition = array_key_exists(annotation::TIMEPOSITION, $data) ? $data[annotation::TIMEPOSITION] : 0;
}
......
......@@ -250,10 +250,6 @@ class editor {
$statut = $annotationData->statutradio;
$res &= $DB->execute(editor::getUpdateSqlText(annotation::TABLEANNOTATION, annotation::STATUT . "=?", annotation::ID . "=?"), array($statut, $annotationData->id));
}
if ($annotationData->validationradio) {
$validation = $annotationData->validationradio;
$res &= $DB->execute(editor::getUpdateSqlText(annotation::TABLEANNOTATION, annotation::VALIDATION . "=?", annotation::ID . "=?"), array($validation, $annotationData->id));
}
return $res;
}
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace mod_audioannotation;
/**
* Version information
*
* @package mod
* @subpackage audioannotation
* @copyright 2018 Université de Lausanne
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class validation {
public $id;
public $typevalidation;
/**
* Convert a compatible stdClass into an instance of this class.
* @param stdClass $record
*/
public function __construct(\stdClass $record = null) {
if ($record) {
foreach ($this as $key => $value) {
if (isset($record->$key)) {
$this->$key = $record->$key;
}
}
}
}
}
......@@ -32,19 +32,7 @@
* @see upgrade_plugins_modules()
*/
function xmldb_audioannotation_install() {
global $DB;
//init validation
$valid1 = new mod_audioannotation\validation();
$valid1->typevalidation = "NC";
$valid2 = new mod_audioannotation\validation();
$valid2->typevalidation = "VALIDE";
$valid3 = new mod_audioannotation\validation();
$valid3->typevalidation = "NOVALIDE";
$valid4 = new mod_audioannotation\validation();
$valid4->typevalidation = "WATCH";
$validations = array($valid1, $valid2, $valid3, $valid4);
$DB->insert_records('audioannotation_validation', $validations);
}
/**
......
......@@ -76,7 +76,6 @@
<FIELD NAME="user" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT=""/>
<FIELD NAME="assignementpart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="Course audioannotation assignement part belongs to"/>
<FIELD NAME="timeposition" TYPE="float" LENGTH="15" DECIMALS="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT=""/>
<FIELD NAME="validation" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT=""/>
<FIELD NAME="statut" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT=""/>
<FIELD NAME="mainmessage" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT=""/>
<FIELD NAME="isquestion" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT=""/>
......@@ -87,20 +86,10 @@
</KEYS>
<INDEXES>
<INDEX NAME="assignementpart" UNIQUE="false" FIELDS="assignementpart"/>
<!--INDEX NAME="validation" UNIQUE="false" FIELDS="typevalidation"/-->
<INDEX NAME="mainmessage" UNIQUE="false" FIELDS="mainmessage"/>
<INDEX NAME="tag" UNIQUE="false" FIELDS="tag"/>
</INDEXES>
</TABLE>
<TABLE NAME="audioannotation_validation" COMMENT="Audio annotation validation">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true"/>
<FIELD NAME="typevalidation" TYPE="text" LENGTH="50" NOTNULL="true" COMMENT=""/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="audioannotation_message" COMMENT="Audio annotation message">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true"/>
......
......@@ -48,7 +48,6 @@
"timeposition" : 584,
"isquestion" : 0,
"assignementpart" : 38,
"validation" : 0,
"statut" : 0,
"mainmessage" : null,
"tag" : null
......@@ -314,7 +313,6 @@
<input type="hidden" name="context" value="{{context}}" />
<input type="hidden" name="id" value="{{annotation.id}}" />
<input type="hidden" name="statut" value="{{annotation.statut}}" />
<input type="hidden" name="validation" value="{{annotation.validation}}" />
<input type="hidden" name="timeposition" value="{{annotation.timeposition}}" />
<input type="hidden" name="assignementpart" value="{{annotation.assignementpart}}" />
<input type="hidden" name="sesskey" value="{{sesskey}}" />
......@@ -348,32 +346,7 @@
{{#annotation.isquestion}}
<textarea name="filcomment" id="id_message_comment" class="form-control "></textarea>
<input name="filmessage" value="" type="hidden" />
{{/annotation.isquestion}}
<div class="d-flex m-t-1">
{{#eval}}
<div>
<div style="font-weight: bold;">
{{# str }} validation, audioannotation {{/ str }}:
</div>
<div class="form-check-inline">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="validationradio" value='0' />{{# str }} not_processed, audioannotation {{/ str }}
</label>
</div>
<div class="form-check-inline">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="validationradio" value='1' />
<i class="fa fa-check" style="color:green;"></i>
</label>
</div>
<div class="form-check-inline">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="validationradio" value='2' />
<i class="fa fa-times" style="color:red;"></i>
</label>
</div>
</div>
{{/eval}}
<div class="btn-group ml-auto" role="group">
<button class="btn btn-secondary" type="button" id='message_form_btn_valid'>
<i class='fa fa-save'></i>
......@@ -381,10 +354,10 @@
</button>
</div>
</div>
{{/annotation.isquestion}}
<div style='display:none;'>
<input type="hidden" name="context" value="{{context}}" />
<input type="hidden" name="id" value="{{annotation.id}}" />
<input type="hidden" name="validation" value="{{annotation.validation}}" />
<input type="hidden" name="timeposition" value="{{annotation.timeposition}}" />
<input type="hidden" name="assignementpart" value="{{annotation.assignementpart}}" />
<input type="hidden" name="sesskey" value="{{sesskey}}" />
......
......@@ -47,7 +47,6 @@
"timeposition" : 584,
"isquestion" : 1,
"assignementpart" : 38,
"validation" : 0,
"statut" : 0,
"mainmessage" : 5,
"tag" : 7
......@@ -176,7 +175,6 @@
<input type="hidden" name="context" value="{{context}}" />
<input type="hidden" name="id" value="{{annotation.id}}" />
<input type="hidden" name="statut" value="{{annotation.statut}}" />
<input type="hidden" name="validation" value="{{annotation.validation}}" />
<input type="hidden" name="timeposition" value="{{annotation.timeposition}}" />
<input type="hidden" name="assignementpart" value="{{annotation.assignementpart}}" />
<input type="hidden" name="sesskey" value="{{sesskey}}" />
......
......@@ -79,7 +79,6 @@
"timeposition" : 584,
"isquestion" : 0,
"assignementpart" : 11,
"validation" : 0,
"statut" : 0,
"mainmessage" : null,
"tag" : 7
......@@ -89,7 +88,6 @@
"timeposition" : 684,
"isquestion" : 1,
"assignementpart" : 11,
"validation" : 0,
"statut" : 0,
"mainmessage" : null,
"tag" : 8
......@@ -108,7 +106,6 @@
"timeposition" : 584,
"isquestion" : 0,
"assignementpart" : 11,
"validation" : 0,
"statut" : 0,
"mainmessage" : null,
"tag" : 7,
......@@ -128,7 +125,6 @@
"timeposition" : 684,
"isquestion" : 1,
"assignementpart" : 11,
"validation" : 0,
"statut" : 0,
"mainmessage" : null,
"tag" : 8,
......
......@@ -79,7 +79,6 @@
"timeposition" : 584,
"isquestion" : 0,
"assignementpart" : 11,
"validation" : 0,
"statut" : 0,
"mainmessage" : null,
"tag" : 7
......@@ -89,7 +88,6 @@
"timeposition" : 684,
"isquestion" : 1,
"assignementpart" : 11,
"validation" : 0,
"statut" : 0,
"mainmessage" : null,
"tag" : 8
......@@ -108,7 +106,6 @@
"timeposition" : 584,
"isquestion" : 0,
"assignementpart" : 11,
"validation" : 0,
"statut" : 0,
"mainmessage" : null,
"tag" : 7,
......@@ -128,7 +125,6 @@
"timeposition" : 684,
"isquestion" : 1,
"assignementpart" : 11,
"validation" : 0,
"statut" : 0,
"mainmessage" : null,
"tag" : 8,
......
......@@ -47,7 +47,6 @@
"timeposition" : 584,
"isquestion" : 1,
"assignementpart" : 38,
"validation" : 0,
"statut" : 0,
"mainmessage" : 5,
"tag" : 7
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment