Reflect Multiple Choices in Question Text

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
rksraajput
Posts: 8
Joined: May 24th, 2022, 3:29 pm

Reflect Multiple Choices in Question Text

Post 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.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Reflect Multiple Choices in Question Text

Post 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;
rksraajput
Posts: 8
Joined: May 24th, 2022, 3:29 pm

Re: Reflect Multiple Choices in Question Text

Post by rksraajput »

Thank you sir.
Post Reply