...
while(var1 == var2){ action to re-randomize var1 }
If you'd like to ensure that the distractors created do not match the correct answer, offer a sequence of while loops, citing each answer to a distractor and directing a precursor variable to be re-randomized
example: in a question with correct answer = v and distractors 2-8 (d2, d3, ... d8), where the distractors are configured with m_1 among other variables
//v and distractors aren't equal
while(v == d2){
m_1 = hws_random(1000.0,1500.0,2.0,1000.0);
}
while(v == d3){
m_1 = hws_random(1000.0,1500.0,2.0,1000.0);
}
while(v == d4){
m_1 = hws_random(1000.0,1500.0,2.0,1000.0);
}
while(v == d5){
m_1 = hws_random(1000.0,1500.0,2.0,1000.0);
}
while(v == d6){
m_1 = hws_random(1000.0,1500.0,2.0,1000.0);
}
while(v == d7){
m_1 = hws_random(1000.0,1500.0,2.0,1000.0);
}
while(v == d8){
m_1 = hws_random(1000.0,1500.0,2.0,1000.0);
}
There is also an (automatic) redundancy checker built into Quest that should weed out duplicate distractors.