Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Adding word to implicit association task workaround

  • kathrynedworthy
  • kathrynedworthy's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 4 months ago - 2 years 4 months ago #231907 by kathrynedworthy
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.28.24
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi, 

I'm using the IAT work around tested on version 2.50 and working with the demo survey (Demo - IAT Concept (LS version 2.50)) ( www.limesurvey.org/manual/Workarounds:_M....29_in_LimeSurvey.3F )

I am wondering how to add a word (the same word for all people and trials) to appear on either the left or the right of the screen for different trials as below. 

 

Is this something I can do?

Many thanks in advance
Last edit: 2 years 4 months ago by kathrynedworthy. Reason: photo added

Please Log in to join the conversation.

  • kathrynedworthy
  • kathrynedworthy's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 4 months ago - 2 years 4 months ago #231908 by kathrynedworthy
Replied by kathrynedworthy on topic Adding word to implicit association task workaround
Apologies, the picture from above is attached
Last edit: 2 years 4 months ago by kathrynedworthy.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 4 months ago #231909 by Joffm
Hi,
as "black" and "white" are constant and your "My Word" as well,
I'd just add it to the left label like
black<br/><br/>My Word||white||Drücke E oder I
 

Make sure that this line looks like this in your script?
Code:
        // Insert IAT display
        var iatTexts = $(thisQuestionHelp).html().split('||');
If there is .text().split..., change it to .html().split...

I remember that Tony initially used "text()" for some good reasons, and I changed it to "html()" to be able to have items in different colors.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 4 months ago #231915 by tpartner

I remember that Tony initially used "text()" for some good reasons, and I changed it to "html()" to be able to have items in different colors.

No good reason. :)

Your change is a good idea.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 4 months ago #231916 by Joffm
@tony,
but - some time ago - when I changed it to "html" (because one of our users desired colored items) you explained why you used the "text".
Or is Mr. Alzheimer sneaking around my chair?

No, he was not. I found it.

By the way the reason that I used .text() in the workaround (and question theme) was to avoid problems with HTML changes in future versions.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 4 months ago #231926 by tpartner
Yeah, I think that was a general statement because at that time, with versions 2, 3 and 4, there were a lot of HTML changes made to the question structures, disabling many workarounds.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • kathrynedworthy
  • kathrynedworthy's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 4 months ago #231938 by kathrynedworthy
Replied by kathrynedworthy on topic Adding word to implicit association task workaround
Thank you so much, Joffm and tpartner.

This certainly gets the 'My word' to appear underneath the 'Black' on the left.

Do you know if there is anyway to allow this 'My Word' to switch between the left and the right side?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 4 months ago - 2 years 4 months ago #231940 by Joffm
What does this mean "to switch"?
When?
a.One respondents gets it on the left side, the other one on the right side?
b.First item left side, second item right side, and so on?

And how?
At random, or?

Case a. and at random you can do easily by using an IF-statement with a random number.
Like:
{if(randomnumber==1,"black<br /><br />My left word||white","black||white<br /><br />My right word")}||Press E or I

To align the right side add some css like
Code:
<style>
.iatRightLabel {
    text-align:right;
}
</style>

 



Other cases, no idea.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 4 months ago by Joffm.

Please Log in to join the conversation.

  • kathrynedworthy
  • kathrynedworthy's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 4 months ago #231942 by kathrynedworthy
Replied by kathrynedworthy on topic Adding word to implicit association task workaround
Thank you Joffm,

Yes, it's option B, switching sides as the trial proceeds.

As a work around I'm now thinking of adding image as a way to get this same effect.

I'm adding an image into the sub-question as usual (below) but it doesn't seem to work.

 

<img alt="" src="/upload/surveys/941186/images/Image%202.png" style="width: 300px; height: 102px;" />

However, in this script above, the image load is not coming through (this trial just shows a blank).

Am I doing something wrong?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 4 months ago #231948 by Joffm
1. Of course you can insert images.
I showed this in another thread - search the forum
 
But, what do you want to achieve by that?
How do the pictures look like?
Do you want to insert the text into the picture?

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • kathrynedworthy
  • kathrynedworthy's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 4 months ago #231956 by kathrynedworthy
Replied by kathrynedworthy on topic Adding word to implicit association task workaround
Thank you all for your help

To get images to load using the IAT workaround tested on version 2.50 the code here was tweaked from:

// Show a word
function iatShowWord() {
$('div.iatWord', thisQuestion).text($('tr.subquestion-list.unanswered:first .answertext', thisQuestion).text());
startTime = new Date();

// Show a word
function iatShowWord() {
$('div.iatWord', thisQuestion).html($('tr.subquestion-list.unanswered:first .answertext', thisQuestion).html());
startTime = new Date();

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose