Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Can you guys take a look at my quiz
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dragonboy456




PostPosted: Mon Mar 16, 2015 3:34 pm   Post subject: Can you guys take a look at my quiz

Hey guys, I was wondering if you could look at my quiz I made with turing.
Could you give some suggestions on where to be better and if you could answer these questions.
1. How do i make it that u can play it more than once but the score doesn't always add up
2. How do i add a high score list

i didn't add the pics because i don't know how to add files but there are pics

3. for the stars at the beginning, how do i make it so that instead of being stars, can i make it that pictures pop up
4. how do i make it so tht u can type the case like ex. type "avatar the last airbender to play tht quiz

Here is the code

%Multiple Choice Quiz ATLA
%Harjas SIngh,
setscreen ("graphics:1000,800")

var answer, choice, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, q21 : string
var score, score1, answer1 : int
score := 0
score1 := 0

var x : int
var y : int
var c : int
var korra : int
loop
delay (20)
randint (x, 1, maxx)
randint (y, 1, maxy)
randint (x, 1, maxx)
randint (y, 1, maxy)
randint (c, 1, maxcolor)
Draw.FillStar (x, y, x + 50, y + 50, c)
exit when c = 250
end loop
cls
loop
put "Welcome to the hardest multiple choice quiz about Avatar the Last Airbender and the Legend of Korra"
Pic.ScreenLoad ("Korra.jpg", 20, 0, picCopy)
put "Would you like to play the quiz for "
put "1) Avatar the Last Airbender"
put "2) the Legend of Korra"
get answer1
cls
case answer1 of

label 1 :
loop
%Question 1
loop
put "Question 1: Who is the avatar?"
put "a) Sokka"
put "b) Aang"
put "c) Katara"
put "d) Zuko"
put "e) Suki"
get q1 : *
%Check to see if they got right answer
if q1 = "b" or q1 = "B" or q1 = "Aang" or q1 = "aang" then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is Aang"
exit
end if
end loop
delay (2000)
cls

%Question 2
loop
put "Question 2: What element can Aang bend/manipulate?"
put "a) Earth"
put "b) Fire"
put "c) Air"
put "d) Water"
put "e) All of the above"
get q2 : *
%Check for correct answer
if q2 = "e" or q2 = "E" or q2 = "All of the above" or q2 = "all of the above" or q2 = "all" or q2 = "All" then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is All of the above"
exit
end if
end loop
delay (2000)
cls

%Question 3
loop
put "Question 3: In which season does the gang meet Toph?"
put "a) Book 1: Water"
put "b) Book 2: Earth"
put "c) Book 3: Fire"
put "d) Book 4: Air"
put "e) There is no Toph"
get q3 : *
%Check for correct answer
if q3 = "b" or q3 = "Earth" or q3 = "B" or q3 = "Book 2" or q3 = "book 2" or q3 = "2" or q3 = "earth" or q3 = "book 2: earth" or q3 = "Book 2: Earth" or q3 = "Book 2: earth" or q3
=
"book 2: earth" then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is Book 2: Earth"
exit
end if
end loop
delay (2000)
cls

%Question 4
loop
put "Now it's going to get harder"
delay (2000)
cls
put "Question 4: According to guru Pathik, how many chakras are in the body?"
put "a) 7 chakras"
put "b) 4 chakras"
put "c) 11 chakras"
put "d) 9 chakras"
put "e) 8 chakras"
get q4 : *
%Check for correct answer
if q4 = "a" or q4 = "A" or q4 = "7" or q4 = "7 chakras"
then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is 7 chakras"
exit
end if
end loop
delay (2000)
cls

%Question 5
loop
put "Question 5: How long did the solar eclipse on the day of black sun last?"
put "a) 5 weeks"
put "b) 6 days"
put "c) 7 hours"
put "d) 8 minutes"
put "e) 9 seconds"
get q5 : *
%Check for correct answer
if q5 = "d" or q5 = "D" or q5 = "8 minutes" or q5 = "8" or q5 = "8 Minutes" then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is 8 minutes"
exit
end if
end loop
delay (2000)
cls

%Question 6
loop
put "Question 6: In which episode did Aang kiss Katara for the first time?"
put "a) The cave of two lovers"
put "b) The day of black Sun"
put "c) The Ember Island Players"
put "d) The Winter Solstice"
put "e) Sozin's Comet part 4: Avatar Aang"
get q6 : *
%Check for correct answer
if q6 = "b" or q6 = "B" or q6 = "the day of black sun" or q6 = "The Day of Black Sun" or q6 = "The Day Of Black Sun" or q6 = "day of black sun" or q6 = "Day of Black Sun" then
put "Correct!"
score := score + 1
exit
elsif q6 = "a" or q6 = "A" or q6 = "The cave of two lovers" or q6 = "the cave of two lovers" or q6 = "The Cave of Two Lovers" or q6 = "cave of two lovers" then
put "Incorrect. They almost kissed here but were interrupted when the crystals started glowing."
exit
else
put "Incorrect."
put "The correct answer is The Day of Black Sun"
exit
end if
end loop
delay (2000)
cls

