Skip to content

Commit f765d3d

Browse files
authored
Merge pull request larymak#5 from Adv-Software-Eng-Assessment/michael
added test cases, sprint logs & requirements.txt
2 parents f11e4c1 + 23d9a89 commit f765d3d

File tree

12 files changed

+103
-90
lines changed

12 files changed

+103
-90
lines changed

GAMES/Software-Eng-UI-Quiz/ClassDiagram.drawio renamed to GAMES/Software-Eng-UI-Quiz/draw.io/ClassDiagram.drawio

Lines changed: 34 additions & 34 deletions
Large diffs are not rendered by default.

GAMES/Software-Eng-UI-Quiz/hacktoberfest_quiz.py

Lines changed: 67 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,99 +5,103 @@
55

66
root.geometry("800x800")
77

8-
root.title("Hacktoberfest Quiz")
8+
root.title("Quiz Game App")
99

1010
scrollbar = Scrollbar(root)
11-
scrollbar.pack( side = RIGHT, fill = Y )
11+
scrollbar.pack(side=RIGHT, fill=Y)
1212

13-
label = Label(root,text="Hacktoberfest Quiz ",width = 20,height=4,font=("algerian",15))
13+
label = Label(root, text="Software Engineering Quiz ",
14+
width=28, height=4, font=("algerian", 15))
1415
label.pack()
1516

17+
1618
class Quiz:
17-
print('Welcome to the Hacktoberfest 2022 Quiz')
18-
score=0
19-
total_questions=4
19+
print('Welcome to the Software Engineering Quiz')
20+
score = 0
21+
total_questions = 4
2022

2123
def __init__(self):
2224
# self.ask_question()
2325
pass
2426

2527
def ask_question(self):
26-
answer=input('Are you ready to play the Quiz ? (yes/no) :')
28+
answer = input('Are you ready to play the Quiz ? (yes/no) :')
2729

28-
if answer.lower()=='yes':
29-
answer=input('Question 1: What programming language was this quiz created in?')
30-
if answer.lower()=='python':
30+
if answer.lower() == 'yes':
31+
answer = input(
32+
'Question 1: What programming language was this quiz created in?')
33+
if answer.lower() == 'python':
3134
self.score += 1
3235
print('correct')
3336
else:
3437
print('Wrong Answer :(')
35-
36-
37-
answer=input('Question 2: What is software Engineering?')
38-
if answer.lower()=='application of engineering principle to the design a software':
38+
39+
answer = input('Question 2: What is software Engineering?')
40+
if answer.lower() == 'application of engineering principle to the design a software':
3941
self.score += 1
4042
print('correct')
4143
else:
4244
print('Wrong Answer :(')
43-
44-
answer=input('Question 3: what does SDLC stand for?')
45-
if answer.lower()=='software Development Life Cycle':
45+
46+
answer = input('Question 3: what does SDLC stand for?')
47+
if answer.lower() == 'software Development Life Cycle':
4648
self.score += 1
4749
print('correct')
4850
else:
4951
print('Wrong Answer :(')
50-
51-
answer=input('Question 4: First phase of software development is:')
52-
if answer.lower()=='requirement ananlysi':
52+
53+
answer = input(
54+
'Question 4: First phase of software development is:')
55+
if answer.lower() == 'requirement ananlysi':
5356
self.score += 1
5457
print('correct')
5558
else:
5659
print('Wrong Answer :(')
57-
58-
print('Thankyou for Playing the Hacktoberfest quiz game, you attempted',self.score,"questions correctly!")
59-
mark=(self.score/self.total_questions)*100
60-
print('Marks obtained:',mark)
60+
61+
print('Thankyou for Playing the Hacktoberfest quiz game, you attempted',
62+
self.score, "questions correctly!")
63+
mark = (self.score/self.total_questions)*100
64+
print('Marks obtained:', mark)
6165
print('BYE!')
6266

6367
def get_score(self):
6468
return self.score
6569

66-
def validate_question_one(self, question_one_value = ''):
67-
if question_one_value.lower()=='python':
70+
def validate_question_one(self, question_one_value=''):
71+
if question_one_value.lower() == 'python':
6872
self.score += 1
6973
print('correct')
7074
else:
7175
print('Wrong Answer1')
7276
print('correct answer is python. ')
73-
return True if question_one_value.lower()=='python' else False
74-
77+
return True if question_one_value.lower() == 'python' else False
78+
7579
def validate_question_two(self, question_two_value):
76-
if question_two_value.lower()=='application of engineering principle to the design a software':
80+
if question_two_value.lower() == 'application of engineering principle to the design a software':
7781
self.score += 1
7882
print('correct')
7983
else:
8084
print('Wrong Answer2')
8185
print('correct answer is application of engineering principle to the design a software. It is the Application of engineering principles to the design,development, and support of software and it helps to solve the challenges of low- quality software project. ')
82-
return True if question_two_value.lower()=='application of engineering principle to the design a software' else False
86+
return True if question_two_value.lower() == 'application of engineering principle to the design a software' else False
8387

8488
def validate_question_three(self, question_three_value):
85-
if question_three_value.lower()=='software development life cycle':
89+
if question_three_value.lower() == 'software development life cycle':
8690
self.score += 1
8791
print('correct')
8892
else:
8993
print('Wrong Answer2')
9094
print('correct answer is software development life cycle. it is a method for designing, developing, and testing high-quality softwarte.')
91-
return True if question_three_value.lower()=='software development life cycle' else False
95+
return True if question_three_value.lower() == 'software development life cycle' else False
9296

9397
def validate_question_four(self, question_four_value):
94-
if question_four_value.lower()=='requirement ananlysis':
98+
if question_four_value.lower() == 'requirement ananlysis':
9599
self.score += 1
96100
print('correct')
97101
else:
98102
print('Wrong Answer2')
99103
print('correct answer is requirement ananlysis, as based on it developer design and developed the software.')
100-
return True if question_four_value.lower()=='requirement ananlysis' else False
104+
return True if question_four_value.lower() == 'requirement ananlysis' else False
101105

102106
def evaluate(self):
103107
self.score = 0
@@ -110,67 +114,74 @@ def evaluate(self):
110114

111115
question_three_value = question_three.get()
112116
self.validate_question_three(question_three_value=question_three_value)
113-
117+
114118
question_four_value = question_four.get()
115119
self.validate_question_four(question_four_value=question_four_value)
116120

121+
print('Thankyou for Playing the Hacktoberfest quiz game, you attempted',
122+
self.score, "questions correctly!")
123+
mark = (self.score/self.total_questions)*100
124+
my_label.config(text="Your score is " + str(mark) + "%")
125+
print('Marks obtained:', mark)
117126

118-
print('Thankyou for Playing the Hacktoberfest quiz game, you attempted',self.score,"questions correctly!")
119-
mark=(self.score/self.total_questions)*100
120-
my_label.config(text = "Your score is " + str(mark) +"%")
121-
print('Marks obtained:',mark)
122-
123-
124-
125127

126128
quiz = Quiz()
127129

128-
w1_label = Label(root,text="Question 1: What programming language was this quiz created in?",font=("arial",10),width=100,height=4)
130+
w1_label = Label(root, text="Question 1: What programming language was this quiz created in?", font=(
131+
"arial", 10), width=100, height=4)
129132
w1_label.pack()
130-
question_one = ttk.Combobox(root,value=["Python","Java","C++"],width=50,height=4)
133+
question_one = ttk.Combobox(
134+
root, value=["Python", "Java", "C++"], width=50, height=4)
131135
w1_label.pack()
132136
question_one.current(0)
133137
question_one.pack()
134138

135-
w1_label = Label(root,text="",font=("arial",10),width=200,height=4)
139+
w1_label = Label(root, text="", font=("arial", 10), width=200, height=4)
136140
w1_label.pack()
137141

138-
w2_label = Label(root,text="Question 2:What is software Engineering?",font=("arial",10),width=200,height=4)
142+
w2_label = Label(root, text="Question 2:What is software Engineering?", font=(
143+
"arial", 10), width=200, height=4)
139144
w2_label.pack()
140-
question_two = ttk.Combobox(root,width=50,height=4,value=["Designing a software","Testing a software","Application of engineering principle to the design a software","None of the above"])
145+
question_two = ttk.Combobox(root, width=50, height=4, value=[
146+
"Designing a software", "Testing a software", "Application of engineering principle to the design a software", "None of the above"])
141147
question_two.current(0)
142148
question_two.pack()
143149

144-
w2_label = Label(root,text="",font=("arial",10),width=200,height=4)
150+
w2_label = Label(root, text="", font=("arial", 10), width=200, height=4)
145151
w2_label.pack()
146152

147153

148-
w3_label = Label(root,text="Question 3:what does SDLC stand for?",font=("arial",10),width=200,height=4)
154+
w3_label = Label(root, text="Question 3:what does SDLC stand for?",
155+
font=("arial", 10), width=200, height=4)
149156
w3_label.pack()
150-
question_three = ttk.Combobox(root,width=50,height=4,value=["System Design Life Cycle","Software Design Life Cycle","System Development Life Cycle","Software Development Life Cycle"])
157+
question_three = ttk.Combobox(root, width=50, height=4, value=[
158+
"System Design Life Cycle", "Software Design Life Cycle", "System Development Life Cycle", "Software Development Life Cycle"])
151159
question_three.current(0)
152160
question_three.pack()
153161

154-
w3_label = Label(root,text="",font=("arial",10),width=200,height=4)
162+
w3_label = Label(root, text="", font=("arial", 10), width=200, height=4)
155163
w3_label.pack()
156164

157-
w4_label = Label(root,text="Question 4: First phase of software development is:",font=("arial",10),width=200,height=4)
165+
w4_label = Label(root, text="Question 4: First phase of software development is:", font=(
166+
"arial", 10), width=200, height=4)
158167
w4_label.pack()
159-
question_four = ttk.Combobox(root,width=50,height=4,value=["Coding","Testing","Design","Requirement ananlysis"])
168+
question_four = ttk.Combobox(root, width=50, height=4, value=[
169+
"Coding", "Testing", "Design", "Requirement ananlysis"])
160170
question_four.current(0)
161171
question_four.pack()
162172

163-
w4_label = Label(root,text="",font=("arial",10),width=200,height=4)
173+
w4_label = Label(root, text="", font=("arial", 10), width=200, height=4)
164174
w4_label.pack()
165175

166176

167-
button = Button(root,text="Submit",font=("bell mt",10), command=quiz.evaluate)
177+
button = Button(root, text="Submit", font=(
178+
"bell mt", 10), command=quiz.evaluate)
168179
button.pack()
169180

170181

171182
# w6_label = Label(root,font=("arial",10),width=100,height=4, textvariable=quiz.get_score())
172183
my_label = Label(root,
173-
text = "Score:")
184+
text="Score:")
174185
my_label.pack()
175186

176187

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
python==3.11.2
2+
tkinter==8.6
Loading
Loading
Loading
Binary file not shown.
Binary file not shown.
Loading
Loading

0 commit comments

Comments
 (0)