|
@@ -19,12 +19,13 @@ export default function useAutoChooseFirstQuestion() {
|
|
|
markStore.currentQuestion = undefined;
|
|
|
markStore.currentScore = undefined;
|
|
|
|
|
|
- // FIXed ME: 此时取到的还是score:null,但是 chooseQuestion之后就变成了score:0
|
|
|
const firstQuestion = markStore.currentTask?.questionList.find(
|
|
|
(question) => !isDisabledQuestion(question)
|
|
|
);
|
|
|
if (firstQuestion) {
|
|
|
- chooseQuestion(firstQuestion);
|
|
|
+ setTimeout(() => {
|
|
|
+ chooseQuestion(firstQuestion);
|
|
|
+ }, 300);
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -68,12 +69,24 @@ export default function useAutoChooseFirstQuestion() {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const scrollToQuestionArea = (question: Question) => {
|
|
|
+ const area = question.picList && question.picList[0];
|
|
|
+ if (!area) return;
|
|
|
+
|
|
|
+ const areaNode = document.getElementById(
|
|
|
+ `${area.i}_${area.x}_${area.y}_${area.w}_${area.h}`
|
|
|
+ );
|
|
|
+ if (!areaNode) return;
|
|
|
+ areaNode.scrollIntoView({ block: "start", behavior: "smooth" });
|
|
|
+ };
|
|
|
+
|
|
|
function chooseQuestion(question: Question) {
|
|
|
if (isDisabledQuestion(question)) return;
|
|
|
|
|
|
markStore.currentQuestion = question;
|
|
|
// FIXME: maybe should be an async function, temp fix for eslint
|
|
|
void scrollToQuestionOfBoard(question);
|
|
|
+ scrollToQuestionArea(question);
|
|
|
|
|
|
void nextTick(() => {
|
|
|
if (markStore.currentQuestion) {
|