%Question 7
loop
put "Question 7: Besides a fish and a cat, what is the only 'normal' type of animal in the series?"
put "a) Penguin"
put "b) Tiger"
put "c) Bear"
put "d) Turtle"
put "e) Lion"
get q7 : *
if q7 = "c" or q7 = "C" or q7 = "Bear" or q7 = "bear" or q7 = "bears" or q7 = "Bears" then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is Bear"
exit
end if
end loop
delay (2000)
cls


%Question 8
loop
put "Question 8: Of the following people, who is NOT a member of the Orfer of the White Lotus?"
put "a) Iroh"
put "b) Bumi"
put "c) Jeong Jeong"
put "d) Hakoda"
put "e) Piando"
get q8 : *
if q8 = "d" or q8 = "D" or q8 = "Hakoda" or q8 = "hakoda" then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is Hakoda"
exit
end if
end loop
delay (2000)
cls

%Question 9
loop
put "Question 9: Who created the Dai Li?"
put "a) Long Feng"
put "b) Poppy Bei Fong"
put "c) Azula"
put "d) Avatar Kyoshi"
put "e) King Bumi"
get q9 : *
if q9 = "d" or q9 = "D" or q9 = "Avatar Kyoshi" or q9 = "avatar kyoshi" or q9 = "kyoshi" or q9 = "Kyoshi" then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is Avatar Kyoshi"
exit
end if
end loop
delay (2000)
cls

%Question 10
loop
put "Question 10: Who is known as 'The Puppetmaster'?"
put "a) Hama"
put "b) Due"
put "c) Moko"
put "d) Kanna"
put "e) Katara"
get q10 : *
if q10 = "a" or q10 = "A" or q10 = "Hama" or q10 = "hama" then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is Hama"
exit
end if
end loop
delay (2000)
cls

%Question 11
loop
put "Question 11: How does Aang defeat Fire Lord Ozai/The Pheonix King?"
put "a) Aang kills him"
put "b) He doesn't, Ozai defeats Aang"
put "c) Aang takes away Ozai's fire bending"
put "d) Aang doesn't defeat Ozai, someone else does"
put "e) Aang puts Ozai in prison"
get q11 : *
if q11 = "c" or q11 = "C" or q11 = "Aang takes away Ozai's fire bending" or q11 = "aang takes away Ozai's fire bending" then
put "Correct!"
score := score + 1
exit
else
put "Incorrect."
put "The correct answer is Aang takes away Ozai's fire bending"
exit
end if
end loop
delay (2000)
cls

%Game Over Screen
put "Your score is ", score
if score = 10 or score = 11 then
put "You are an Avatar Genius!"
elsif score > 4 and score < 10 then
put "You are a great bender!"
else
put "You are a non-bender!"
end if
%Play again prompt
put "Would you like to play again (yes/no)?"
get choice
exit when choice = 'no' or choice = 'No' or choice = 'n' or choice = 'N'
end loop
cls


%Legend of korra game
label 2 :
loop
%Question 12
loop
put "Question 1: Which city does Korra travel too to complete her Airbending training?"
put "a) Aang City"
put "b) Republic City"
put "c) Ba Sing Se"
put "d) Omashu"
put "e) New York City"
get q12
if q12 = "b" or q12 = "B" or q12 = "Republic City" or q12 = "republic city" or q12 = "Republic city" or q12 = "republic City" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect."
put "The correct answer is Republic City"
exit
end if
end loop
delay (2000)
cls

%Question 13
loop
put "Question 2: What is the name of Korra, Bolin and Mako's pro-bending team?"
put "a) Team Avatar"
put "b) Platypus Bears"
put "c) White Falls Wolfbats"
put "d) Fire Ferrets"
put "e) Black Quarry Boar-q-pines"
get q13 : *
if q13 = "d" or q13 = "D" or q13 = "Fire Ferrets" or q13 = "fire ferrets" or q13 = "Fire ferrets" or q13 = "fire Ferrets" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect."
put "The correct answer is Fire Ferrets"
exit
end if
end loop
delay (2000)
cls
%Question 14
loop
put "Question 3: What are the names of the main villains of each book, in order? (Book 1, Book 2, Book 3, Book 4)"
put "a) Amon, Zaheer, Kuvira, Vattu"
put "b) Zaheer, Amon, Vattu, Kuvira"
put "c) Amon, Vattu, Zaheer, Kuvira"
put "d) Kuvira, Zaheer, Vattu, Amon"
put "e) Vattu, Kuvira, Amon, Zaheer"
get q14 : *
if q14 = "c" or q14 = "C" or q14 = "Amon, Vattu, Zaheer, Kuvira" or q14 = "amon, vattu, zaheer, kuvira" or q14 = "Amon Vattu Zaheer Kuvira" or q14 = "amon vattu zaheer kuvira" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect."
put "The correct answer is Amon, Vattu, Zaheer, Kuvira"
exit
end if
end loop
delay (2000)
cls

