|
@@ -550,7 +550,16 @@ export default function useDraw(drawConfig: DrawConfig) {
|
|
const dataArr = dataList[imgIndex];
|
|
const dataArr = dataList[imgIndex];
|
|
const userMap: UserMapType = {};
|
|
const userMap: UserMapType = {};
|
|
const isDoubleMark = !groupQuestions.some((question) => {
|
|
const isDoubleMark = !groupQuestions.some((question) => {
|
|
- const userIds = question.trackList.map((track) => track.userId);
|
|
|
|
|
|
+ let userIds = question.trackList.map((track) => track.userId);
|
|
|
|
+ if (
|
|
|
|
+ !userIds.length &&
|
|
|
|
+ question.markerList &&
|
|
|
|
+ question.markerList.length
|
|
|
|
+ ) {
|
|
|
|
+ userIds = question.markerList
|
|
|
|
+ .filter((marker) => !marker.header)
|
|
|
|
+ .map((marker) => marker.userId);
|
|
|
|
+ }
|
|
const uids = new Set(userIds);
|
|
const uids = new Set(userIds);
|
|
return uids.size === 1;
|
|
return uids.size === 1;
|
|
});
|
|
});
|
|
@@ -576,9 +585,33 @@ export default function useDraw(drawConfig: DrawConfig) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ // 普通模式没有轨迹
|
|
|
|
+ if (
|
|
|
|
+ !question.trackList.length &&
|
|
|
|
+ question.markerList &&
|
|
|
|
+ question.markerList.length
|
|
|
|
+ ) {
|
|
|
|
+ question.markerList
|
|
|
|
+ .filter((marker) => !marker.header)
|
|
|
|
+ .forEach((marker) => {
|
|
|
|
+ if (!userMap[marker.userId]) {
|
|
|
|
+ userMap[marker.userId] = {
|
|
|
|
+ userId: marker.userId,
|
|
|
|
+ userName: marker.userName,
|
|
|
|
+ color: marker.header ? 'green' : 'red',
|
|
|
|
+ scores: [],
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ userMap[marker.userId].scores.push({
|
|
|
|
+ score: marker.score,
|
|
|
|
+ subNumber: question.subNumber,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
- // 填空题的打分需要自动换行,目前一行只展示最多7个评分
|
|
|
|
|
|
+ // 填空题的打分需要自动换行,目前一行只展示最多10个评分
|
|
let offsetY = -1 * trackInfoLineHeight;
|
|
let offsetY = -1 * trackInfoLineHeight;
|
|
Object.values(userMap).forEach((user, index) => {
|
|
Object.values(userMap).forEach((user, index) => {
|
|
const zhs = ['一', '二', '三'];
|
|
const zhs = ['一', '二', '三'];
|
|
@@ -675,6 +708,22 @@ export default function useDraw(drawConfig: DrawConfig) {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ // 普通模式没有轨迹
|
|
|
|
+ if (!tList.length && question.markerList && question.markerList.length) {
|
|
|
|
+ let markers = question.markerList.filter((marker) => marker.header);
|
|
|
|
+ if (!markers.length) {
|
|
|
|
+ markers = question.markerList.filter((marker) => !marker.header);
|
|
|
|
+ }
|
|
|
|
+ markers.forEach((marker) => {
|
|
|
|
+ userMap[marker.userId] = {
|
|
|
|
+ userId: marker.userId,
|
|
|
|
+ userName: marker.userName,
|
|
|
|
+ color: marker.header ? 'green' : 'red',
|
|
|
|
+ scores: [{ score: marker.score, subNumber: question.subNumber }],
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
const isDoubleMark = Object.values(userMap).length > 1;
|
|
const isDoubleMark = Object.values(userMap).length > 1;
|
|
Object.values(userMap).forEach((user, index) => {
|
|
Object.values(userMap).forEach((user, index) => {
|
|
const zhs = ['一', '二', '三'];
|
|
const zhs = ['一', '二', '三'];
|