Multiple Choice Options: Fixing parts of an option | XM Community
Skip to main content

Hi everyone,

I need to create a multiple choice question (or similar), wherein the 5 statements are randomized but some text (or image) is always fixed to the 4th choice position (X).

Example:

A question asking to select one statement below:

                          Statement A (randomized)

                          Statement B (randomized)

                          Statement C (randomized)

X (Fixed on 4) Statement D (randomized)

                          Statement E (randomized)

 

I am not sure if I can use Java or other coding to make this happen. Here are some initial ideas:

  1. Create a 2 columns x 5 rows table that (1) assigns one multiple choice option to each row and (2) randomizes only the second column
  2. Create “If then” rules on randomization, where the subset statements for the 4th position is 1 of 5 statements that always include the fixed text (e.g., X Statement A - X Statement E) and then the subset statements for the other 4 options always excludes the one statement  selected in position 4 (with randomization on the remaining statements).
  3. Create a side by side question with two columns of statements (randomize one column of statements and fix the other column containing X in position 4). 

Are any of these possible OR is there an easier solution?  I am trying to avoid creating dozens of blocks to get this done... 

You can simply apply fix display randomization using advance choice randomization. Refer Fixed Display Order in below link to achieve this.

 

Choice Randomization


Thanks for responding. It does not answer my question, but it will be useful when I don’t need both fixed and randomization in the same statement (one part of the statement is fixed and one part is randomized). 


But your question say. You want to fix one postion and want to randamize remaining 4. So you can use advance randomization and except 4th postion statement you can move other statements as randomization. 

Thanks for responding. It does not answer my question, but it will be useful when I don’t need both fixed and randomization in the same statement (one part of the statement is fixed and one part is randomized). 

 

I still don't understand "(one part of the statement is fixed and one part is randomized). ". Can you please provide real time example that what you are looking for.

 

Is it something like you have total 10 options and you want to show only 5 options and all 5 will randomize. If option 6 will appear in those 5 option that option will always appear at 4th position. It you problem statement like that?


Thanks for your continued help. I want 5 randomized statements for 5 choice options. Wherein the 4th position option also includes something fixed.

Imagine a question asking your favourite type of cheese. Then the choice options are: mozzarella, cheddar, gouda, Swiss, and havarti. I want all 5 cheese options randomized but, for example, I also want a “Certified Organic” label to always show up on the 4th choice option (regardless of which cheese was randomized to that spot). Does that make sense?

 

 


I'm sure you must be using one question per page. If yes, then you will need to apply js and can append this text using .after("Certified Organic") function of jquery.

 

Try this.

jQuery(".ChoiceStructure li:eq(3) .LabelWrapper span").after("  Certified Organic");

 

Simple paste this under addOnReady() function in javascript notepad of your question.

 


Yes, perfect! Can you show me the js to also make Certified Organic show up in red?

Thank you so much!


Then you can append html and css under after() function.

 

jQuery(".ChoiceStructure li:eq(3) .LabelWrapper span").after("<span style='color:red;'>&nbsp; Certified Organic</span>");


Leave a Reply