Skip to content
Prev Previous commit
Next Next commit
Rename
  • Loading branch information
rgomezcasas committed Apr 14, 2021
commit 376fe3ff281040fe1704736a1cfabd050d08af1e
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ final class CourseStepsGetController
const VIDEO_DURATION_PAUSES_MULTIPLIER = 1.1;
const QUIZ_TIME_PER_QUESTION_MULTIPLIER = 0.5;
const STEP_TYPE_VIDEO = 'video';
const STEP_TYPE_QUIZ = 'quiz';
const STEP_TYPE_QUIZ = 'quiz';
const VIDEO_POINTS_PER_MINUTE = 100;
const QUIZ_POINTS_PER_MINUTE = 10;
private Platform $platform;

public function __construct(Platform $platform)
Expand Down Expand Up @@ -52,11 +54,11 @@ public function get(string $courseId): string
}

if ($type === self::STEP_TYPE_VIDEO) {
$points = $stepDurationInMinutes * 100;
$points = $stepDurationInMinutes * self::VIDEO_POINTS_PER_MINUTE;
}

if ($type === self::STEP_TYPE_QUIZ) {
$points = $quizTotalQuestions * self::QUIZ_TIME_PER_QUESTION_MULTIPLIER * 10;
$points = $quizTotalQuestions * self::QUIZ_TIME_PER_QUESTION_MULTIPLIER * self::QUIZ_POINTS_PER_MINUTE;
}

$results .= json_encode(
Expand Down