CONTRIB-716 - adding the exabis_student_review block. Thanks to Daniel Prieler for contributing the code.

This commit is contained in:
arborrow
2008-09-21 04:14:49 +00:00
parent 88d8b37b18
commit 666a4a6eb7
42 changed files with 2099 additions and 0 deletions
@@ -0,0 +1,3 @@
Version 1.1.0
* First changelog entry
* added de_du
@@ -0,0 +1,99 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class block_exabis_student_review extends block_list {
function init() {
$this->title = get_string('blocktitle', 'block_exabis_student_review');
$this->version = 2008031000;
}
function instance_allow_multiple() {
return false;
}
function has_config() {
return true;
}
function instance_allow_config() {
return false;
}
function config_save($data) {
print_r($data);
die();
// Default behavior: save all variables as $CFG properties
foreach ($data as $name => $value) {
set_config($name, $value);
}
return true;
}
function get_content() {
global $CFG, $COURSE, $USER;
if ($this->content !== NULL) {
return $this->content;
}
$this->content = '';
$context = get_context_instance(CONTEXT_SYSTEM);
if (!has_capability('block/exabis_student_review:use', $context)) {
return $this->content;
}
if (empty($this->instance)) {
return $this->content;
}
$this->content = new stdClass;
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';
if(has_capability('block/exabis_student_review:head', $context)) {
$this->content->icons[]='<img src="' . $CFG->wwwroot . '/blocks/exabis_student_review/pix/klassenzuteilung.png" height="12" width="11" alt="" />';
$this->content->items[]='<a title="' . get_string('configuration', 'block_exabis_student_review') . '" href="' . $CFG->wwwroot . '/blocks/exabis_student_review/configuration.php?courseid=' . $COURSE->id . '">' . get_string('configuration', 'block_exabis_student_review') . '</a>';
$this->content->icons[]='<img src="' . $CFG->wwwroot . '/blocks/exabis_student_review/pix/zeugnisse.png" height="12" width="11" alt="" />';
$this->content->items[]='<a title="' . get_string('report', 'block_exabis_student_review') . '" href="' . $CFG->wwwroot . '/blocks/exabis_student_review/report.php?courseid=' . $COURSE->id . '">' . get_string('report', 'block_exabis_student_review') . '</a>';
}
if(has_capability('block/exabis_student_review:editperiods', $context)) {
$this->content->icons[]='<img src="' . $CFG->wwwroot . '/blocks/exabis_student_review/pix/eingabezeitraum.png" height="12" width="11" alt="" />';
$this->content->items[]='<a title="' . get_string('periods', 'block_exabis_student_review') . '" href="' . $CFG->wwwroot . '/blocks/exabis_student_review/periods.php?courseid=' . $COURSE->id . '">' . get_string('periods', 'block_exabis_student_review') . '</a>';
}
if(count_records('block_exabstudreviteactoclas', 'teacherid', $USER->id) > 0) {
$this->content->icons[]='<img src="' . $CFG->wwwroot . '/blocks/exabis_student_review/pix/beurteilung.png" height="12" width="11" alt="" />';
$this->content->items[]='<a title="' . get_string('review', 'block_exabis_student_review') . '" href="' . $CFG->wwwroot . '/blocks/exabis_student_review/review.php?courseid=' . $COURSE->id . '">' . get_string('review', 'block_exabis_student_review') . '</a>';
}
return $this->content;
}
}
@@ -0,0 +1,16 @@
<?php //$Id$
require_once($CFG->libdir .'/rsslib.php');
?>
<table cellpadding="9" cellspacing="0">
<tr valign="top">
<tr><td align="right">Grafik 1 (links oben) (<?php echo $CFG->block_exabis_student_review_grafik1;?>):</td>
<td><input type="file" name="block_exabis_student_review_grafik1" /></td></tr>
<tr><td align="right">Grafik 2 (rechts oben) (<?php echo $CFG->block_exabis_student_review_grafik2;?>):</td>
<td><input type="file" name="block_exabis_student_review_grafik2" /></td></tr>
<tr><td align="right">Grafik 3 (links und rechts) (<?php echo $CFG->block_exabis_student_review_grafik3;?>):</td>
<td><input type="file" name="block_exabis_student_review_grafik3" /></td></tr>
</tr>
<tr>
<td colspan="3" align="center"><input type="submit" value="<?php print_string('savechanges') ?>" /></td>
</tr>
</table>
@@ -0,0 +1,95 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
$showall = optional_param('showall', 0, PARAM_BOOL);
$searchtext = optional_param('searchtext', '', PARAM_ALPHANUM); // search string
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
require_capability('block/exabis_student_review:head', $context);
block_exabis_student_review_print_header('configuration');
if (!$class = get_record('block_exabstudreviclas', 'userid', $USER->id)) {
redirect('configuration_class.php?courseid=' . $courseid, get_string('redirectingtoclassinput', 'block_exabis_student_review'));
}
print_heading($class->class);
print_single_button($CFG->wwwroot . '/blocks/exabis_student_review/configuration_class.php',
array('courseid' => $courseid, 'sesskey' => sesskey()),
get_string('editclassname', 'block_exabis_student_review'));
/* Print the Students */
$table = new stdClass();
$table->head = array (get_string('firstname'), get_string('lastname'), get_string('email'));
$table->align = array ("left", "left", "left");
$table->width = "90%";
$usertoclasses = get_records('block_exabstudrevistudtoclas', 'classid', $class->id, 'studentid');
$classusers = array();
foreach($usertoclasses as $usertoclass) {
$user = get_record('user', 'id', $usertoclass->studentid);
$table->data[] = array ($user->firstname, $user->lastname, $user->email);
}
print_table($table);
print_single_button($CFG->wwwroot . '/blocks/exabis_student_review/configuration_classmembers.php',
array('courseid' => $courseid, 'sesskey' => sesskey()),
get_string('editclassmemberlist', 'block_exabis_student_review'));
/* Print the Classes */
$table = new stdClass();
$table->head = array (get_string('firstname'), get_string('lastname'), get_string('email'));
$table->align = array ("left", "left", "left");
$table->width = "90%";
$usertoclasses = get_records('block_exabstudreviteactoclas', 'classid', $class->id, 'teacherid');
$classusers = array();
foreach($usertoclasses as $usertoclass) {
$user = get_record('user', 'id', $usertoclass->teacherid);
$table->data[] = array ($user->firstname, $user->lastname, $user->email);
}
print_table($table);
print_single_button($CFG->wwwroot . '/blocks/exabis_student_review/configuration_classteachers.php',
array('courseid' => $courseid, 'sesskey' => sesskey()),
get_string('editclassteacherlist', 'block_exabis_student_review'));
block_exabis_student_review_print_footer();
@@ -0,0 +1,86 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
require_once($CFG->dirroot . '/blocks/exabis_student_review/lib/edit_form.php');
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
$showall = optional_param('showall', 0, PARAM_BOOL);
$searchtext = optional_param('searchtext', '', PARAM_ALPHANUM); // search string
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
require_capability('block/exabis_student_review:head', $context);
if (!$class = get_record('block_exabstudreviclas', 'userid', $USER->id)) {
$class = new stdClass();
$class->courseid = $courseid;
$class->class = '';
}
$classform = new class_edit_form();
if ($classedit = $classform->get_data()) {
if(!confirm_sesskey()) {
print_error("badsessionkey","block_exabis_student_review");
}
$newclass = new stdClass();
$newclass->timemodified = time();
$newclass->userid = $USER->id;
$newclass->class = $classedit->class;
// das ist glaub ich falsch, weil $class noch nicht definiert ist!
if(isset($class->id)) {
$newclass->id = $class->id;
if (!update_record('block_exabstudreviclas', $newclass)) {
print_error('errorupdatingclass', 'block_exabis_student_review');
}
add_to_log($courseid, 'exabis_student_review', 'edit', 'configuration.php?courseid=' . $courseid, $class->id);
}
else {
if (!($class->id = insert_record('block_exabstudreviclas', $newclass))) {
print_error('errorinsertingclass', 'block_exabis_student_review');
}
add_to_log($courseid, 'exabis_student_review', 'new', 'configuration.php?courseid=' . $courseid, '');
}
redirect('configuration.php?courseid=' . $courseid);
}
block_exabis_student_review_print_header(array('configuration', 'editclassname'));
print_heading($class->class);
$classform->set_data($class);
$classform->display();
print_single_button($CFG->wwwroot . '/blocks/exabis_student_review/configuration.php',
array('courseid' => $courseid),
get_string('back', 'block_exabis_student_review'));
block_exabis_student_review_print_footer();
@@ -0,0 +1,127 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
define("MAX_USERS_PER_PAGE", 5000);
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
$showall = optional_param('showall', 0, PARAM_BOOL);
$searchtext = optional_param('searchtext', '', PARAM_TEXT); // search string
$add = optional_param('add', 0, PARAM_BOOL);
$remove = optional_param('remove', 0, PARAM_BOOL);
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
require_capability('block/exabis_student_review:head', $context);
if (!$class = get_record('block_exabstudreviclas', 'userid', $USER->id)) {
print_error('noclassfound', 'block_exabis_student_review');
}
$header = get_string('configmember', 'block_exabis_student_review', $class->class);
block_exabis_student_review_print_header(array('configuration', '='.$header));
if ($frm = data_submitted()) {
if(!confirm_sesskey()) {
print_error("badsessionkey","block_exabis_student_review");
}
if ($add and !empty($frm->addselect)) {
foreach ($frm->addselect as $adduser) {
if (!$adduser = clean_param($adduser, PARAM_INT)) {
continue;
}
$newuser = new stdClass();
$newuser->studentid = $adduser;
$newuser->classid = $class->id;
$newuser->timemodified = time();
if (!insert_record('block_exabstudrevistudtoclas', $newuser)) {
print_error('errorinsertingstudents', 'block_exabis_student_review');
}
}
} else if ($remove and !empty($frm->removeselect)) {
foreach ($frm->removeselect as $removeuser) {
if (!$removeuser = clean_param($removeuser, PARAM_INT)) {
continue;
}
if (!delete_records('block_exabstudrevistudtoclas', 'studentid', $removeuser, 'classid', $class->id)) {
print_error('errorremovingstudents', 'block_exabis_student_review');
}
}
} else if ($showall) {
$searchtext = '';
}
}
$select = "username <> 'guest' AND deleted = 0 AND confirmed = 1";
if ($searchtext !== '') { // Search for a subset of remaining users
$LIKE = sql_ilike();
$FULLNAME = sql_fullname();
$selectsql = " AND ($FULLNAME $LIKE '%$searchtext%' OR email $LIKE '%$searchtext%') ";
$select .= $selectsql;
} else {
$selectsql = "";
}
$availableusers = get_records_sql('SELECT id, firstname, lastname, email
FROM '.$CFG->prefix.'user
WHERE '.$select.'
AND id NOT IN (
SELECT studentid
FROM '.$CFG->prefix.'block_exabstudrevistudtoclas
WHERE classid = '.$class->id.'
'.$selectsql.')
ORDER BY lastname ASC, firstname ASC');
print_heading($header);
$usertoclasses = get_records('block_exabstudrevistudtoclas', 'classid', $class->id, 'studentid');
$classusers = array();
if ($usertoclasses) {
foreach($usertoclasses as $usertoclass) {
$classusers[] = get_record('user', 'id', $usertoclass->studentid);
}
}
print_simple_box_start('center');
$form_target = 'configuration_classmembers.php';
include('configuration_userlist.html');
print_simple_box_end();
print_single_button($CFG->wwwroot . '/blocks/exabis_student_review/configuration.php',
array('courseid' => $courseid),
get_string('back', 'block_exabis_student_review'));
block_exabis_student_review_print_footer();
@@ -0,0 +1,128 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
define("MAX_USERS_PER_PAGE", 5000);
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
$showall = optional_param('showall', 0, PARAM_BOOL);
$searchtext = optional_param('searchtext', '', PARAM_TEXT); // search string
$add = optional_param('add', 0, PARAM_BOOL);
$remove = optional_param('remove', 0, PARAM_BOOL);
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
require_capability('block/exabis_student_review:head', $context);
if (!$class = get_record('block_exabstudreviclas', 'userid', $USER->id)) {
print_error('noclassfound', 'block_exabis_student_review');
}
$header = get_string('configteacher', 'block_exabis_student_review', $class->class);
block_exabis_student_review_print_header(array('configuration', '='.$header));
if ($frm = data_submitted()) {
if(!confirm_sesskey()) {
print_error("badsessionkey","block_exabis_student_review");
}
if ($add and !empty($frm->addselect)) {
foreach ($frm->addselect as $adduser) {
if (!$adduser = clean_param($adduser, PARAM_INT)) {
continue;
}
$newuser = new stdClass();
$newuser->teacherid = $adduser;
$newuser->classid = $class->id;
$newuser->timemodified = time();
if (!insert_record('block_exabstudreviteactoclas ', $newuser)) {
print_error('errorinsertingteachers', 'block_exabis_student_review');
}
}
} else if ($remove and !empty($frm->removeselect)) {
foreach ($frm->removeselect as $removeuser) {
if (!$removeuser = clean_param($removeuser, PARAM_INT)) {
continue;
}
if (!delete_records('block_exabstudreviteactoclas', 'teacherid', $removeuser, 'classid', $class->id)) {
print_error('errorremovingteachers', 'block_exabis_student_review');
}
}
} else if ($showall) {
$searchtext = '';
}
}
$select = "username <> 'guest' AND deleted = 0 AND confirmed = 1";
if ($searchtext !== '') { // Search for a subset of remaining users
$LIKE = sql_ilike();
$FULLNAME = sql_fullname();
$selectsql = " AND ($FULLNAME $LIKE '%$searchtext%' OR email $LIKE '%$searchtext%') ";
$select .= $selectsql;
} else {
$selectsql = "";
}
$availableusers = get_records_sql('SELECT id, firstname, lastname, email
FROM '.$CFG->prefix.'user
WHERE '.$select.'
AND id NOT IN (
SELECT teacherid
FROM '.$CFG->prefix.'block_exabstudreviteactoclas
WHERE classid = '.$class->id.'
'.$selectsql.')
ORDER BY lastname ASC, firstname ASC');
echo '<div id="exabis_student_review">';
print_heading($header);
$usertoclasses = get_records('block_exabstudreviteactoclas', 'classid', $class->id, 'teacherid');
$classusers = array();
if ($usertoclasses) {
foreach($usertoclasses as $usertoclass) {
$classusers[] = get_record('user', 'id', $usertoclass->teacherid);
}
}
print_simple_box_start('center');
$form_target = 'configuration_classteachers.php';
include('configuration_userlist.html');
print_simple_box_end();
print_single_button($CFG->wwwroot . '/blocks/exabis_student_review/configuration.php',
array('courseid' => $courseid),
get_string('back', 'block_exabis_student_review'));
block_exabis_student_review_print_footer();
@@ -0,0 +1,107 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
require_once($CFG->dirroot . '/blocks/exabis_student_review/lib/edit_form.php');
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
$periodid = optional_param('periodid', 0, PARAM_INT);
$action = optional_param('action', '', PARAM_ALPHA);
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
require_capability('block/exabis_student_review:editperiods', $context);
$periodform = new period_edit_form();
if ($periodedit = $periodform->get_data()) {
if(!confirm_sesskey()) {
print_error("badsessionkey","block_exabis_student_review");
}
$newperiod = new stdClass();
$newperiod->timemodified = time();
$newperiod->userid=$USER->id;
$newperiod->description = $periodedit->description;
$newperiod->starttime = $periodedit->starttime;
$newperiod->endtime = $periodedit->endtime;
if(isset($periodedit->id) && ($periodedit->action == 'edit')) {
$newperiod->id = $periodedit->id;
if (!update_record('block_exabstudreviperi', $newperiod)) {
print_error('errorupdateingperiod', 'block_exabis_student_review');
}
add_to_log($courseid, 'exabis_student_review', 'new', 'configuration_period.php?courseid=' . $courseid . '&action=edit', $periodedit->id);
}
else if($periodedit->action == 'new') {
if (!(insert_record('block_exabstudreviperi', $newperiod))) {
print_error('errorinsertingperiod', 'block_exabis_student_review');
}
add_to_log($courseid, 'exabis_student_review', 'new', 'configuration_period.php?courseid=' . $courseid . '&action=new', '');
}
redirect('periods.php?courseid=' . $courseid);
}
if($action == 'edit') {
if(!confirm_sesskey()) {
print_error("badsessionkey","block_exabis_student_review");
}
if (!$period = get_record('block_exabstudreviperi', 'id', $periodid)) {
print_error("invalidperiodid","block_exbais_student_review");
}
$period->action = 'edit';
}
else if($action == 'delete') {
if(!confirm_sesskey()) {
print_error("badsessionkey","block_exabis_student_review");
}
delete_records('block_exabstudreviperi', 'id', $periodid);
redirect('periods.php?courseid=' . $courseid);
}
else {
$period->action = 'new';
$period->description = '';
$period->starttime = time();
$period->endtime = time();
$period->id = 0;
}
block_exabis_student_review_print_header(array('periods', 'periodinput'));
$periodform->set_data($period);
$periodform->display();
print_single_button($CFG->wwwroot . '/blocks/exabis_student_review/periods.php',
array('courseid' => $courseid),
get_string('back', 'block_exabis_student_review'));
block_exabis_student_review_print_footer();
@@ -0,0 +1,100 @@
<form id="assignform" action="<?php p($form_target)?>" method="post">
<div>
<input type="hidden" name="id" value="<?php p($courseid) ?>" />
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
<table summary="" style="margin-left:auto;margin-right:auto" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">
<label for="removeselect"><?php print_string('members', 'block_exabis_student_review'); ?></label>
<br />
<select name="removeselect[]" size="20" id="removeselect" multiple="multiple"
onfocus="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=false;
getElementById('assignform').addselect.selectedIndex=-1;">
<?php
$i = 0;
foreach ($classusers as $classuser) {
$fullname = fullname($classuser, true);
if ($classuser->hidden) {
$hidden=' ('.get_string('hiddenassign').') ';
} else {
$hidden="";
}
echo "<option value=\"$classuser->id\">".$fullname.", ".$classuser->email.$hidden."</option>\n";
$i++;
}
if ($i==0) {
echo '<option/>'; // empty select breaks xhtml strict
}
?>
</select>
</td>
<td valign="top">
<br />
<?php check_theme_arrows(); ?>
<p class="arrow_button">
<input name="add" id="add" type="submit" value="<?php echo '&nbsp;'.$THEME->larrow.' &nbsp; &nbsp; '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
<br />
<input name="remove" id="remove" type="submit" value="<?php echo '&nbsp; '.$THEME->rarrow.' &nbsp; &nbsp; '.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" />
</p>
</td>
<td valign="top">
<label for="addselect"><?php print_string('availableusers', 'block_exabis_student_review'); ?></label>
<br />
<select name="addselect[]" size="20" id="addselect" multiple="multiple"
onfocus="getElementById('assignform').add.disabled=false;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;">
<?php
$i = 0;
if (!empty($searchtext)) {
echo '<optgroup label="' . get_string('searchresults') . ' (' . count($availableusers) . ')">\n';
foreach ($availableusers as $user) {
$fullname = fullname($user, true);
echo '<option value="' . $user->id . '">' . $fullname . ', ' . $user->email . '</option>\n';
$i++;
}
echo "</optgroup>\n";
} else {
if (count($availableusers) > MAX_USERS_PER_PAGE) {
echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
.'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
} else {
foreach ($availableusers as $user) {
$fullname = fullname($user, true);
echo '<option value="' . $user->id . '">' . $fullname . ', ' . $user->email . '</option>\n';
$i++;
}
}
}
if ($i==0) {
echo '<option/>'; // empty select breaks xhtml strict
}
?>
</select>
<br />
<label for="searchtext" class="accesshide"><?php p($strsearch) ?></label>
<input type="text" name="searchtext" id="searchtext" size="30" value="<?php p($searchtext, true) ?>"
onfocus ="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;
getElementById('assignform').addselect.selectedIndex=-1;"
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
if (keyCode == 13) {
getElementById('assignform').previoussearch.value=1;
getElementById('assignform').submit();
} " />
<input name="search" id="search" type="submit" value="<?php print_string('search') ?>" />
<?php
if (!empty($searchtext)) {
echo '<input name="showall" id="showall" type="submit" value="'.get_string('showall').'" />'."\n";
}
?>
</td>
</tr>
</table>
</div>
</form>
@@ -0,0 +1,63 @@
<?php
//
// Capability definitions for the rss_client block.
//
// The capabilities are loaded into the database table when the block is
// installed or updated. Whenever the capability definitions are updated,
// the module version number should be bumped up.
//
// The system has four possible values for a capability:
// CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
//
//
// CAPABILITY NAMING CONVENTION
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
// [mod/block]/<component_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
// Core moodle capabilities are defined thus:
// moodle/<capabilityclass>:<capabilityname>
//
// Examples: mod/forum:viewpost
// block/recent_activity:view
// moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
// $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.
$block_exabis_student_review_capabilities = array(
'block/exabis_student_review:use' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'user' => CAP_ALLOW
)
),
'block/exabis_student_review:head' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
)
),
'block/exabis_student_review:editperiods' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'admin' => CAP_ALLOW
)
)
);
?>
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="blocks/exabis_student_review/db" VERSION="20080310" COMMENT="XMLDB file for Moodle blocks/exabis_student_review"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="exabis_student_review" COMMENT="Default comment for exabis_student_review, please edit me" NEXT="block_exabstudreviclas">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for exabis_student_review"/>
</KEYS>
</TABLE>
<TABLE NAME="block_exabstudreviclas" COMMENT="block_exabis_student_review_class" PREVIOUS="exabis_student_review" NEXT="block_exabstudreviteactoclas">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="User ID of principal" PREVIOUS="timemodified" NEXT="class"/>
<FIELD NAME="class" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="Title of class" PREVIOUS="userid"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
</KEYS>
</TABLE>
<TABLE NAME="block_exabstudreviteactoclas" COMMENT="Mapping of the Teachers to the classes (made by principal)" PREVIOUS="block_exabstudreviclas" NEXT="block_exabstudrevistudtoclas">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="teacherid"/>
<FIELD NAME="teacherid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="classid"/>
<FIELD NAME="classid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacherid"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
</KEYS>
</TABLE>
<TABLE NAME="block_exabstudrevistudtoclas" COMMENT="Mapping of the students to the class" PREVIOUS="block_exabstudreviteactoclas" NEXT="block_exabstudreviperi">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="studentid"/>
<FIELD NAME="studentid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Default comment for the field, please edit me" PREVIOUS="timemodified" NEXT="classid"/>
<FIELD NAME="classid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Default comment for the field, please edit me" PREVIOUS="studentid"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
</KEYS>
</TABLE>
<TABLE NAME="block_exabstudreviperi" COMMENT="block_exabis_student_review_periods" PREVIOUS="block_exabstudrevistudtoclas" NEXT="block_exabstudrevirevi">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="User ID of person who edited this period" PREVIOUS="timemodified" NEXT="starttime"/>
<FIELD NAME="starttime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Default comment for the field, please edit me" PREVIOUS="userid" NEXT="endtime"/>
<FIELD NAME="endtime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Default comment for the field, please edit me" PREVIOUS="starttime" NEXT="description"/>
<FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="Description of period" PREVIOUS="endtime"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
</KEYS>
</TABLE>
<TABLE NAME="block_exabstudrevirevi" COMMENT="block_exabis_student_review_review" PREVIOUS="block_exabstudreviperi">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="student_id"/>
<FIELD NAME="student_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="periods_id"/>
<FIELD NAME="periods_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="student_id" NEXT="teacher_id"/>
<FIELD NAME="teacher_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="periods_id" NEXT="team"/>
<FIELD NAME="team" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacher_id" NEXT="resp"/>
<FIELD NAME="resp" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="team" NEXT="inde"/>
<FIELD NAME="inde" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="resp" NEXT="review"/>
<FIELD NAME="review" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="inde"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
@@ -0,0 +1,2 @@
<tr><td width="100%" align="center" bgcolor="#EEEEEE"><font size="2"><b>###NAME###</b></font></td></tr>
<tr><td width="100%"><font size="2">###REVIEW###</font></td></tr>
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

