Commit 96505d5c by Иван Кубота

change probabilities, fix timeout

parent 38c3d9df
Pipeline #547 canceled with stage
......@@ -444,7 +444,7 @@ data = {tags:[], connections:[], more:[], standardQuestions: {}, standardAnswers
var tid = 1, cid = 1;
var tagsHash = {};
data.more = data.more.concat([
{p: '1cards.csv', i: '1components.csv'},
{p: '1cards.csv', i: '1components.csv'},
{q: '2questions.csv', a: '2answers.csv', c: '2cards.csv'},
{q: '3questions.csv', a: '3answers.csv', c: '3cards.csv'},
{q: '4questions.csv', a: '4answers.csv', c: '4cards.csv'}
......@@ -629,6 +629,8 @@ data = {tags:[], connections:[], more:[], standardQuestions: {}, standardAnswers
}
}
fs.writeFileSync('./data/tmp/full.json', JSON.stringify(data, null, 2))
data.after && data.after(data);
})();
......
let ComponentsOfProduct;
quizTypes.checkbox = [ ComponentsOfProduct = {
probability: 10,
probability: 0,//10,
correct: {min: 2, max: 4},
wrong: {min: 1, max: 4},
answers: {min: 3, max: 6},
......@@ -41,7 +41,7 @@ quizTypes.checkbox = [ ComponentsOfProduct = {
}
},
Object.assign({}, ComponentsOfProduct, {
probability: 4,
probability: 0,// 4,
correct: {min: 2, max: 4},
wrong: {min: 2, max: 4},
answers: {min: 4, max: 8},
......@@ -64,7 +64,7 @@ quizTypes.checkbox = [ ComponentsOfProduct = {
}
}),
{
probability: 10,
probability: 0,//10,
correct: {min: 2, max: 4},
wrong: {min: 1, max: 3},
answers: {min: 4, max: 6},
......
quizTypes.checkboxPhoto = [
{
questionMinComponentsCount: 2,
probability: 8,
probability: 0,//8,
type: 'What components are in it',
answers: {min: 3, max: 6},
......@@ -33,7 +33,7 @@ quizTypes.checkboxPhoto = [
},
{
questionMinComponentsCount: 2,
probability: 3,
probability: 0,//3,
type: 'What components are NOT in it',
answers: {min: 3, max: 6},
......
......@@ -17,7 +17,7 @@ quizTypes.radio = [
},
{
questionCmpAmount: 2,
probability: 8,
probability: 0,//8,
type: 'Component in product',
products: {from: 4, to: 6},
minSimilarTags: 1,
......@@ -83,7 +83,7 @@ quizTypes.radio = [
}
},
{
probability: 10,
probability: 0,//10,
answers: {from: 3, to: 6},
question: ({product})=> `Выберите лишний ингредиент, НЕ входящий в продукт "${product.title}"`,
......
......@@ -33,7 +33,7 @@ quizTypes.radioPhoto = [
},
{
questionMinComponentsCount: 2,
probability: 3,
probability: 0,//3,
type: 'What component is in it',
answers: {min: 4, max: 6},
......
......@@ -94,7 +94,11 @@ ${opt.required?'<span class="api-option-required">Required</span>': '<span class
for(let key in apis){
let api = apis[key], args;
router[api.method.toLowerCase()](key, async function(req, res) {
let timeout = setTimeout(()=>res.end('Timeout'), 10000);
let timeout = setTimeout(()=>{
res.status(408);
res.end('{"error": true, "data": "Timeout"}');
res.connection.destroy();
}, 10000);
try{
args = parseArgs( req, res, api.options );
}catch(e){
......
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