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
Hello Ankita,
Sergey is working on general solution right now. We will come back to you soon.
Thank you,
Andrew
SurveyJS Team
Hello,
I'm working on the general solution that will allow to add any property from a question or a choice item to the survey plain data result.
I've tried to check whether my solution solves the case described in this ticket.
But I'm stuck when I've compared the JSON from this question and the plunker you've provided - https://plnkr.co/edit/2U84N9mga87HNlTs2HeT?p=preview . Because they are completely different.
So I'd like to clarify some points. You've added the
score
property to the matrix rows and to the matrix columns. The question is - How do you want to calculate the score of the "question1" depending the selected columns?Thanks, Serge
SurveyJS Team
Hello Serge,
Please find the pluncker here, I have added Matrix control with scores (question name "Single Choice"). You can please check this plucker. Calculation are not working for the Matrix control.
https://plnkr.co/edit/kVyrmETHDMQohWLRWVke?p=preview
Thanks in advance.
Hello,
My question was - how do you want to calculate a score of the matrix question from the row and column scores?
Thanks, Serge
SurveyJS Team
Serge, you can better suggest how it should work as it has Score in rows and columns both side, so how we can make it calculated.
If it has score on both ends so it should calculate both side only. Kindly suggest.
Hello,
The survey JSON is:
{ "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 } ] } ] } ] }
I'll try to explain. Let's say user selects "text 1" in the first row and "text 3" in the second row. IMO the question's score should be 1 + 3 = 4. And I don't understand - how do you want to use score 5 of the "First" row and score 10 of the "Second" row. Should they be taken into account? If so then how?
Thanks, Serge
SurveyJS Team
If the case is this, can we remove score property from Rows? if yes then we can consider columns scoring only. Kindly suggest on this.
If this can be done, we can move with this. You seem right we should go with column scoring only on selecting values.
Hello,
This is your scenario and I hoped you described me how did you want to calculate scores in your application.
Thanks, Serge
SurveyJS Team
Yes Serge, can you please help me with this now?
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
Hello, how to calculate matrix single choice score ?
Hello,
Please check this thread - https://surveyjs.answerdesk.io/ticket/details/t1778
Thanks, Serge
SurveyJS Team