Skip to content
Snippets Groups Projects
Commit a9ddc31e authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Cast successfulFreeTextAnswer to boolean

`successfulFreeTextAnswer` can be `null` for old documents which causes
problems for the backend which expects a boolean value as part of the
key of `skill_question/count_all_answers_by_question`.
parent 06791668
No related merge requests found
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
"reduce": "_sum" "reduce": "_sum"
}, },
"count_all_answers_by_question": { "count_all_answers_by_question": {
"map": "function(doc) { if (doc.type == 'skill_question_answer') { emit([doc.questionId, doc.answerText, doc.answerSubject, doc.successfulFreeTextAnswer], 1); }}", "map": "function(doc) { if (doc.type == 'skill_question_answer') { emit([doc.questionId, doc.answerText, doc.answerSubject, !!doc.successfulFreeTextAnswer], 1); }}",
"reduce": "_sum" "reduce": "_sum"
}, },
"count_total_answers_by_question_and_piround": { "count_total_answers_by_question_and_piround": {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment