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

#1 2009-09-24 18:29:01

legendzkillar
Scratcher
Registered: 2009-09-24
Posts: 15

Need Immediate HELP!!!!!!!!!!

Ok I'm suppose to make a 10 question quiz. However the questions have to appear in a random order and after the quiz, their score and percentages are shown. Also, if they get a question wrong the right answer is explained. Please reply back asap on how to do this. If you can't help on all, then the most important thing would be to explain how to have 10 questions appear in a random order without any repeating any.

Offline

 

#2 2009-09-24 19:54:14

greenflash
Scratcher
Registered: 2009-05-27
Posts: 1000+

Re: Need Immediate HELP!!!!!!!!!!

the easiest way to do is to have a list that "reads off" the questions in a random order. Have the list randomize at the beggining of the project by using the script:

When green flag clicked
Add [Question 1] at [pick random 1-10] of [list]
Add [Question 2] at [pick random 1-10] of [list]
Add [Question 3] at [pick random 1-10] of [list]
Add [Question 4] at [pick random 1-10] of [list]
Add [Question 5] at [pick random 1-10] of [list]
Add [Question 6] at [pick random 1-10] of [list]
Add [Question 7] at [pick random 1-10] of [list]
Add [Question 8] at [pick random 1-10] of [list]
Add [Question 9] at [pick random 1-10] of [list]
Add [Question 10] at [pick random 1-10] of [list]

When asking a question use:

when i receive (first question)
Ask [item (1) of (list)]
If (answer= correct answer)
    Say [Good Job!]
    Broadcast [second question]
Else
    Say [Sorry, the correct answer is.... (insert correct explanation here)
    Broadcast [second question]

I hope that helps!  big_smile


http://i48.tinypic.com/2wrkirk.pnghttp://i46.tinypic.com/6r5zk7.pnghttp://i45.tinypic.com/2vtxr1t.png

Offline

 

#3 2009-09-25 09:49:49

legendzkillar
Scratcher
Registered: 2009-09-24
Posts: 15

Re: Need Immediate HELP!!!!!!!!!!

I don't really understand this. What do you mean by item 1. Some of the codes don't look like they could be done in scratch.

Offline

 

#4 2009-09-25 17:11:54

Digimath
Scratcher
Registered: 2007-07-07
Posts: 100+

Re: Need Immediate HELP!!!!!!!!!!

legendzkillar wrote:

...  If you can't help on all, then the most important thing would be to explain how to have 10 questions appear in a random order without any repeating any.

Here’s something you could try for making your questions random and non-repeating.

Say you made a list called questions with 10 items, a variable called index, and another variable called question_temp.

Set the variable index to a random number between 1 and 9
Set the variable question_temp to item "index" of questions.
Now delete item "index’ of questions.
Now add question_temp to questions.

If you put this in a repeat block and repeat it 10 times your list of questions ought to be fairly well shuffled.

Its like shuffling a deck of cards by repeatedly picking a card out of the middle and moving it to the bottom of the deck.


I've updated my text adventure game.
Colossal Cave 150http://scratch.mit.edu/static/projects/Digimath/3003787_sm.png

Offline

 

Board footer