Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: "MicroWorlds Forum" <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: MIA, Ask an Expert: using lists to generate random questions
From: "Daniel Ajoy" <da.ajoy@xxxxxxxxx>
Date: Sun, 20 Mar 2011 11:40:46 -0500

from: Susan <sweiss@xxxxxxxxxxxxxxxxxx>
date: Sun Mar 20 06:02:02 2011
platform: Platform not specified
version: MicroWorlds Ex

My students made 5 questions with answers. They want to choose only 3 questions randomly . Each question is a separate program since the answer causes a mouse to move. How can we randomize the order of the questions.

These are all the 3 element permutations of a 5 element set:


[[1 2 3] [1 2 4] [1 2 5] [1 3 2] [1 3 4] [1 3 5] [1 4 2] [1 4 3] [1 4 5] [1 5 2] [1 5 3] [1 5 4] [2 1 3] [2 1 4] [2 1 5] [2 3 1] [2 3 4] [2 3 5] [2 4 1] [2 4 3] [2 4 5] [2 5 1] [2 5 3] [2 5 4] [3 1 2] [3 1 4] [3 1 5] [3 2 1] [3 2 4] [3 2 5] [3 4 1] [3 4 2] [3 4 5] [3 5 1] [3 5 2] [3 5 4] [4 1 2] [4 1 3] [4 1 5] [4 2 1] [4 2 3] [4 2 5] [4 3 1] [4 3 2] [4 3 5] [4 5 1] [4 5 2] [4 5 3] [5 1 2] [5 1 3] [5 1 4] [5 2 1] [5 2 3] [5 2 4] [5 3 1] [5 3 2] [5 3 4] [5 4 1] [5 4 2] [5 4 3]]

You can put that into a variable:


make "p [[1 2 3] [1 2 4] [1 2 5] [1 3 2] [1 3 4] [1 3 5] [1 4 2] [1 4 3] [1 4 5] [1 5 2] [1 5 3] [1 5 4] [2 1 3] [2 1 4] [2 1 5] [2 3 1] [2 3 4] [2 3 5] [2 4 1] [2 4 3] [2 4 5] [2 5 1] [2 5 3] [2 5 4] [3 1 2] [3 1 4] [3 1 5] [3 2 1] [3 2 4] [3 2 5] [3 4 1] [3 4 2] [3 4 5] [3 5 1] [3 5 2] [3 5 4] [4 1 2] [4 1 3] [4 1 5] [4 2 1] [4 2 3] [4 2 5] [4 3 1] [4 3 2] [4 3 5] [4 5 1] [4 5 2] [4 5 3] [5 1 2] [5 1 3] [5 1 4] [5 2 1] [5 2 3] [5 2 4] [5 3 1] [5 3 2] [5 3 4] [5 4 1] [5 4 2] [5 4 3]]

Then use "pick"

make "mythree pick :p

show :mythree
3 2 1

Then use the elements of :mythree in this way:

show item 1 :mythree
3

show item 2 :mythree
2

show item 3 :mythree
1


... The questions would have to be numerated.

Daniel
OpenWorld Learning



  • Previous by thread: MIA, Ask an Expert: using lists to generate random questions
  • Next by thread: Re: MIA, Ask an Expert: using lists to generate random questions

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008