Skip to content
Snippets Groups Projects
Commit 46bf1c9d authored by Jannik Wurche's avatar Jannik Wurche
Browse files

:scroll: add comments

parent 29a52e69
No related branches found
No related tags found
No related merge requests found
......@@ -17,31 +17,34 @@ type alias Model =
, runTime : Bool }
type Msg
= SendQuizRequest
| ReceiveQuiz (Result Json.Decode.Error Quiz)
| ReceivePartialQuiz (Result Json.Decode.Error PartialQuiz)
| ReceiveError String
| LinkClicked Browser.UrlRequest
| UrlChanged Url.Url
| UpdateQuizId String
| AnswerQuestion Int String
| Tick Time.Posix
| GoToQuestion Int
| GoToNextQuestion
| GoToPrevQuestion
| ResetQuizID
| ResetCurTime
= SendQuizRequest -- Message to send a quiz request
| ReceivePartialQuiz (Result Json.Decode.Error PartialQuiz) -- Message for receiving a partial quiz
| ReceiveError String -- Message for receiving an error
| LinkClicked Browser.UrlRequest -- Message for handling a clicked link
| UrlChanged Url.Url -- Message for handling a URL change
| UpdateQuizId String -- Message for updating the quiz ID
| AnswerQuestion Int String -- Message for answering a question
| Tick Time.Posix -- Message for ticking the timer
| GoToQuestion Int -- Message for navigating to a specific question
| GoToNextQuestion -- Message for navigating to the next question
| GoToPrevQuestion -- Message for navigating to the previous question
| ResetQuizID -- Message for resetting the quiz ID
| ResetCurTime -- Message for resetting the current time
-- The different routes in the application.
type Route
= HomeRoute
| QuestionRoute Int
| ResultRoute
| NotFound
-- Represents a graph, including its window and functions.
type alias Graph =
{ window : Window
, functions : List MathFunction }
-- The window of a graph, specifying its boundaries.
type alias Window =
{ xMin : Int
, yMin : Int
......@@ -49,6 +52,7 @@ type alias Window =
, yMax : Int
}
-- The different types of mathematical functions.
type MathFunction
= Const Float
| X
......@@ -65,6 +69,7 @@ type MathFunction
| Tan MathFunction
| Exp MathFunction
-- Represents a quiz, including its ID, name, duration, and questions.
type alias Quiz =
{ id : String
, name : String
......@@ -72,6 +77,7 @@ type alias Quiz =
, questions : List Question
}
-- Represents a single question in a quiz.
type alias Question =
{ id : Int
, task : String
......@@ -82,15 +88,22 @@ type alias Question =
, questionType : QuestionType
}
-- The different types of questions that can be asked.
type QuestionType
= MCQ { choices : List String, correct : List String, userSelection : List String }
| SCQ { choices : List String, correct : String, userSelection : String }
| Input { correct : List String, sensitive : Bool, userSelection : String }
{-
-
- Representing partial Types, which we get from the server:
-
-}
type alias PartialQuiz =
{ id : String
, name : String
, duration : Maybe Int -- Duration in minutes
, duration : Maybe Int
, questions : List PartialQuestion
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment