Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Math Tutor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jannik Wurche
Math Tutor
Commits
2484cb9e
Commit
2484cb9e
authored
9 months ago
by
Jannik Wurche
Browse files
Options
Downloads
Patches
Plain Diff
add comments
parent
7c095a84
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Pages/HomeView.elm
+13
-3
13 additions, 3 deletions
src/Pages/HomeView.elm
with
13 additions
and
3 deletions
src/Pages/HomeView.elm
+
13
−
3
View file @
2484cb9e
...
...
@@ -6,9 +6,11 @@ import Html.Attributes exposing (class, type_, placeholder, value)
import
Html
.
Events
exposing
(
onSubmit
,
onClick
,
onInput
)
import
String
exposing
(
startsWith
)
-- Function to render the home view, allowing the user to enter a Quiz ID and start a quiz.
homeView
:
Model
->
Html
Msg
homeView
model
=
let
-- Determine the loading message based on the current error state.
loadingMsg
=
if
model
.
error
==
"
404"
then
p
[
class
"
error"
]
[
text
"
Diese Quiz ID gibt es nicht! Bitte gib eine andere ein."
]
else
if
startsWith
"
Error"
model
.
error
then
...
...
@@ -16,22 +18,30 @@ homeView model =
else
p
[]
[
text
"
zum testen: mwPpDw0HlJ1l65WObssa, 4tH5RYt62lho5q5TsabW"
]
in
-- Main container div with a background and centered content.
div
[
class
"
home"
]
[
div
[
class
"
background"
]
[]
,
div
[
class
"
center"
]
[
h1
[
class
"
title"
]
[
text
"
Mathe Quizzes"
]
[
-- Title of the home page.
h1
[
class
"
title"
]
[
text
"
Mathe Quizzes"
]
-- Form to submit the Quiz ID.
,
form
[
onSubmit
SendQuizRequest
]
[
input
[
-- Input field for the Quiz ID.
input
[
type_
"
text"
,
placeholder
"
Quiz ID"
,
value
model
.
quizId
,
onInput
UpdateQuizId
,
class
"
input-field"
]
[]
-- Submit button for the form.
,
button
[
onClick
SendQuizRequest
,
type_
"
submit"
,
class
"
submit-button"
]
[
text
"
Öffnen"
]
]
,
loadingMsg
]
]
\ No newline at end of file
-- Display the loading message or any error message.
,
loadingMsg
]
]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment