|
@@ -62,11 +62,14 @@ import { Question } from "@/types";
|
|
|
import { isNumber } from "lodash";
|
|
|
import { computed, defineComponent, onMounted, onUnmounted, watch } from "vue";
|
|
|
import { store } from "./store";
|
|
|
+import { autoChooseFirstQuestion } from "./use/autoChooseFirstQuestion";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: "MarkBoardTrack",
|
|
|
emits: ["submit"],
|
|
|
setup(props, { emit }) {
|
|
|
+ const { chooseQuestion } = autoChooseFirstQuestion();
|
|
|
+
|
|
|
const questionScoreSteps = computed(() => {
|
|
|
const question = store.currentQuestion;
|
|
|
if (!question) return [];
|
|
@@ -95,9 +98,7 @@ export default defineComponent({
|
|
|
store.currentScore = undefined;
|
|
|
}
|
|
|
);
|
|
|
- function chooseQuestion(question: Question) {
|
|
|
- store.currentQuestion = question;
|
|
|
- }
|
|
|
+
|
|
|
function isCurrentScore(score: number) {
|
|
|
return store.currentScore === score;
|
|
|
}
|
|
@@ -126,6 +127,7 @@ export default defineComponent({
|
|
|
chooseScore(score);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
document.addEventListener("keydown", numberKeyListener);
|
|
|
});
|