Question T1806
Visible to All Users

Calculation issue- Matrix single choise

created 6 years ago

Hi Serge/Andrew,

I have posted ticket before as well but did not get the solution.

So now I am checking and exploring controls one by one, so I took Matrix single choice control and applied scores values but I need specific code condition to calculate the rows and columns values, below is my json :

{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "matrix",
"name": "question1",
"title": "Single choise",
"isRequired": true,
"id": "sq_148",
"columns": [
{
"value": "text 1",
"score": 1
},
{
"value": "text 2",
"score": 2
},
{
"value": "text 3",
"score": 3
}
],
"rows": [
{
"value": "First",
"score": 5
},
{
"value": "Second",
"score": 10
}
]
}
]
}
]
}

And the code I am using for calculation is, you can get using this plunker example, just put the json in same example and check :

https://plnkr.co/edit/2U84N9mga87HNlTs2HeT?p=preview

After that I need to check multiple choice matrix control, so please help me with this.

I hope you can understand my urgency here, waiting for your reply.

Thanks

Show previous comments (9)

    Hello,

    Right now I'm working on the general solution for the https://surveyjs.answerdesk.io/ticket/details/t1778 ticket. I hope it will be completed today and you'll get a new release with a suitable solution.

    Thanks, Serge
    SurveyJS Team

    KC KC
    Keneth Carunia 3 years ago

      Hello, how to calculate matrix single choice score ?

        Hello,

        Please check this thread - https://surveyjs.answerdesk.io/ticket/details/t1778

        As I wrote earlier, all necessary code for calculating the overall survey score for all question types can be found here - https://github.com/surveyjs/surveyjs/blob/master/tests/surveytests.ts#L6240-L6540

        Thanks, Serge
        SurveyJS Team