%Question 15
loop
put "Question 4: How does Amon take away other's bending away?"
put "a) He uses blood bending"
put "b) He is the avatar therefore he can spirit/energy bend"
put "c) He uses chi blocking"
put "d) He uses earth bending to poison the other person with mercury"
put "e) He uses magical powers and steals their bending so that he can use it"
get q15 : *
if q15 = "a" or q15 = "A" or q15 = "he uses blood bending" or q15 = "He uses blood bending" or q15 = "blood bending" or q15 = "Blood Bending" or q15 = "Blood bending" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect"
put "The correct answer is he uses blood bending"
exit
end if
end loop
delay (2000)
cls

%Question 16
loop
put "Question 5: Who dies at the end of Book 1 and how?"
put "a) Korra, Bolin, Mako and Asami. Noatok kills them"
put "b) Korra, Bolin, Mako and Asami. Tarrlok kills them"
put "c) Noatok and Tarrlok. Korra kills them"
put "d) Amon dies. Noatok kills him"
put "e) Noatok and Tarrlok die. Tarrlok kills them both"
get q16
if q16 = "e" or q16 = "E" or q16 = "Noatok and Tarrlok die. Tarrlok kills them both" or q16 = "noatok and tarrlok die. tarrlok kills them both" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect"
put "The correct answer is Noatok and Tarrlok die. Tarrlok kills them both"
exit
end if
end loop
delay (2000)
cls

%Question 17
loop
put "Question 6: Who is the first Avatar?"
put "a) Avatar Aang"
put "b) Avatar Korra"
put "c) Avatar Roku"
put "d) Avatar Wan"
put "e) Avatar Yangchen"
get q17 : *
if q17 = "d" or q17 = "D" or q17 = "Wan" or q17 = "wan" or q17 = "avatar wan" or q17 = "Avatar Wan" or q17 = "avatar Wan" or q17 = "Avatar wan" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect"
put "The correct answer is Avatar Wan"
exit
end if
end loop
delay (2000)
cls

%Question 18
loop
put "Question 7: After how many years does Harmonic Convergence take place?"
put "a) 10,000 years"
put "b) 1000 years"
put "c) 100 years"
put "d) 10 years"
put "e) 1 year"
get q18 : *
if q18 = "a" or q18 = "A" or q18 = "10,000 years" or q18 = "10000 years" or q18 = "10 000 years" or q18 = "10000" or q18 = "10 000" or q18 = "10,000" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect"
put "The correct answer is 10,000 years"
exit
end if
end loop
delay (2000)
cls

%Qustion 19
loop
put "Question 8: What sub-bending technique does Bolin develop in Book 3?"
put "a) Metal Bending"
put "b) Blood Bending"
put "c) Lightining Generation"
put "d) Wood Bending"
put "e) Lava Bending"
get q19 : *
if q19 = "e" or q19 = "E" or q19 = "Lava bending" or q19 = "lava bending" or q19 = "Lava bending" or q19 = "lava Bending" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect"
put "The correct answer is Lava Bending"
exit
end if
end loop
delay (2000)
cls

%Question 20
loop
put "Question 9: How many years later does Book 4 take place?"
put "a) 3 years later"
put "b) 5 years later"
put "c) 7 years later"
put "d) 1 year later"
put "e) 9 years later"
get q20 : *
if q20 = "3 years later" or q20 = "3 years" or q20 = "3" or q20 = "a" or q20 = "A" or q20 = "three years later" or q20 = "three" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect"
put "The correct answer is 3 years later"
exit
end if
end loop
delay (2000)
cls

%Question 21
loop
put "Question 10: Who gets married at the end of the series?"
put "a) Korra and Mako"
put "b) Varick and Zhu Li"
put "c) Asami and Bolin"
put "d) Kai and Jinora"
put "e) Asami and Mako"
get q21 : *
if q21 = "b" or q21 = "B" or q21 = "Varick and Zhu Li" or q21 = "varick and zhu li" then
put "Correct!"
score1 := score1 + 1
exit
else
put "Incorrect"
put "The correct answer is Varick and Zhu Li"
exit
end if
end loop
delay (2000)
cls

%Game Over Screen
put "Your score is ", score1
if score1 = 10 then
put "You are an Avatar Genius!"
elsif score1 > 4 and score1 < 10 then
put "You are a great bender!"
else
put "You are a non-bender!"
end if
%Play again prompt
put "Would you like to play again (yes/no)?"
get choice
exit when choice = 'no' or choice = 'No' or choice = 'n' or choice = 'N'
end loop
cls
end case
end loop

put "Your final score of both quizzes is ", score + score1
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Mon Mar 16, 2015 3:55 pm   Post subject: RE:Can you guys take a look at my quiz

Quote:
1. How do i make it that u can play it more than once but the score doesn't always add up


You'll have to set the score value to 0 again somewhere in your code.

Quote:
2. How do i add a high score list


This is a bit harder. You'll need to know how to read and write from a file as well as how to sort as list.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: