Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
maf
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d7856c3d
authored
Jan 14, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
869ff4d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
Public/static/js/common.js
+35
-0
No files found.
Public/static/js/common.js
View file @
d7856c3d
...
@@ -60,6 +60,8 @@ let nowAnswer = '';
...
@@ -60,6 +60,8 @@ let nowAnswer = '';
let
answerArr
=
[];
let
answerArr
=
[];
// 已经进入的题目
// 已经进入的题目
let
watchedQuestion
=
[
1
];
let
watchedQuestion
=
[
1
];
//结果
let
resultType
=
0
;
//海报canvas
//海报canvas
let
posterCanvas
;
let
posterCanvas
;
...
@@ -78,6 +80,8 @@ $(document).ready(function () {
...
@@ -78,6 +80,8 @@ $(document).ready(function () {
$
(
'.btn-nextquestion'
).
on
(
'click'
,
{
$
(
'.btn-nextquestion'
).
on
(
'click'
,
{
source
:
'btn'
source
:
'btn'
},
nextQuestion
);
},
nextQuestion
);
//提交答案
$
(
'.question-page .btn-submit'
).
on
(
'click'
,
submitAnswer
);
...
@@ -115,6 +119,37 @@ $(document).ready(function () {
...
@@ -115,6 +119,37 @@ $(document).ready(function () {
});
});
});
});
function
submitAnswer
()
{
if
(
nowAnswer
!==
''
)
{
if
(
answerArr
[
0
]
==
0
)
{
resultType
=
4
;
}
else
if
(
answerArr
[
1
]
==
0
)
{
resultType
=
1
;
}
else
if
(
answerArr
[
1
]
==
2
)
{
resultType
=
3
;
}
else
if
(
answerArr
[
2
]
==
1
)
{
resultType
=
1
;
}
else
if
(
answerArr
[
2
]
==
2
)
{
resultType
=
6
;
}
else
if
(
answerArr
[
3
]
==
2
)
{
resultType
=
7
;
}
else
if
(
answerArr
[
4
]
==
0
)
{
resultType
=
8
;
}
else
if
(
answerArr
[
4
]
==
1
)
{
resultType
=
2
;
}
else
if
(
answerArr
[
4
]
==
2
)
{
resultType
=
5
;
}
$
(
'.question'
+
nowQuestionIndex
+
'-block'
).
addClass
(
'fadeoutleft'
);
setTimeout
(
function
()
{
$
(
'.question'
+
nowIndex
+
'-block'
).
removeClass
(
'fadeoutleft'
).
hide
();
$
(
'.question-page'
).
hide
();
$
(
'.poster-page'
).
show
();
},
1000
);
}
}
function
prevQuestion
()
{
function
prevQuestion
()
{
if
(
nowQuestionIndex
!=
1
)
{
if
(
nowQuestionIndex
!=
1
)
{
let
nowIndex
=
nowQuestionIndex
;
let
nowIndex
=
nowQuestionIndex
;
...
...
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