[作业批改] - 重新优化常规作业逻辑

This commit is contained in:
“zouyf” 2024-10-16 09:22:18 +08:00
parent 5b1986afaf
commit d9ddb1982b
4 changed files with 32 additions and 23 deletions

View File

@ -18,6 +18,14 @@ export function listClassworkdataByDeadDate(query) {
}) })
} }
// 查询classworkdata详细
export function getClassworkdata(id) {
return request({
url: '/education/classworkdata/' + id,
method: 'get'
})
}
// 查询classworkdata列表 班级作业列表 // 查询classworkdata列表 班级作业列表
export function listClassworkdata(query) { export function listClassworkdata(query) {
return request({ return request({

View File

@ -460,12 +460,13 @@ import useUserStore from '@/store/modules/user'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
// import { Plus } from '@element-plus/icons-vue' // import { Plus } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import { updateClassworkeval, updateClassworkdata } from '@/api/classTask' import { updateClassworkeval, updateClassworkdata, getClassworkdata } from '@/api/classTask'
import { getTimeDate } from '@/utils/date' import { getTimeDate } from '@/utils/date'
import ReFilePreview from '@/components/refile-preview/index.vue' import ReFilePreview from '@/components/refile-preview/index.vue'
import { quizStrToList } from '@/utils/comm'; import { quizStrToList } from '@/utils/comm';
const userStore = useUserStore() const userStore = useUserStore()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
@ -644,7 +645,7 @@ const selectScore = (score) => {
} }
// //
const acceptParams = (params) => { const acceptParams = async (params) => {
console.log(params) console.log(params)
console.log(dialogProps, 'dialogProps') console.log(dialogProps, 'dialogProps')
// //
@ -709,8 +710,9 @@ const acceptParams = (params) => {
if (params.studentObj.worktype == '常规作业') { if (params.studentObj.worktype == '常规作业') {
try { try {
// datacontent TODO // datacontent TODO
if (params.studentObj.datacontent != '') { const res = await getClassworkdata(params.studentObj.id);
const teachWorkFileList = JSON.parse(params.studentObj.datacontent) if(res.data.datacontent != ''){
const teachWorkFileList = JSON.parse(res.data.datacontent);
console.log(teachWorkFileList, '老师filelist-------------') console.log(teachWorkFileList, '老师filelist-------------')
teachWorkFileList && teachWorkFileList &&
teachWorkFileList.forEach((item) => { teachWorkFileList.forEach((item) => {
@ -727,7 +729,6 @@ const acceptParams = (params) => {
teacherFeedContentList.value.push(teachWorkFileList) teacherFeedContentList.value.push(teachWorkFileList)
} }
dialogProps.value.studentObj.datacontent = dialogProps.value.studentObj.datacontent
} catch (error) { } catch (error) {
console.error('Invalid JSON:', error) console.error('Invalid JSON:', error)
} }

View File

@ -418,15 +418,15 @@ const getStudentClassWorkDataDetail = (row) => {
wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0 wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0
// html // html
wevalres.rows[w].rightanswer = // wevalres.rows[w].rightanswer =
wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null // wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '') // ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
: wevalres.rows[w].rightanswer // : wevalres.rows[w].rightanswer
// html // // html
wevalres.rows[w].feedcontent = // wevalres.rows[w].feedcontent =
wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null // wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '') // ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
: wevalres.rows[w].feedcontent // : wevalres.rows[w].feedcontent
if (classWorkAnalysis.row.worktype == '常规作业') { if (classWorkAnalysis.row.worktype == '常规作业') {
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent) wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)

View File

@ -410,15 +410,15 @@ const getStudentClassWorkDataDetail = (row) => {
wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0 wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0
// html // html
wevalres.rows[w].rightanswer = // wevalres.rows[w].rightanswer =
wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null // wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '') // ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
: wevalres.rows[w].rightanswer // : wevalres.rows[w].rightanswer
// html // // html
wevalres.rows[w].feedcontent = // wevalres.rows[w].feedcontent =
wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null // wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '') // ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
: wevalres.rows[w].feedcontent // : wevalres.rows[w].feedcontent
if (classWorkAnalysis.row.worktype == '常规作业') { if (classWorkAnalysis.row.worktype == '常规作业') {
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent) wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)