|
@@ -228,12 +228,6 @@ function isCurrentQuestion(question: Question) {
|
|
store.currentQuestion?.subNumber === question.subNumber
|
|
store.currentQuestion?.subNumber === question.subNumber
|
|
);
|
|
);
|
|
}
|
|
}
|
|
-watch(
|
|
|
|
- () => store.currentQuestion,
|
|
|
|
- () => {
|
|
|
|
- store.currentScore = undefined;
|
|
|
|
- }
|
|
|
|
-);
|
|
|
|
|
|
|
|
function isCurrentScore(score: number) {
|
|
function isCurrentScore(score: number) {
|
|
return store.currentScore === score;
|
|
return store.currentScore === score;
|
|
@@ -306,54 +300,27 @@ onUnmounted(() => {
|
|
document.removeEventListener("keydown", submitListener);
|
|
document.removeEventListener("keydown", submitListener);
|
|
});
|
|
});
|
|
|
|
|
|
-const handleMouseOverWithBoard = () => {
|
|
|
|
- if (store.setting.uiSetting["score.board.collapse"]) {
|
|
|
|
- const container = document.querySelector(".mark-board-track-container");
|
|
|
|
- if (container) {
|
|
|
|
- container.classList.add("show-board");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-const handleMouseOutWithBoard = () => {
|
|
|
|
- if (store.setting.uiSetting["score.board.collapse"]) {
|
|
|
|
- const container = document.querySelector(".mark-board-track-container");
|
|
|
|
- if (container) {
|
|
|
|
- container.classList.remove("show-board");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
function clearLatestMarkOfCurrentQuetion() {
|
|
function clearLatestMarkOfCurrentQuetion() {
|
|
if (!store.currentTask?.markResult || !store.currentQuestion) return;
|
|
if (!store.currentTask?.markResult || !store.currentQuestion) return;
|
|
|
|
|
|
|
|
+ const { __index, mainNumber, subNumber } = store.currentQuestion;
|
|
const markResult = store.currentTask.markResult;
|
|
const markResult = store.currentTask.markResult;
|
|
const ts = markResult.trackList.filter(
|
|
const ts = markResult.trackList.filter(
|
|
- (q) =>
|
|
|
|
- q.mainNumber === store.currentQuestion?.mainNumber &&
|
|
|
|
- q.subNumber === store.currentQuestion?.subNumber
|
|
|
|
|
|
+ (q) => q.mainNumber === mainNumber && q.subNumber === subNumber
|
|
);
|
|
);
|
|
if (ts.length === 0) {
|
|
if (ts.length === 0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- const maxNumber = Math.max(...ts.map((q) => q.number));
|
|
|
|
- const idx = markResult.trackList.findIndex(
|
|
|
|
- (q) =>
|
|
|
|
- q.mainNumber === store.currentQuestion?.mainNumber &&
|
|
|
|
- q.subNumber === store.currentQuestion?.subNumber &&
|
|
|
|
- q.number === maxNumber
|
|
|
|
- );
|
|
|
|
- if (idx >= 0) {
|
|
|
|
- store.removeScoreTracks = markResult.trackList.splice(idx, 1);
|
|
|
|
- const { __index, mainNumber, subNumber } = store.currentQuestion;
|
|
|
|
- const trackList = markResult.trackList
|
|
|
|
- .filter((t) => t.mainNumber === mainNumber && t.subNumber === subNumber)
|
|
|
|
- .map((t) => t.score);
|
|
|
|
- markResult.scoreList[__index] =
|
|
|
|
- trackList.length === 0
|
|
|
|
- ? null
|
|
|
|
- : trackList.reduce((acc, v) => (acc += Math.round(v * 100)), 0) / 100;
|
|
|
|
- }
|
|
|
|
|
|
+ const lastMark = ts.splice(-1)[0];
|
|
|
|
+ store.removeScoreTracks = [lastMark];
|
|
|
|
+ markResult.trackList = markResult.trackList.filter((t) => t !== lastMark);
|
|
|
|
+
|
|
|
|
+ markResult.scoreList[__index] =
|
|
|
|
+ ts.length === 0
|
|
|
|
+ ? null
|
|
|
|
+ : ts
|
|
|
|
+ .map((t) => t.score)
|
|
|
|
+ .reduce((acc, v) => (acc += Math.round(v * 100)), 0) / 100;
|
|
}
|
|
}
|
|
|
|
|
|
function clearAllMarksOfCurrentQuetion() {
|
|
function clearAllMarksOfCurrentQuetion() {
|
|
@@ -366,11 +333,7 @@ function clearAllMarksOfCurrentQuetion() {
|
|
q.subNumber === store.currentQuestion?.subNumber
|
|
q.subNumber === store.currentQuestion?.subNumber
|
|
);
|
|
);
|
|
markResult.trackList = markResult.trackList.filter(
|
|
markResult.trackList = markResult.trackList.filter(
|
|
- (q) =>
|
|
|
|
- !(
|
|
|
|
- q.mainNumber === store.currentQuestion?.mainNumber &&
|
|
|
|
- q.subNumber === store.currentQuestion?.subNumber
|
|
|
|
- )
|
|
|
|
|
|
+ (q) => !store.removeScoreTracks.includes(q)
|
|
);
|
|
);
|
|
const { __index } = store.currentQuestion;
|
|
const { __index } = store.currentQuestion;
|
|
markResult.scoreList[__index] = null;
|
|
markResult.scoreList[__index] = null;
|