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

#1 2012-12-02 20:53:02

hclarson
New Scratcher
Registered: 2012-11-22
Posts: 7

Multiple Choice Question

Ok, I am making a math game with these numbers depicted. And there are three different sprites, each with different costumes for all 9 questions. And they are labeled AnswerA, AmswerB, and AnswerC. But I am wondering how I do the different questions, I know I would need to add a question variable, but how can I write each question and have it change every time when I click the right arrow? And how do I program the sprite to be correct/incorrect with multiple questions?


1.    2 – AnswerB
2.    7 – AnswerA
3.    16 – AnswerB
4.    23 – AnswerC
5.    29 – AnswerA
6.    32 – AnswerB
7.    40 – AnswerB
8.    60 – AnswerC
9.    99 – AnswerA

Offline

 

#2 2012-12-02 22:47:05

thebriculator
Scratcher
Registered: 2011-07-11
Posts: 500+

Re: Multiple Choice Question

Here's my current brain dump:

Make these global variables:

(question)
(right)
and this variable in each sprite:
(selection)
and in the three sprites:
When I receive [next v]
show

when [AnswerA] clicked// this is the "spriteclicked" hat block
set [selection v] to [a]//different for each sprite
broadcast [check v]
hide
in a common sprite, or the stage:
when gf clicked
set [question v] to (1)
set [right v] to (0)
broadcast [next v]

when I receive [check v]
if <(item (question) of [answers v]) = (selection)>
say [right answer] for (1) secs
change [right v] by (1)
else
say [wrong answer] for (1) secs
end
if <(question) < [9]>
change [question v] by (1)
broadcast [next v]
else
say (join (join [Game over. You got ] (right) ) [ answers of 9 right.])
end
Don't forget to make the list with the answers (a, b, or c) in the right order, etc.

Hope this helped!

Last edited by thebriculator (2012-12-02 22:53:06)


.     http://tiny.cc/2cwgpw    http://tiny.cc/viwgpw    http://tiny.cc/iwwgpw

Offline

 

#3 2012-12-03 13:27:54

hclarson
New Scratcher
Registered: 2012-11-22
Posts: 7

Re: Multiple Choice Question

that item looks like it's in a list, would I then program the correct sprite into each item?

Offline

 

#4 2012-12-03 13:31:14

hclarson
New Scratcher
Registered: 2012-11-22
Posts: 7

Re: Multiple Choice Question

and how can you put an individual variable, like selection into a common script on the stage like in your example?

Offline

 

#5 2012-12-03 16:52:33

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Multiple Choice Question

hclarson wrote:

and how can you put an individual variable, like selection into a common script on the stage like in your example?

Under the sensing tab, you should see a block like this about 13 blocks down:

([x position v] of [sprite3 v])
Then, change the second drop down to the sprite you want, and under the first drop down menu, select what you want. You can choose the sprite's x position, y position, and local variables, just to name a few.

I hope that this helps!


http://i46.tinypic.com/35ismmc.png

Offline

 

#6 2012-12-04 16:35:51

hclarson
New Scratcher
Registered: 2012-11-22
Posts: 7

Re: Multiple Choice Question

Hey, if I uploaded my unfinished game with what I think is actually correct, then could someone help me figure out what is wrong?

Thanks  smile

Offline

 

#7 2012-12-04 17:23:23

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Multiple Choice Question

hclarson wrote:

Hey, if I uploaded my unfinished game with what I think is actually correct, then could someone help me figure out what is wrong?

Thanks  smile

Of course we can. As long as I (or some other helpful scratcher) has access to a computer, then we'll help as much as needed.  smile


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer