Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
kus-admin
Commits
2e638366
Commit
2e638366
authored
Mar 12, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not group components and pictures by test categories
parent
d107ab3a
Pipeline
#569
failed with stage
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
main.js
public/js/controller/quizBits/main.js
+1
-0
quizGenerator.js
public/js/controller/quizGenerator.js
+1
-1
generateRandom.js
src/api/generateRandom.js
+15
-5
apiMappers.js
src/apiMappers.js
+1
-1
No files found.
public/js/controller/quizBits/main.js
View file @
2e638366
...
@@ -177,6 +177,7 @@ const qB = {
...
@@ -177,6 +177,7 @@ const qB = {
tags
,
tags
,
minMatch
minMatch
}){
}){
tags
=
tags
.
filter
(
t
=>
t
.
type_id
===
1
);
if
(
minMatch
===
void
0
){
if
(
minMatch
===
void
0
){
minMatch
=
tags
.
length
;
minMatch
=
tags
.
length
;
}
}
...
...
public/js/controller/quizGenerator.js
View file @
2e638366
...
@@ -65,7 +65,7 @@ const standardGenerator = function(random) {
...
@@ -65,7 +65,7 @@ const standardGenerator = function(random) {
q
.
answers
.
forEach
(
q
.
answers
.
forEach
(
a
=>
a
=>
log
.
push
((
a
.
correct
?
'+'
:
' '
)
+
` >
${
a
.
title
}
`
));
log
.
push
((
a
.
correct
?
'+'
:
' '
)
+
` >
${
a
.
title
}
`
));
debugger
//
debugger
return
{
return
{
type
:
q
.
multiple
?
'checkbox'
:
'radio'
,
type
:
q
.
multiple
?
'checkbox'
:
'radio'
,
categoryId
:
q
.
category_id
,
categoryId
:
q
.
category_id
,
...
...
src/api/generateRandom.js
View file @
2e638366
...
@@ -39,8 +39,12 @@ var ctxCtor = new Function('',body);
...
@@ -39,8 +39,12 @@ var ctxCtor = new Function('',body);
var
ctx
;
var
ctx
;
var
initCtx
=
function
()
{
var
initCtx
=
function
()
{
let
ctxready
=
ctx
&&
ctx
.
ready
,
ctxr
=
ctx
&&
ctx
.
_r
;
ctx
=
ctxCtor
();
ctx
=
ctxCtor
();
ctx
.
ready
=
new
Promise
((
r
,
j
)
=>
{
ctx
.
_r
=
ctxr
;
ctx
.
ready
=
ctxready
||
new
Promise
((
r
,
j
)
=>
{
ctx
.
_r
=
r
;
ctx
.
_r
=
r
;
});
});
ctx
.
setData
=
function
(
dataSet
)
{
ctx
.
setData
=
function
(
dataSet
)
{
...
@@ -48,7 +52,7 @@ var initCtx = function() {
...
@@ -48,7 +52,7 @@ var initCtx = function() {
countStdQ
=
Object
.
values
(
dataSet
.
standardQuestions
).
length
;
countStdQ
=
Object
.
values
(
dataSet
.
standardQuestions
).
length
;
//console.log(ctx.dP)
//console.log(ctx.dP)
data
=
dataSet
data
=
dataSet
ctx
.
_r
();
};
};
};
};
const
normalizeText
=
function
(
text
)
{
const
normalizeText
=
function
(
text
)
{
...
@@ -65,7 +69,9 @@ data.after = function(inComeData, skipInit){
...
@@ -65,7 +69,9 @@ data.after = function(inComeData, skipInit){
}
}
ctx
.
setData
(
theData
=
inComeData
);
ctx
.
setData
(
theData
=
inComeData
);
standardQuestions
=
inComeData
.
standardQuestions
;
standardQuestions
=
inComeData
.
standardQuestions
;
firstRequest
();
firstRequest
(
true
);
//ctx._r();
}
}
};
};
...
@@ -100,6 +106,7 @@ const readCSV = async function(scope) {
...
@@ -100,6 +106,7 @@ const readCSV = async function(scope) {
};
};
let
afterLoaded
=
async
function
(
infoHash
)
{
let
afterLoaded
=
async
function
(
infoHash
)
{
ctx
.
_r
();
return
;
// everything imported
return
;
// everything imported
let
categoryID
=
5
;
let
categoryID
=
5
;
console
.
log
(
'Importing category:'
,
categoryID
);
console
.
log
(
'Importing category:'
,
categoryID
);
...
@@ -284,6 +291,7 @@ let inc = 1;
...
@@ -284,6 +291,7 @@ let inc = 1;
}*/
}*/
}
}
}
}
...
@@ -320,7 +328,7 @@ module.exports = {
...
@@ -320,7 +328,7 @@ module.exports = {
if
(
error
)
throw
new
Error
(
error
);
if
(
error
)
throw
new
Error
(
error
);
var
s
=
data
,
var
s
=
data
,
l
=
JSON
.
parse
(
response
.
body
);
l
=
JSON
.
parse
(
response
.
body
);
console
.
log
(
'Request: category loaded'
);
var
options
=
{
var
options
=
{
'method'
:
'GET'
,
'method'
:
'GET'
,
...
@@ -330,7 +338,7 @@ module.exports = {
...
@@ -330,7 +338,7 @@ module.exports = {
request
(
options
,
function
(
error
,
response
){
request
(
options
,
function
(
error
,
response
){
if
(
error
)
throw
new
Error
(
error
);
if
(
error
)
throw
new
Error
(
error
);
var
tags
=
JSON
.
parse
(
response
.
body
);
var
tags
=
JSON
.
parse
(
response
.
body
);
console
.
log
(
'Request: tag loaded'
);
var
options
=
{
var
options
=
{
'method'
:
'GET'
,
'method'
:
'GET'
,
'url'
:
'https://api.new.local.vkusvill.testin.ru/api/admin/question/'
,
'url'
:
'https://api.new.local.vkusvill.testin.ru/api/admin/question/'
,
...
@@ -339,6 +347,8 @@ module.exports = {
...
@@ -339,6 +347,8 @@ module.exports = {
request
(
options
,
function
(
error
,
response
){
request
(
options
,
function
(
error
,
response
){
if
(
error
)
throw
new
Error
(
error
);
if
(
error
)
throw
new
Error
(
error
);
var
questions
=
JSON
.
parse
(
response
.
body
);
var
questions
=
JSON
.
parse
(
response
.
body
);
console
.
log
(
'Request: question loaded'
);
var
qCardHash
=
{},
infoHash
=
{};
var
qCardHash
=
{},
infoHash
=
{};
questions
.
forEach
(
function
(
q
)
{
questions
.
forEach
(
function
(
q
)
{
...
...
src/apiMappers.js
View file @
2e638366
...
@@ -154,7 +154,7 @@ ${opt.required?'<span class="api-option-required">Required</span>': '<span class
...
@@ -154,7 +154,7 @@ ${opt.required?'<span class="api-option-required">Required</span>': '<span class
}catch(e){
}catch(e){
}
}
},
1
0000);
},
3
0000);
try{
try{
args = parseArgs( req, res, api.options );
args = parseArgs( req, res, api.options );
}catch(e){
}catch(e){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment