public function __construct()
 {
     parent::__construct(get_string('continuousgradedistribution', 'gradereport_visual'));
     $this->layout = visualization::LAYOUT_AXIS;
     $this->layoutsettings = null;
     $this->edges = array(new edge('grade', array('item', 'group')));
     $this->xaxis = 'grade';
     $this->yaxis = 'students';
     $this->xaxislabelformat = '0\\%';
     $this->xaxisxoffset = -27;
     $this->xaxislabel = get_string('grade', 'gradereport_visual');
     if ($this->percent) {
         $this->yaxislabelformat = '0\\%';
         $this->yaxislabel = get_string('percentstudents', 'gradereport_visual');
     } else {
         $this->yaxislabel = get_string('numberstudents', 'gradereport_visual');
     }
     $this->title = get_string('continuousgradedistribution', 'gradereport_visual');
     $this->capability = 'gradereport/visual:vis:continuous_grade_distribution';
     $this->colorencoderedge = new encoder(encoder::ENCODER_COLOR, 'item', array(2));
     $this->colorencodernode = new encoder(encoder::ENCODER_COLOR, 'item', array(1));
     $this->shapeencodernode = new encoder(encoder::ENCODER_SHAPE, 'group', array(1));
     $this->encoders = array($this->colorencodernode, $this->colorencoderedge, $this->shapeencodernode);
     $this->grouplegend = new legend($this->shapeencodernode, array(get_string('allgroups', 'gradereport_visual')));
     $this->itemlegend = new legend($this->colorencodernode, array(get_string('coursetotal', 'grades')));
     $this->legends = array($this->itemlegend, $this->grouplegend);
 }
 public function __construct()
 {
     global $DB;
     parent::__construct(get_string('gradedistributionbar', 'gradereport_visual'));
     $this->layout = visualization::LAYOUT_AXIS;
     $this->layoutsettings = null;
     //array('false', 'true');
     $this->nodeshape = visualization::SHAPE_VERTICAL_BAR;
     $this->xaxis = 'grade';
     $this->yaxis = 'students';
     $this->xaxislabelformat = '0\\%';
     //$this->xaxismax = 100 + grade_distribution::RANGE;
     //$this->xaxismin = grade_distribution::RANGE;
     $this->xaxisxoffset = -27;
     $this->xaxislabel = get_string('grade', 'gradereport_visual');
     if ($this->percent) {
         $this->yaxislabelformat = '0\\%';
         $this->yaxislabel = get_string('percentstudents', 'gradereport_visual');
     } else {
         $this->yaxislabel = get_string('numberstudents', 'gradereport_visual');
     }
     $this->title = get_string('gradedistribution:title', 'gradereport_visual');
     $this->capability = 'gradereport/visual:vis:grade_distribution_bar';
     $this->usegroups = true;
     $options = array();
     foreach (groups_get_all_groups(required_param('id')) as $groupkey => $group) {
         $options[$groupkey] = grade_report_visual::truncate($group->name);
     }
     $options[0] = 'All Groups';
     if (isset($DB) && !is_null($DB)) {
         $course = $DB->get_record('course', array('id' => required_param('id')));
     } else {
         $course = get_record('course', 'id', required_param('id'));
     }
     if (!$course) {
         print_error('nocourseid');
     }
     $active = groups_get_course_group($course, true);
     if (!$active) {
         $active = 0;
     }
     $this->selector = new selector('group', $options, $active);
     $this->selectors = array($this->selector);
     $this->colorencoder = new encoder(encoder::ENCODER_COLOR, 'item');
     $this->encoders = array($this->colorencoder);
     $this->itemlegend = new legend($this->colorencoder, array(get_string('coursetotal', 'grades')));
     $this->legends = array($this->itemlegend);
 }
 public function __construct()
 {
     parent::__construct(get_string('gradesvsstudents', 'gradereport_visual'));
     $this->layout = visualization::LAYOUT_AXIS;
     $this->layoutsettings = null;
     $this->xaxis = 'student';
     $this->yaxis = 'grade';
     $this->xaxislabel = get_string('student', 'gradereport_visual');
     $this->yaxislabel = get_string('grade', 'gradereport_visual');
     $this->title = get_string('gradesvsstudents:title', 'gradereport_visual');
     $this->capability = 'gradereport/visual:vis:grades_vs_students';
     $this->colorencoder = new encoder(encoder::ENCODER_COLOR, 'item');
     $this->shapeencoder = new encoder(encoder::ENCODER_SHAPE, 'group');
     $this->encoders = array($this->colorencoder, $this->shapeencoder);
     $this->grouplegend = new legend($this->shapeencoder);
     $this->itemlegend = new legend($this->colorencoder);
     $this->legends = array($this->itemlegend, $this->grouplegend);
 }
 public function __construct()
 {
     parent::__construct(get_string('gradesvsitems', 'gradereport_visual'));
     $this->layout = visualization::LAYOUT_AXIS;
     $this->layoutsettings = null;
     //$this->edges = array(new edge('item', array('group')));
     $this->xaxis = 'item';
     $this->yaxis = 'grade';
     $this->yaxislabelformat = '0\\%';
     $this->xaxislabel = get_string('item', 'gradereport_visual');
     $this->yaxislabel = get_string('grade', 'gradereport_visual');
     $this->title = get_string('gradesvsitems:title', 'gradereport_visual');
     $this->capability = 'gradereport/visual:vis:grades_vs_items';
     $this->colorencodernode = new encoder(encoder::ENCODER_COLOR, 'group');
     $this->shapeencodernode = new encoder(encoder::ENCODER_SHAPE, 'item');
     $this->colorencoderedge = new encoder(encoder::ENCODER_COLOR, 'group', array(2));
     $this->encoders = array($this->colorencodernode, $this->colorencoderedge, $this->shapeencodernode);
     $this->grouplegend = new legend($this->colorencodernode);
     $this->itemlegend = new legend($this->shapeencodernode);
     $this->legends = array($this->grouplegend, $this->itemlegend);
 }
 public function __construct()
 {
     global $DB;
     parent::__construct(get_string('gradedistributiongroupbar', 'gradereport_visual'));
     $this->layout = visualization::LAYOUT_AXIS;
     $this->layoutsettings = array('false', 'true');
     $this->nodeshape = visualization::SHAPE_VERTICAL_BAR;
     $this->xaxis = 'grade';
     $this->yaxis = 'students';
     $this->xaxislabelformat = '0\\%';
     $this->xaxisxoffset = -27;
     $this->xaxislabel = get_string('grade', 'gradereport_visual');
     if ($this->percent) {
         $this->yaxislabelformat = '0\\%';
         $this->yaxislabel = get_string('percentstudents', 'gradereport_visual');
     } else {
         $this->yaxislabel = get_string('numberstudents', 'gradereport_visual');
     }
     $this->title = get_string('gradedistribution:title', 'gradereport_visual');
     $this->capability = 'gradereport/visual:vis:grade_distribution_group_bar';
     $courseid = required_param('id');
     $options = array();
     $items = grade_item::fetch_all(array('courseid' => $courseid));
     foreach ($items as $item) {
         if (count($item->get_final()) > 0) {
             $options[$item->id] = grade_report_visual::truncate($item->get_name());
         }
     }
     $options['ai'] = 'All Items';
     $this->selector = new selector('item', $options, 'ai');
     $this->selectors = array($this->selector);
     $this->colorencoder = new encoder(encoder::ENCODER_COLOR, 'group');
     $this->encoders = array($this->colorencoder);
     $this->grouplegend = new legend($this->colorencoder);
     $this->legends = array($this->grouplegend);
 }