Page 1 of 1

Reflect Multiple Choices in Question Text

Posted: March 20th, 2023, 2:50 am
by rksraajput
Hi Sir/Mam,

I have a multiple choice question 101 where Codes used for ValueSet are A to M
A = Ball,
B = Bat,
C = Wicket,
D = Gloves
.
.
.
.
L = Water
M = Field

I Want to reflect the selection in Question 102 question text
like
102 From where you bought __(blank)___?
In blank reflect A to G only no matter HKLM is also selected.

Re: Reflect Multiple Choices in Question Text

Posted: March 20th, 2023, 8:02 am
by Gregory Martin
You can do something like this:
string codes_to_check = "ABCDEFG";
string selected_labels;

do numeric ctr = 1 while ctr <= length(codes_to_check)

    if ischecked(codes_to_check[ctr:1], Q101) then
       
        if
selected_labels <> "" then
           
selected_labels = selected_labels + ", ";
        endif;

        selected_labels = selected_labels + getlabel(Q101, codes_to_check[ctr:1]);

    endif;

enddo;

Re: Reflect Multiple Choices in Question Text

Posted: March 26th, 2023, 4:05 am
by rksraajput
Thank you sir.