Commit 2e638366 by Иван Кубота

do not group components and pictures by test categories

parent d107ab3a
Pipeline #569 failed with stage
......@@ -177,6 +177,7 @@ const qB = {
tags,
minMatch
}){
tags = tags.filter(t=>t.type_id===1);
if(minMatch === void 0){
minMatch = tags.length;
}
......
......@@ -65,7 +65,7 @@ const standardGenerator = function(random) {
q.answers.forEach(
a =>
log.push((a.correct?'+':' ')+` > ${a.title}`));
debugger
//debugger
return {
type: q.multiple ? 'checkbox': 'radio',
categoryId: q.category_id,
......
......@@ -39,8 +39,12 @@ var ctxCtor = new Function('',body);
var ctx;
var initCtx = function() {
let ctxready = ctx && ctx.ready,
ctxr = ctx && ctx._r;
ctx = ctxCtor();
ctx.ready = new Promise((r,j)=>{
ctx._r = ctxr;
ctx.ready = ctxready || new Promise((r,j)=>{
ctx._r = r;
});
ctx.setData = function(dataSet) {
......@@ -48,7 +52,7 @@ var initCtx = function() {
countStdQ = Object.values(dataSet.standardQuestions).length;
//console.log(ctx.dP)
data = dataSet
ctx._r();
};
};
const normalizeText = function(text) {
......@@ -65,7 +69,9 @@ data.after = function(inComeData, skipInit){
}
ctx.setData(theData=inComeData);
standardQuestions = inComeData.standardQuestions;
firstRequest();
firstRequest(true);
//ctx._r();
}
};
......@@ -100,6 +106,7 @@ const readCSV = async function(scope) {
};
let afterLoaded = async function(infoHash) {
ctx._r();
return;// everything imported
let categoryID = 5;
console.log('Importing category:', categoryID);
......@@ -284,6 +291,7 @@ let inc = 1;
}*/
}
}
......@@ -320,7 +328,7 @@ module.exports = {
if( error ) throw new Error( error );
var s = data,
l = JSON.parse( response.body );
console.log('Request: category loaded');
var options = {
'method': 'GET',
......@@ -330,7 +338,7 @@ module.exports = {
request( options, function( error, response ){
if( error ) throw new Error( error );
var tags = JSON.parse( response.body );
console.log('Request: tag loaded');
var options = {
'method': 'GET',
'url': 'https://api.new.local.vkusvill.testin.ru/api/admin/question/',
......@@ -339,6 +347,8 @@ module.exports = {
request( options, function( error, response ){
if( error ) throw new Error( error );
var questions = JSON.parse( response.body );
console.log('Request: question loaded');
var qCardHash = {}, infoHash = {};
questions.forEach(function(q) {
......
......@@ -154,7 +154,7 @@ ${opt.required?'<span class="api-option-required">Required</span>': '<span class
}catch(e){
}
}, 10000);
}, 30000);
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