|
@@ -66,19 +66,13 @@ export default defineComponent({
|
|
|
const question = store.currentQuestion;
|
|
|
if (!question) return [];
|
|
|
|
|
|
+ const remainScore = question.maxScore - (question.score || 0);
|
|
|
const steps = [];
|
|
|
- for (
|
|
|
- let i = 0;
|
|
|
- i <= question.maxScore - (question.score || 0);
|
|
|
- i += question.intervalScore
|
|
|
- ) {
|
|
|
+ for (let i = 0; i <= remainScore; i += question.intervalScore) {
|
|
|
steps.push(i);
|
|
|
}
|
|
|
- if (
|
|
|
- (question.maxScore - (question.score || 0)) % question.intervalScore !==
|
|
|
- 0
|
|
|
- ) {
|
|
|
- steps.push(question.maxScore - (question.score || 0));
|
|
|
+ if (remainScore % question.intervalScore !== 0) {
|
|
|
+ steps.push(remainScore);
|
|
|
}
|
|
|
|
|
|
return steps;
|
|
@@ -90,13 +84,6 @@ export default defineComponent({
|
|
|
store.currentQuestion?.subNumber === question.subNumber
|
|
|
);
|
|
|
}
|
|
|
- // 当题目改变时,重置当前分数
|
|
|
- watch(
|
|
|
- () => store.currentQuestion,
|
|
|
- () => {
|
|
|
- store.currentScore = undefined;
|
|
|
- }
|
|
|
- );
|
|
|
|
|
|
let keyPressTimestamp = 0;
|
|
|
let keys: string[] = [];
|