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
a1d06adf
Commit
a1d06adf
authored
Jan 16, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix random seed before generating
parent
1362f47a
Pipeline
#517
canceled with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
quizGenerator.js
public/js/controller/quizGenerator.js
+2
-1
No files found.
public/js/controller/quizGenerator.js
View file @
a1d06adf
...
@@ -56,11 +56,12 @@ const quizGenerator = function(type, photo, subType) {
...
@@ -56,11 +56,12 @@ const quizGenerator = function(type, photo, subType) {
},
},
_quizGenerator
=
function
(
type
,
photo
,
subType
,
attempt
)
{
_quizGenerator
=
function
(
type
,
photo
,
subType
,
attempt
)
{
attempt
=
attempt
||
0
;
attempt
=
attempt
||
0
;
const
initialSeed
=
Math
.
random
.
seeded
.
getStringSeed
();
let
log
;
let
log
;
if
(
attempt
===
0
){
if
(
attempt
===
0
){
const
types
=
quizTypes
[
type
+
(
photo
?
'Photo'
:
''
)];
const
types
=
quizTypes
[
type
+
(
photo
?
'Photo'
:
''
)];
subType
=
probabilityRand
(
types
);
subType
=
probabilityRand
(
types
);
log
=
quizGenerator
.
log
=
[
'Random seed: '
+
Math
.
random
.
seeded
.
getStringSeed
()
,
'Quiz generate '
+
type
+
(
photo
?
' with photo'
:
''
)
+
' '
+
(
subType
?
`
${
lapk
(
subType
.
type
)}
`
:
'. FAIL'
)];
log
=
quizGenerator
.
log
=
[
'Random seed: '
+
initialSeed
,
'Quiz generate '
+
type
+
(
photo
?
' with photo'
:
''
)
+
' '
+
(
subType
?
`
${
lapk
(
subType
.
type
)}
`
:
'. FAIL'
)];
}
else
if
(
attempt
<
30
){
}
else
if
(
attempt
<
30
){
log
=
quizGenerator
.
log
;
log
=
quizGenerator
.
log
;
log
.
push
(
'
\
nATTEMPT FAILED!
\
n
\
n'
+
log
.
push
(
'
\
nATTEMPT FAILED!
\
n
\
n'
+
...
...
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