Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
20e7938
[csharp] [courses_steps_csv] Kickstart base
JavierCane Apr 22, 2021
60ae8c8
[csharp] [courses_steps_csv] Test execution works 🎉
JavierCane Apr 22, 2021
22297c6
[csharp] [courses_steps_csv] Test execution with mock works ✨
JavierCane Apr 22, 2021
f96cfbe
[csharp] [courses_steps_csv] Implement 01 base
ismanapa Apr 26, 2021
d881a3a
[csharp] [courses_steps_csv] Add 02 semantics
ismanapa Apr 26, 2021
127aab0
[csharp] [courses_steps_csv] Provide semantics to video step type
JavierCane Apr 26, 2021
a34e08d
[csharp] [courses_steps_csv] Provide semantics to the overall CourseS…
JavierCane Apr 26, 2021
76559e1
[csharp] [courses_steps_csv] [03_split_parsing_phase] Add base code r…
JavierCane Apr 26, 2021
b5c5410
[csharp] [courses_steps_csv] [03_split_parsing_phase] Duplicate loop …
JavierCane Apr 26, 2021
844007c
[csharp] [courses_steps_csv] Fix mini-typo in file name
JavierCane Apr 26, 2021
8508df1
[csharp] [courses_steps_csv] [03_split_parsing_phase] Clean out the f…
JavierCane Apr 26, 2021
326099d
[csharp] [courses_steps_csv] [03_split_parsing_phase] Refactor the se…
JavierCane Apr 26, 2021
78123d8
[csharp] [courses_steps_csv] [03_split_parsing_phase] Encapsulate `St…
JavierCane Apr 26, 2021
8ed79de
[csharp] [courses_steps_csv] [03_split_parsing_phase] Extract method …
JavierCane Apr 26, 2021
67e5ba0
[csharp] [courses_steps_csv] [04_split_serialization_phase] Add base …
ismanapa Apr 26, 2021
d174ca5
[csharp] [courses_steps_csv] [04_split_serialization_phase] Change se…
ismanapa Apr 26, 2021
83f192f
[csharp] [courses_steps_csv] [04_split_serialization_phase] Extract m…
ismanapa Apr 26, 2021
25f413a
[csharp] [courses_steps_csv] Move FindCourseSteps from ParseCsv to Co…
ismanapa Apr 26, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[csharp] [courses_steps_csv] Provide semantics to video step type
  • Loading branch information
JavierCane committed Apr 26, 2021
commit 127aab0db82c2e5ad9cba540a32f76eab67762e1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace CodelyTv.CoursesStepsCsv
{
public sealed class CourseStepsGetController
{
private const double VIDEO_DURATION_PAUSES_MULTIPLIER = 1.1;

private readonly Platform platform;

public CourseStepsGetController(Platform platform)
Expand All @@ -28,17 +30,18 @@ public string Get(string courseId)
var row = lines[i].Split(',');

var type = row[1];
var duration = 0.0;
var stepDuration = 0.0;
var points = 0.0;

if (type == "video")
{
duration = int.Parse(row[3]) * 1.1;
var videoDuration = int.Parse(row[3]);
stepDuration = videoDuration * VIDEO_DURATION_PAUSES_MULTIPLIER;
}

if (type == "quiz")
{
duration = int.Parse(row[2]) * 0.5; // 0.5 = time in minutes per question
stepDuration = int.Parse(row[2]) * 0.5; // 0.5 = time in minutes per question
}

if (type != "video" && type != "quiz")
Expand All @@ -48,7 +51,7 @@ public string Get(string courseId)

if (type == "video")
{
points = int.Parse(row[3]) * 1.1 * 100;
points = stepDuration * 100;
}

if (type == "quiz")
Expand All @@ -60,7 +63,7 @@ public string Get(string courseId)
{
Id = row[0],
Type = row[1],
Duration = duration,
Duration = stepDuration,
Points = points
};

Expand Down