Skip to content
Snippets Groups Projects
Commit 3a2a9820 authored by Minal Khatri's avatar Minal Khatri
Browse files

Score added

parent b0ef9b41
No related branches found
No related tags found
No related merge requests found
...@@ -2,10 +2,9 @@ from random import shuffle ...@@ -2,10 +2,9 @@ from random import shuffle
from kivy.app import App from kivy.app import App
from kivy.clock import Clock from kivy.clock import Clock
from kivy.properties import BooleanProperty, ListProperty
from kivy.modules import inspector
from kivy.core.window import Window from kivy.core.window import Window
from kivy.modules import inspector
from kivy.properties import BooleanProperty, NumericProperty, ListProperty
GUI_QUESTIONS = [ GUI_QUESTIONS = [
('What are the fundamental building blocks of a GUI?', ('What are the fundamental building blocks of a GUI?',
...@@ -64,6 +63,7 @@ TREE_QUESTIONS = [ ...@@ -64,6 +63,7 @@ TREE_QUESTIONS = [
PAUSE_TIME = 0.75 # seconds PAUSE_TIME = 0.75 # seconds
class QuizzerApp(App): class QuizzerApp(App):
DEFAULT_QUESTION = ('What is your favorite color?', ('Blue', 'Blue', 'Blue', 'Blue'), 'Blue') DEFAULT_QUESTION = ('What is your favorite color?', ('Blue', 'Blue', 'Blue', 'Blue'), 'Blue')
...@@ -74,6 +74,7 @@ class QuizzerApp(App): ...@@ -74,6 +74,7 @@ class QuizzerApp(App):
questions = ListProperty([]) questions = ListProperty([])
paused = BooleanProperty(False) paused = BooleanProperty(False)
correct = BooleanProperty(False) correct = BooleanProperty(False)
score = NumericProperty(0)
def build(self): def build(self):
inspector.create_inspector(Window, self) inspector.create_inspector(Window, self)
......
...@@ -74,6 +74,17 @@ ScreenManager: ...@@ -74,6 +74,17 @@ ScreenManager:
on_press: on_press:
root.transition.direction = 'right' root.transition.direction = 'right'
root.current = 'settings' root.current = 'settings'
Label:
text:'Score: 100'
font_size: sp(24)
size_hint: (1, None)
size: (self.texture_size[0] + 64, self.texture_size[1] + 64)
Label:
text: f'Score: {app.score}'
font_size: sp(24)
size_hint: (1, None)
size: (self.texture_size[0] + 64, self.texture_size[1] + 64)
Label: Label:
text: 'Do you know…' text: 'Do you know…'
font_size: sp(24) font_size: sp(24)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment