Skip to content

Commit 604336a

Browse files
authored
Merge pull request larymak#1 from Adv-Software-Eng-Assessment/vashali
user stories
2 parents 655c2bd + 0fa394e commit 604336a

File tree

3 files changed

+34
-33
lines changed

3 files changed

+34
-33
lines changed
81.8 KB
Binary file not shown.

GAMES/Hacktoberfest Quiz/hacktoberfest_quiz.py

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
root = Tk()
55

6-
root.geometry("500x500")
6+
root.geometry("800x800")
77

88
root.title("Hacktoberfest Quiz")
99

@@ -24,30 +24,30 @@ def ask_question(self):
2424
answer=input('Are you ready to play the Quiz ? (yes/no) :')
2525

2626
if answer.lower()=='yes':
27-
answer=input('Question 1: What programming language was this quiz created in? Hint: Java, C++, Python')
27+
answer=input('Question 1: What programming language was this quiz created in?')
2828
if answer.lower()=='python':
2929
self.score += 1
3030
print('correct')
3131
else:
3232
print('Wrong Answer :(')
3333

3434

35-
answer=input('Question 2: Is one of the values of Hacktoberfest 2022 "EVERYONE IS WELCOME" ? ')
36-
if answer.lower()=='yes':
35+
answer=input('Question 2: What is software Engineering?')
36+
if answer.lower()=='application of engineering principle to the design a software':
3737
self.score += 1
3838
print('correct')
3939
else:
4040
print('Wrong Answer :(')
4141

42-
answer=input('Question 3: Does Hacktoberfest end on December 31?')
43-
if answer.lower()=='no':
42+
answer=input('Question 3: what does SDLC stand for?')
43+
if answer.lower()=='software Development Life Cycle':
4444
self.score += 1
4545
print('correct')
4646
else:
4747
print('Wrong Answer :(')
4848

49-
answer=input('Question 3: Does Hacktoberfest have a discord server?')
50-
if answer.lower()=='yes':
49+
answer=input('Question 4: First phase of software development is:')
50+
if answer.lower()=='requirement ananlysi':
5151
self.score += 1
5252
print('correct')
5353
else:
@@ -67,35 +67,35 @@ def validate_question_one(self, question_one_value = ''):
6767
print('correct')
6868
else:
6969
print('Wrong Answer1')
70-
print('correct answer is python ')
70+
print('correct answer is python. ')
7171
return True if question_one_value.lower()=='python' else False
7272

7373
def validate_question_two(self, question_two_value):
74-
if question_two_value.lower()=='yes':
74+
if question_two_value.lower()=='application of engineering principle to the design a software':
7575
self.score += 1
7676
print('correct')
7777
else:
7878
print('Wrong Answer2')
79-
print('correct answer is yes ')
80-
return True if question_two_value.lower()=='yes' else False
79+
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. ')
80+
return True if question_two_value.lower()=='application of engineering principle to the design a software' else False
8181

8282
def validate_question_three(self, question_three_value):
83-
if question_three_value.lower()=='no':
83+
if question_three_value.lower()=='software development life cycle':
8484
self.score += 1
8585
print('correct')
8686
else:
8787
print('Wrong Answer2')
88-
print('correct answer is no')
89-
return True if question_three_value.lower()=='no' else False
88+
print('correct answer is software development life cycle. it is a method for designing, developing, and testing high-quality softwarte.')
89+
return True if question_three_value.lower()=='software development life cycle' else False
9090

9191
def validate_question_four(self, question_four_value):
92-
if question_four_value.lower()=='yes':
92+
if question_four_value.lower()=='requirement ananlysis':
9393
self.score += 1
9494
print('correct')
9595
else:
9696
print('Wrong Answer2')
97-
print('correct answer is yes')
98-
return True if question_four_value.lower()=='yes' else False
97+
print('correct answer is requirement ananlysis, as based on it developer design and developed the software.')
98+
return True if question_four_value.lower()=='requirement ananlysis' else False
9999

100100
def evaluate(self):
101101
self.score = 0
@@ -123,41 +123,42 @@ def evaluate(self):
123123

124124
quiz = Quiz()
125125

126-
w1_label = Label(root,text="Question 1: What programming language was this quiz created in? Hint: Java, C++, Python ?",font=("arial",10),width=100,height=4)
126+
w1_label = Label(root,text="Question 1: What programming language was this quiz created in?",font=("arial",10),width=100,height=4)
127+
w1_label.pack()
128+
question_one = ttk.Combobox(root,value=["Python","Java","C++"],width=50,height=4)
127129
w1_label.pack()
128-
question_one = ttk.Combobox(root,value=["Python","Java","C++"])
129130
question_one.current(0)
130131
question_one.pack()
131132

132-
w1_label = Label(root,text="",font=("arial",10),width=100,height=4)
133+
w1_label = Label(root,text="",font=("arial",10),width=200,height=4)
133134
w1_label.pack()
134135

135-
w2_label = Label(root,text="Question 2: Is one of the values of Hacktoberfest 2022 'EVERYONE IS WELCOME' ?",font=("arial",10),width=100,height=4)
136+
w2_label = Label(root,text="Question 2:What is software Engineering?",font=("arial",10),width=200,height=4)
136137
w2_label.pack()
137-
question_two = ttk.Combobox(root,value=["Yes","No"])
138+
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"])
138139
question_two.current(0)
139140
question_two.pack()
140141

141-
w2_label = Label(root,text="",font=("arial",10),width=100,height=4)
142+
w2_label = Label(root,text="",font=("arial",10),width=200,height=4)
142143
w2_label.pack()
143144

144145

145-
w3_label = Label(root,text="Question 3: Does Hacktoberfest end on December 31?",font=("arial",10),width=100,height=4)
146+
w3_label = Label(root,text="Question 3:what does SDLC stand for?",font=("arial",10),width=200,height=4)
146147
w3_label.pack()
147-
question_three = ttk.Combobox(root,value=["Yes","No"])
148+
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"])
148149
question_three.current(0)
149150
question_three.pack()
150151

151-
w3_label = Label(root,text="",font=("arial",10),width=100,height=4)
152+
w3_label = Label(root,text="",font=("arial",10),width=200,height=4)
152153
w3_label.pack()
153154

154-
w4_label = Label(root,text="Question 4: Does Hacktoberfest have a discord server?",font=("arial",10),width=50,height=4)
155+
w4_label = Label(root,text="Question 4: First phase of software development is:",font=("arial",10),width=200,height=4)
155156
w4_label.pack()
156-
question_four = ttk.Combobox(root,value=["Yes","No"])
157+
question_four = ttk.Combobox(root,width=50,height=4,value=["Coding","Testing","Design","Requirement ananlysis"])
157158
question_four.current(0)
158159
question_four.pack()
159160

160-
w4_label = Label(root,text="",font=("arial",10),width=50,height=4)
161+
w4_label = Label(root,text="",font=("arial",10),width=200,height=4)
161162
w4_label.pack()
162163

163164

GAMES/Hacktoberfest Quiz/quiz_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ def test_correct_answer_to_question_one(self):
88

99
def test_correct_answer_to_question_two(self):
1010
quiz = Quiz()
11-
self.assertTrue(quiz.validate_question_two('yes'))
11+
self.assertTrue(quiz.validate_question_two('application of engineering principle to the design a software'))
1212

1313
def test_correct_answer_to_question_three(self):
1414
quiz = Quiz()
15-
self.assertTrue(quiz.validate_question_three('no'))
15+
self.assertTrue(quiz.validate_question_three('software development life cycle'))
1616

1717
def test_correct_answer_to_question_four(self):
1818
quiz = Quiz()
19-
self.assertTrue(quiz.validate_question_four('yes'))
19+
self.assertTrue(quiz.validate_question_four('requirement ananlysis'))
2020

2121
def test_correct_score(self):
2222
pass

0 commit comments

Comments
 (0)