I am building a multiply choice quiz and need a bit of help.
I have a list of 30 questions and a list of 30 lists of answers (each question has 3 answers). I can call the questions in the order that they are listed, and the correct answer list, but, I wanted to randomise the questions and correct answer set which appear, but can only randomise the question and not the answers, therefore, the question is randomised, but the answers stay at the same order of the original answers list and don't match the randomised question.
How do match the output of the question randomiser to the answer list selection so they match?
I have enclosed a screenshot of the question/answer generator block.
If anyone can help, I would be very grateful!
instead of
set global index to get global index + 1
use the pick a random item block http://appinventor.mit. edu/explore/ai2/support/ blocks/lists.html# pickrandomitem
set global index to pick a random item listQ
pick a random item
Picks an item at random from the list.
This isn't complete.
Your instructions would only pick one item. "Picks an item at random from the list." I need the same random process to correspond to two lists.
Do you understand?
I did carry out your instructions, and i got a runtime error: The operation pick random item cannot accept the arguments: 0
yes, sorry, my answer was wrong...
you have to use the random integer block to get a random index, see also this snippet
That does help a bit.
There lots of examples on this forum of people giving advice via actual explanations and examples of exactly what needs to be done specific to their issue, is there any chance I could get one if those please.
I know I need to use a random interger block and I know I'm working with lists and sub lists, what I need to know is, how to populate the random index list with paralel random choices across two lists
There lots of examples on this forum of people giving advice via actual explanations and examples of exactly what needs to be done specific to their issue, is there any chance I could get one if those please.
I know I need to use a random interger block and I know I'm working with lists and sub lists, what I need to know is, how to populate the random index list with paralel random choices across two lists
well, if you have a random index, you can select the corresponding questions from the question list and the corresponding answers from the answers list
set global index to random integer from 1 to length of list get global listQ
just try my suggestion and in case you still have problems, it would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
댓글 없음:
댓글 쓰기