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
96505d5c
Commit
96505d5c
authored
Feb 17, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change probabilities, fix timeout
parent
38c3d9df
Pipeline
#547
canceled with stage
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
10 deletions
+16
-10
db.js
db.js
+3
-1
checkbox.js
public/js/controller/quizBits/checkbox.js
+3
-3
checkboxPhoto.js
public/js/controller/quizBits/checkboxPhoto.js
+2
-2
radio.js
public/js/controller/quizBits/radio.js
+2
-2
radioPhoto.js
public/js/controller/quizBits/radioPhoto.js
+1
-1
apiMappers.js
src/apiMappers.js
+5
-1
No files found.
db.js
View file @
96505d5c
...
@@ -444,7 +444,7 @@ data = {tags:[], connections:[], more:[], standardQuestions: {}, standardAnswers
...
@@ -444,7 +444,7 @@ data = {tags:[], connections:[], more:[], standardQuestions: {}, standardAnswers
var
tid
=
1
,
cid
=
1
;
var
tid
=
1
,
cid
=
1
;
var
tagsHash
=
{};
var
tagsHash
=
{};
data
.
more
=
data
.
more
.
concat
([
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
:
'2questions.csv'
,
a
:
'2answers.csv'
,
c
:
'2cards.csv'
},
{
q
:
'3questions.csv'
,
a
:
'3answers.csv'
,
c
:
'3cards.csv'
},
{
q
:
'3questions.csv'
,
a
:
'3answers.csv'
,
c
:
'3cards.csv'
},
{
q
:
'4questions.csv'
,
a
:
'4answers.csv'
,
c
:
'4cards.csv'
}
{
q
:
'4questions.csv'
,
a
:
'4answers.csv'
,
c
:
'4cards.csv'
}
...
@@ -629,6 +629,8 @@ data = {tags:[], connections:[], more:[], standardQuestions: {}, standardAnswers
...
@@ -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);
data.after && data.after(data);
})();
})();
...
...
public/js/controller/quizBits/checkbox.js
View file @
96505d5c
let
ComponentsOfProduct
;
let
ComponentsOfProduct
;
quizTypes
.
checkbox
=
[
ComponentsOfProduct
=
{
quizTypes
.
checkbox
=
[
ComponentsOfProduct
=
{
probability
:
10
,
probability
:
0
,
//
10,
correct
:
{
min
:
2
,
max
:
4
},
correct
:
{
min
:
2
,
max
:
4
},
wrong
:
{
min
:
1
,
max
:
4
},
wrong
:
{
min
:
1
,
max
:
4
},
answers
:
{
min
:
3
,
max
:
6
},
answers
:
{
min
:
3
,
max
:
6
},
...
@@ -41,7 +41,7 @@ quizTypes.checkbox = [ ComponentsOfProduct = {
...
@@ -41,7 +41,7 @@ quizTypes.checkbox = [ ComponentsOfProduct = {
}
}
},
},
Object
.
assign
({},
ComponentsOfProduct
,
{
Object
.
assign
({},
ComponentsOfProduct
,
{
probability
:
4
,
probability
:
0
,
//
4,
correct
:
{
min
:
2
,
max
:
4
},
correct
:
{
min
:
2
,
max
:
4
},
wrong
:
{
min
:
2
,
max
:
4
},
wrong
:
{
min
:
2
,
max
:
4
},
answers
:
{
min
:
4
,
max
:
8
},
answers
:
{
min
:
4
,
max
:
8
},
...
@@ -64,7 +64,7 @@ quizTypes.checkbox = [ ComponentsOfProduct = {
...
@@ -64,7 +64,7 @@ quizTypes.checkbox = [ ComponentsOfProduct = {
}
}
}),
}),
{
{
probability
:
10
,
probability
:
0
,
//
10,
correct
:
{
min
:
2
,
max
:
4
},
correct
:
{
min
:
2
,
max
:
4
},
wrong
:
{
min
:
1
,
max
:
3
},
wrong
:
{
min
:
1
,
max
:
3
},
answers
:
{
min
:
4
,
max
:
6
},
answers
:
{
min
:
4
,
max
:
6
},
...
...
public/js/controller/quizBits/checkboxPhoto.js
View file @
96505d5c
quizTypes
.
checkboxPhoto
=
[
quizTypes
.
checkboxPhoto
=
[
{
{
questionMinComponentsCount
:
2
,
questionMinComponentsCount
:
2
,
probability
:
8
,
probability
:
0
,
//
8,
type
:
'What components are in it'
,
type
:
'What components are in it'
,
answers
:
{
min
:
3
,
max
:
6
},
answers
:
{
min
:
3
,
max
:
6
},
...
@@ -33,7 +33,7 @@ quizTypes.checkboxPhoto = [
...
@@ -33,7 +33,7 @@ quizTypes.checkboxPhoto = [
},
},
{
{
questionMinComponentsCount
:
2
,
questionMinComponentsCount
:
2
,
probability
:
3
,
probability
:
0
,
//
3,
type
:
'What components are NOT in it'
,
type
:
'What components are NOT in it'
,
answers
:
{
min
:
3
,
max
:
6
},
answers
:
{
min
:
3
,
max
:
6
},
...
...
public/js/controller/quizBits/radio.js
View file @
96505d5c
...
@@ -17,7 +17,7 @@ quizTypes.radio = [
...
@@ -17,7 +17,7 @@ quizTypes.radio = [
},
},
{
{
questionCmpAmount
:
2
,
questionCmpAmount
:
2
,
probability
:
8
,
probability
:
0
,
//
8,
type
:
'Component in product'
,
type
:
'Component in product'
,
products
:
{
from
:
4
,
to
:
6
},
products
:
{
from
:
4
,
to
:
6
},
minSimilarTags
:
1
,
minSimilarTags
:
1
,
...
@@ -83,7 +83,7 @@ quizTypes.radio = [
...
@@ -83,7 +83,7 @@ quizTypes.radio = [
}
}
},
},
{
{
probability
:
10
,
probability
:
0
,
//
10,
answers
:
{
from
:
3
,
to
:
6
},
answers
:
{
from
:
3
,
to
:
6
},
question
:
({
product
})
=>
`Выберите лишний ингредиент, НЕ входящий в продукт "
${
product
.
title
}
"`
,
question
:
({
product
})
=>
`Выберите лишний ингредиент, НЕ входящий в продукт "
${
product
.
title
}
"`
,
...
...
public/js/controller/quizBits/radioPhoto.js
View file @
96505d5c
...
@@ -33,7 +33,7 @@ quizTypes.radioPhoto = [
...
@@ -33,7 +33,7 @@ quizTypes.radioPhoto = [
},
},
{
{
questionMinComponentsCount
:
2
,
questionMinComponentsCount
:
2
,
probability
:
3
,
probability
:
0
,
//
3,
type
:
'What component is in it'
,
type
:
'What component is in it'
,
answers
:
{
min
:
4
,
max
:
6
},
answers
:
{
min
:
4
,
max
:
6
},
...
...
src/apiMappers.js
View file @
96505d5c
...
@@ -94,7 +94,11 @@ ${opt.required?'<span class="api-option-required">Required</span>': '<span class
...
@@ -94,7 +94,11 @@ ${opt.required?'<span class="api-option-required">Required</span>': '<span class
for(let key in apis){
for(let key in apis){
let api = apis[key], args;
let api = apis[key], args;
router[api.method.toLowerCase()](key, async function(req, res) {
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{
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