Jump to content

Pass randomized array to other users


jandrews3

Recommended Posts

I want the quiz questions a teacher loads to be randomized so that each time the teacher gives it (different class, different day, whatever …) the order of questions will be randomized. I'm loading the data into an array and then shuffling it. Problem solved. BUT … students on their smart devices need to load the same quiz with the same question order.

 

I can solve this by:

- teacher stores question and answer data and order temporarily in a dB table

- students load that information

- problem solved

 

But I was hoping to do this without using a table. Is there a way to pass a randomized array from the teacher to the students without going through a dB table? Thanks.

 

 

Link to comment
Share on other sites

I don't think so. HTTP is stateless and you need to store the order someplace. The only other solution I can think of is to use an old pseudo random number generator that does not automatically seed and creates the same sequence if given the same seed and then have the teacher distribute the seed to the students. Hardly seems worth it to me, easier just to store the sequence. Also, storing it allows the teacher to have a copy of the questions in the correct order when reviewing it with students, etc. even if she reused the test.

Link to comment
Share on other sites

It would be best to use a db for this, but you can always save a questionnaire to a file and serve that to the users. You could even store a serialized array or whatever you want to do, but personally I'd probably save it as a PDF and serve that to the students as it's more of a universal format.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.