This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-02-10 03:16:51

warioty
Scratcher
Registered: 2013-02-09
Posts: 7

More Than One Questions On Scratch

I'm wondering could you have 3 or 4 questions on scratch.

when gf clicked
ask [what is the capital of ireland?] and wait
when gf clicked
forever if <(answer) = [dublin]>
say [Correct!] for (3) secs
when gf clicked
forever if <(answer) = [warsaw]>
say [bad!] for (3) secs
Now if i wanted to have a different question for example where is Brazil,
And somebody answered dublin it would say "Correct!"

Please let me know if you find the answer to how to make 5, 4, 3 or 2 questins on scratch.

Offline

 

#2 2013-02-10 03:32:06

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: More Than One Questions On Scratch

Here's your solution:

when gf clicked
ask [What is the capital of Ireland?] and wait
if <(answer) = [Dublin]>
 say [Correct!] for (3) secs
else
 say [Sorry, that is incorrect!] for (3) secs
end
ask [Will you insert another question here?] and wait
if <(answer) = [Yes]>
 say [Correct!] for (3) secs
else
 say [Sorry, that is incorrect!] for (3) secs
end
Ask you can see, you can just duplicate the code for one question and add it to the same stack, and it will ask another question directly afterwards.

Also, this belongs in the Help with Scripts section. I'll ask for it to be moved.  smile

Offline

 

#3 2013-02-10 03:57:45

warioty
Scratcher
Registered: 2013-02-09
Posts: 7

Re: More Than One Questions On Scratch

thank you!

Offline

 

#4 2013-02-10 04:05:55

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: More Than One Questions On Scratch

No problem! Good luck with your project  smile

Another thing that you might want to do is repeat the question until the correct answer is given -- if so, you can use this code for each question:

ask [What is the capital of Ireland?] and wait
repeat until <(answer) = [Dublin]>
 say [Sorry, that is incorrect!] for (3) secs
 ask [What is the capital of Ireland?] and wait
end
say [Yes, that is correct!] for (3) secs

Offline

 

#5 2013-02-11 01:34:53

warioty
Scratcher
Registered: 2013-02-09
Posts: 7

Re: More Than One Questions On Scratch

So even if somebody didn't answer anything yet it would say "sorry that's incorrect"?

Offline

 

#6 2013-02-11 03:40:37

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: More Than One Questions On Scratch

warioty wrote:

So even if somebody didn't answer anything yet it would say "sorry that's incorrect"?

yeah, as long as they pressed enter.  tongue

Offline

 

#7 2013-02-11 05:08:04

warioty
Scratcher
Registered: 2013-02-09
Posts: 7

Re: More Than One Questions On Scratch

Thank you very much,
you should see my project that is based on questions!
smile

Offline

 

#8 2013-02-11 05:12:14

warioty
Scratcher
Registered: 2013-02-09
Posts: 7

Re: More Than One Questions On Scratch

Link to this project:

http://scratch.mit.edu/projects/warioty/3094549

Offline

 

Board footer