|
@@ -275,6 +275,7 @@ export default function useDraw(winId: number) {
|
|
const answerTags = paserRecogData(i);
|
|
const answerTags = paserRecogData(i);
|
|
drawTrackList.push(...answerTags);
|
|
drawTrackList.push(...answerTags);
|
|
drawTrackList.push(...markDeailList[i]);
|
|
drawTrackList.push(...markDeailList[i]);
|
|
|
|
+ drawTrackList.push(getTotalTrack(img));
|
|
|
|
|
|
trackData[i] = {
|
|
trackData[i] = {
|
|
url: img.url,
|
|
url: img.url,
|
|
@@ -489,22 +490,46 @@ export default function useDraw(winId: number) {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ // 填空题的打分需要自动换行,目前一行只展示最多7个评分
|
|
|
|
+ let offsetY = -20;
|
|
Object.values(userMap).forEach((user, index) => {
|
|
Object.values(userMap).forEach((user, index) => {
|
|
- const userScore = user.scores
|
|
|
|
- .map((item) => `${item.subNumber}:${item.score}分`)
|
|
|
|
- .join(',');
|
|
|
|
-
|
|
|
|
const zhs = ['一', '二', '三'];
|
|
const zhs = ['一', '二', '三'];
|
|
const prename = isDoubleMark ? `${zhs[index] || ''}评` : '评卷员';
|
|
const prename = isDoubleMark ? `${zhs[index] || ''}评` : '评卷员';
|
|
- const content = `${prename}:${user.userName},评分:${userScore}`;
|
|
|
|
|
|
+
|
|
|
|
+ const userScore = user.scores.map(
|
|
|
|
+ (item) => `${item.subNumber}:${item.score}分`
|
|
|
|
+ );
|
|
|
|
+ const lineScoreCount = 10;
|
|
|
|
+ const groupCount = Math.ceil(userScore.length / lineScoreCount);
|
|
|
|
+ const groups: string[] = [];
|
|
|
|
+ for (let i = 0; i < groupCount; i++) {
|
|
|
|
+ groups.push(
|
|
|
|
+ userScore
|
|
|
|
+ .slice(i * lineScoreCount, (i + 1) * lineScoreCount)
|
|
|
|
+ .join(',')
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ offsetY += 20;
|
|
dataArr.push({
|
|
dataArr.push({
|
|
type: 'text',
|
|
type: 'text',
|
|
option: {
|
|
option: {
|
|
x: area.x,
|
|
x: area.x,
|
|
- y: area.y + index * 20,
|
|
|
|
- text: content,
|
|
|
|
|
|
+ y: area.y + offsetY,
|
|
|
|
+ text: `${prename}:${user.userName},评分:`,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
+ groups.forEach((group) => {
|
|
|
|
+ offsetY += 20;
|
|
|
|
+ dataArr.push({
|
|
|
|
+ type: 'text',
|
|
|
|
+ option: {
|
|
|
|
+ x: area.x,
|
|
|
|
+ y: area.y + offsetY,
|
|
|
|
+ text: group,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ });
|
|
});
|
|
});
|
|
|
|
|
|
const score = calcSum(groupQuestions.map((item) => item.score || 0));
|
|
const score = calcSum(groupQuestions.map((item) => item.score || 0));
|
|
@@ -514,7 +539,7 @@ export default function useDraw(winId: number) {
|
|
dataArr.push({
|
|
dataArr.push({
|
|
type: 'text',
|
|
type: 'text',
|
|
option: {
|
|
option: {
|
|
- x: area.x + area.w - Math.ceil(tContLen * 20),
|
|
|
|
|
|
+ x: area.x + area.w - Math.ceil(tContLen * 30),
|
|
y: area.y,
|
|
y: area.y,
|
|
text: tCont,
|
|
text: tCont,
|
|
fontSize: 30,
|
|
fontSize: 30,
|
|
@@ -570,7 +595,7 @@ export default function useDraw(winId: number) {
|
|
dataArr.push({
|
|
dataArr.push({
|
|
type: 'text',
|
|
type: 'text',
|
|
option: {
|
|
option: {
|
|
- x: area.x + area.w - Math.ceil(tContLen * 20),
|
|
|
|
|
|
+ x: area.x + area.w - Math.ceil(tContLen * 30),
|
|
y: area.y,
|
|
y: area.y,
|
|
text: tCont,
|
|
text: tCont,
|
|
fontSize: 30,
|
|
fontSize: 30,
|
|
@@ -581,6 +606,20 @@ export default function useDraw(winId: number) {
|
|
return dataList;
|
|
return dataList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function getTotalTrack(image: ImageItem): DrawTrackItem {
|
|
|
|
+ const totalScore = rawTask.markerScore || 0;
|
|
|
|
+ const objectiveScore = rawTask.objectiveScore || 0;
|
|
|
|
+ const subjectiveScore = totalScore - objectiveScore;
|
|
|
|
+ return {
|
|
|
|
+ type: 'text',
|
|
|
|
+ option: {
|
|
|
|
+ x: 0.15 * image.width,
|
|
|
|
+ y: 0.01 * image.height,
|
|
|
|
+ text: `总分:${totalScore},主观题得分:${subjectiveScore},客观题得分:${objectiveScore}`,
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
// 获取属于填空题的试题号
|
|
// 获取属于填空题的试题号
|
|
function getFillLines() {
|
|
function getFillLines() {
|
|
const questions: Record<number, string[]> = {};
|
|
const questions: Record<number, string[]> = {};
|