Permalink
Browse files

CONTRIB-716 - adding the exabis_student_review block. Thanks to Danie…

…l Prieler for contributing the code.
  • Loading branch information...
1 parent 88d8b37 commit 666a4a6eb75a97418ccab0656ed2f730d1ebcf25 arborrow committed Sep 21, 2008
Showing with 2,099 additions and 0 deletions.
  1. +3 −0 blocks/exabis_student_review/ChangeLog.txt
  2. +99 −0 blocks/exabis_student_review/block_exabis_student_review.php
  3. +16 −0 blocks/exabis_student_review/config_global.html
  4. +95 −0 blocks/exabis_student_review/configuration.php
  5. +86 −0 blocks/exabis_student_review/configuration_class.php
  6. +127 −0 blocks/exabis_student_review/configuration_classmembers.php
  7. +128 −0 blocks/exabis_student_review/configuration_classteachers.php
  8. +107 −0 blocks/exabis_student_review/configuration_period.php
  9. +100 −0 blocks/exabis_student_review/configuration_userlist.html
  10. +63 −0 blocks/exabis_student_review/db/access.php
  11. +78 −0 blocks/exabis_student_review/db/install.xml
  12. +2 −0 blocks/exabis_student_review/default_template/comment.html
  13. BIN blocks/exabis_student_review/default_template/cool1.gif
  14. +1 −0 blocks/exabis_student_review/default_template/footer.html
  15. +7 −0 blocks/exabis_student_review/default_template/header.html
  16. BIN blocks/exabis_student_review/default_template/icon.gif
  17. BIN blocks/exabis_student_review/default_template/info.gif
  18. BIN blocks/exabis_student_review/default_template/l2g_vert.gif
  19. +1 −0 blocks/exabis_student_review/default_template/no_comments.html
  20. BIN blocks/exabis_student_review/default_template/pm1.gif
  21. BIN blocks/exabis_student_review/default_template/print.gif
  22. +32 −0 blocks/exabis_student_review/default_template/student.html
  23. +4 −0 blocks/exabis_student_review/inc.php
  24. +30 −0 blocks/exabis_student_review/lang/de_du_utf8/block_exabis_eportfolio.php
  25. +96 −0 blocks/exabis_student_review/lang/de_utf8/block_exabis_student_review.php
  26. +97 −0 blocks/exabis_student_review/lang/en_utf8/block_exabis_student_review.php
  27. +137 −0 blocks/exabis_student_review/lib/edit_form.php
  28. +240 −0 blocks/exabis_student_review/lib/lib.php
  29. +80 −0 blocks/exabis_student_review/periods.php
  30. BIN blocks/exabis_student_review/pix/beurteilung.png
  31. BIN blocks/exabis_student_review/pix/eingabezeitraum.png
  32. BIN blocks/exabis_student_review/pix/klassenzuteilung.png
  33. BIN blocks/exabis_student_review/pix/print.gif
  34. BIN blocks/exabis_student_review/pix/zeugnisse.png
  35. +53 −0 blocks/exabis_student_review/printclass.php
  36. +46 −0 blocks/exabis_student_review/printstudent.php
  37. +83 −0 blocks/exabis_student_review/report.php
  38. +64 −0 blocks/exabis_student_review/review.php
  39. +88 −0 blocks/exabis_student_review/review_class.php
  40. +126 −0 blocks/exabis_student_review/review_student.php
  41. +8 −0 blocks/exabis_student_review/styles.php
  42. +2 −0 blocks/exabis_student_review/template/info.txt
@@ -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 <info@exabis.at>
+* 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 <info@exabis.at>
+* 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 <info@exabis.at>
+* 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();
Oops, something went wrong.

0 comments on commit 666a4a6

Please sign in to comment.