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 d043471

Browse files
ESTE ES UN STEP TEMPORAL
1 parent 6ae0c75 commit d043471

File tree

1 file changed

+2
-34
lines changed

1 file changed

+2
-34
lines changed

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

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -66,40 +66,8 @@ public function get(string $courseId): string
6666

6767
$results = '[';
6868

69-
foreach ($parsedCsv as $index => $row) {
70-
$stepId = $row['stepId'];
71-
$type = $row['type'];
72-
$quizTotalQuestions = $row['quizTotalQuestions'];
73-
$videoDuration = $row['videoDuration'];
74-
75-
$stepDurationInMinutes = 0;
76-
$points = 0;
77-
78-
if ($type === self::STEP_TYPE_VIDEO) {
79-
$stepDurationInMinutes = $videoDuration * self::VIDEO_DURATION_PAUSES_MULTIPLIER;
80-
}
81-
82-
if ($type === self::STEP_TYPE_QUIZ) {
83-
$stepDurationInMinutes = $quizTotalQuestions * self::QUIZ_TIME_PER_QUESTION_MULTIPLIER;
84-
}
85-
86-
if ($type === self::STEP_TYPE_VIDEO) {
87-
$points = $stepDurationInMinutes * self::VIDEO_POINTS_PER_MINUTE;
88-
}
89-
90-
if ($type === self::STEP_TYPE_QUIZ) {
91-
$points = $stepDurationInMinutes * self::QUIZ_POINTS_PER_MINUTE;
92-
}
93-
94-
$results .= json_encode(
95-
[
96-
'id' => $stepId,
97-
'type' => $type,
98-
'duration' => $stepDurationInMinutes,
99-
'points' => $points,
100-
],
101-
JSON_THROW_ON_ERROR
102-
);
69+
foreach ($steps as $index => $step) {
70+
$results .= json_encode($step, JSON_THROW_ON_ERROR);
10371

10472
$hasMoreRows = $index !== count($parsedCsv) - 1;
10573
if ($hasMoreRows) {

0 commit comments

Comments
(0)

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