Show image on roster

Discussions about CSEntry
Post Reply
Arjun Brti
Posts: 63
Joined: October 15th, 2020, 3:40 am
Location: Nepal

Show image on roster

Post by Arjun Brti »

Dear team

In a survey, there are 50 medical equipment and its uses on the roster format. I want to show the image of each item in the capi question. How to set the image for each occurrence.

Thank you.

Regards
Brti
aaronw
Posts: 571
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Show image on roster

Post by aaronw »

Each field's CAPI question text includes the ability to add conditions. You could add a condition for each of the 50 occurrences like this:
capi-condition.PNG
Then select each condition and add the image for that occurrence.
You do not have the required permissions to view the files attached to this post.
Gregory Martin
Posts: 1948
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Show image on roster

Post by Gregory Martin »

Another option, if you are comfortable editing the question text HTML, is to call a function that gives you the name of the image. That may be easier to maintain than keeping track of 50 separate occurrences of question text. The HTML may be something like:

Code: Select all

<p><img src="~~GetImageFilename()~~"></p>
And then this, as an example, alternates between providing two images:
function string GetImageFilename()

    if systime() % 2 = 0 then
        exit
"image1.jpg";
    else
        exit
"image2.jpg";
    endif;
   
end;
Post Reply