fix: 修复学生回答显示问题,和排序
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
This commit is contained in:
parent
dd12737ee4
commit
4fd36aedf1
@ -43,6 +43,7 @@ const rows = computed(() => {
|
|||||||
titleId: item?.titleId ?? '',
|
titleId: item?.titleId ?? '',
|
||||||
correctNum: correct,
|
correctNum: correct,
|
||||||
errorNum: error,
|
errorNum: error,
|
||||||
|
correctRate: Number.isFinite(rate) ? rate : 0,
|
||||||
correctRateText: `${(rate * 100).toFixed(0)}%`,
|
correctRateText: `${(rate * 100).toFixed(0)}%`,
|
||||||
unSubmitNum: unSubmit,
|
unSubmitNum: unSubmit,
|
||||||
}
|
}
|
||||||
@ -139,6 +140,10 @@ watch(
|
|||||||
function getTitleKey(item: any) {
|
function getTitleKey(item: any) {
|
||||||
return item.xkwTitle?.titleId ?? item.titleId ?? item.xkwTitle?.id ?? item.id
|
return item.xkwTitle?.titleId ?? item.titleId ?? item.xkwTitle?.id ?? item.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sortByCorrectRate(a: any, b: any) {
|
||||||
|
return Number(a?.correctRate ?? 0) - Number(b?.correctRate ?? 0)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -198,6 +203,7 @@ function getTitleKey(item: any) {
|
|||||||
label="得分率"
|
label="得分率"
|
||||||
class-name="pointer-cell"
|
class-name="pointer-cell"
|
||||||
sortable
|
sortable
|
||||||
|
:sort-method="sortByCorrectRate"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
|
|||||||
@ -54,8 +54,18 @@ type StudentPerformanceLevel =
|
|||||||
| 'fail'
|
| 'fail'
|
||||||
| 'default'
|
| 'default'
|
||||||
|
|
||||||
|
function hasAnyAnswer(item: any): boolean {
|
||||||
|
const answer = item?.submitAnswer
|
||||||
|
const hasText =
|
||||||
|
typeof answer === 'string' ? Boolean(answer.trim()) : Boolean(answer)
|
||||||
|
const pics = item?.submitAnswerPic
|
||||||
|
const hasPics = typeof pics === 'string' ? Boolean(pics.trim()) : Boolean(pics)
|
||||||
|
return hasText || hasPics
|
||||||
|
}
|
||||||
|
|
||||||
function resolvePerformanceLevel(item: any): StudentPerformanceLevel {
|
function resolvePerformanceLevel(item: any): StudentPerformanceLevel {
|
||||||
if (item.status === 0) return 'unsubmitted'
|
// 约定:学生只要上传了作答图片,也视为已作答(不算未提交)
|
||||||
|
if (item.status === 0 && !hasAnyAnswer(item)) return 'unsubmitted'
|
||||||
if (item.gradingStatus === 0) return 'ungraded'
|
if (item.gradingStatus === 0) return 'ungraded'
|
||||||
|
|
||||||
const level = Number(item?.level ?? item?.scoreLevel ?? 0)
|
const level = Number(item?.level ?? item?.scoreLevel ?? 0)
|
||||||
@ -72,6 +82,14 @@ function resolvePerformanceLevel(item: any): StudentPerformanceLevel {
|
|||||||
return 'default'
|
return 'default'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSubmitAnswerText(item: any): string {
|
||||||
|
const answer = item?.submitAnswer
|
||||||
|
if (typeof answer === 'string' && answer.trim()) return answer
|
||||||
|
if (answer != null && String(answer).trim()) return String(answer)
|
||||||
|
if (item?.submitAnswerPic) return '(已上传图片作答)'
|
||||||
|
return '未作答'
|
||||||
|
}
|
||||||
|
|
||||||
function getGradingStatusText(item: any) {
|
function getGradingStatusText(item: any) {
|
||||||
const performanceLevel = resolvePerformanceLevel(item)
|
const performanceLevel = resolvePerformanceLevel(item)
|
||||||
if (performanceLevel === 'unsubmitted') return '未提交'
|
if (performanceLevel === 'unsubmitted') return '未提交'
|
||||||
@ -578,7 +596,7 @@ async function submitCorrection() {
|
|||||||
<template v-if="!isSubjectiveItem(item)">
|
<template v-if="!isSubjectiveItem(item)">
|
||||||
<div class="student-answer">
|
<div class="student-answer">
|
||||||
<span class="label">学生答案:</span>
|
<span class="label">学生答案:</span>
|
||||||
<span class="content">{{ item.submitAnswer || '-' }}</span>
|
<span class="content">{{ getSubmitAnswerText(item) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="system-mark">
|
<div class="system-mark">
|
||||||
<span class="label">系统批改结果:</span>
|
<span class="label">系统批改结果:</span>
|
||||||
@ -611,7 +629,7 @@ async function submitCorrection() {
|
|||||||
class="answer-body"
|
class="answer-body"
|
||||||
v-html="
|
v-html="
|
||||||
highlightKeywords(
|
highlightKeywords(
|
||||||
formatParagraphs(item.submitAnswer || '未作答'),
|
formatParagraphs(getSubmitAnswerText(item)),
|
||||||
getAiKeywords(item),
|
getAiKeywords(item),
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user