Commit d7856c3d by doszhang

dos

parent 869ff4d9
...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment