Gitlab CSE Unil

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

modif affichage global : utilisation boostrap et fa

modif css pour le centrage des fenêtres en mode étudiant
parent 9dafe8e4
......@@ -140,10 +140,6 @@ if ($action === 'pollconversions') {
$page = json_decode($pagejson);
$index = required_param('index', PARAM_INT);
/* $added = page_editor::set_comments($grade->id, $index, $page->comments);
if ($added != count($page->comments)) {
array_push($response->errors, get_string('couldnotsavepage', 'assignfeedback_editpdfplus', $index + 1));
} */
$added = page_editor::set_annotations($grade->id, $index, $page->annotations);
if ($added != count($page->annotations)) {
array_push($response->errors, get_string('couldnotsavepage', 'assignfeedback_editpdfplus', $index + 1));
......
// Standard license block omitted.
/*
* @package assignfeedback_editpdfplus
* @copyright 2015 Someone cool
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/editplus
*/
define(['jquery'], function ($) {
/**
* @constructor
* @alias module:mod_assignfeedback_editpdfplus/editplus
*/
var greeting = function () {
/** @access private */
//var privateThoughts = 'I like the colour blue';
$("#id").val();
/** @access public */
this.publicThoughts = 'I like the colour orange';
};
/**
* A formal greeting.
* @access public
* @return {string}
*/
greeting.prototype.formal = function () {
return 'How do you do?';
};
/**
* An informal greeting.
* @access public
* @return {string}
*/
greeting.prototype.informal = function () {
return 'Wassup!';
};
return {
init: function () {
alert("hello");
}
};
});
\ No newline at end of file
......@@ -296,9 +296,13 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
$toolbaraxis .= "</div><div style='display:inline;margin-left:5px;text-align:left;'>";
}
$toolbaraxis .= "</div></div>";
$questionchoice = html_writer::select([get_string('question_select', 'assignfeedback_editpdfplus'), get_string('question_select_without', 'assignfeedback_editpdfplus'), get_string('question_select_with', 'assignfeedback_editpdfplus')], 'questionselection', 0, FALSE);
$axischoice = html_writer::select([get_string('statut_select', 'assignfeedback_editpdfplus'), get_string('statut_select_nc', 'assignfeedback_editpdfplus'), get_string('statut_select_ok', 'assignfeedback_editpdfplus'), get_string('statut_select_ko', 'assignfeedback_editpdfplus')], 'statutselection', 0, FALSE);
$validatebutton = html_writer::tag('button', get_string('send_pdf_update', 'assignfeedback_editpdfplus'), array('class' => 'button', 'id' => 'student_valide_button'));
$questionchoice = html_writer::select(
[get_string('question_select', 'assignfeedback_editpdfplus'), get_string('question_select_without', 'assignfeedback_editpdfplus'), get_string('question_select_with', 'assignfeedback_editpdfplus')],
'questionselection', 0, FALSE, array('class' => 'form-control'));
$axischoice = html_writer::select(
[get_string('statut_select', 'assignfeedback_editpdfplus'), get_string('statut_select_nc', 'assignfeedback_editpdfplus'), get_string('statut_select_ok', 'assignfeedback_editpdfplus'), get_string('statut_select_ko', 'assignfeedback_editpdfplus')],
'statutselection', 0, FALSE, array('class' => 'form-control'));
$validatebutton = html_writer::tag('button', get_string('send_pdf_update', 'assignfeedback_editpdfplus'), array('class' => 'button btn btn-default', 'id' => 'student_valide_button'));
$toolbaraxis .= html_writer::div($validatebutton, 'toolbar ', array('role' => 'toolbar'));
$toolbaraxis .= html_writer::div($axischoice, 'toolbar ', array('role' => 'toolbar'));
$toolbaraxis .= html_writer::div($questionchoice, 'toolbar ', array('role' => 'toolbar'));
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
......@@ -21,7 +22,6 @@
* @copyright 2012 Davo Smith
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
......@@ -36,32 +36,26 @@ defined('MOODLE_INTERNAL') || die();
* @param array $options - List of options affecting file serving.
* @return bool false if file not found, does not return if found - just send the file
*/
function assignfeedback_editpdfplus_pluginfile($course,
$cm,
context $context,
$filearea,
$args,
$forcedownload,
array $options=array()) {
function assignfeedback_editpdfplus_pluginfile($course, $cm, context $context, $filearea, $args, $forcedownload, array $options = array()) {
global $USER, $DB, $CFG;
if ($context->contextlevel == CONTEXT_MODULE) {
require_login($course, false, $cm);
$itemid = (int)array_shift($args);
$itemid = (int) array_shift($args);
if (!$assign = $DB->get_record('assign', array('id'=>$cm->instance))) {
if (!$assign = $DB->get_record('assign', array('id' => $cm->instance))) {
return false;
}
$record = $DB->get_record('assign_grades', array('id'=>$itemid), 'userid,assignment', MUST_EXIST);
$record = $DB->get_record('assign_grades', array('id' => $itemid), 'userid,assignment', MUST_EXIST);
$userid = $record->userid;
if ($assign->id != $record->assignment) {
return false;
}
// Check is users feedback or has grading permission.
if ($USER->id != $userid and !has_capability('mod/assign:grade', $context)) {
if ($USER->id != $userid and ! has_capability('mod/assign:grade', $context)) {
return false;
}
......@@ -74,7 +68,30 @@ function assignfeedback_editpdfplus_pluginfile($course,
return false;
}
// Download MUST be forced - security!
send_stored_file($file, 0, 0, true, $options);// Check if we want to retrieve the stamps.
send_stored_file($file, 0, 0, true, $options); // Check if we want to retrieve the stamps.
}
}
/**
*
* @param navigation_node $navigation
* @param stdClass $course
* @param context_course $context
*/
function assignfeedback_editpdfplus_extend_navigation_course(navigation_node $navigation, stdClass $course, context_course $context) {
global $PAGE;
$url = new moodle_url('/admin/tool/devcourse/index.php');
$devcoursenode = navigation_node::create('Development course', $url, navigation_node::TYPE_CUSTOM, 'Dev course', 'devcourse');
$navigation->add_node($devcoursenode);
/* $coursenode = $PAGE->navigation->find($courseid, navigation_node::TYPE_COURSE);
$thingnode = $coursenode->add(get_string('Name of thing'), new moodle_url('/a/link/if/you/want/one.php'));
$thingnode->make_active(); */
}
/*function assignfeedback_editpdfplus_extend_navigation_course(navigation_node $parentnode, $course, $context) {
$url = new moodle_url('/course/view.php', array('courseid' => $course->id));
$settingsnode = navigation_node::create('test ND navigation node', $url,
navigation_node::TYPE_SETTING, null, null, new pix_icon('i/settings', ''));
$parentnode->add_node($settingsnode);
}*/
......@@ -246,6 +246,9 @@ class assign_feedback_editpdfplus extends assign_feedback_plugin {
*/
public function view(stdClass $grade) {
global $PAGE;
//$PAGE->requires->js_call_amd('assignfeedback_editpdfplus/editplus', 'init');
$html = '';
// Show a link to download the pdf.
if (page_editor::has_annotations_or_comments($grade->id, false)) {
......
......@@ -27,15 +27,19 @@
}
.assignfeedback_editpdfplus_widget .drawingregion {
border: 1px solid #ccc;
left: 1em;
left: 0.1em;
right: 1em;
top: 52px;
/*top: 52px;*/
bottom: 0;
position: absolute;
overflow: auto;
background-color: #ccc;
}
.assignfeedback_editpdfplus_widget[data-region="review-panel-content"] .drawingregion {
top: 52px;
}
.assignfeedback_editpdfplus_widget {
user-select: none;
-moz-user-select: none;
......
......@@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2017051600;
$plugin->version = 2017052900;
$plugin->requires = 2017050500; // Requires this Moodle version.
$plugin->dependencies = array(
'assignfeedback_editpdf' => 2017050500
......
......@@ -1105,7 +1105,7 @@ Y.extend(ANNOTATION, Y.Base, {
var textarea = Y.Node.create("<br/><textarea id='"
+ this.divcartridge
+ "_studentanswer' type='text' value=\""
+ rep + "\" >"
+ rep + "\" class='form-control'>"
+ rep
+ "</textarea>");
rep = this.studentanswer;
......@@ -1180,14 +1180,16 @@ Y.extend(ANNOTATION, Y.Base, {
+ '</label>';
var buttonstatus2 = '<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>';
+ '_status" value=1 >'
//+ M.util.image_url('tick', 'assignfeedback_editpdfplus')
+ '<i style="color:green;" class="fa fa-check" aria-hidden="true"></i>'
+ '</label>';
var buttonstatus3 = '<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> ';
+ '_status" value=2 >'
//+ M.util.image_url('cross', 'assignfeedback_editpdfplus')
+ '<i style="color:red;" class="fa fa-times" aria-hidden="true"></i>'
+ '</label> ';
var buttonstatus1display = Y.Node.create(buttonstatus1);
var buttonstatus2display = Y.Node.create(buttonstatus2);
var buttonstatus3display = Y.Node.create(buttonstatus3);
......
......@@ -1105,7 +1105,7 @@ Y.extend(ANNOTATION, Y.Base, {
var textarea = Y.Node.create("<br/><textarea id='"
+ this.divcartridge
+ "_studentanswer' type='text' value=\""
+ rep + "\" >"
+ rep + "\" class='form-control'>"
+ rep
+ "</textarea>");
rep = this.studentanswer;
......@@ -1180,14 +1180,16 @@ Y.extend(ANNOTATION, Y.Base, {
+ '</label>';
var buttonstatus2 = '<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>';
+ '_status" value=1 >'
//+ M.util.image_url('tick', 'assignfeedback_editpdfplus')
+ '<i style="color:green;" class="fa fa-check" aria-hidden="true"></i>'
+ '</label>';
var buttonstatus3 = '<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> ';
+ '_status" value=2 >'
//+ M.util.image_url('cross', 'assignfeedback_editpdfplus')
+ '<i style="color:red;" class="fa fa-times" aria-hidden="true"></i>'
+ '</label> ';
var buttonstatus1display = Y.Node.create(buttonstatus1);
var buttonstatus2display = Y.Node.create(buttonstatus2);
var buttonstatus3display = Y.Node.create(buttonstatus3);
......
......@@ -570,7 +570,7 @@ Y.extend(ANNOTATION, Y.Base, {
var textarea = Y.Node.create("<br/><textarea id='"
+ this.divcartridge
+ "_studentanswer' type='text' value=\""
+ rep + "\" >"
+ rep + "\" class='form-control'>"
+ rep
+ "</textarea>");
rep = this.studentanswer;
......@@ -645,14 +645,16 @@ Y.extend(ANNOTATION, Y.Base, {
+ '</label>';
var buttonstatus2 = '<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>';
+ '_status" value=1 >'
//+ M.util.image_url('tick', 'assignfeedback_editpdfplus')
+ '<i style="color:green;" class="fa fa-check" aria-hidden="true"></i>'
+ '</label>';
var buttonstatus3 = '<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> ';
+ '_status" value=2 >'
//+ M.util.image_url('cross', 'assignfeedback_editpdfplus')
+ '<i style="color:red;" class="fa fa-times" aria-hidden="true"></i>'
+ '</label> ';
var buttonstatus1display = Y.Node.create(buttonstatus1);
var buttonstatus2display = Y.Node.create(buttonstatus2);
var buttonstatus3display = Y.Node.create(buttonstatus3);
......
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