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
20843987
Commit
20843987
authored
Feb 21, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove ingredient questions
parent
a98f97f6
Pipeline
#556
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
6 deletions
+30
-6
checkboxPhoto.js
public/js/controller/quizBits/checkboxPhoto.js
+1
-1
radio.js
public/js/controller/quizBits/radio.js
+1
-1
table.js
public/js/view/cmp/table.js
+9
-1
generateRandom.js
src/api/generateRandom.js
+19
-3
No files found.
public/js/controller/quizBits/checkboxPhoto.js
View file @
20843987
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
},
...
...
public/js/controller/quizBits/radio.js
View file @
20843987
quizTypes
.
radio
=
[
quizTypes
.
radio
=
[
{
{
questionCmpAmount
:
4
,
questionCmpAmount
:
4
,
probability
:
10
,
probability
:
0
,
//
10,
type
:
'Product contains 4 components'
,
type
:
'Product contains 4 components'
,
products
:
{
from
:
4
,
to
:
8
},
products
:
{
from
:
4
,
to
:
8
},
minSimilarTags
:
1
,
minSimilarTags
:
1
,
...
...
public/js/view/cmp/table.js
View file @
20843987
...
@@ -24,7 +24,7 @@ view.cmp.Table.prototype = {
...
@@ -24,7 +24,7 @@ view.cmp.Table.prototype = {
this
.
filterRegExp
=
new
RegExp
(
text
.
replace
(
/
[\[\]\(\)\?\*\.\+]
/g
,
''
).
replace
(
/
\s
+/g
,
'|'
),
'ig'
)
this
.
filterRegExp
=
new
RegExp
(
text
.
replace
(
/
[\[\]\(\)\?\*\.\+]
/g
,
''
).
replace
(
/
\s
+/g
,
'|'
),
'ig'
)
},
},
fetch
:
function
()
{
fetch
:
function
()
{
const
field
=
Object
.
keys
(
this
.
sort
[
0
])[
0
]
const
field
=
Object
.
keys
(
this
.
sort
[
0
])[
0
]
;
this
.
currentSlice
=
this
.
items
this
.
currentSlice
=
this
.
items
.
filter
(
item
=>
this
.
filterFn
.
call
(
item
,
this
.
filterText
,
this
))
.
filter
(
item
=>
this
.
filterFn
.
call
(
item
,
this
.
filterText
,
this
))
.
sort
((
a
,
b
)
=>
a
[
field
]
>
b
.
field
?
1
:
a
[
field
]
<
b
.
field
?
-
1
:
0
)
.
sort
((
a
,
b
)
=>
a
[
field
]
>
b
.
field
?
1
:
a
[
field
]
<
b
.
field
?
-
1
:
0
)
...
@@ -46,6 +46,14 @@ view.cmp.Table.prototype = {
...
@@ -46,6 +46,14 @@ view.cmp.Table.prototype = {
item
.
dom
=
dom
;
item
.
dom
=
dom
;
}
}
},
},
removeChild
:
function
(
item
)
{
if
(
item
.
dom
){
item
.
dom
.
parentNode
.
removeChild
(
item
.
dom
);
item
.
dom
=
null
;
this
.
currentSlice
=
this
.
currentSlice
.
filter
(
i
=>!
(
i
.
data
===
item
.
data
));
this
.
items
=
this
.
items
.
filter
(
i
=>!
(
i
===
item
.
data
));
}
},
updateChildByData
:
function
(
data
)
{
updateChildByData
:
function
(
data
)
{
const
match
=
this
.
currentSlice
.
filter
(
i
=>
i
.
data
===
data
),
const
match
=
this
.
currentSlice
.
filter
(
i
=>
i
.
data
===
data
),
item
=
match
[
0
];
item
=
match
[
0
];
...
...
src/api/generateRandom.js
View file @
20843987
...
@@ -226,7 +226,7 @@ pre {font-family: monospace;}
...
@@ -226,7 +226,7 @@ pre {font-family: monospace;}
</style><script>var toggle=function(a){a.parentNode.parentNode.querySelector('.how-block').classList.toggle('hidden')}</script>`
+
'</head><body><div class="seed">seed: '
+
seed
+
'</div> '
+
</style><script>var toggle=function(a){a.parentNode.parentNode.querySelector('.how-block').classList.toggle('hidden')}</script>`
+
'</head><body><div class="seed">seed: '
+
seed
+
'</div> '
+
list
.
map
((
result
,
i
)
=>
list
.
map
((
result
,
i
)
=>
`<div class="quest"><div class="title">
${
i
+
1
}
)
${
result
.
question
}
<span class="how" onclick="toggle(this)">Как так получилось?</span></div>
`<div class="quest"><div class="title">
${
i
+
1
}
)
${
result
.
question
}
<span class="how" onclick="toggle(this)">Как так получилось?</span></div>
<pre>
<pre>
${
result
.
image
?
'<img height="100px" src="'
+
TRANSFORMER
.
IMAGE
(
result
.
image
)
+
'" style="float: left"/>'
:
''
}
${
result
.
answers
.
map
(
a
=>
${
result
.
answers
.
map
(
a
=>
(
(
result
.
type
===
'checkbox'
?(
a
.
correct
?
'[v]'
:
'[ ]'
):(
a
.
correct
?
'(o)'
:
'( )'
))
+
' '
+
a
.
text
)
(
(
result
.
type
===
'checkbox'
?(
a
.
correct
?
'[v]'
:
'[ ]'
):(
a
.
correct
?
'(o)'
:
'( )'
))
+
' '
+
a
.
text
)
).
join
(
'
\
n'
)}
).
join
(
'
\
n'
)}
...
@@ -243,4 +243,20 @@ ${ result.answers.map(a=>
...
@@ -243,4 +243,20 @@ ${ result.answers.map(a=>
return
list
;
return
list
;
}
}
}
}
};
};
\ No newline at end of file
const
TRANSFORMER
=
{
IMAGE
:
function
(
image
){
if
(
!
image
){
}
else
{
image
=
image
.
trim
();
if
(
image
.
indexOf
(
'/upload/resize'
)
===
0
){
image
=
'https://vkusvill.ru'
+
image
;
}
else
{
image
=
image
?
'https://api.new.local.vkusvill.testin.ru/storage'
+
image
.
trim
()
:
void
0
;
}
}
return
image
;
}
}
\ No newline at end of file
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