|
@@ -66,40 +66,40 @@ export async function getHistoryTask({
|
|
|
export async function saveTask() {
|
|
|
const markResult = findCurrentTaskMarkResult();
|
|
|
if (markResult) {
|
|
|
- const scoreGroups = groupBy(
|
|
|
- markResult.trackList,
|
|
|
- (obj) =>
|
|
|
- (obj.mainNumber + "").padStart(10, "0") +
|
|
|
- obj.subNumber.padStart(10, "0")
|
|
|
- );
|
|
|
- const questionWithScore = Object.entries(scoreGroups);
|
|
|
- const questionWithTotalScore = questionWithScore.map((v) => [
|
|
|
- v[0],
|
|
|
- v[1].reduce((acc, c) => (acc += c.score), 0),
|
|
|
- ]);
|
|
|
- const questionWithTotalScoreSorted = sortBy(
|
|
|
- questionWithTotalScore,
|
|
|
- (obj) => obj[0]
|
|
|
- );
|
|
|
- const scoreList = questionWithTotalScoreSorted.map((s) => s[1]);
|
|
|
- // console.log(
|
|
|
- // scoreGroups,
|
|
|
- // questionWithScore,
|
|
|
+ // const scoreGroups = groupBy(
|
|
|
+ // markResult.trackList,
|
|
|
+ // (obj) =>
|
|
|
+ // (obj.mainNumber + "").padStart(10, "0") +
|
|
|
+ // obj.subNumber.padStart(10, "0")
|
|
|
+ // );
|
|
|
+ // const questionWithScore = Object.entries(scoreGroups);
|
|
|
+ // const questionWithTotalScore = questionWithScore.map((v) => [
|
|
|
+ // v[0],
|
|
|
+ // v[1].reduce((acc, c) => (acc += c.score), 0),
|
|
|
+ // ]);
|
|
|
+ // const questionWithTotalScoreSorted = sortBy(
|
|
|
// questionWithTotalScore,
|
|
|
- // questionWithTotalScoreSorted,
|
|
|
- // scoreList
|
|
|
+ // (obj) => obj[0]
|
|
|
// );
|
|
|
- markResult.scoreList = scoreList as number[];
|
|
|
- // const sortScore = orderBy(markResult.trackList, ['mainNumber', 'subNumber', 'score']);
|
|
|
- // markResult.scoreList = sortScore.reduce((acc, pre) => {
|
|
|
- // if(pre.mainNumber === cur.mainNumber && pre.subNumber === cur.subNumber) {
|
|
|
- // acc[acc.length-1] += cur.score
|
|
|
- // }
|
|
|
- // }, [0])
|
|
|
- markResult.markerScore =
|
|
|
- markResult.trackList
|
|
|
- .map((t) => t.score)
|
|
|
- .reduce((acc, v) => (acc += v * 100), 0) / 100;
|
|
|
+ // const scoreList = questionWithTotalScoreSorted.map((s) => s[1]);
|
|
|
+ // // console.log(
|
|
|
+ // // scoreGroups,
|
|
|
+ // // questionWithScore,
|
|
|
+ // // questionWithTotalScore,
|
|
|
+ // // questionWithTotalScoreSorted,
|
|
|
+ // // scoreList
|
|
|
+ // // );
|
|
|
+ // markResult.scoreList = scoreList as number[];
|
|
|
+ // // const sortScore = orderBy(markResult.trackList, ['mainNumber', 'subNumber', 'score']);
|
|
|
+ // // markResult.scoreList = sortScore.reduce((acc, pre) => {
|
|
|
+ // // if(pre.mainNumber === cur.mainNumber && pre.subNumber === cur.subNumber) {
|
|
|
+ // // acc[acc.length-1] += cur.score
|
|
|
+ // // }
|
|
|
+ // // }, [0])
|
|
|
+ // markResult.markerScore =
|
|
|
+ // markResult.trackList
|
|
|
+ // .map((t) => t.score)
|
|
|
+ // .reduce((acc, v) => (acc += v * 100), 0) / 100;
|
|
|
markResult.specialTagList = [];
|
|
|
markResult.problem = false;
|
|
|
markResult.spent = Date.now() - markResult.spent;
|