You are here

public function CourseObjectPoll::getReport in Course 8.2

Same name and namespace in other branches
  1. 8.3 modules/course_poll/src/Course/Object/CourseObjectPoll.php \Drupal\course_poll\Course\Object\CourseObjectPoll::getReport()

File

modules/course_poll/src/Course/Object/CourseObjectPoll.php, line 64

Class

CourseObjectPoll
Parent class for poll tracking.

Namespace

Drupal\course_poll\Course\Object

Code

public function getReport($key) {
  module_load_include('inc', 'poll', 'poll.pages');
  switch ($key) {
    case 'results':
      return array(
        'title' => $this
          ->getNode()->title,
        'content' => poll_view_results($this
          ->getNode(), NULL, NULL, NULL),
      );
    case 'all':
      $out = poll_votes($this
        ->getNode());
      return array(
        'title' => 'All votes',
        'content' => drupal_render($out),
      );
  }
  return parent::getReport($key);
}