original_string: public function display($scorm, $cm, $course, $download) {
          global $DB, $OUTPUT, $PAGE;
  
          $contextmodule = context_module::instance($cm->id);
  
          if ($groupmode = groups_get_activity_groupmode($cm)) {   // Groups are being used.
              groups_print_activity_menu($cm, new moodle_url($PAGE->url));
          }
  
          // Find out current restriction.
          $group = groups_get_activity_group($cm, true);
          if (empty($group)) {
              // All users who can attempt scoes.
              $students = get_users_by_capability($contextmodule, 'mod/scorm:savetrack', 'u.id' , '', '', '', '', '', false);
              $allowedlist = empty($students) ? array() : array_keys($students);
          } else {
              // All users who can attempt scoes and who are in the currently selected group.
              $groupstudents = get_users_by_capability($contextmodule, 'mod/scorm:savetrack', 'u.id', '', '', '', $group, '', false);
              $allowedlist = empty($groupstudents) ? array() : array_keys($groupstudents);
          }
  
          // Labels.
          $labels = [get_string('invaliddata', 'scormreport_graphs')];
          for ($i = 1; $i <= self::BANDS - 1; $i++) {
              $labels[] = ($i - 1) * self::BANDWIDTH . ' - ' . $i * self::BANDWIDTH;
          }
  
          if ($scoes = $DB->get_records('scorm_scoes', array("scorm" => $scorm->id), 'sortorder, id')) {
              foreach ($scoes as $sco) {
                  if ($sco->launch != '') {
  
                      $data = $this->get_data($sco->id, $allowedlist);
                      $series = new chart_series($sco->title, $data);
  
                      $chart = new chart_bar();
                      $chart->set_labels($labels);
                      $chart->add_series($series);
                      $chart->get_xaxis(0, true)->set_label(get_string('percent', 'scormreport_graphs'));
                      $yaxis = $chart->get_yaxis(0, true);
                      $yaxis->set_label(get_string('participants', 'scormreport_graphs'));
                      $yaxis->set_stepsize(max(1, round(max($data) / 10)));
  
                      echo $OUTPUT->heading($sco->title, 3);
                      echo $OUTPUT->render($chart);
                  }
              }
          }
      }
code: public function display($scorm, $cm, $course, $download) {
          global $DB, $OUTPUT, $PAGE;
  
          $contextmodule = context_module::instance($cm->id);
  
          if ($groupmode = groups_get_activity_groupmode($cm)) {   // Groups are being used.
              groups_print_activity_menu($cm, new moodle_url($PAGE->url));
          }
  
          // Find out current restriction.
          $group = groups_get_activity_group($cm, true);
          if (empty($group)) {
              // All users who can attempt scoes.
              $students = get_users_by_capability($contextmodule, 'mod/scorm:savetrack', 'u.id' , '', '', '', '', '', false);
              $allowedlist = empty($students) ? array() : array_keys($students);
          } else {
              // All users who can attempt scoes and who are in the currently selected group.
              $groupstudents = get_users_by_capability($contextmodule, 'mod/scorm:savetrack', 'u.id', '', '', '', $group, '', false);
              $allowedlist = empty($groupstudents) ? array() : array_keys($groupstudents);
          }
  
          // Labels.
          $labels = [get_string('invaliddata', 'scormreport_graphs')];
          for ($i = 1; $i <= self::BANDS - 1; $i++) {
              $labels[] = ($i - 1) * self::BANDWIDTH . ' - ' . $i * self::BANDWIDTH;
          }
  
          if ($scoes = $DB->get_records('scorm_scoes', array("scorm" => $scorm->id), 'sortorder, id')) {
              foreach ($scoes as $sco) {
                  if ($sco->launch != '') {
  
                      $data = $this->get_data($sco->id, $allowedlist);
                      $series = new chart_series($sco->title, $data);
  
                      $chart = new chart_bar();
                      $chart->set_labels($labels);
                      $chart->add_series($series);
                      $chart->get_xaxis(0, true)->set_label(get_string('percent', 'scormreport_graphs'));
                      $yaxis = $chart->get_yaxis(0, true);
                      $yaxis->set_label(get_string('participants', 'scormreport_graphs'));
                      $yaxis->set_stepsize(max(1, round(max($data) / 10)));
  
                      echo $OUTPUT->heading($sco->title, 3);
                      echo $OUTPUT->render($chart);
                  }
              }
          }
      }
code_tokens: public function display ( $ scorm , $ cm , $ course , $ download ) { global $ DB , $ OUTPUT , $ PAGE ; $ contextmodule = context_module :: instance ( $ cm -> id ) ; if ( $ groupmode = groups_get_activity_groupmode ( $ cm ) ) { // Groups are being used. groups_print_activity_menu ( $ cm , new moodle_url ( $ PAGE -> url ) ) ; } // Find out current restriction. $ group = groups_get_activity_group ( $ cm , true ) ; if ( empty ( $ group ) ) { // All users who can attempt scoes. $ students = get_users_by_capability ( $ contextmodule , 'mod/scorm:savetrack' , 'u.id' , '' , '' , '' , '' , '' , false ) ; $ allowedlist = empty ( $ students ) ? array ( ) : array_keys ( $ students ) ; } else { // All users who can attempt scoes and who are in the currently selected group. $ groupstudents = get_users_by_capability ( $ contextmodule , 'mod/scorm:savetrack' , 'u.id' , '' , '' , '' , $ group , '' , false ) ; $ allowedlist = empty ( $ groupstudents ) ? array ( ) : array_keys ( $ groupstudents ) ; } // Labels. $ labels = [ get_string ( 'invaliddata' , 'scormreport_graphs' ) ] ; for ( $ i = 1 ; $ i <= self :: BANDS - 1 ; $ i ++ ) { $ labels [ ] = ( $ i - 1 ) * self :: BANDWIDTH . ' - ' . $ i * self :: BANDWIDTH ; } if ( $ scoes = $ DB -> get_records ( 'scorm_scoes' , array ( "scorm" => $ scorm -> id ) , 'sortorder, id' ) ) { foreach ( $ scoes as $ sco ) { if ( $ sco -> launch != '' ) { $ data = $ this -> get_data ( $ sco -> id , $ allowedlist ) ; $ series = new chart_series ( $ sco -> title , $ data ) ; $ chart = new chart_bar ( ) ; $ chart -> set_labels ( $ labels ) ; $ chart -> add_series ( $ series ) ; $ chart -> get_xaxis ( 0 , true ) -> set_label ( get_string ( 'percent' , 'scormreport_graphs' ) ) ; $ yaxis = $ chart -> get_yaxis ( 0 , true ) ; $ yaxis -> set_label ( get_string ( 'participants' , 'scormreport_graphs' ) ) ; $ yaxis -> set_stepsize ( max ( 1 , round ( max ( $ data ) / 10 ) ) ) ; echo $ OUTPUT -> heading ( $ sco -> title , 3 ) ; echo $ OUTPUT -> render ( $ chart ) ; } } } }
docstring: Displays the full report.
  
  @param \stdClass $scorm full SCORM object
  @param \stdClass $cm - full course_module object
  @param \stdClass $course - full course object
  @param string $download - type of download being requested
  @return void
docstring_tokens: Displays the full report .