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

#1 2010-07-22 15:07:00

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

School project help

Im working on a project for school and im making a quiz type animation i have 3 lists
answer,questions,responses it already asks a random question and stores the answer but i need it to be able to tell what question is asked and what answer is put in to know what response to use based on the question and answer

Offline

 

#2 2010-07-22 15:16:39

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: School project help

Try a script like this inside a "repeat" or "forever" loop  smile

http://i32.tinypic.com/23o6rq.gif


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#3 2010-07-22 15:22:34

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

Script like what??

Offline

 

#4 2010-07-22 15:27:33

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: School project help

There was an image of some Scratch blocks in my last post  smile  This one:

http://i32.tinypic.com/23o6rq.gif


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#5 2010-07-22 15:33:59

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

hey arent displaying and if i try to open the image by its self it has this error

The requested URL could not be retrieved

While trying to retrieve the URL: N/A

The following error was encountered:

Connection Lifetime Expired
Footprint has terminated the request because it has exceeded the maximum connection lifetime.

Footprint 4.6/FPMCP
Generated Thu, 22 Jul 2010 19:28:33 GMT by 205.128.91.126 (Footprint 4.6/FPMCP)

Offline

 

#6 2010-07-22 15:37:05

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: School project help

Hmm... that's odd... I'll try uploading it in a project for you  smile

Here's the project: http://scratch.mit.edu/projects/blueshadow/1206911

That should work now  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#7 2010-07-22 15:44:02

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

ok ill try this out thank you very much for the help and im thinking it wont show images cuz im in class right now and they block just about everything on there network

Offline

 

#8 2010-07-22 16:57:21

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

ok that was almost perfect this is what i have so far http://koenfam.co.cc/update.sb


I need it to ask a question from the list
check the answer with the answer list
and respond with something out of the responses list based on a right or wrong answer

Offline

 

#9 2010-07-22 17:20:52

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: School project help

Put this in place of "Hmm... that's not right!" in Wolfie1996's script:
[blocks]item <pick random( 1 )to( length of Responses )) of Responses [/blocks]
(the "item () of Responses" and "length of Responses" are list blocks and Responses is a list)

Last edited by meowmeow55 (2010-07-22 17:23:19)


Yawn.

Offline

 

#10 2010-07-22 17:32:49

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

Re: School project help

meowmeow55 wrote:

Put this in place of "Hmm... that's not right!" in Wolfie1996's script:
[blocks]item <pick random( 1 )to( length of Responses )) of Responses [/blocks]
(the "item () of Responses" and "length of Responses" are list blocks and Responses is a list)

Actually, you can achieve the same effect with the <item (any) of responses> block.

Offline

 

#11 2010-07-22 17:49:19

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: School project help

Oh yeah, I forgot that "any" chooses a random item. (Actually, I forgot about the whole drop-down list there!  tongue )


Yawn.

Offline

 

#12 2010-07-22 18:00:45

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

this is working great so far thanks again for all the help but let me ask you this when it askes what you age is it gives a right or wrong answer is there anyway around this to say maybe store the age they put in and be able to say something like wow your getting up there or wow your a youngin or so on im really new to scratch and programming

Offline

 

#13 2010-07-22 18:15:24

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: School project help

Make a variable called "Age" that is set with this script:
[blocks]ask "What's you're age?" and wait

<set{ Age  }to( answer [/blocks]
And is used with this script:
[blocks]<if><( <{ Age  }> <>> something )>
<say[ blah blah blah ]for( some )secs>
<end>[/blocks]
Duplicate the if as many times as you want, changing the values in "something" and "blah blah blah" each time. You can also change the "greater than" to a "less than" on some duplicates.


Yawn.

Offline

 

#14 2010-07-22 18:42:14

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

sweet thank you guys very much

Offline

 

#15 2010-07-23 17:04:53

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

ok i think this is the last question when you run the code it picks the question at random but some times it will pick the same one 2 or 3 times any fix for this? or should i just add more questions to the list

Offline

 

#16 2010-07-23 18:50:12

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

Re: School project help

adamk8875 wrote:

ok i think this is the last question when you run the code it picks the question at random but some times it will pick the same one 2 or 3 times any fix for this? or should i just add more questions to the list

Adding more questions to the list will reduce the frequency at which the questions will get chosen, but you would need to rework your project a bit to completely eliminate the possibility. Do you want me to show you how to do that? You should be fine as is, though.

Offline

 

#17 2010-07-23 19:04:53

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

no i think ill just add more questions i dont want to re write it right now

Offline

 

#18 2010-07-23 19:28:09

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

thanks again

Offline

 

#19 2010-07-23 19:32:25

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

Re: School project help

No problem! Just to clarify, you would not have to rewrite the whole project, just change the way it works a bit... It really wouldn't take all that much effort.

Offline

 

#20 2010-07-23 19:39:08

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

ok my teacher wants it to not repeat the questions so im gunna have to rewrite it so any help would be great

Offline

 

#21 2010-07-23 19:50:28

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

sorry to keep buggin you guys with all this i shouldnt have started making something so far over my head

Offline

 

#22 2010-07-23 20:02:16

MaxtheWeirdo
Scratcher
Registered: 2010-03-18
Posts: 500+

Re: School project help

It's okay. Just have it delete item counter of each list. That should work.


My website. Hall Crawler My Awesome OS
It's just marketing, guys! Nothing sinister!

Offline

 

#23 2010-07-23 20:11:28

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

this is what i have right now http://koenfam.co.cc/new.jpg

ok i cant post images so there is the link to the image

Offline

 

#24 2010-07-23 20:40:38

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

Re: School project help

adamk8875 wrote:

this is what i have right now http://koenfam.co.cc/new.jpg

ok i cant post images so there is the link to the image

That looks good - but it'll still repeat questions. You could do as MaxTheWierdo suggested and simply delete the item from the list, but then the project will still be lacking those questions when it restarts.

I'd suggest something like this:

Make a list called askedQuestions. Place this block just below the first "set counter to" block in the script:

Code:

add (counter) to [askedQuestions]

Before that block that I just gave you, put this in:

Code:

repeat until <not <askedQuestions contains (counter)>>
  set counter to (pick random (1) to (length of [questions]))
==

Then, just below the hat block of "When I recieve [quiz]," put this script:

Code:

delete (all) of [askedQuestions]

That should work like a charm; if it doesn't, post here and I'll help you out.

Offline

 

#25 2010-07-23 21:10:14

adamk8875
New Scratcher
Registered: 2010-07-22
Posts: 16

Re: School project help

ok let me add this in here and ill see how it works and get back to you guys

Offline

 

Board footer