Commit f468f888 by Иван Кубота

output feature

parent 22f34d91
Pipeline #521 canceled with stage
...@@ -11,7 +11,8 @@ const options = yargs ...@@ -11,7 +11,8 @@ const options = yargs
.option("m", { alias: "multiple", describe: "multiple answers", type: "boolean"}) .option("m", { alias: "multiple", describe: "multiple answers", type: "boolean"})
.option("p", { alias: "photo", describe: "quiz with photo", type: "boolean"}) .option("p", { alias: "photo", describe: "quiz with photo", type: "boolean"})
.option("s", { alias: "seed", describe: "random seed", type: "string"}) .option("s", { alias: "seed", describe: "random seed", type: "string"})
.option("v", { alias: "verbose", describe: "print log", type: "string"}) .option("o", { alias: "output", describe: "file for output", type: "string"})
.option("v", { alias: "verbose", describe: "print log", type: "boolean"})
.option("n", { alias: "nolog", describe: "no text log in object", type: "boolean"}) .option("n", { alias: "nolog", describe: "no text log in object", type: "boolean"})
.argv; .argv;
...@@ -70,6 +71,8 @@ data.after = function() { ...@@ -70,6 +71,8 @@ data.after = function() {
delete result.log; delete result.log;
console.log('--- START ---\n\n'+JSON.stringify(result,null,2)+'\n\n--- END ---') console.log('--- START ---\n\n'+JSON.stringify(result,null,2)+'\n\n--- END ---')
} }
if(options.output)
fs.writeFileSync(options.output, JSON.stringify(result,null,2))
}; };
......
{
"question": "В какой из продуктов входят данные ингредиенты: томаты сушеные, перец сладкий сушеный, масло подсолнечное нерафинированное, майоран сушеный",
"answers": [
{
"correct": false,
"text": "Паштет мясной запеченный"
},
{
"correct": true,
"text": "Паштет из тофу «По-испански»"
},
{
"correct": false,
"text": "Паштет из печени кролика с шампиньонами"
},
{
"correct": false,
"text": "Риет из горбуши с миндалем"
},
{
"correct": false,
"text": "Паштет мясной с печенью индейки и грушей"
}
],
"log": [
"Random seed: m1vuhh",
"Quiz generate radio „Product contains 4 components“",
"Have >= 4 components: 51",
"Clusters that have >= 1 similar tags: 7",
"Used cluster tags: Паштеты, холодцы",
"Base products:",
" > Паштет из тофу «По-испански»",
" > Риет из горбуши с миндалем",
" > Паштет из печени кролика с шампиньонами",
" > Паштет мясной с печенью индейки и грушей",
" > Паштет мясной запеченный",
"",
"Product „Паштет из тофу «По-испански»“ have >= 4 uniq components (7):",
" > «сыр» тофу",
"+ > масло подсолнечное нерафинированное",
" > масло оливковое нерафинированное",
"+ > перец сладкий сушеный",
"+ > томаты сушеные",
" > зеленый базилик сушеный",
"+ > майоран сушеный"
],
"type": "radio",
"image": "",
"category": 1
}
\ No newline at end of file
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