Page 2 of 2

Re: Generate CAPI questions

Posted: October 29th, 2018, 2:34 pm
by arkagwa
Dear Josh

Kindly assist i am using %NAME% where NAME is the coding variable to recall the answer of previous question for the next question so that the interviewer can read the previous answer. I have noted that in numeric answers/value sets, the next question displays number of the value set instead of the label. In this picture the value set is 11 coded as cartridges
Screenshot 2018-10-29 21.30.23.png
Screenshot 2018-10-29 21.30.23.png (21.69 KiB) Viewed 116063 times

Re: Generate CAPI questions

Posted: October 29th, 2018, 2:52 pm
by Gregory Martin
You have to assign the label in logic. One way to do it is by creating a function:
PROC GLOBAL

function string StockItem1Label()
    StockItem1Label = getlabel(STOCK_ITEM1, STOCK_ITEM1);
end;
Then use %StockItem1Label% in the CAPI text.

Re: Generate CAPI questions

Posted: October 30th, 2018, 1:22 pm
by arkagwa
Dear Josh

On the same form attached in the previous question, i have a code to check if disposed quantity is greater than stocked amount.
In case data is not available, i have a special code of 9,999=Missing.
When i am making the sum as indicated below i find error on the sum because the missing value has been included in the summation. What coding should i add to avoid it?

Example code:
totstock=STOCKED_2013 + STOCKED_2014 + STOCKED_2015 + STOCKED_2016 + STOCKED_2017 + STOCKED_2018;
totdisposal=QUANTITY_2013 + QUANTITY_2014 + QUANTITY_2015 + QUANTITY_2016 + QUANTITY_2017 + QUANTITY_2018;
If totdisposal>totstock then errmsg(7);
reenter QUANTITY_2013;
endif;

Re: Generate CAPI questions

Posted: October 31st, 2018, 2:23 am
by Gregory Martin
Take a look at this: http://www.csprousers.org/help/CSPro/se ... ement.html

You can use that functionality to change the behavior of mathematical operations so that special values (missing, notappl, default) are treated as 0 values.

Re: Generate CAPI questions

Posted: October 31st, 2018, 4:05 pm
by arkagwa
Dear Martin

Thanks for your support, works very nice

Re: Generate CAPI questions

Posted: December 13th, 2018, 3:06 am
by btri Arjun
Dear CSPro uesr

I developing a CAPI application. For this, I defined the CAPI language "ENG" = English (_VS1) and "NEP" = Nepali (_VS2). First of all I have added all CAPI question, label and code in English. After then, I added the Nepali CAPI question, label and code as well. Now, when I changed the language from Option menu, the CAPI question changed in Nepali but the label and code not changed (shows in English). I cant fond the mistake.

Thank you

With best regards
Arjun

Re: Generate CAPI questions

Posted: December 13th, 2018, 3:13 am
by Gregory Martin
See these posts:

http://www.csprousers.org/help/CSPro/de ... uages.html

http://www.csprousers.org/help/CSPro/mu ... aries.html

Instead of creating different value sets for each language, which was the only way to do this in older versions of CSPro, you will want to create a multiple language dictionary. Add "ENG" and "NEP" to the dictionary and then set the labels as appropriate. Once you do this, when you change the language, the 1) question text; 2) value sets; 3) form labels should all change.

Re: Generate CAPI questions

Posted: December 14th, 2018, 12:00 am
by btri Arjun
Dear Gregory,

Thank you for your response. Than, I tried to my label best to do this, but its not working. So, I have attached my application in this email. Please have a look in my application and suggested me what mistake I have made.

With best regards,
Arjun.

Re: Generate CAPI questions

Posted: December 17th, 2018, 8:52 am
by Gregory Martin
You need to add the multiple languages under the same value set name. For example, look at the screenshot.
languages.png
languages.png (8.63 KiB) Viewed 115776 times
Instead of having two values sets, you should only have one. Click on the language bar, change to NEP, and then modify the value labels from Yes/No -> चाहन्छु/चाहन्न. In other words, you will never have two value sets, one for English and one for Nepali, but will instead have one value set with two sets of labels, one in English and one in Nepali.