@@ -0,0 +1 @@
</body></html>
@@ -0,0 +1,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Sch&uuml;ler-Bewertung</title>
<link rel="stylesheet" type="text/css" href="###WWWROOT###/blocks/exabis_student_review/style1.css">
</head>
<body>
Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

@@ -0,0 +1 @@
<tr><td width="100%" align="center" bgcolor="#EEEEEE"><font size="2"><b>keine Beurteilungen vorhanden</b></font></td></tr>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

@@ -0,0 +1,32 @@
<table border="0" width="100%" cellspacing="0">
<tr>
<td width="100%" align="center" colspan="3">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="175" align="center"><img border="0" src="###WWWROOT###/blocks/exabis_student_review/default_template/cool1.gif" width="98" height="86"></td>
<td align="center"><p><font size="6"><b>Sch&uuml;lerbewertung</b></font></p><p><b><font size="3">f&uuml;r</font></b></p>
<p><font size="6"><b>###FIRSTNAME### ###LASTNAME###<p><font size="6"><b>
<p><b><font size="4">Sch&uuml;ler der ###CLASS###</font></b></p>
<p>&nbsp;</td>
<td width="175" align="center"><img border="0" src="###WWWROOT###/blocks/exabis_student_review/default_template/pm1.gif" width="176" height="94"></td>
</tr></table></td></tr><tr><td width="100" align="center"><img border="0" src="###WWWROOT###/blocks/exabis_student_review/default_template/l2g_vert.gif" width="50" height="316"></td>
<td align="center" valign="top">&nbsp;<table align="center" border="1" width="90%" cellspacing="0" cellpadding="0" bordercolor="#CCCCCC">
<tr><td align="left" colspan="2" bgcolor="#CCCCCC"><b><p style="margin: 3"><font size="4">Bewertung:*</font></b><font size="2">(###NUM### Bewertungen abgegeben)</font></td></tr>
<tr><td width="70%" align="center" bgcolor="#FFFFFF" ><p style="margin: 3"><span style="letter-spacing: 1pt">Teamf&auml;higkeit</span></td>
<td width="30%" align="center" bgcolor="#EEEEEE" ><p style="margin: 3"><font size="4"><b>###REPORT_TEAM###</b></font></td></tr>
<tr><td width="70%" align="center" bgcolor="#FFFFFF" ><p style="margin: 3"><span style="letter-spacing: 1pt">Verantwortlichkeit</span></td>
<td width="30%" align="center" bgcolor="#EEEEEE" ><p style="margin: 3"><font size="4"><b>###REPORT_RESP###</b></font></td></tr>
<tr><td width="70%" align="center" bgcolor="#FFFFFF" ><p style="margin: 3"><span style="letter-spacing: 1pt">Selbstst&auml;ndigkeit</span></td>
<td width="30%" align="center" bgcolor="#EEEEEE" ><p style="margin: 3"><font size="4"><b>###REPORT_INDE###</b></font></td></tr>
</table>&nbsp;<table border="1" width="90%" bordercolor="#CCCCCC" cellspacing="0">
<tr><td width="100%" align="left" bgcolor="#CCCCCC">
<p style="margin: 3"><b><font size="4">Ausf&uuml;hrliche Beurteilung:</font></b></td></tr>
###COMMENTS###
</table>
</td><td width="100" align="center"><img border="0" src="###WWWROOT###/blocks/exabis_student_review/default_template/l2g_vert.gif" width="50" height="316"></td></tr>
<tr><td width="100">&nbsp;</td>
<td align="left">&nbsp;<p><font size="2">*) </font></p><p><font size="2">10 = sehr gut, 1 = schlecht. </font></p>
<p><font size="2">Die Bewertung in den 3 Kategorien entsprechen jeweils dem Mittelwert aller Bewertungen in der jeweiligen Kategorie.</font></td>
<td width="100" align="center"></td>
</tr>
</table>
+4
View File
@@ -0,0 +1,4 @@
<?php
require_once(dirname(__FILE__)."/../../config.php");
require_once($CFG->dirroot . '/blocks/exabis_student_review/lib/lib.php');
@@ -0,0 +1,30 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
?>
<?php // $Id$
// glossary.php - created with Moodle 1.1 Beta (2003082001)
require dirname(__FILE__).'/../de_utf8/block_exabis_eportfolio.php';
@@ -0,0 +1,96 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
?>
<?php // $Id$
// glossary.php - created with Moodle 1.1 Beta (2003082001)
$string['block/exabis_student_review:use'] = 'Use of Exabis Student Review';
$string['block/exabis_student_review:head'] = 'Head of a class';
$string['block/exabis_student_review:editperiods'] = 'Edit the periods';
$string['blocktitle'] = 'Exabis Student Review';
$string['modulename'] = 'Exabis Student Review';
$string['blockname'] = 'Exabis Student Review';
$string['configuration'] = 'Klassen Konfiguration';
$string['report'] = 'Report';
$string['periods'] = 'Periods';
$string['review'] = 'Review';
$string['availableusers'] = 'Available Users';
$string['members'] = 'Members';
$string['errorinsertingclass'] = 'Error when inserting class';
$string['redirectingtoclassinput'] = 'No class information found, redirecting to class input.';
$string['errorupdatingclass'] = 'Error when updating class';
$string['editclassmemberlist'] = 'Edit class member list';
$string['editclassteacherlist'] = 'Edit class teacher list';
$string['editclassname'] = 'Edit class name';
$string['configteacher'] = 'Teachers in $a';
$string['configmember'] = 'Students of $a';
$string['errorinsertingstudents'] = 'Error when adding Student to a course';
$string['errorremovingstudents'] = 'Error when removing student from a course';
$string['errorinsertingteachers'] = 'Error when adding teacher to a course';
$string['errorremovingteachers'] = 'Error when removing teacher to a course';
$string['back'] = 'Back';
$string['periods'] = 'Periods';
$string['periodinput'] = 'Periodeneingabe';
$string['redirectingtoperiodsinput'] = 'No period information found, redirecting to periods input';
$string['errorinsertingperiod'] = 'Error when inserting period';
$string['errorupdateingperiod'] = 'Error when updating period';
$string['perioddescription'] = 'Description';
$string['starttime'] = 'Start time';
$string['endtime'] = 'End time';
$string['newperiod'] = 'New period';
$string['invalidperiodid'] = 'Invalid period id';
$string['noclassestoreview'] = 'No classes to review';
$string['class'] = 'Class';
$string['reviewclass'] = 'Class review';
$string['badclass'] = 'You cannot edit this class';
$string['nostudentstoreview'] = 'No students to review';
$string['reviewstudent'] = 'Student review';
$string['teamplayer'] = 'Team player';
$string['responsibility'] = 'Responsibility';
$string['selfreliance'] = 'Self-reliance';
$string['evaluation'] = 'Evaluation';
$string['badstudent'] = 'The student is not member of this class';
$string['errorupdatingstudent'] = 'Error when updating student';
$string['errorinsertingstudent'] = 'Error when inserting student';
$string['report'] = 'Report';
$string['nostudentstoreport'] = 'No students to report.';
$string['errorstarttimebeforeendtime'] = 'Period $a->description has its starttime before its endtime!';
$string['printversion'] = 'Print version';
$string['printall'] = 'Print all';
$string['periodoverlaps'] = 'Period $a->period1 overlaps with $a->period2';
$string['periodserror'] = 'Error at the configuration of the periods';
$string['evaluation1'] = '1 - unzureichend';
$string['evaluation2'] = '2';
$string['evaluation3'] = '3';
$string['evaluation4'] = '4';
$string['evaluation5'] = '5';
$string['evaluation6'] = '6';
$string['evaluation7'] = '7';
$string['evaluation8'] = '8';
$string['evaluation9'] = '9';
$string['evaluation10'] = '10 - sehr gut';
?>
@@ -0,0 +1,97 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
?>
<?php // $Id$
// glossary.php - created with Moodle 1.1 Beta (2003082001)
$string['block/exabis_student_review:use'] = 'Use of Exabis Student Review';
$string['block/exabis_student_review:head'] = 'Head of a class';
$string['block/exabis_student_review:editperiods'] = 'Edit the periods';
$string['blocktitle'] = 'Exabis Student Review';
$string['modulename'] = 'Exabis Student Review';
$string['blockname'] = 'Exabis Student Review';
$string['configuration'] = 'Class Configuration';
$string['report'] = 'Report';
$string['periods'] = 'Periods';
$string['review'] = 'Review';
$string['availableusers'] = 'Available Users';
$string['members'] = 'Members';
$string['errorinsertingclass'] = 'Error when inserting class';
$string['redirectingtoclassinput'] = 'No class information found, redirecting to class input.';
$string['errorupdatingclass'] = 'Error when updating class';
$string['editclassmemberlist'] = 'Edit class member list';
$string['editclassteacherlist'] = 'Edit class teacher list';
$string['editclassname'] = 'Edit class';
$string['noclassfound'] = 'No class found!';
$string['configteacher'] = 'Teachers in $a';
$string['configmember'] = 'Students of $a';
$string['errorinsertingstudents'] = 'Error when adding student to a course';
$string['errorremovingstudents'] = 'Error when removing student from a course';
$string['errorinsertingteachers'] = 'Error when adding teacher to a course';
$string['errorremovingteachers'] = 'Error when removing teacher to a course';
$string['back'] = 'Back';
$string['periods'] = 'Periods';
$string['periodinput'] = 'Periods input';
$string['redirectingtoperiodsinput'] = 'No period information found, redirecting to periods input';
$string['errorinsertingperiod'] = 'Error when inserting period';
$string['errorupdateingperiod'] = 'Error when updating period';
$string['perioddescription'] = 'Description';
$string['starttime'] = 'Start time';
$string['endtime'] = 'End time';
$string['newperiod'] = 'New period';
$string['invalidperiodid'] = 'Invalid period id';
$string['noclassestoreview'] = 'No classes to review';
$string['class'] = 'Class';
$string['reviewclass'] = 'Class review';
$string['badclass'] = 'You cannot edit this class';
$string['nostudentstoreview'] = 'No students to review';
$string['reviewstudent'] = 'Student review';
$string['teamplayer'] = 'Team player';
$string['responsibility'] = 'Responsibility';
$string['selfreliance'] = 'Self-reliance';
$string['evaluation'] = 'Evaluation';
$string['badstudent'] = 'The student is not member of this class';
$string['errorupdatingstudent'] = 'Error when updating student';
$string['errorinsertingstudent'] = 'Error when inserting student';
$string['report'] = 'Report';
$string['nostudentstoreport'] = 'No students to report.';
$string['errorstarttimebeforeendtime'] = 'Period $a->description has its starttime before its endtime!';
$string['printversion'] = 'Print version';
$string['printall'] = 'Print all';
$string['periodoverlaps'] = 'Period $a->period1 overlaps with $a->period2';
$string['periodserror'] = 'Error at the configuration of the periods';
$string['evaluation1'] = '1 - unzureichend';
$string['evaluation2'] = '2';
$string['evaluation3'] = '3';
$string['evaluation4'] = '4';
$string['evaluation5'] = '5';
$string['evaluation6'] = '6';
$string['evaluation7'] = '7';
$string['evaluation8'] = '8';
$string['evaluation9'] = '9';
$string['evaluation10'] = '10 - sehr gut';
?>
@@ -0,0 +1,137 @@
<?php
require_once($CFG->dirroot.'/lib/formslib.php');
class class_edit_form extends moodleform {
function definition() {
global $CFG, $USER;
$mform =& $this->_form;
$mform->addElement('text', 'class', get_string('class','block_exabis_student_review').':', array('size' => 50));
$mform->setType('class', PARAM_TEXT);
$mform->addRule('class', null, 'required', null, 'client');
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
$mform->setDefault('id', 0);
$this->add_action_buttons(false);
}
function validation($data) {
return true;
}
}
class period_edit_form extends moodleform {
function definition() {
global $CFG, $USER;
$mform =& $this->_form;
$mform->addElement('text', 'description', 'Beschreibung der Periode:', array('size' => 50));
$mform->setType('description', PARAM_TEXT);
$mform->addRule('description', null, 'required', null, 'client');
$timeoptions = array(
'language' => 'en',
'format' => 'd. M. Y - H:i',
'minYear' => 2001,
'maxYear' => 2010,
'addEmptyOption' => false,
'emptyOptionValue' => '',
'emptyOptionText' => '&nbsp;',
'optionIncrement' => array('i' => 1, 's' => 1),
'optional' => false,
);
$mform->addElement('date_time_selector', 'starttime', 'Startdatum:', $timeoptions);
$mform->setType('starttime', PARAM_INT);
$mform->addRule('starttime', null, 'required', null, 'client');
$mform->addElement('date_time_selector', 'endtime', 'Enddatum:', $timeoptions);
$mform->setType('endtime', PARAM_INT);
$mform->addRule('endtime', null, 'required', null, 'client');
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
$mform->setDefault('id', 0);
$mform->addElement('hidden', 'action');
$mform->setType('action', PARAM_TEXT);
$mform->setDefault('action', 0);
$this->add_action_buttons(false);
}
}
class student_edit_form extends moodleform {
function definition() {
global $CFG, $USER;
$mform =& $this->_form;
$mform->addElement('hidden', 'courseid');
$mform->setType('courseid', PARAM_INT);
$mform->setDefault('courseid', 0);
$mform->addElement('hidden', 'classid');
$mform->setType('classid', PARAM_INT);
$mform->setDefault('classid', 0);
$mform->addElement('hidden', 'studentid');
$mform->setType('studentid', PARAM_INT);
$mform->setDefault('studentid', 0);
//$mform->addElement('hidden', 'teacher_id');
//$mform->setType('teacher_id', PARAM_INT);
//$mform->setDefault('teacher_id', 0);
//$mform->addElement('hidden', 'period_id');
//$mform->setType('period_id', PARAM_INT);
//$mform->setDefault('period_id', 0);
//$mform->addElement('hidden', 'student_id');
//$mform->setType('student_id', PARAM_INT);
//$mform->setDefault('student_id', 0);
//$mform->addElement('hidden', 'action');
//$mform->setType('action', PARAM_TEXT);
//$mform->setDefault('action', 0);
$selectoptions = array(
1 => get_string('evaluation1', 'block_exabis_student_review'),
2 => get_string('evaluation2', 'block_exabis_student_review'),
3 => get_string('evaluation3', 'block_exabis_student_review'),
4 => get_string('evaluation4', 'block_exabis_student_review'),
5 => get_string('evaluation5', 'block_exabis_student_review'),
6 => get_string('evaluation6', 'block_exabis_student_review'),
7 => get_string('evaluation7', 'block_exabis_student_review'),
8 => get_string('evaluation8', 'block_exabis_student_review'),
9 => get_string('evaluation9', 'block_exabis_student_review'),
10 => get_string('evaluation10', 'block_exabis_student_review'),
);
$mform->addElement('select', 'team', get_string('teamplayer', 'block_exabis_student_review'), $selectoptions);
$mform->setType('team', PARAM_INT);
$mform->setDefault('team', 1);
$mform->addElement('select', 'resp', get_string('responsibility', 'block_exabis_student_review'), $selectoptions);
$mform->setType('resp', PARAM_INT);
$mform->setDefault('resp', 1);
$mform->addElement('select', 'inde', get_string('selfreliance', 'block_exabis_student_review'), $selectoptions);
$mform->setType('inde', PARAM_INT);
$mform->setDefault('inde', 1);
$mform->addElement('htmleditor', 'review', get_string('review', 'block_exabis_student_review'), array('cols'=>50, 'rows'=>30));
$mform->setType('review', PARAM_RAW);
//$mform->addRule('review', get_string('required'), 'required', null, 'client');
$mform->setHelpButton('review', array('reading', 'writing', 'richtext'), false, 'editorhelpbutton');
$this->add_action_buttons(false);
}
}
?>
+240
View File
@@ -0,0 +1,240 @@
<?php
define('DECIMALPOINTS', 1);
function block_exabis_student_review_check_periods($printBoxInsteadOfError = false) {
block_exabis_student_review_has_wrong_periods($printBoxInsteadOfError);
block_exabis_student_review_check_if_period_ovelap($printBoxInsteadOfError);
}
function block_exabis_student_review_has_wrong_periods($printBoxInsteadOfError = false) {
global $CFG;
// check if any entry has a starttime after the endtime:
$content = '';
$wrongs = get_records_sql('SELECT p.description, p.starttime, p.endtime FROM ' . $CFG->prefix . 'block_exabstudreviperi p WHERE starttime > endtime');
if ($wrongs) {
foreach($wrongs as $wrong) {
if($printBoxInsteadOfError) {
notify(get_string('errorstarttimebeforeendtime', 'block_exabis_student_review', $wrong));
}
else {
print_error('errorstarttimebeforeendtime', 'block_exabis_student_review', '', $wrong);
}
}
}
return true;
}
function block_exabis_student_review_check_if_period_ovelap($printBoxInsteadOfError = false) {
global $CFG;
$allPeriods = get_records('block_exabstudreviperi', '', '', 'id, description, starttime, endtime');
$periodshistory = '';
foreach ($allPeriods as $actPeriod) {
if($periodshistory == '') {
$periodshistory .= $actPeriod->id;
}
else {
$periodshistory .= ', ' . $actPeriod->id;
}
$ovelapPeriods = get_records_sql('SELECT id, description, starttime, endtime FROM ' . $CFG->prefix . 'block_exabstudreviperi
WHERE (id NOT IN (' . $periodshistory . ')) AND NOT ( (starttime < ' . $actPeriod->starttime . ' AND endtime < ' . $actPeriod->starttime . ')
OR (starttime > ' . $actPeriod->endtime . ' AND endtime > ' . $actPeriod->endtime . ') )');
if ($ovelapPeriods) {
foreach ($ovelapPeriods as $overlapPeriod) {
$a = new stdClass();
$a->period1 = $actPeriod->description;
$a->period2 = $overlapPeriod->description;
if($printBoxInsteadOfError) {
notify(get_string('periodoverlaps', 'block_exabis_student_review', $a));
}
else {
print_error('periodoverlaps', 'block_exabis_student_review', '', $a);
}
}
}
}
}
function block_exabis_student_review_get_active_period($printBoxInsteadOfError = false) {
global $CFG;
$periods = get_records_sql('SELECT * FROM ' . $CFG->prefix . 'block_exabstudreviperi WHERE (starttime < ' . time() . ') AND (endtime > ' . time() . ')');
// genau 1e periode?
if(is_array($periods) && (count($periods) == 1)) {
return array_shift($periods);
} else {
if($printBoxInsteadOfError) {
notify(get_string('periodserror', 'block_exabis_student_review'));
}
else {
print_error('periodserror', 'block_exabis_student_review');
}
}
}
function block_exabis_student_review_get_report($student_id, $period_id) {
global $CFG;
$report = new stdClass();
$team = get_record_sql('SELECT \'1\' AS id, ROUND(AVG(team), ' . DECIMALPOINTS . ') AS avgteam FROM ' . $CFG->prefix . 'block_exabstudrevirevi WHERE student_id=' . $student_id . ' AND periods_id=' . $period_id);
$report->team = is_null($team->avgteam) ? '': $team->avgteam;
$resp = get_record_sql('SELECT \'1\' AS id, ROUND(AVG(resp), ' . DECIMALPOINTS . ') AS avgresp FROM ' . $CFG->prefix . 'block_exabstudrevirevi WHERE student_id=' . $student_id . ' AND periods_id=' . $period_id);
$report->resp = is_null($resp->avgresp) ? '': $resp->avgresp;
$inde = get_record_sql('SELECT \'1\' AS id, ROUND(AVG(inde), ' . DECIMALPOINTS . ') AS avginde FROM ' . $CFG->prefix . 'block_exabstudrevirevi WHERE student_id=' . $student_id . ' AND periods_id=' . $period_id);
$report->inde = is_null($inde->avginde) ? '': $inde->avginde;
$numrecords = get_record_sql('SELECT COUNT(id) AS count FROM ' . $CFG->prefix . 'block_exabstudrevirevi WHERE student_id=' . $student_id . ' AND periods_id=' . $period_id);
$report->numberOfEvaluations = $numrecords->count;
$comments = get_records_sql('SELECT id, teacher_id, review FROM ' . $CFG->prefix . 'block_exabstudrevirevi WHERE student_id = \'' . $student_id . '\' AND periods_id = \'' . $period_id . '\' AND TRIM(review) != \'\'');
$report->comments = array();
if (is_array($comments)) {
foreach($comments as $comment) {
$teacher = get_record('user', 'id', $comment->teacher_id);
$newcomment = new stdClass();
$newcomment->name = fullname($teacher, $teacher->id);
$newcomment->review = format_text($comment->review);
$report->comments[] = $newcomment;
}
}
return $report;
}
function block_exabis_student_review_read_template_file($filename) {
global $CFG;
$filecontent = '';
if(is_file($CFG->dirroot . '/blocks/exabis_student_review/template/' . $filename)) {
$filecontent = file_get_contents ($CFG->dirroot . '/blocks/exabis_student_review/template/' . $filename);
}
else if(is_file($CFG->dirroot. '/blocks/exabis_student_review/default_template/' . $filename)) {
$filecontent = file_get_contents ($CFG->dirroot. '/blocks/exabis_student_review/default_template/' . $filename);
}
$filecontent = str_replace ( '###WWWROOT###', $CFG->wwwroot, $filecontent);
return $filecontent;
}
function block_exabis_student_review_print_student_report_header() {
echo block_exabis_student_review_read_template_file('header.html');
}
function block_exabis_student_review_print_student_report_footer() {
echo block_exabis_student_review_read_template_file('footer.html');
}
function block_exabis_student_review_print_student_report($studentid, $periodid, $classstring)
{
$studentreport = '';
$studentreportcommentstemplate = '';
$studentreportcomments = '';
if(!$studentReport = block_exabis_student_review_get_report($studentid, $periodid)) {
print_error('studentnotfound','block_exabis_student_review');
}
$student = get_record('user', 'id', $studentid);
$studentreport = block_exabis_student_review_read_template_file('student.html');
$studentreport = str_replace ( '###FIRSTNAME###', $student->firstname, $studentreport);
$studentreport = str_replace ( '###LASTNAME###', $student->lastname, $studentreport);
$studentreport = str_replace ( '###CLASS###', $classstring, $studentreport);
$studentreport = str_replace ( '###NUM###', $studentReport->numberOfEvaluations, $studentreport);
$studentreport = str_replace ( '###REPORT_TEAM###', $studentReport->team, $studentreport);
$studentreport = str_replace ( '###REPORT_RESP###', $studentReport->resp, $studentreport);
$studentreport = str_replace ( '###REPORT_INDE###', $studentReport->inde, $studentreport);
if (!$studentReport->comments) {
// Keine Kommentare
$studentreportcomments .= block_exabis_student_review_read_template_file('no_comments.html');
}
else {
// Kommentare vorhanden
$studentreportcommentstemplate = block_exabis_student_review_read_template_file('comment.html');
foreach($studentReport->comments as $comment) {
$studentreportcommentstemplatetmp = $studentreportcommentstemplate;
$studentreportcommentstemplatetmp = str_replace ( '###NAME###', $comment->name, $studentreportcommentstemplatetmp);
$studentreportcommentstemplatetmp = str_replace ( '###REVIEW###', $comment->review, $studentreportcommentstemplatetmp);
$studentreportcomments .= $studentreportcommentstemplatetmp;
}
}
$studentreport = str_replace ( '###COMMENTS###', $studentreportcomments, $studentreport);
echo $studentreport;
}
function block_exabis_student_review_print_header($items, $options = array())
{
global $CFG, $COURSE;
$items = (array)$items;
$strheader = get_string('modulename', 'block_exabis_student_review');
// navigationspfad
$navlinks = array();
$navlinks[] = array('name' => $strheader, 'link' => null, 'type' => 'title');
$last_item_name = '';
foreach ($items as $level => $item) {
if (!is_array($item)) {
if (!is_string($item)) {
echo 'noch nicht unterstützt';
}
if ($item == 'periods')
$link = 'periods.php?courseid='.$COURSE->id;
elseif ($item == 'configuration')
$link = 'configuration.php?courseid='.$COURSE->id;
elseif ($item == 'review')
$link = 'review.php?courseid='.$COURSE->id;
else
$link = null;
if ($item[0] == '=')
$item_name = substr($item, 1);
else
$item_name = get_string($item, "block_exabis_student_review");
$item = array('name' => $item_name, 'link' => ($link ? $CFG->wwwroot.'/blocks/exabis_student_review/'.$link : null));
}
if (!isset($item['type']))
$item['type'] = 'misc';
$last_item_name = $item['name'];
$navlinks[] = $item;
}
$navigation = build_navigation($navlinks);
print_header_simple($strheader.': '.$last_item_name, '', $navigation, "", "", true);
echo '<div id="exabis_student_review">';
// header
if (empty($options['noheading']))
print_heading($last_item_name);
}
function block_exabis_student_review_print_footer()
{
global $COURSE;
echo '</div>';
print_footer($COURSE);
}
+80
View File
@@ -0,0 +1,80 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
require_capability('block/exabis_student_review:editperiods', $context);
$strperiods = get_string('periods', 'block_exabis_student_review');
block_exabis_student_review_print_header('periods');
block_exabis_student_review_check_periods(true);
if (!$periods = get_records('block_exabstudreviperi')) {
redirect('configuration_period.php?courseid=' . $courseid, get_string('redirectingtoperiodsinput', 'block_exabis_student_review'));
}
/* Print the periods */
$table = new stdClass();
$table->head = array(
get_string('perioddescription', 'block_exabis_student_review'),
get_string('starttime', 'block_exabis_student_review'),
get_string('endtime', 'block_exabis_student_review'),
get_string('action')
);
$table->align = array("left", "left", "left", "right");
$table->width = "90%";
foreach($periods as $period) {
$link = '<a href="' . $CFG->wwwroot . '/blocks/exabis_student_review/configuration_period.php?courseid=' . $courseid . '&amp;periodid=' . $period->id . '&amp;sesskey=' . sesskey() . '&amp;action=edit">';
$icons = $link.'<img src="' . $CFG->wwwroot . '/blocks/exabis_student_review/pix/edit.gif" width="16" height="16" alt="' . get_string('edit'). '" /></a>
<a href="' . $CFG->wwwroot . '/blocks/exabis_student_review/configuration_period.php?courseid=' . $courseid . '&amp;periodid=' . $period->id . '&amp;sesskey=' . sesskey() . '&amp;action=delete"><img src="' . $CFG->wwwroot . '/pix/t/delete.gif" width="11" height="11" alt="' . get_string('delete'). '" /></a> ';
$starttime = date('d. M. Y - H:i', $period->starttime);
$endtime = date('d. M. Y - H:i', $period->endtime);
$table->data[] = array ($link.$period->description.'</a>', $starttime, $endtime, $icons);
}
print_table($table);
print_single_button($CFG->wwwroot . '/blocks/exabis_student_review/configuration_period.php',
array('courseid' => $courseid, 'sesskey' => sesskey(), 'action' => 'new'),
get_string('newperiod', 'block_exabis_student_review'));
block_exabis_student_review_print_footer();
Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

@@ -0,0 +1,53 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require('inc.php');
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
require_capability('block/exabis_student_review:head', $context);
if (!$class = get_record('block_exabstudreviclas', 'userid', $USER->id)) {
print_error('noclassfound', 'block_exabis_student_review');
}
$actPeriod = block_exabis_student_review_get_active_period();
if(!$mystudents = get_records_sql('SELECT s.id, s.studentid, r.team, r.resp, r.inde, r.review FROM ' . $CFG->prefix . 'block_exabstudrevistudtoclas s LEFT JOIN ' . $CFG->prefix . 'block_exabstudrevirevi r ON s.studentid=r.student_id WHERE s.classid=\'' . $class->id . '\'')) {
print_error('studentsnotfound','block_exabis_student_review');
}
block_exabis_student_review_print_student_report_header();
foreach($mystudents as $mystudent) {
block_exabis_student_review_print_student_report($mystudent->studentid, $actPeriod->id, $class->class);
echo '<p style=\'page-break-before: always;\'>&nbsp;</p>';
}
block_exabis_student_review_print_student_report_footer();
@@ -0,0 +1,46 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
$studentid = required_param('studentid', PARAM_INT); // Course ID
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
require_capability('block/exabis_student_review:head', $context);
$actPeriod = block_exabis_student_review_get_active_period();
if (!$class = get_record('block_exabstudreviclas', 'userid', $USER->id)) {
print_error('noclassfound', 'block_exabis_student_review');
}
// CHECK IF TEACHER HAS ACCESS TO THIS STUDENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
block_exabis_student_review_print_student_report_header();
block_exabis_student_review_print_student_report($studentid, $actPeriod->id, $class->class);
block_exabis_student_review_print_student_report_footer();
+83
View File
@@ -0,0 +1,83 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
require_capability('block/exabis_student_review:head', $context);
if (!$class = get_record('block_exabstudreviclas', 'userid', $USER->id)) {
print_error('noclassfound', 'block_exabis_student_review');
}
block_exabis_student_review_print_header('report');
$actPeriod = block_exabis_student_review_get_active_period();
if(!$classusers = get_records_sql('SELECT s.id, s.studentid FROM ' . $CFG->prefix . 'block_exabstudrevistudtoclas s WHERE s.classid=\'' . $class->id . '\' ')) {
print_error('nostudentstoreview','block_exabis_student_review');
}
/* Print the Students */
$table = new stdClass();
$table->head =
array( get_string('name'),
get_string('teamplayer', 'block_exabis_student_review'),
get_string('responsibility', 'block_exabis_student_review'),
get_string('selfreliance', 'block_exabis_student_review'),
get_string('action'));
$table->align = array('left', 'center', 'center', 'center', 'right');
$table->width = "90%";
foreach($classusers as $classuser) {
$user = get_record('user', 'id', $classuser->studentid);
if (!$user)
continue;
$userReport = block_exabis_student_review_get_report($user->id, $actPeriod->id);
$link = '<a href="' . $CFG->wwwroot . '/blocks/exabis_student_review/printstudent.php?courseid=' . $courseid . '&amp;studentid=' . $user->id . '&amp;sesskey=' . sesskey() . '">';
$icons = $link.'<img src="' . $CFG->wwwroot . '/blocks/exabis_student_review/pix/print.gif" width="16" height="16" alt="' . get_string('printversion', 'block_exabis_student_review'). '" /></a>';
$studentdesc = print_user_picture($user->id, $courseid, $user->picture, 0, true, false) . ' ' . $link.fullname($user, $user->id).'</a>';
$table->data[] = array($studentdesc, $userReport->team, $userReport->resp, $userReport->inde, $icons);
}
print_table($table);
echo '<a href="' . $CFG->wwwroot . '/blocks/exabis_student_review/printclass.php?courseid=' . $courseid . '&amp;classid=' . $class->id . '&amp;sesskey=' . sesskey() . '"><img src="' . $CFG->wwwroot . '/blocks/exabis_student_review/pix/print.gif" width="16" height="16" alt="' . get_string('printall', 'block_exabis_student_review'). '" /></a>';
block_exabis_student_review_print_footer();
+64
View File
@@ -0,0 +1,64 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
block_exabis_student_review_print_header('review');
$actPeriod = block_exabis_student_review_get_active_period();
if(!$myclasses = get_records_sql('SELECT * FROM ' . $CFG->prefix . 'block_exabstudreviteactoclas t JOIN mdl_block_exabstudreviclas c ON t.classid=c.id AND t.teacherid=\'' . $USER->id . '\'')) {
print_error('noclassestoreview','block_exabis_student_review');
}
/* Print the Students */
$table = new stdClass();
$table->head = array(
get_string('class', 'block_exabis_student_review'),
get_string('action')
);
$table->align = array("left", "right");
$table->width = "90%";
foreach($myclasses as $myclass) {
$edit_link = '<a href="' . $CFG->wwwroot . '/blocks/exabis_student_review/review_class.php?courseid=' . $courseid . '&amp;classid=' . $myclass->classid . '&amp;sesskey=' . sesskey() . '&amp;action=edit">';
$icons = $edit_link.'<img src="' . $CFG->wwwroot . '/pix/i/edit.gif" width="16" height="16" alt="' . get_string('edit'). '" /></a>';
$table->data[] = array($edit_link.$myclass->class.'</a>', $icons);
}
print_table($table);
block_exabis_student_review_print_footer();
@@ -0,0 +1,88 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
$classid = required_param('classid', PARAM_INT);
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
if(!confirm_sesskey()) {
print_error("badsessionkey","block_exabis_student_review");
}
if(count_records('block_exabstudreviteactoclas', 'teacherid', $USER->id, 'classid', $classid) == 0) {
print_error("badclass","block_exabis_student_review");
}
block_exabis_student_review_print_header(array('review', 'reviewclass'));
$actPeriod = block_exabis_student_review_get_active_period();
if(!$classusers = get_records('block_exabstudrevistudtoclas', 'classid', $classid)) {
print_error('nostudentstoreview','block_exabis_student_review');
}
/* Print the Students */
$table = new stdClass();
$table->head =
array( get_string('name'),
get_string('teamplayer', 'block_exabis_student_review'),
get_string('responsibility', 'block_exabis_student_review'),
get_string('selfreliance', 'block_exabis_student_review'),
get_string('evaluation', 'block_exabis_student_review'),
get_string('action') );
$table->align = array('left', 'center', 'center', 'center', 'left', 'right');
$table->width = "90%";
foreach($classusers as $classuser) {
$user = get_record('user', 'id', $classuser->studentid);
if (!$user)
continue;
$link = '<a href="' . $CFG->wwwroot . '/blocks/exabis_student_review/review_student.php?courseid=' . $courseid . '&amp;classid=' . $classid . '&amp;sesskey=' . sesskey() . '&amp;studentid=' . $user->id . '">';
$icons = $link.'<img src="' . $CFG->wwwroot . '/pix/i/edit.gif" width="16" height="16" alt="' . get_string('edit'). '" /></a>';
$userdesc = print_user_picture($user->id, $courseid, $user->picture, 0, true, false) . ' ' . $link . fullname($user, $user->id).'</a>';
$report = get_record('block_exabstudrevirevi', 'teacher_id', $USER->id, 'periods_id', $actPeriod->id, 'student_id', $user->id);
if ($report)
$table->data[] = array ($userdesc, $report->team, $report->resp, $report->inde, format_text($report->review), $icons);
else
$table->data[] = array ($userdesc, '', '', '', '', $icons);
}
print_table($table);
block_exabis_student_review_print_footer();
@@ -0,0 +1,126 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 exabis internet solutions <[email protected]>
* All rights reserved
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This module is based on the Collaborative Moodle Modules from
* NCSA Education Division (http://www.ncsa.uiuc.edu)
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require("inc.php");
require_once($CFG->dirroot . '/blocks/exabis_student_review/lib/edit_form.php');
$courseid = optional_param('courseid', 1, PARAM_INT); // Course ID
$classid = required_param('classid', PARAM_INT);
$studentid = required_param('studentid', PARAM_INT);
require_login($courseid);
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('block/exabis_student_review:use', $context);
if(!confirm_sesskey()) {
print_error('badsessionkey', 'block_exabis_student_review');
}
if(count_records('block_exabstudreviteactoclas', 'teacherid', $USER->id, 'classid', $classid) == 0) {
print_error('badclass', 'block_exabis_student_review');
}
if(count_records('block_exabstudrevistudtoclas', 'studentid', $studentid, 'classid', $classid) == 0) {
print_error('badstudent', 'block_exabis_student_review');
}
$strstudentreview = get_string('reviewstudent', 'block_exabis_student_review');
$strclassreview = get_string('reviewclass', 'block_exabis_student_review');
$strreview = get_string('review', 'block_exabis_student_review');
$actPeriod = block_exabis_student_review_get_active_period();
$formdata = new stdClass();
if(!$reviewdata = get_record('block_exabstudrevirevi', 'teacher_id', $USER->id, 'periods_id', $actPeriod->id, 'student_id', $studentid)) {
$formdata->courseid = $courseid;
$formdata->studentid = $studentid;
$formdata->classid = $classid;
$formdata->team = 1;
$formdata->resp = 1;
$formdata->inde = 1;
$formdata->review = '';
}
else {
$formdata->courseid = $courseid;
$formdata->studentid = $studentid;
$formdata->classid = $classid;
$formdata->team = $reviewdata->team;
$formdata->resp = $reviewdata->resp;
$formdata->inde = $reviewdata->inde;
$formdata->review = $reviewdata->review;
}
$studentform = new student_edit_form();
if ($studentedit = $studentform->get_data()) {
$newreview = new stdClass();
$newreview->timemodified = time();
$newreview->student_id = $studentid;
$newreview->periods_id = $actPeriod->id;
$newreview->teacher_id = $USER->id;
$newreview->team = $studentedit->team;
$newreview->resp = $studentedit->resp;
$newreview->inde = $studentedit->inde;
$newreview->review = $studentedit->review;
trusttext_after_edit($newreview->review, $context);
if(isset($reviewdata->id)) {
$newreview->id = $reviewdata->id;
if (!update_record('block_exabstudrevirevi', $newreview)) {
print_error('errorupdatingstudent', 'block_exabis_student_review');
}
add_to_log($courseid, 'exabis_student_review', 'edit', 'review_student.php?courseid=' . $courseid, $classid);
}
else {
if (!($class->id = insert_record('block_exabstudrevirevi', $newreview))) {
print_error('errorinsertingstudent', 'block_exabis_student_review');
}
add_to_log($courseid, 'exabis_student_review', 'new', 'review_student.php?courseid=' . $courseid, '');
}
redirect($CFG->wwwroot . '/blocks/exabis_student_review/review_class.php?courseid=' . $courseid . '&amp;classid=' . $classid . '&amp;sesskey=' . sesskey());
}
block_exabis_student_review_print_header(array('review',
array('name' => $strclassreview, 'link' => $CFG->wwwroot.'/blocks/exabis_student_review/review_class.php?courseid='.$courseid.
'&amp;classid='.$classid.'&amp;sesskey='.sesskey()),
'='.$strstudentreview
), array('noheading'=>true));
$student = get_record('user', 'id', $studentid);
$studentdesc = print_user_picture($student->id, $courseid, $student->picture, 0, true, false) . ' ' . fullname($student, $student->id);
print_heading($studentdesc);
$studentform->set_data($formdata);
$studentform->display();
print_single_button($CFG->wwwroot . '/blocks/exabis_student_review/review_class.php',
array('courseid' => $courseid, 'classid' => $classid, 'sesskey' => sesskey()),
get_string('back', 'block_exabis_student_review'));
block_exabis_student_review_print_footer();
+8
View File
@@ -0,0 +1,8 @@
#exabis_student_review {
}
#exabis_student_review .singlebutton {
text-align: center;
margin: 1em 0em;
width: 95%;
}
@@ -0,0 +1,2 @@
Put your own report template in this directory.
Every file here will be priorized over the same file in the default_template-directory.