/**
  * @param int $userId
  * @param GradebookItem $item
  * @param $ignore_score_color
  * @return null|string
  */
 private function build_result_column($userId, $item, $ignore_score_color, $forceSimpleResult = false)
 {
     $scoredisplay = ScoreDisplay::instance();
     $score = $item->calc_score($userId);
     if (!empty($score)) {
         switch ($item->get_item_type()) {
             // category
             case 'C':
                 if ($score != null) {
                     if ($forceSimpleResult) {
                         return array('display' => $scoredisplay->display_score($score, SCORE_DIV), 'score' => $score, 'score_weight' => $score);
                     }
                     return array('display' => $scoredisplay->display_score($score, SCORE_DIV), 'score' => $score, 'score_weight' => $score);
                 } else {
                     return array('display' => null, 'score' => $score, 'score_weight' => $score);
                 }
                 break;
                 // evaluation and link
             // evaluation and link
             case 'E':
             case 'L':
                 //if ($parentId == 0) {
                 $scoreWeight = [$score[1] > 0 ? $score[0] / $score[1] * $item->get_weight() : 0, $item->get_weight()];
                 //}
                 $display = $scoredisplay->display_score($score, SCORE_DIV);
                 $type = $item->get_item_type();
                 if ($type == 'L' && get_class($item) == 'ExerciseLink') {
                     $display = ExerciseLib::show_score($score[0], $score[1], false);
                 }
                 return array('display' => $display, 'score' => $score, 'score_weight' => $scoreWeight);
         }
     }
     return array('display' => null, 'score' => null, 'score_weight' => null);
 }
 /**
  * @param int $userId
  * @param GradebookItem $item
  * @param $ignore_score_color
  * @return null|string
  */
 private function build_result_column($userId, $item, $ignore_score_color, $forceSimpleResult = false)
 {
     $scoredisplay = ScoreDisplay::instance();
     $score = $item->calc_score($userId);
     if (!empty($score)) {
         switch ($item->get_item_type()) {
             // category
             case 'C':
                 if ($score != null) {
                     $displaytype = SCORE_PERCENT;
                     if ($ignore_score_color) {
                         $displaytype |= SCORE_IGNORE_SPLIT;
                     }
                     if ($forceSimpleResult) {
                         return array('display' => $scoredisplay->display_score($score, SCORE_DIV), 'score' => $score, 'score_weight' => $score);
                     }
                     return array('display' => $scoredisplay->display_score($score, SCORE_DIV), 'score' => $score, 'score_weight' => $score);
                 } else {
                     return array('display' => null, 'score' => $score, 'score_weight' => $score);
                 }
                 break;
                 // evaluation and link
             // evaluation and link
             case 'E':
             case 'L':
                 //if ($parentId == 0) {
                 $scoreWeight = [$score[0] / $score[1] * $item->get_weight(), $item->get_weight()];
                 //}
                 return array('display' => $scoredisplay->display_score($score, SCORE_DIV), 'score' => $score, 'score_weight' => $scoreWeight);
         }
     }
     return array('display' => null, 'score' => null, 'score_weight' => null);
 }