File tree Expand file tree Collapse file tree 5 files changed +16
-6
lines changed Expand file tree Collapse file tree 5 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 2
2
<span >
3
3
<el-button type =" text" @click =" $emit('update:showTip',!showTip)" >{{ showTip ? '隐藏帮助' : '查看帮助' }}</el-button >
4
4
<span v-if =" showTip" style =" font-size :0.8rem ;font-weight :600 " >
5
+ <p >题目做完以后将会继续显示,直到下一题也做完了。</p >
5
6
<p >【Ctrl+Shift+↑】键返回上一题,【Ctrl+Shift+↓】键进入下一题</p >
6
7
<p >题目内按【Ctrl+Alt+Enter】提交答案</p >
7
8
<p >【Ctrl+Alt+数字】选中选项</p >
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ export default {
137
137
beforeLeave,
138
138
problem_show (d ) {
139
139
if (! d) return
140
- return ! this .kill_problem || ! d .completed
140
+ return ! this .kill_problem || ( ! d .completed || d . completed > new Date (). getTime () - 1e3 )
141
141
},
142
142
onKeyUp (v ) {
143
143
const { ctrlKey , shiftKey , key } = v
@@ -174,6 +174,7 @@ export default {
174
174
this .handle_focus ({ id: filtered_data[new_index].id , is_manual })
175
175
},
176
176
onSubmit ({ problem, is_right }) {
177
+ console .log (' onsubmit to status' , problem)
177
178
this .$refs .completion_tip .update_status ({ problem, is_right })
178
179
this .focus_next ({ focus_move_step: 1 })
179
180
},
@@ -323,7 +324,7 @@ export default {
323
324
return null // 如果id重复,则标记题目为待删除
324
325
}
325
326
id_dict[r .id ] = 1 // 将题目加入重复判断字典中
326
- r .completed = false
327
+ r .completed = null
327
328
return r
328
329
})
329
330
prblems = this .do_filter_problems (prblems)
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div v-if =" name" v-loading =" loading" >
3
+
3
4
<div v-if =" database" >
4
5
<el-card class =" right-hover-panel flashing-layout-right" >
5
6
<span >
10
11
<div class =" train-container" >
11
12
<div class =" train" >
12
13
<h1 >题库:{{ database.alias || database.description }}</h1 >
14
+ <PracticeTip :show-tip.sync =" show_tip" />
13
15
<ProblemList :data =" database.problems" @onStatus =" v => problem_status = v" @requireInit =" show_options=true" />
14
16
</div >
15
17
</div >
@@ -43,6 +45,7 @@ export default {
43
45
ProblemList : () => import (' ./ProblemList' ),
44
46
TrainOptions : () => import (' ./TrainOptions' ),
45
47
TrainStatus : () => import (' ./TrainStatus' ),
48
+ PracticeTip : () => import (' ../PracticeTip' )
46
49
},
47
50
props: {
48
51
name: { type: String , default: null }
@@ -53,7 +56,8 @@ export default {
53
56
problem_focus: null ,
54
57
problem_status: null ,
55
58
show_options: false ,
56
- current_option_focus: ' 1'
59
+ current_option_focus: ' 1' ,
60
+ show_tip: false
57
61
}),
58
62
computed: {
59
63
... mapState ({
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export default {
63
63
watch: {
64
64
userAnswerConfirmResult: {
65
65
handler (val ) {
66
- this .$emit (' update:completed' , val)
66
+ this .$emit (' update:completed' , val ? new Date () : null )
67
67
}
68
68
}
69
69
},
@@ -102,9 +102,11 @@ export default {
102
102
if (! is_right) this .update_problem ({ is_right: false , is_manual })
103
103
},
104
104
onAnswerResult ({ is_right, is_manual, answer }) {
105
+ console .log (' onAnswerResult' , is_right, is_manual, answer)
105
106
this .userAnswerConfirmResult = true
106
107
if (this .userAnswerResult === false ) return
107
108
this .showAnswer = false
109
+ console .log (' update_problem' , is_right, is_manual, answer)
108
110
this .update_problem ({ is_right, is_manual, answer })
109
111
},
110
112
update_problem ({ is_right, is_manual, answer }) {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export default {
34
34
},
35
35
data : () => ({
36
36
ProblemType: api .ProblemType ,
37
- completed: false ,
37
+ completed: null ,
38
38
submitted: false
39
39
}),
40
40
computed: {
@@ -57,7 +57,9 @@ export default {
57
57
},
58
58
methods: {
59
59
handle_submit ({ is_right, is_manual, answer }) {
60
+ console .log (' handle_submit' , is_right, is_manual, answer)
60
61
if (this .submitted ) return
62
+ console .log (' handle_submit_true' , is_right, is_manual, answer)
61
63
this .submitted = true
62
64
return this .$emit (' onSubmit' , { is_right, is_manual, answer })
63
65
},
@@ -74,7 +76,7 @@ export default {
74
76
c && c .onSubmit ({ is_right, is_manual, answer })
75
77
},
76
78
reset () {
77
- this .completed = false
79
+ this .completed = null
78
80
this .submitted = false
79
81
const c = this .$refs .base
80
82
c && c .reset ()
You can’t perform that action at this time.
0 commit comments