You are here

protected function LearningPathController::build_step_score_label in Opigno Learning path 3.x

Returns step score cell.

1 call to LearningPathController::build_step_score_label()
LearningPathController::trainingContentSteps in src/Controller/LearningPathController.php
Training content steps.

File

src/Controller/LearningPathController.php, line 64

Class

LearningPathController
Class LearningPathController.

Namespace

Drupal\opigno_learning_path\Controller

Code

protected function build_step_score_label($step) {
  if (in_array($step['typology'], [
    'Module',
    'Course',
    'Meeting',
    'ILT',
  ])) {
    $score = $step['best score'];
    return $score . '%';
  }
  else {
    return '0%';
  }
}