Displaying 1 result from an estimated 1 matches for "answer_list".
2010 Aug 31
6
ajax and partials
...a question, answers,
and responses to the answers. In the model have the following method
to shuffle the answer –annotation(response) pairs so they don’t look the
same every time they are viewed.
Question.rb model
def set_format_for_presentation
# Create array and shuffle incorrects.
answer_list = [
[incorrect_ans_1, incorrect_anno_1],
[incorrect_ans_2, incorrect_anno_2],
[incorrect_ans_3, incorrect_anno_3],
[incorrect_ans_4, incorrect_anno_4],
[incorrect_ans_5, incorrect_anno_5],
[incorrect_ans_6, incorrect_anno_6]
].shuffle
# Rando...