Commit 3cf91d0d by Иван Кубота

category pass through

parent 30cec291
Pipeline #536 canceled with stage
...@@ -67,6 +67,7 @@ data = {tags, connections, more:[]}; ...@@ -67,6 +67,7 @@ data = {tags, connections, more:[]};
postProcess: (a) => { postProcess: (a) => {
a.answers = []; a.answers = [];
a.multiple = a.multiple === 'checkbox'; a.multiple = a.multiple === 'checkbox';
a.category = 2;
}, },
index: 'qID' index: 'qID'
}); });
...@@ -148,7 +149,7 @@ data = {tags, connections, more:[]}; ...@@ -148,7 +149,7 @@ data = {tags, connections, more:[]};
title: String, title: String,
image: String, image: String,
multiple: String, multiple: String,
category: String, category: Number,
answer_type: String answer_type: String
}, },
postProcess: (a) => { postProcess: (a) => {
......
...@@ -63,9 +63,10 @@ const standardGenerator = function(random) { ...@@ -63,9 +63,10 @@ const standardGenerator = function(random) {
q.answers.forEach( q.answers.forEach(
a => a =>
log.push((a.correct?'+':' ')+` > ${a.title}`)); log.push((a.correct?'+':' ')+` > ${a.title}`));
return { return {
type: q.multiple ? 'checkbox': 'radio', type: q.multiple ? 'checkbox': 'radio',
categoryId: 2, categoryId: q.category,
productId: q.cardInfoID, productId: q.cardInfoID,
question: textFormat(q.title), question: textFormat(q.title),
answers: shuffle(q.answers.map(a => answers: shuffle(q.answers.map(a =>
......
Markdown is supported
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