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
352493fa
Commit
352493fa
authored
Jan 16, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
productId
parent
cd45ee72
Pipeline
#524
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
4 deletions
+21
-4
checkbox.js
public/js/controller/quizBits/checkbox.js
+1
-0
main.js
public/js/controller/quizBits/main.js
+1
-0
radio.js
public/js/controller/quizBits/radio.js
+7
-3
quizGenerator.js
public/js/controller/quizGenerator.js
+12
-1
No files found.
public/js/controller/quizBits/checkbox.js
View file @
352493fa
...
...
@@ -106,6 +106,7 @@ quizTypes.checkbox = [ ComponentsOfProduct = {
log
.
push
(
'Chosen component: '
+
chosen
.
component
.
name
);
return
{
baseProduct
:
chosen
.
products
[
0
],
component
:
chosen
.
component
,
correct
:
chosen
.
products
,
wrong
:
products
.
filter
(
p
=>
chosen
.
products
.
indexOf
(
p
)
===-
1
)
...
...
public/js/controller/quizBits/main.js
View file @
352493fa
...
...
@@ -194,6 +194,7 @@ const qB = {
wrong
.
splice
(
i
,
1
);
return
{
baseProduct
:
product
,
correct
:
product
,
wrong
:
wrong
,
uniq
:
used
,
...
...
public/js/controller/quizBits/radio.js
View file @
352493fa
...
...
@@ -86,11 +86,15 @@ quizTypes.radio = [
probability
:
10
,
answers
:
{
from
:
3
,
to
:
6
},
question
:
(
product
)
=>
`Выберите лишний ингредиент, НЕ входящий в продукт "
${
product
.
title
}
"`
,
question
:
(
{
product
}
)
=>
`Выберите лишний ингредиент, НЕ входящий в продукт "
${
product
.
title
}
"`
,
type
:
'Do not contain'
,
from
:
(
log
)
=>
qB
.
randomProduct
({
minComponents
:
2
,
single
:
true
},
log
),
from
:
(
log
)
=>
{
const
product
=
qB
.
randomProduct
({
minComponents
:
2
,
single
:
true
},
log
);
return
{
baseProduct
:
product
,
product
}
answer
(
product
,
log
){
},
answer
(
{
product
},
log
){
const
out
=
shuffle
(
...
...
public/js/controller/quizGenerator.js
View file @
352493fa
...
...
@@ -91,7 +91,18 @@ const quizGenerator = function(type, photo, subType) {
// давай по новой
return
_quizGenerator
(
type
,
photo
,
subType
,
attempt
+
1
);
}
return
{
seed
:
initialSeed
,
question
:
cfg
.
question
.
call
(
cfg
,
source
,
log
),
answers
,
log
,
type
,
image
:
!
photo
?
''
:
true
,
category
:
1
}
return
{
seed
:
initialSeed
,
type
,
categoryId
:
1
,
productId
:
source
.
baseProduct
.
id
,
question
:
cfg
.
question
.
call
(
cfg
,
source
,
log
),
answers
,
image
:
!
photo
?
null
:
true
,
log
,
}
};
...
...
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