Trying to get numerical choices from a question and to do math calculations

ChristophChristoph 2 hours south of Brisbane, AustraliaCommunity Member Qubie ✭

Trying to get numerical choices from a question and to do math calculations

After help from Shahi I got to the following code:

This code concatenates the numerical answers, i.e. the choice may be "A lot", "Some" and "None" and I get '1', '2' or '3', depending on the choice of the user.
However, if they choose the first (1) and third (3) option for the first two questions, the sum is not 4, but 13. Could you help?
If this goes beyond community support, I would be happy to pay for somebody to help me.

Tagged:

Best Answer

  • Mohammedali_Rajapakar_UgamMohammedali_Rajapakar_Ugam Mumbai - India Wizard ✭✭✭✭✭
    edited November 2018 Accepted Answer

    Can you try like below for first 2 variables...

    var pf1 = parseInt("${q://QID13/SelectedAnswerRecode/1}",10);
    var pf2 = parseInt("${q://QID13/SelectedAnswerRecode/2}",10);
    var x = (pf1+pf2);

Answers

Sign In to Comment