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

#1 2010-05-19 16:29:50

fatamorgAnna
Scratcher
Registered: 2010-02-22
Posts: 13

multiple choice questions PROBLEM

i try to create a multiple choice question game but i'm in trouble!
i can make it to appear a question when the spite touches another spite, for example (when ... touches.... - ask ...- if -answer = a - say You won). So,my problem is that when someone is going to play the game again i can make it to have many different questions...

I believe that it has something to do with " random choice 1 to 10"
but i can find an appropriate codec

if you have any idea plz let me know

Offline

 

#2 2010-05-19 16:45:52

jaksta
Scratcher
Registered: 2010-05-19
Posts: 1

Re: multiple choice questions PROBLEM

hi i am new i am mwhitey12 friend

Offline

 

#3 2010-05-19 17:04:00

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: multiple choice questions PROBLEM

jaksta wrote:

hi i am new i am mwhitey12 friend

Hi jaksta! If you're new, why not post it in the "New Members" forum?

As for your problem, I'm not quite sure what you're getting at. To sum up:
-You have a project which asks a question when a sprite touches another sprite.
-You want mostly different questions when the user restarts the project.
Am I correct?

Last edited by coolstuff (2010-05-19 17:05:07)

Offline

 

#4 2010-05-19 17:48:04

fatamorgAnna
Scratcher
Registered: 2010-02-22
Posts: 13

Re: multiple choice questions PROBLEM

yeap coolstuff you are right!  big_smile

Offline

 

#5 2010-05-19 18:41:50

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: multiple choice questions PROBLEM

Maybe this code will do the trick. First, make a list will all of your questions in it.

When green flag clicked
forever
   if <touching [sprite] >
      ask (item (pick random 1 to (length of [list] ) ) of [list]
      wait until <not <touching sprite> >
   ===================
======

Last edited by coolstuff (2010-05-19 18:43:35)

Offline

 

#6 2010-05-20 08:20:46

fatamorgAnna
Scratcher
Registered: 2010-02-22
Posts: 13

Re: multiple choice questions PROBLEM

i think that's a quiete cool codec but then i'm going to have problems with the right answer... i found that someone used 3 lists to do something like what i want, one  questions,one answers and one called order... i will to try something with that and i'll see...

Offline

 

#7 2010-05-20 15:54:02

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: multiple choice questions PROBLEM

fatamorgAnna wrote:

i think that's a quiete cool codec but then i'm going to have problems with the right answer... i found that someone used 3 lists to do something like what i want, one  questions,one answers and one called order... i will to try something with that and i'll see...

You'll only need two lists - the order list is compensated for by the order of the two lists.

Make a list with all of your questions in it, and then make another list with all of your answers in it. Make sure that the lists correspond, for example, item 1 of the Answers list is the answer to item 1 of the Questions list. Make a variable, call it what you want. For this example, we'll call it "Variable." Then use this script instead:

Code:

When Green Flag Clicked
forever
  if <touching [sprite]>
    set [variable] to (pick random (1) to (length of [Questions]))
    ask (item (variable) of [Questions]) and wait
    if <(answer) = (item (variable) of [Answers])
      [Insert code for right answer]
    else
      [Insert code for wrong answer]
    end
  end
end

Offline

 

Board footer