Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Quizzer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ryan Thomas
Quizzer
Commits
519ffe31
Commit
519ffe31
authored
3 years ago
by
Ian Broyles
Browse files
Options
Downloads
Patches
Plain Diff
Added progress bar to keep track of how many questions the user has answered
parent
fbd47fc1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+3
-0
3 additions, 0 deletions
main.py
quizzer.kv
+3
-0
3 additions, 0 deletions
quizzer.kv
with
6 additions
and
0 deletions
main.py
+
3
−
0
View file @
519ffe31
...
...
@@ -5,6 +5,7 @@ from kivy.clock import Clock
from
kivy.properties
import
BooleanProperty
,
ListProperty
,
NumericProperty
from
kivy.modules
import
inspector
from
kivy.core.window
import
Window
from
kivy.uix.progressbar
import
ProgressBar
GUI_QUESTIONS
=
[
...
...
@@ -74,6 +75,7 @@ class QuizzerApp(App):
questions
=
ListProperty
([])
paused
=
BooleanProperty
(
False
)
correct
=
BooleanProperty
(
False
)
questions_answered
=
NumericProperty
(
0
)
def
build
(
self
):
inspector
.
create_inspector
(
Window
,
self
)
...
...
@@ -108,6 +110,7 @@ class QuizzerApp(App):
question
=
self
.
questions
[
-
1
]
if
len
(
self
.
questions
)
>
0
else
QuizzerApp
.
DEFAULT_QUESTION
self
.
paused
=
True
self
.
correct
=
answer
==
question
[
2
]
self
.
questions_answered
+=
1
if
self
.
correct
:
self
.
user_score
+=
1
print
(
self
.
user_score
)
...
...
This diff is collapsed.
Click to expand it.
quizzer.kv
+
3
−
0
View file @
519ffe31
...
...
@@ -77,6 +77,9 @@ ScreenManager:
on_press:
root.transition.direction = 'right'
root.current = 'settings'
ProgressBar:
max: 5
value: app.questions_answered
BoxLayout:
orientation: 'horizontal'
Label:
...
...
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