This article applies to:
E-Prime 3.0
E-Prime 2.0
Detail
This sample demonstrates how to display multiple choice options in a randomized order.
Abstract
This sample experiment presents a series of multiple choice questions in which the order of possible answers is listed in a randomized order. Because the order of possible answers is randomized, the sample also keeps track of which option (number) is the correct answer.
E-Prime 3.0
The TrialList contains Attributes holding the question, the correct answer, 4 Attributes that will be used for each possible answer and 4 more Attributes to designate each option as a correct option or incorrect option. For each question (row) a Nested List is created and contains the 4 possible answers to the question. These Nested Lists are set to Random Selection so that the values end up displayed in a random order. For the Attributes, Option1-4, Colon Syntax is used to sample different Attribute values of the randomized Nested List for each option.
At the beginning of TrialProc, Inline script is used to determine which numbered option contains the correct answer for each trial. A global counter variable (defined in User Script) is used to enumerate through the Attributes, Option1-4. The value of each Option Attribute is compared to the Correct Answer. If they match, the Option#Correct Attribute is set to Yes. In the Question Slide's SlideChoice sub-object properties, the Label column specifies Attribute references so that the options are listed on the SlideChoice sub-object. The IncludeACC column contains Attribute references to the Option#Correct Attributes. Include ACC can be thought of in terms of "Is this choice correct?" where the value of each row resolves to Yes or No. In this sample, they are all set to No by default in the TrialList but the Inline script at the beginning of the TrialProc changes one of the Option#Correct Attributes to Yes based on which option contains the correct answer so that the question can be scored properly. The question is then presented followed by feedback.
E-Prime 2.0
The TrialList contains Attributes holding the question and the correct answer, as well as Attributes that will be used for each possible answer. For each question (row) a Nested List is created and contains the 4 possible answers to the question. These Nested Lists are set to Random Selection so that the values end up displayed in a random order. For the Attributes, Option1-4, Colon Syntax is used to sample different Attribute values of the randomized Nested List for each option.
At the beginning of TrialProc, Inline script is used to determine which numbered option contains the correct answer for each trial. A global counter variable (defined in User Script) is used to enumerate through the Attributes, Option1-4. The value of each Attribute is compared to the Correct Answer. If they match, that index is logged as the correct option number. The question is then presented followed by feedback.
See Also:
Comments
0 comments
Please sign in to leave a comment.