Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 376fe3f

Browse files
Rename
1 parent 4f22e1b commit 376fe3f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎examples/php/php-divergent_change-01_base/src/Controller/CourseStepsGetController.php‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ final class CourseStepsGetController
1111
const VIDEO_DURATION_PAUSES_MULTIPLIER = 1.1;
1212
const QUIZ_TIME_PER_QUESTION_MULTIPLIER = 0.5;
1313
const STEP_TYPE_VIDEO = 'video';
14-
const STEP_TYPE_QUIZ = 'quiz';
14+
const STEP_TYPE_QUIZ = 'quiz';
15+
const VIDEO_POINTS_PER_MINUTE = 100;
16+
const QUIZ_POINTS_PER_MINUTE = 10;
1517
private Platform $platform;
1618

1719
public function __construct(Platform $platform)
@@ -52,11 +54,11 @@ public function get(string $courseId): string
5254
}
5355

5456
if ($type === self::STEP_TYPE_VIDEO) {
55-
$points = $stepDurationInMinutes * 100;
57+
$points = $stepDurationInMinutes * self::VIDEO_POINTS_PER_MINUTE;
5658
}
5759

5860
if ($type === self::STEP_TYPE_QUIZ) {
59-
$points = $quizTotalQuestions * self::QUIZ_TIME_PER_QUESTION_MULTIPLIER * 10;
61+
$points = $quizTotalQuestions * self::QUIZ_TIME_PER_QUESTION_MULTIPLIER * self::QUIZ_POINTS_PER_MINUTE;
6062
}
6163

6264
$results .= json_encode(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /