Ejemplo n.º 1
0
 function referral_process()
 {
     if (!$this->exporting) {
         $times = times_student_referred($this->obj);
         echo '<ul class="student_list">
              ' . array_reduce($times, array($this, 'reduce_times')) . '
               </ul>';
     }
     return parent::referral_process();
 }
Ejemplo n.º 2
0
 function is_capable()
 {
     return ($this->cps_user and $this->cps_user->getSectionsForMoodleCourse(null, true)) || parent::is_capable();
 }
Ejemplo n.º 3
0
require_once '../../config.php';
require_once 'visualizer/lib.php';
require_login();
// Course id is optional
$courseid = optional_param('id', NULL, PARAM_INT);
if ($courseid) {
    $course = has_reporting_permission($courseid);
} else {
    $course = null;
}
$export = optional_param('export');
$key = optional_param('key', $courseid ? 'course' : null);
$keyid = optional_param('keyid');
$page = optional_param('page', 0);
$per_page = optional_param('per_page', 50);
$visualizer = referral_visualizer::build_visualizer($course, $key, $keyid, $page, $per_page, $export);
if ($visualizer->exporting and $visualizer->exportable()) {
    $visualizer->export();
    die;
}
// Print the header and heading
$blockname = get_string('blockname', 'block_student_gradeviewer');
$heading = get_string('analysis', 'block_student_gradeviewer');
$navigation = array();
if ($courseid) {
    $navigation[] = array('name' => $course->shortname, 'link' => $CFG->wwwroot . '/course/view.php?id=' . $courseid, 'type' => 'title');
}
$navigation[] = array('name' => $blockname, 'link' => '', 'type' => 'title');
$navigation[] = array('name' => $heading, 'link' => $CFG->wwwroot . '/blocks/student_gradeviewer/analysis.php?id=' . $courseid, 'type' => 'title');
$extra = $visualizer->extra_navigation();
if (!empty($extra)) {
Ejemplo n.º 4
0
Archivo: lib.php Proyecto: rrusso/EARS
 static function build_visualizer($course, $key = null, $keyid = null, $page = 0, $per_page = 50, $export = false)
 {
     global $CFG;
     $base = $CFG->dirroot . '/blocks/student_gradeviewer/visualizer/';
     if (in_array($key, referral_visualizer::types())) {
         require_once $base . $key . '_visualizer.php';
         $class = 'referral_' . $key . '_visualizer';
         return new $class($course, $key, $keyid, $page, $per_page, $export);
     }
     require_once $base . 'blank_visualizer.php';
     return new referral_blank_visualizer($course, 'blank');
 }
Ejemplo n.º 5
0
<?php

require_once '../../config.php';
require_once 'visualizer/lib.php';
require_login();
$courseid = optional_param('id');
$navigation = array();
if ($courseid) {
    $course = get_record('course', 'id', $courseid);
    if ($course) {
        $navigation[] = array('name' => $course->shortname, 'link' => $CFG->wwwroot . '/course/view.php?id=' . $courseid, 'type' => 'title');
    }
}
$options = referral_visualizer::build_visualizer(null, 'options', $USER->username);
require_js(array($CFG->wwwroot . '/blocks/student_gradeviewer/jquery.min.js', $CFG->wwwroot . '/blocks/student_gradeviewer/option_functions.js'));
// Print the header and heading
$blockname = get_string('blockname', 'block_student_gradeviewer');
$heading = get_string('auto_options', 'block_student_gradeviewer');
$navigation[] = array('name' => $blockname, 'link' => '', 'type' => 'title');
$navigation[] = array('name' => $heading, 'link' => '', 'type' => 'title');
print_header_simple($heading, '', build_navigation($navigation));
$options->print_filters('options.php');
$options->print_heading($heading);
if ($data = data_submitted()) {
    $options->process($data);
    $options->print_notices();
}
echo '<form method="post">';
$options->print_table();
echo '<div class="center_button">
        <input type="submit" value="' . get_string('submit') . '">