This commit is contained in:
Leifer Mendez
2022-11-05 11:24:22 +01:00
parent 0a9e14c460
commit 0a9b1907d7
4 changed files with 40 additions and 15 deletions

View File

@@ -16,21 +16,19 @@ const addAnswer = (inCtx) => (answer, options) => {
const ctxAnswer = () => {
const ref = `ans_${generateRef()}`
const options = {
...getAnswerOptions(),
keyword: {},
}
const json = [].concat(inCtx.json).concat([
{
ref,
keyword: lastCtx.ref,
answer,
options,
},
])
/**
* Se guarda en db
*/
const options = {
answer: getAnswerOptions(),
keyword: {},
}
return { ...lastCtx, ref, answer, json, options }
}