Closed brickpop closed 2 years ago
I don't think this is doable as you propose. For example, given one question with two choices:
choices: [{ title: { default: "AA" }, value: 0 }, { title: { default: "BB" }, value: 1 }]
Then, no matter what weights "AA" is receiving, its sum would always be 0
, as everything would be multipled by 0
. Same for BB (always by 1), same for CC (always by 2), etc.
IMO the results matrix is interpreted like:
results: [
[ 0-points-AAA, 1-points-AAA, 2-points-AAA ],
[ 0-points-BBB, 1-points-BBB, 2-points-BBB ]
]
As I see it, the value
is only relevant on the results for single choice votes, where you copy the value in the vote.
For multiple choice, my understanding is that you use the value
when voting, and take it as the index on the vote array.
ah, good point! in that case everything looks good to me.
The current PR adds support for aggregating multiple choice results.
getDigestedResults()
into the rawgetResults()
and the aggregatorsdigestSingleChoiceResults()
digestSingleQuestionResults()
that the UI can use