Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Switching columns in Semantic differential

Hi all

I have two images I'm showing, with a semantic differential question asking how much they like one over the other.

I would like to randomise the order the images show, and then make the columns match.  Currently, we just have the ability to randomly switch the columns.  Anyone written any code that switches them based on a list?
asked Feb 11 by Marion Bronze (3,770 points)
Can you explain what you mean by "make the columns match"?

If there are only two images, shouldn't there only be two possible semantic diff configurations?  Either A on the left and B on the right, or B on the left and A on the right?
So I have two images in the header (they are too big to go in the question itself and still look nice).  They are labelled A and B.  I want to randomise them, and then randomise the columns (A is more motivating/B is more motivating) to match the order the images are showing.
This script will flip the left and right labels only if the first item of "list1" is 2:

    var flip = [% ListValue(list1, 1) %] == 2;
    if (flip) {
        var temp = $('#[% QuestionName() %]_div .left_label_cell').text();
        $('#[% QuestionName() %]_div .left_label_cell').text($('#[% QuestionName() %]_div .right_label_cell').text());
        $('#[% QuestionName() %]_div .right_label_cell').text(temp);

You'll need to bear in mind that the responses are still recorded as if the labels had not been flipped.
No worries - I'll reverse the options or not based on the first item in the list.  Thanks a heap.

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.