Compare commits
14 Commits
6112cc8a92
...
8a759479bd
Author | SHA1 | Date |
---|---|---|
lyc | 8a759479bd | |
lyc | e891259413 | |
yangws | 14340e211d | |
小杨 | 24ce28f2e2 | |
小杨 | 0de7a7356e | |
lyc | 0b4019957f | |
lyc | e457ac9baf | |
baigl | 7b2ad4ce64 | |
白了个白 | 758081d9e5 | |
白了个白 | a7a84b3738 | |
yangws | 6467203c26 | |
小杨 | 49b4ba1f02 | |
小杨 | 2c2c5b32e9 | |
zouyf | 2f726bccfb |
|
@ -259,9 +259,10 @@ const onSubmit = (formEl) => {
|
|||
classworkarray: JSON.stringify(ary)
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
setLoading.value = false
|
||||
ElMessage.success('操作成功')
|
||||
emit('on-success', res.data)
|
||||
emit('on-success', res)
|
||||
cloneDialog(formEl)
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -32,9 +32,9 @@ export const editListItem = (row, courseObj) => {
|
|||
worktype: '', // 设计中的作业类型
|
||||
quizlist: [], // 设计中的试题列表
|
||||
chooseWorkLists: [],// 设计中的框架梳理list
|
||||
fileHomeworkList: [],// 设计中的主题作业list
|
||||
whiteboardObj: '',// 设计中的创作展示对象
|
||||
question: '', // 设计中的[创作展示]的问题
|
||||
fileHomeworkList: [],// 设计中的常规作业list
|
||||
whiteboardObj: '',// 设计中的课堂展示对象
|
||||
question: '', // 设计中的[课堂展示]的问题
|
||||
};
|
||||
console.log('编辑的行', row);
|
||||
|
||||
|
@ -53,8 +53,8 @@ export const editListItem = (row, courseObj) => {
|
|||
classtaskObj.worktype= row.worktype; // 设计中的作业类型
|
||||
classtaskObj.quizlist= []; // 设计中的试题列表
|
||||
classtaskObj.chooseWorkLists = []; //设计中的 框架梳理list
|
||||
classtaskObj.fileHomeworkList = []; //设计中的 主题作业list
|
||||
classtaskObj.whiteboardObj = ''; //设计中的 创作展示对象
|
||||
classtaskObj.fileHomeworkList = []; //设计中的 常规作业list
|
||||
classtaskObj.whiteboardObj = ''; //设计中的 课堂展示对象
|
||||
|
||||
|
||||
if (row.worktype == '框架梳理') {
|
||||
|
@ -96,19 +96,19 @@ export const editListItem = (row, courseObj) => {
|
|||
}
|
||||
})
|
||||
}
|
||||
else if (row.worktype == '创作展示') {
|
||||
console.log('row.创作展示', row.workcodes);
|
||||
else if (row.worktype == '课堂展示') {
|
||||
console.log('row.课堂展示', row.workcodes);
|
||||
const workcodes = JSON.parse(row.workcodes);
|
||||
classtaskObj.whiteboardObj = JSON.stringify(workcodes.json);
|
||||
classtaskObj.question = row.worktag;
|
||||
// console.log('创作展示', classtaskObj);
|
||||
// console.log('课堂展示', classtaskObj);
|
||||
return resolve(classtaskObj);
|
||||
}
|
||||
else if (row.worktype == '主题作业') {
|
||||
else if (row.worktype == '常规作业') {
|
||||
if(isJson(row.workcodes)){
|
||||
classtaskObj.fileHomeworkList = JSON.parse(row.workcodes);
|
||||
//
|
||||
// console.log('主题作业', classtaskObj);
|
||||
// console.log('常规作业', classtaskObj);
|
||||
return resolve(classtaskObj);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,11 +86,11 @@ const getHomeWorkList = async () => {
|
|||
// res.rows[i].workcodesList = JSON.parse(res.rows[i].workcodes);
|
||||
// } else
|
||||
// 课标研读 目标设定 教材研读 框架梳理 学科定位 TODO 后续接入在添加
|
||||
if (res.rows[i].worktype == '创作展示') {
|
||||
if (res.rows[i].worktype == '课堂展示') {
|
||||
res.rows[i].workclass = 'primary';
|
||||
} else if (res.rows[i].worktype == '框架梳理') {
|
||||
res.rows[i].workclass = 'warning';
|
||||
} else if (res.rows[i].worktype == '主题作业') {
|
||||
} else if (res.rows[i].worktype == '常规作业') {
|
||||
res.rows[i].workclass = 'info';
|
||||
} else if (res.rows[i].worktype == '习题训练') {
|
||||
res.rows[i].workclass = 'danger';
|
||||
|
|
|
@ -36,8 +36,8 @@ export class MsgEnum {
|
|||
* | MSG_pushQuizOfClassWorkdata2Public | 老师端:把选中的学生习题作业,推到大屏 | pushQuizOfClassWorkdata2Public |
|
||||
* | MSG_pushClassWorkdata2Public | 老师端:把选中的学生作业,推到大屏 | pushClassWorkdata2Public |
|
||||
* | MSG_shareStudentPresentdata2All | 把某个学生的展示成果数据推给全班所有学生 | shareStudentPresentdata2All |
|
||||
* | MSG_pushStudentPresentdata2Public | 老师端:创作展示活动,把选中的学生展示数据,推到大屏 | pushStudentPresentdata2Public |
|
||||
* | MSG_pushClassWorkPresentList2Public | 老师端:创作展示活动,任务列表,推到大屏 | pushClassWorkPresentList2Public |
|
||||
* | MSG_pushStudentPresentdata2Public | 老师端:课堂展示活动,把选中的学生展示数据,推到大屏 | pushStudentPresentdata2Public |
|
||||
* | MSG_pushClassWorkPresentList2Public | 老师端:课堂展示活动,任务列表,推到大屏 | pushClassWorkPresentList2Public |
|
||||
* | MSG_activePageType | 课标研读-分页切换 | activePageType |
|
||||
* | MSG_slideFlapping | 幻灯片-切换 | slideFlapping |
|
||||
* | MSG_anmationclick | 幻灯片-动画切换 | anmationclick |
|
||||
|
@ -46,7 +46,7 @@ export class MsgEnum {
|
|||
* | MSG_classtaskfeedback | 老师端:接收到学生反馈消息-课堂测练中的其他任务 | classtaskfeedback |
|
||||
* | MSG_studentfeedback | 老师端:学生反馈的消息,具体要看其中的feedbackkey,类别较繁杂 | studentfeedback |
|
||||
* | MSG_studentfeedbackcancel | 老师端:学生反馈的消息取消,如取消学会了,取消困惑 | studentfeedbackcancel |
|
||||
* | MSG_classshowdata | 学生提交的创作展示数据-要在老师端显示,再由老师选择推送到公屏上 | classshowdata |
|
||||
* | MSG_classshowdata | 学生提交的课堂展示数据-要在老师端显示,再由老师选择推送到公屏上 | classshowdata |
|
||||
* | MSG_classWorkOfPresentDataUpdate | 学生在公屏上展示并完善后,保存后,老师端要更新 | classWorkOfPresentDataUpdate |
|
||||
* | MSG_classlecturePagesrc | 课堂讲授活动,选择不同的内容 | classlecturePagesrc |
|
||||
* | --- | 以下为新定义-消息头 | --- |
|
||||
|
@ -66,9 +66,9 @@ export class MsgEnum {
|
|||
MSG_pushClassWorkdata2Public : 'pushClassWorkdata2Public',
|
||||
/** @desc: 把某个学生的展示成果数据推给全班所有学生 */
|
||||
MSG_shareStudentPresentdata2All : 'shareStudentPresentdata2All',
|
||||
/** @desc: 老师端:创作展示活动,把选中的学生展示数据,推到大屏 */
|
||||
/** @desc: 老师端:课堂展示活动,把选中的学生展示数据,推到大屏 */
|
||||
MSG_pushStudentPresentdata2Public : 'pushStudentPresentdata2Public',
|
||||
/** @desc: 老师端:创作展示活动,任务列表,推到大屏 */
|
||||
/** @desc: 老师端:课堂展示活动,任务列表,推到大屏 */
|
||||
MSG_pushClassWorkPresentList2Public : 'pushClassWorkPresentList2Public',
|
||||
/** @desc: 课标研读-分页切换 */
|
||||
MSG_activePageType : 'activePageType',
|
||||
|
@ -86,7 +86,7 @@ export class MsgEnum {
|
|||
MSG_studentfeedback : 'studentfeedback',
|
||||
/** @desc: 老师端:学生反馈的消息取消,如取消学会了,取消困惑 */
|
||||
MSG_studentfeedbackcancel : 'studentfeedbackcancel',
|
||||
/** @desc: 学生提交的创作展示数据-要在老师端显示,再由老师选择推送到公屏上 */
|
||||
/** @desc: 学生提交的课堂展示数据-要在老师端显示,再由老师选择推送到公屏上 */
|
||||
MSG_classshowdata : 'classshowdata',
|
||||
/** @desc: 学生在公屏上展示并完善后,保存后,老师端要更新 */
|
||||
MSG_classWorkOfPresentDataUpdate : 'classWorkOfPresentDataUpdate',
|
||||
|
|
|
@ -291,7 +291,7 @@ const getStudentClassWorkData = async() => {
|
|||
}
|
||||
|
||||
for (var e = 0; e < evalarray.length; e++) {
|
||||
if (res.rows[i].worktype == '主题作业') {
|
||||
if (res.rows[i].worktype == '常规作业') {
|
||||
evalarray[e].feedcontent = escapeHtmlQuotes(evalarray[e].feedcontent).replace(
|
||||
/"(\[.*\])"/g,
|
||||
'$1'
|
||||
|
|
|
@ -148,9 +148,9 @@
|
|||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TODO 创作展示 预览待开发-->
|
||||
<!-- 主题作业:包含多个格式(图片略缩图展示,点击放大;其他附件跳转另外弹窗查看) -->
|
||||
<div v-if="currentTag=='主题作业'" :style="{'padding': '15px', 'overflow': 'auto'}">
|
||||
<!-- TODO 课堂展示 预览待开发-->
|
||||
<!-- 常规作业:包含多个格式(图片略缩图展示,点击放大;其他附件跳转另外弹窗查看) -->
|
||||
<div v-if="currentTag=='常规作业'" :style="{'padding': '15px', 'overflow': 'auto'}">
|
||||
<div style="margin: 5px; background-color: white">
|
||||
<div v-if="workConfObj.teacherFeedContentList.length > 0">
|
||||
<div class="image_list">
|
||||
|
@ -362,9 +362,9 @@ const currentTag = ref('');// 当前作业类型
|
|||
const workConfObj = reactive({
|
||||
quizlist: [], // 习题list
|
||||
chooseWorkLists: [], // 框架梳理
|
||||
teacherFeedContentList: [],//主题作业
|
||||
teachFileList: [], // 主题作业文件list
|
||||
teachImageList: [],// 主题作业图片list
|
||||
teacherFeedContentList: [],//常规作业
|
||||
teachFileList: [], // 常规作业文件list
|
||||
teachImageList: [],// 常规作业图片list
|
||||
});
|
||||
|
||||
// 推送相关
|
||||
|
@ -440,11 +440,11 @@ const queryPushRecords = (row) => {
|
|||
// res.rows[i].workcodesList = JSON.parse(res.rows[i].workcodes);
|
||||
// } else
|
||||
// 课标研读 目标设定 教材研读 框架梳理 学科定位 TODO 后续接入在添加
|
||||
if (res.rows[i].worktype == '创作展示') {
|
||||
if (res.rows[i].worktype == '课堂展示') {
|
||||
res.rows[i].workclass = 'primary';
|
||||
} else if (res.rows[i].worktype == '框架梳理') {
|
||||
res.rows[i].workclass = 'warning';
|
||||
} else if (res.rows[i].worktype == '主题作业') {
|
||||
} else if (res.rows[i].worktype == '常规作业') {
|
||||
res.rows[i].workclass = 'info';
|
||||
} else if (res.rows[i].worktype == '习题训练') {
|
||||
res.rows[i].workclass = 'danger';
|
||||
|
@ -686,9 +686,9 @@ const handleWorkTitleEdit = (row, index, type) => {
|
|||
})
|
||||
}
|
||||
|
||||
//TODO 待完善 创作展示
|
||||
if(row.worktype == '主题作业'){
|
||||
console.log(row,'主题作业');
|
||||
//TODO 待完善 课堂展示
|
||||
if(row.worktype == '常规作业'){
|
||||
console.log(row,'常规作业');
|
||||
workConfObj.teacherFeedContentList = [];
|
||||
workConfObj.teachImageList = [];
|
||||
workConfObj.teachFileList = [];
|
||||
|
@ -795,13 +795,13 @@ const prevRead = (item) => {
|
|||
proxy.$refs.prevReadMsgDialogRef.openDialog(item);
|
||||
}
|
||||
/**
|
||||
* 主题作业:其他附件预览
|
||||
* 常规作业:其他附件预览
|
||||
*/
|
||||
const openFile = () => {
|
||||
const obj = {
|
||||
teacherFeedContentList: workConfObj.teacherFeedContentList,//主题作业
|
||||
teachFileList: workConfObj.teachFileList, // 主题作业文件list
|
||||
teachImageList: workConfObj.teachImageList,// 主题作业图片list
|
||||
teacherFeedContentList: workConfObj.teacherFeedContentList,//常规作业
|
||||
teachFileList: workConfObj.teachFileList, // 常规作业文件list
|
||||
teachImageList: workConfObj.teachImageList,// 常规作业图片list
|
||||
}
|
||||
proxy.$refs.prevReadImgFileDialogRef.acceptParams(obj);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-form ref="classWorkFormScoreRef" :model="classWorkFormScore" style="height: 100%">
|
||||
<!-- <div class="teacher_content" :style="{ height: dialogProps.maxheight + 'px' }"> -->
|
||||
<div class="teacher_content" :style="{ height: '100%' }">
|
||||
<div class="teacher_content" :style="{ height: '100%',fontSize: '18px' }">
|
||||
<div style="font-size: 18px; width: 100%; padding: 5px 10px; flex: 0 0 auto;">
|
||||
{{ classWorkFormScore.name }} 答题详情
|
||||
</div>
|
||||
|
@ -136,11 +136,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 题目内容:主题作业、创作展示 -->
|
||||
<!-- 题目内容:常规作业、课堂展示 -->
|
||||
<div
|
||||
v-if="
|
||||
dialogProps.studentObj.worktype == '主题作业' ||
|
||||
dialogProps.studentObj.worktype == '创作展示' ||
|
||||
dialogProps.studentObj.worktype == '常规作业' ||
|
||||
dialogProps.studentObj.worktype == '课堂展示' ||
|
||||
dialogProps.studentObj.worktype == '框架梳理'
|
||||
"
|
||||
>
|
||||
|
@ -152,11 +152,11 @@
|
|||
<span>{{ sIndex + 1 }}、{{ stuItem.score ? stuItem.score : 0 }}分</span>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 主题作业 -->
|
||||
<!-- 常规作业 -->
|
||||
<div
|
||||
v-if="
|
||||
dialogProps.studentObj.worktype == '主题作业' ||
|
||||
dialogProps.studentObj.worktype == '创作展示' ||
|
||||
dialogProps.studentObj.worktype == '常规作业' ||
|
||||
dialogProps.studentObj.worktype == '课堂展示' ||
|
||||
dialogProps.studentObj.worktype == '框架梳理'
|
||||
"
|
||||
>
|
||||
|
@ -210,8 +210,8 @@
|
|||
|
||||
<!-- 学生答题展示 -->
|
||||
<div v-if="feedContentList.length > 0">
|
||||
<div v-if="dialogProps.studentObj.worktype == '主题作业' && stuItem.rightanswer != ''&& stuItem.rightanswer != null">
|
||||
<!-- 主题作业:学生有的会答复 -->
|
||||
<div v-if="dialogProps.studentObj.worktype == '常规作业' && stuItem.rightanswer != ''&& stuItem.rightanswer != null">
|
||||
<!-- 常规作业:学生有的会答复 -->
|
||||
<p style="padding: 10px 0;text-align: left;">学生答复内容</p>
|
||||
<div style="padding: 0 20px;text-align: left;">{{stuItem.rightanswer}}</div>
|
||||
</div>
|
||||
|
@ -284,59 +284,27 @@
|
|||
|
||||
<!-- 批改评价与评语 -->
|
||||
<div class="tacher_conten_foot">
|
||||
<el-row style="padding: 1% 4%; border: 2px dotted">
|
||||
<el-col :span="24" style="display: flex; flex-direction: column">
|
||||
<el-row style=" padding: 1% 4%; border: 2px dotted;">
|
||||
<el-col :span="24" style="display: flex;flex-direction: column;">
|
||||
<el-row>
|
||||
<el-col :span="14">
|
||||
<div style="display: flex; margin: 10px auto">
|
||||
<span style="display: flex; align-items: center">
|
||||
<span v-if="dialogProps.studentObj.worktype == '习题训练'">
|
||||
<span>得分: </span>
|
||||
<span style="margin: 0; color: red">{{
|
||||
classWorkFormScore.teacherRating.reduce((a, b) => a + b.score, 0).toFixed(2)
|
||||
}}</span>
|
||||
<span>分</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span>得分: </span>
|
||||
<span v-if="classWorkFormScore.teacherRating.length > 0">
|
||||
<el-input-number
|
||||
v-model="classWorkFormScore.teacherRating[0].score"
|
||||
:controls="false"
|
||||
type="number"
|
||||
:min="0"
|
||||
:max="classWorkFormScore.teacherRating[0].maxScore"
|
||||
size="small"
|
||||
style="width: 60px"
|
||||
@change="handleChange"
|
||||
></el-input-number>
|
||||
</span>
|
||||
<span>分</span>
|
||||
</span>
|
||||
</span>
|
||||
<el-col :span="24">
|
||||
<div class="greenLine" style="text-align: left;" v-if="dialogProps.studentObj.worktype == '习题训练'">
|
||||
<span style="font-weight: bold;">老师点评:</span>
|
||||
<span style="margin: 0;">{{ classWorkFormScore.teacherRating.reduce((a, b) => a + b.score, 0).toFixed(2)}}</span>分
|
||||
</div>
|
||||
<div style="display: flex; margin: 10px auto;align-items: center;justify-content: space-between;">
|
||||
<div class="score-container">
|
||||
<div
|
||||
v-for="(score, index) in teacherRatingList"
|
||||
:key="index"
|
||||
style="white-space: nowrap;"
|
||||
:class="[
|
||||
'score-circle',
|
||||
{ active: classWorkFormScore.rating == score.ratingKey }
|
||||
]"
|
||||
:class="['score-circle', { 'active': classWorkFormScore.rating == score.ratingKey }]"
|
||||
@click="selectScore(score)"
|
||||
>
|
||||
{{ score.ratingValue }}
|
||||
<el-text :style="{fontWeight:'bold', color: classWorkFormScore.rating == score.ratingKey ? 'rgb(225,12,8)':'rgb(131,131,131)' }">{{ score.ratingValue }}</el-text>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="10" style="display: flex; align-items: center">
|
||||
<el-select
|
||||
v-model="value"
|
||||
placeholder="常用评语"
|
||||
style="width: 240px"
|
||||
@change="onSelectOption"
|
||||
>
|
||||
<el-select v-model="value" placeholder="常用评语" style="width: 240px" @change="onSelectOption">
|
||||
<el-option
|
||||
v-for="item in cities"
|
||||
:key="item.value"
|
||||
|
@ -354,23 +322,21 @@
|
|||
placeholder="输入新的常用语"
|
||||
size="small"
|
||||
/>
|
||||
<el-button type="primary" size="small" @click="onConfirm"> 确定 </el-button>
|
||||
<el-button type="primary" size="small" @click="onConfirm">
|
||||
确定
|
||||
</el-button>
|
||||
<el-button size="small" @click="clear">取消</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" style="display: flex; flex-direction: column">
|
||||
<el-form-item label="评语说明">
|
||||
<el-col :span="15" style="padding: 0px">
|
||||
<el-input
|
||||
v-model="classWorkFormScore.teacherremark"
|
||||
type="textarea"
|
||||
rows="1"
|
||||
placeholder="请输入评语说明"
|
||||
/>
|
||||
<el-col :span="24" style="display: flex;flex-direction: column;">
|
||||
<el-form-item>
|
||||
<el-col :span="24" style="padding: 0px">
|
||||
<el-input row="5" type="textarea" v-model="classWorkFormScore.teacherremark" rows="1" placeholder="输入评语" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -484,11 +450,11 @@ const dialogProps = ref({
|
|||
studentQuizAllList: [], //学生答题的list
|
||||
quizlist: [] // 当前学生的所有题目list
|
||||
})
|
||||
//学生主题作业list
|
||||
//学生常规作业list
|
||||
const feedContentList = ref([])
|
||||
const imageList = ref([])
|
||||
const fileList = ref([])
|
||||
// 老师主题作业、创作展示布置题目附件list
|
||||
// 老师常规作业、课堂展示布置题目附件list
|
||||
const teacherFeedContentList = ref([])
|
||||
const teachImageList = ref([])
|
||||
const teachFileList = ref([])
|
||||
|
@ -644,7 +610,33 @@ const selectScore = (score) => {
|
|||
console.log(score, 'score----')
|
||||
classWorkFormScore.rating = score.ratingKey
|
||||
}
|
||||
const checkWorkType = (params) => {
|
||||
//这里判断题目类型
|
||||
const subType = params.quizlist.map(item => item.worktype)
|
||||
const objectiveQuestion = ['单选题','多选题','判断题']
|
||||
//判断题目是不是客观题
|
||||
if(subType.every(item => objectiveQuestion.includes(item))){
|
||||
// 获取学生答题列表
|
||||
|
||||
const score = extractedNumber(params.studentObj.scoingRate)
|
||||
if(0<=score<=59){
|
||||
classWorkFormScore.rating = 5
|
||||
}else if(60<=score<=69){
|
||||
classWorkFormScore.rating = 4
|
||||
}else if(70<=score<=79){
|
||||
classWorkFormScore.rating = 3
|
||||
}else if(80<=score<=99){
|
||||
classWorkFormScore.rating = 2
|
||||
}else{
|
||||
classWorkFormScore.rating = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取百分比的数字
|
||||
const extractedNumber = (score) => {
|
||||
const match = score.match(/\d+/);
|
||||
return match ? parseInt(match[0], 10) : null;
|
||||
}
|
||||
// 接收父组件传过来的参数
|
||||
const acceptParams = async (params) => {
|
||||
console.log(params)
|
||||
|
@ -665,7 +657,7 @@ const acceptParams = async (params) => {
|
|||
teacherFeedContentList.value = []
|
||||
teachImageList.value = []
|
||||
teachFileList.value = []
|
||||
|
||||
checkWorkType(params)
|
||||
// -----------------
|
||||
dialogProps.value = params
|
||||
classWorkFormScore.name = params.studentObj.studentname
|
||||
|
@ -708,9 +700,9 @@ const acceptParams = async (params) => {
|
|||
})
|
||||
} else {
|
||||
// 学生回答
|
||||
if (params.studentObj.worktype == '主题作业') {
|
||||
if (params.studentObj.worktype == '常规作业') {
|
||||
try {
|
||||
// 老师布置的附件 datacontent TODO:主题作业、其他类型还未接入
|
||||
// 老师布置的附件 datacontent TODO:常规作业、其他类型还未接入
|
||||
const res = await getClassworkdata(params.studentObj.id);
|
||||
if(res.data.datacontent != ''){
|
||||
const teachWorkFileList = JSON.parse(res.data.datacontent);
|
||||
|
@ -762,7 +754,7 @@ const acceptParams = async (params) => {
|
|||
}
|
||||
})
|
||||
} else if (
|
||||
params.studentObj.worktype == '创作展示' ||
|
||||
params.studentObj.worktype == '课堂展示' ||
|
||||
params.studentObj.worktype == '框架梳理'
|
||||
) {
|
||||
params.studentQuizAllList.forEach((item) => {
|
||||
|
@ -774,7 +766,7 @@ const acceptParams = async (params) => {
|
|||
classWorkFormScore.teacherremark = item.teacherremark // 评价语
|
||||
// 根据移动端返回定义:只返回一张图片:rightanswer:"https://wzyzoss.eos-chongqing-3.cmecloud.cn/2024/9/5/c5d8e00a93364dd3b975f669afa217f9.png"
|
||||
// 这里只有一张图片;
|
||||
console.log(item.rightanswer, '----------创作展示学生答题------------------')
|
||||
console.log(item.rightanswer, '----------课堂展示学生答题------------------')
|
||||
|
||||
if (item.rightanswer != '' && item.rightanswer != null) {
|
||||
if (
|
||||
|
@ -803,7 +795,7 @@ const acceptParams = async (params) => {
|
|||
console.log(params.studentQuizAllList[0].rating, '----------------------------')
|
||||
// 为null 或0 则默认为0
|
||||
classWorkFormScore.rating =
|
||||
params.studentQuizAllList[0].rating == 0 ? 0 : params.studentQuizAllList[0].rating
|
||||
params.studentQuizAllList[0].rating == 0 ? classWorkFormScore.rating : params.studentQuizAllList[0].rating
|
||||
}
|
||||
|
||||
analysisScoreOpen.value = true
|
||||
|
@ -975,23 +967,23 @@ defineExpose({
|
|||
}
|
||||
|
||||
.score-circle {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
background-color: pink;
|
||||
color: red;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 13px;
|
||||
margin: 0 10px;
|
||||
border: 1px solid rgb(131,131,131,.5);
|
||||
padding: 5px 0;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s;
|
||||
margin-right: 5px;
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.score-circle.active {
|
||||
background-color: red;
|
||||
background-color: rgb(253, 236, 224);
|
||||
color: white;
|
||||
border: 1px solid rgb(253, 236, 224);
|
||||
}
|
||||
.greenLine{
|
||||
border-left: 5px solid rgb(14, 209, 22);
|
||||
padding-left: 5px
|
||||
}
|
||||
|
||||
.card-header{
|
||||
|
|
|
@ -59,7 +59,7 @@ const props = defineProps({})
|
|||
|
||||
const fileReadopen = ref(false)
|
||||
|
||||
// 老师主题作业、创作展示布置题目附件list
|
||||
// 老师常规作业、课堂展示布置题目附件list
|
||||
const teacherFeedContentList = ref([])
|
||||
const teachImageList = ref([])
|
||||
const teachFileList = ref([])
|
||||
|
|
|
@ -429,7 +429,7 @@ const getStudentClassWorkDataDetail = (row) => {
|
|||
// ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
|
||||
// : wevalres.rows[w].feedcontent
|
||||
|
||||
if (classWorkAnalysis.row.worktype == '主题作业') {
|
||||
if (classWorkAnalysis.row.worktype == '常规作业') {
|
||||
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)
|
||||
}
|
||||
if (wevalres.rows[w].feedcontent != '') {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<!-- 作业资源 -->
|
||||
<el-row class="middle">
|
||||
<el-col :span="24" style="height: 100%; overflow: hidden;">
|
||||
<div v-if="classWorkForm.worktype == '创作展示'" style="height: 100%; display: flex; flex-direction: column;">
|
||||
<div v-if="classWorkForm.worktype == '课堂展示'" style="height: 100%; display: flex; flex-direction: column;">
|
||||
<div style="flex: 0 0 auto;">
|
||||
<el-form-item label="问题">
|
||||
<el-input v-model="classWorkForm.question" type="text" placeholder="请输入问题" />
|
||||
|
@ -130,7 +130,7 @@
|
|||
<!-- 非习题训练:常规作业、 -->
|
||||
<div v-if="classWorkForm.worktype!='习题训练'">
|
||||
<div :style="{ 'overflow': 'auto'}">
|
||||
<template v-if="classWorkForm.worktype!='主题作业'">
|
||||
<template v-if="classWorkForm.worktype!='常规作业'">
|
||||
<template v-for="(item, index) in workResource.teachResourceList" :key="item">
|
||||
<div v-if="item.worktype==classWorkForm.worktype" style="border-bottom: 1px dotted;display: flex;justify-content: space-between;">
|
||||
<div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;">
|
||||
|
@ -152,7 +152,7 @@
|
|||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="classWorkForm.worktype =='主题作业'">
|
||||
<template v-if="classWorkForm.worktype =='常规作业'">
|
||||
<div v-loading="fileLoading" class="upload-homework">
|
||||
<FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
|
||||
</div>
|
||||
|
@ -208,7 +208,7 @@
|
|||
<!-- 作业说明 -->
|
||||
<el-row class="bottom">
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="classWorkForm.worktype != '创作展示'" label="作业说明" style="margin: 10px 0;">
|
||||
<el-form-item v-if="classWorkForm.worktype != '课堂展示'" label="作业说明" style="margin: 10px 0;">
|
||||
<el-col :span="15" style="padding: 0px">
|
||||
<!-- <el-input v-model="classWorkForm.title" type="textarea" :rows="1" placeholder="请输入作业说明"/> -->
|
||||
<el-input v-model="classWorkForm.title" style="width: 400px" placeholder="请输入作业说明"/>
|
||||
|
@ -352,16 +352,16 @@ let classWorkForm = reactive({
|
|||
quizlist: props.propsformobj.quizlist?cloneDeep(props.propsformobj.quizlist):[], // 作业习题列表内容
|
||||
chooseWorkLists: props.propsformobj.chooseWorkLists?cloneDeep(props.propsformobj.chooseWorkLists):[], // 作业框架梳理list
|
||||
fileHomeworkList: props.propsformobj.fileHomeworkList?cloneDeep(props.propsformobj.fileHomeworkList):[], // 常规作业文件列表
|
||||
whiteboardObj: props.propsformobj.whiteboardObj?cloneDeep(props.propsformobj.whiteboardObj):'', // 作业资源 - 创作展示 白板
|
||||
question: props.propsformobj.question?cloneDeep(props.propsformobj.question):'', // 作业资源 - 创作展示 输入的问题
|
||||
whiteboardObj: props.propsformobj.whiteboardObj?cloneDeep(props.propsformobj.whiteboardObj):'', // 作业资源 - 课堂展示 白板
|
||||
question: props.propsformobj.question?cloneDeep(props.propsformobj.question):'', // 作业资源 - 课堂展示 输入的问题
|
||||
}); // 提交的作业内容
|
||||
// ---------------------------------------------------
|
||||
// const listWorkType = ref(['习题训练', '框架梳理', '创作展示', '主题作业']); //作业类型
|
||||
const listWorkType = ref(['习题训练', '创作展示', '主题作业']); //作业类型
|
||||
// const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //作业类型
|
||||
const listWorkType = ref(['习题训练', '课堂展示', '常规作业']); //作业类型
|
||||
|
||||
// 创作展示-------
|
||||
// 课堂展示-------
|
||||
const boardLoading = ref(false);
|
||||
//主题作业----------
|
||||
//常规作业----------
|
||||
const fileLoading = ref(false); // 常规作业loading
|
||||
|
||||
/***
|
||||
|
@ -638,7 +638,7 @@ const handleClassWorkSave = async () => {
|
|||
|
||||
|
||||
|
||||
if (classWorkForm.worktype === "创作展示") {
|
||||
if (classWorkForm.worktype === "课堂展示") {
|
||||
boardLoading.value = true
|
||||
let canvasJson = proxy.$refs.boardref.getCanvasJson()
|
||||
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
|
||||
|
@ -651,7 +651,7 @@ const handleClassWorkSave = async () => {
|
|||
addClassworkReturnId(cform).then(() => {
|
||||
ElMessage({ type: 'success', message: '作业设计成功!'});
|
||||
// 重置提交表单
|
||||
classWorkForm.worktype = "创作展示";
|
||||
classWorkForm.worktype = "课堂展示";
|
||||
classWorkForm.uniquekey = props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
||||
classWorkForm.title = "";
|
||||
classWorkForm.question = "";
|
||||
|
@ -667,7 +667,7 @@ const handleClassWorkSave = async () => {
|
|||
boardLoading.value = false
|
||||
}
|
||||
}
|
||||
else if(classWorkForm.worktype === "主题作业"){
|
||||
else if(classWorkForm.worktype === "常规作业"){
|
||||
fileLoading.value = true
|
||||
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
||||
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
||||
|
@ -675,7 +675,7 @@ const handleClassWorkSave = async () => {
|
|||
addClassworkReturnId(cform).then(() => {
|
||||
ElMessage({ type: 'success', message: '作业设计成功!'});
|
||||
// 重置提交表单
|
||||
classWorkForm.worktype = "主题作业";
|
||||
classWorkForm.worktype = "常规作业";
|
||||
classWorkForm.uniquekey = props.propsformobj.uniquekey, // 作业唯一标识 作业名称
|
||||
classWorkForm.title = "";
|
||||
classWorkForm.quizlist = [], // 作业习题列表内容
|
||||
|
@ -757,7 +757,7 @@ const editWork = async (cform) =>{
|
|||
ElMessage.error('请先添加作业资源!');
|
||||
return;
|
||||
}
|
||||
}else if (classWorkForm.worktype == '创作展示' || classWorkForm.worktype == '主题作业') {
|
||||
}else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
|
||||
// 不做校验
|
||||
|
||||
}else {
|
||||
|
@ -842,13 +842,13 @@ const editWork = async (cform) =>{
|
|||
let res = await updateClassworkeval(uplParams);
|
||||
}
|
||||
}
|
||||
else if (classWorkForm.worktype=='创作展示') {
|
||||
else if (classWorkForm.worktype=='课堂展示') {
|
||||
let canvasJson = proxy.$refs.boardref.getCanvasJson()
|
||||
let canvasBase64 = await proxy.$refs.boardref.getCanvasBase64()
|
||||
cform.workcodes = JSON.stringify({json: canvasJson, base64: canvasBase64});
|
||||
cform.worktag = classWorkForm.question;
|
||||
}
|
||||
else if (classWorkForm.worktype=='主题作业') {
|
||||
else if (classWorkForm.worktype=='常规作业') {
|
||||
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
||||
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
||||
}
|
||||
|
|
|
@ -68,8 +68,8 @@ const classWorkForm = reactive({
|
|||
quizlist: classtaskObj? JSON.parse(classtaskObj).quizlist : [], // 设计中的试题列表
|
||||
chooseWorkLists: classtaskObj? JSON.parse(classtaskObj).chooseWorkLists : [],// 设计中的框架梳理list
|
||||
fileHomeworkList: classtaskObj? JSON.parse(classtaskObj).fileHomeworkList : [],// 设计中的常规文件作业list
|
||||
whiteboardObj: classtaskObj? JSON.parse(classtaskObj).whiteboardObj : '',// 设计中的 创作展示 板书作业
|
||||
question: classtaskObj? JSON.parse(classtaskObj).question : '',// 设计中的 创作展示 输入的问题
|
||||
whiteboardObj: classtaskObj? JSON.parse(classtaskObj).whiteboardObj : '',// 设计中的 课堂展示 板书作业
|
||||
question: classtaskObj? JSON.parse(classtaskObj).question : '',// 设计中的 课堂展示 输入的问题
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ const getStudentClassWorkDataDetail = (row) => {
|
|||
// ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
|
||||
// : wevalres.rows[w].feedcontent
|
||||
|
||||
if (classWorkAnalysis.row.worktype == '主题作业') {
|
||||
if (classWorkAnalysis.row.worktype == '常规作业') {
|
||||
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)
|
||||
}
|
||||
if (wevalres.rows[w].feedcontent != '') {
|
||||
|
|
|
@ -85,10 +85,11 @@ import FileImage from '@/components/file-image/index.vue'
|
|||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { ipcMsgSend, ipcMsgInvoke } from '@/utils/tool'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import {createWindow} from '@/utils/tool'
|
||||
import Lesson from './lesson.vue';
|
||||
import { parseCataByNode } from '@/utils/talkFile'
|
||||
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息枚举
|
||||
import { createHomework } from '../createHomework'
|
||||
import { createHomework, getClassWorkList, getStudentClassWorkData } from '../createHomework'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -110,7 +111,13 @@ const curNode = reactive({
|
|||
data: {}
|
||||
})
|
||||
|
||||
const props = defineProps(['curNode'])
|
||||
const emit = defineEmits(['closeActive'])
|
||||
|
||||
|
||||
const sendHomework = (row,type) => {
|
||||
|
||||
|
||||
if(type == 'item'){
|
||||
// 布置推送单个作业
|
||||
curRow.value = [row]
|
||||
|
@ -124,11 +131,28 @@ const sendHomework = (row,type) => {
|
|||
const closeHomework = async() => {
|
||||
ipcMsgSend('tool-sphere:set:ignore', true)
|
||||
}
|
||||
|
||||
|
||||
// 推送成功
|
||||
const successHomework = (data)=>{
|
||||
const successHomework = async (data)=>{
|
||||
// data.msg
|
||||
// console.log('推送成功', data)
|
||||
// 发送im消息-推送作业(app|平板)
|
||||
// ipcMsgInvoke('im-chat:msg', data, MsgEnum.HEADS.MSG_0016)
|
||||
|
||||
/**
|
||||
* 推送成功 打开作业批改
|
||||
* 2024/10/23
|
||||
* 以下两个函数 代码 参照"作业批改" 页面
|
||||
*/
|
||||
let result = await getClassWorkList(data.msg)
|
||||
result = await getStudentClassWorkData()
|
||||
localStorage.setItem('teachClassWorkItem', JSON.stringify(result[0]));
|
||||
toolStore.isTaskWin=true; // 设置打开批改窗口
|
||||
emit('closeActive')
|
||||
createWindow('open-taskwin',{url:'/teachClassTask'}); // 调用新窗口批改页面
|
||||
|
||||
|
||||
}
|
||||
// 章节目录change
|
||||
const changeChapter = async (data)=>{
|
||||
|
@ -222,7 +246,8 @@ onMounted(async () => {
|
|||
entpcourseid.value = route.query.entpcourseid
|
||||
lesson.value = route.query.label
|
||||
// 当前节点 mounted 的时候从缓存里拿
|
||||
curNode.data = sessionStore.get('subject.curNode')
|
||||
// curNode.data = sessionStore.get('subject.curNode')
|
||||
curNode.data = props.curNode
|
||||
getHomework()
|
||||
getResource()
|
||||
})
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<div class="c-popover" :style="`--top: ${topPos}px;--height:${hPost}px;`" v-show="isVisible">
|
||||
<div class="content" v-if="isVisible">
|
||||
<slot name="content">
|
||||
<homework v-if="activeObj?.prop === 'resource'" />
|
||||
<homework v-if="activeObj?.prop === 'resource'" :curNode="curNode" @closeActive="closeActive" />
|
||||
<span v-else style="color:red;">{{activeObj}}</span>
|
||||
</slot>
|
||||
</div>
|
||||
|
@ -35,6 +35,7 @@
|
|||
</template>
|
||||
<script setup>
|
||||
import { computed, defineProps, ref, reactive, watchEffect, onMounted } from 'vue'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import homework from './homework.vue';
|
||||
|
||||
// 功能说明:侧边-工具栏
|
||||
|
@ -63,6 +64,8 @@ const topPos = ref(30) // 顶部距离-内容的距离
|
|||
const hPost = ref(0) // 顶部距离-内容的距离
|
||||
const isFold = ref(false) // 是否折叠
|
||||
let posBtnAll = {} // 存储位置
|
||||
|
||||
let curNode = null // 当前节点(作业需要)
|
||||
// === 计算属性 ===
|
||||
const list = computed(() => props.data.map((o,i) => {
|
||||
o.style = getStyle(o.style, i)
|
||||
|
@ -71,6 +74,8 @@ const list = computed(() => props.data.map((o,i) => {
|
|||
onMounted(() => {
|
||||
posBtnAll = btnRef.value.getBoundingClientRect()
|
||||
hPost.value = posBtnAll.height
|
||||
|
||||
curNode = sessionStore.get('subject.curNode')
|
||||
})
|
||||
// === 方法 ===
|
||||
// 获取颜色索引
|
||||
|
@ -96,6 +101,10 @@ const clickHandel = (o, e) => {
|
|||
}
|
||||
emit('change', o)
|
||||
}
|
||||
|
||||
const closeActive = () =>{
|
||||
isVisible.value = false
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.warp{
|
||||
|
|
|
@ -1,37 +1,226 @@
|
|||
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
||||
import { listClassworkdata } from '@/api/classTask'
|
||||
import { homeworklist } from '@/api/teaching/classwork'
|
||||
|
||||
|
||||
|
||||
export const createHomework = ({ uniquekey, evalid, data, entpcourseid }) => {
|
||||
const usertore = useUserStore().user
|
||||
|
||||
var formObj = {};
|
||||
formObj.id = 0;
|
||||
var formObj = {}
|
||||
formObj.id = 0
|
||||
|
||||
formObj.deaddate = '';
|
||||
formObj.entpid = usertore.deptId;
|
||||
formObj.level = 1;
|
||||
formObj.parentid = 0;
|
||||
formObj.worktype = '主题作业';
|
||||
formObj.workkey = '';
|
||||
formObj.worktag = '';
|
||||
formObj.deaddate = ''
|
||||
formObj.entpid = usertore.deptId
|
||||
formObj.level = 1
|
||||
formObj.parentid = 0
|
||||
formObj.worktype = '常规作业'
|
||||
formObj.workkey = ''
|
||||
formObj.worktag = ''
|
||||
|
||||
formObj.uniquekey = uniquekey;
|
||||
formObj.uniquekey = uniquekey
|
||||
|
||||
formObj.classid = 0;
|
||||
formObj.classcourseid = 0;
|
||||
formObj.classid = 0
|
||||
formObj.classcourseid = 0
|
||||
|
||||
formObj.entpcourseid = entpcourseid;
|
||||
formObj.entpcourseid = entpcourseid
|
||||
|
||||
formObj.slideid = 0;
|
||||
formObj.slideid = 0
|
||||
|
||||
formObj.workcodes = JSON.stringify(data);
|
||||
formObj.workcodes = JSON.stringify(data)
|
||||
|
||||
formObj.edusubject = usertore.edusubject;
|
||||
formObj.edusubject = usertore.edusubject
|
||||
formObj.evalid = evalid
|
||||
|
||||
formObj.edustage = usertore.edustage;
|
||||
formObj.status = '';
|
||||
formObj.edituserid = usertore.userId;
|
||||
formObj.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
||||
formObj.edustage = usertore.edustage
|
||||
formObj.status = ''
|
||||
formObj.edituserid = usertore.userId
|
||||
formObj.entpcourseworklist = JSON.stringify([{ id: -2, score: '10' }])
|
||||
return addClassworkReturnId(formObj)
|
||||
}
|
||||
|
||||
let classWorkList = []
|
||||
|
||||
/**
|
||||
* 获取班级作业
|
||||
*/
|
||||
export const getClassWorkList = async (id) => {
|
||||
// 班级作业数据,包含多个班级 homeworklist
|
||||
const response = await homeworklist({ id })
|
||||
|
||||
/**
|
||||
* 2024-10-17 由于 后面截止时间加了 时分,特加判断
|
||||
* 1、进行中、以前是以明天判断。现改为传当天的日期,并根据当前日期的时分与截止日期进行判断,
|
||||
* 2、已结束、以前默认是以明天判断。现依然以明天为判断,并根据当前日期时分大于截止日期时分判断。
|
||||
*/
|
||||
|
||||
let list = response.rows
|
||||
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
// 初始化部分新增字段值
|
||||
list[i].workdatalist = []
|
||||
list[i].workdatacount = 0 // 人数
|
||||
list[i].workdatalistVisible = false
|
||||
list[i].workdatafeedbackcount = 0 // 已交人数
|
||||
list[i].feedtimelength = 0
|
||||
list[i].rightAnswerCount = 0
|
||||
list[i].scoingRate = 0 + '%' // 得分率
|
||||
list[i].averagetime = 0 // 平均用时
|
||||
|
||||
// ----------------------------------------------
|
||||
// 处理任务类型的UI
|
||||
if (list[i].worktype == '学习目标定位') {
|
||||
list[i].workclass = 'success'
|
||||
list[i].workcodesList = JSON.parse(list[i].workcodes)
|
||||
} else if (list[i].worktype == '教材研读') {
|
||||
list[i].workclass = 'primary'
|
||||
} else if (list[i].worktype == '框架梳理') {
|
||||
list[i].workclass = 'warning'
|
||||
} else if (list[i].worktype == '学科定位') {
|
||||
list[i].workclass = 'info'
|
||||
} else if (list[i].worktype == '习题训练') {
|
||||
list[i].workclass = 'danger'
|
||||
} else {
|
||||
list[i].workclass = ''
|
||||
}
|
||||
// 如果是习题训练任务,则检查一共有多少道
|
||||
if (list[i].entpcourseworklist != '') {
|
||||
list[i].entpcourseworklistarray = JSON.parse('[' + list[i].entpcourseworklist + ']')
|
||||
} else {
|
||||
list[i].entpcourseworklistarray = []
|
||||
}
|
||||
// 根据 classworkdatastudentids 初始化判断分配的人数
|
||||
if (
|
||||
list[i].classworkdatastudentids != '' &&
|
||||
list[i].classworkdatastudentids != null &&
|
||||
list[i].classworkdatastudentids != 'null'
|
||||
) {
|
||||
const stuList = JSON.parse('[' + list[i].classworkdatastudentids + ']')
|
||||
list[i].workdatacount = stuList.length
|
||||
}
|
||||
}
|
||||
// 显示分配人数(workdatacount)>0 的
|
||||
if (list && list.length > 0) {
|
||||
classWorkList = list && list.filter((item) => item.workdatacount > 0)
|
||||
//TODO: 这里没分页,貌似这个 total 不重要,后续看
|
||||
} else {
|
||||
classWorkList = []
|
||||
}
|
||||
|
||||
return classWorkList
|
||||
}
|
||||
|
||||
export const getStudentClassWorkData = async () => {
|
||||
const ids = classWorkList.map((item) => item.id).join(',')
|
||||
if (ids == '') {
|
||||
return
|
||||
}
|
||||
const res = await listClassworkdata({
|
||||
classworkids: ids,
|
||||
pageSize: 1000
|
||||
})
|
||||
|
||||
for (var t = 0; t < classWorkList.length; t++) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
if (
|
||||
res.rows[i].classworkid == classWorkList[t].id &&
|
||||
res.rows[i].finishtimelength != '0'
|
||||
) {
|
||||
console.log('==================')
|
||||
// 有几个学生完成/正在完成学习任务
|
||||
// 至少resultcount不是0
|
||||
classWorkList[t].workdatafeedbackcount++
|
||||
|
||||
// 在参与学习任务的人中,汇总计算用时
|
||||
classWorkList[t].feedtimelength += parseInt(res.rows[i].finishtimelength)
|
||||
|
||||
// 计算得分率
|
||||
if (
|
||||
res.rows[i].classworkevallist != '' &&
|
||||
res.rows[i].classworkevallist != null &&
|
||||
res.rows[i].classworkevallist != 'null'
|
||||
) {
|
||||
let replacedString = res.rows[i].classworkevallist.replace(/""/g, '"')
|
||||
// 将标签中双引号改为转义, 测试数据: "{\"id\":172907, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":358520, \"feedcontent\":\"④①⑤③②\", \"score\":4, \"rightanswer\":\"④①⑤③②\"},{\"id\":172908, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":358521, \"feedcontent\":\"气壮山威,鲲鹏展翅楚云飞\", \"score\":4, \"rightanswer\":\"志远天高,春风杨柳麓山青\"},{\"id\":172909, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363096, \"feedcontent\":\"《红烛》化用“蜡矩”这一古典意象,赋予它新的含义,赞美了红烛以“蜡炬成灰”来点亮世界的奉献精神。\", \"score\":4, \"rightanswer\":\"《立在地球边上放号》中,全诗采用间接抒情的方式,描绘了太平洋的浪潮,吟唱了一曲惊心动魄的力的颂歌,意在赞美摧毁旧世界、创造新生活的“五四”精神。\"},{\"id\":172910, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363098, \"feedcontent\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"},{\"id\":172911, \"rating\":0, \"teacherRating\":0, \"entpcourseworkid\":363100, \"feedcontent\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\", \"score\":4, \"rightanswer\":\"毛泽东重游橘子洲,面对如画的秋色和大好的革命形势,回忆过去战斗的岁月,不禁心潮起伏,<bdo class=\"mathjye-underpoint2\">浮想联翩</bdo>。\"}"
|
||||
replacedString = escapeHtmlQuotes(res.rows[i].classworkevallist).replace(
|
||||
/"(\[.*\])"/g,
|
||||
'$1'
|
||||
)
|
||||
replacedString = escapeHtmlQuotes(res.rows[i].classworkevallist)
|
||||
var evalarray
|
||||
try {
|
||||
evalarray = JSON.parse('[' + res.rows[i].classworkevallist + ']')
|
||||
} catch {
|
||||
evalarray = JSON.parse('[' + replacedString + ']')
|
||||
}
|
||||
|
||||
for (var e = 0; e < evalarray.length; e++) {
|
||||
if (res.rows[i].worktype == '常规作业') {
|
||||
evalarray[e].feedcontent = escapeHtmlQuotes(evalarray[e].feedcontent).replace(
|
||||
/"(\[.*\])"/g,
|
||||
'$1'
|
||||
)
|
||||
evalarray[e].feedcontent = escapeHtmlQuotes(evalarray[e].feedcontent)
|
||||
}
|
||||
if (evalarray[e].feedcontent == evalarray[e].rightanswer) {
|
||||
// 正确,得分
|
||||
classWorkList[t].rightAnswerCount++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 当前这个学习任务,共推送给了几个学生,workdatacount
|
||||
if (res.rows[i].classworkid == classWorkList[t].id) {
|
||||
classWorkList[t].workdatalist.push(res.rows[i])
|
||||
}
|
||||
}
|
||||
// 计算完成进度 workdatacount人数要大于0
|
||||
if (
|
||||
classWorkList[t].workdataresultcount > 0 &&
|
||||
classWorkList[t].workdatacount > 0
|
||||
) {
|
||||
classWorkList[t].finishpercent = parseInt(
|
||||
(classWorkList[t].workdataresultcount / classWorkList[t].workdatacount) * 100
|
||||
)
|
||||
} else {
|
||||
classWorkList[t].finishpercent = 0
|
||||
}
|
||||
|
||||
// 以下四个参数,都要计算
|
||||
// 2024-04-12,酉阳,by jackyshen
|
||||
|
||||
// 计算参与学习任务的平均用时
|
||||
if (classWorkList[t].workdatafeedbackcount > 0) {
|
||||
classWorkList[t].averagetime = Math.ceil(
|
||||
classWorkList[t].feedtimelength / classWorkList[t].workdatafeedbackcount / 60
|
||||
).toFixed(0)
|
||||
} else {
|
||||
classWorkList[t].averagetime = 0
|
||||
}
|
||||
|
||||
// 计算批阅异常,需要获取每个题目的类型,找出主观题
|
||||
// 暂缓
|
||||
|
||||
// 计算平均得分率: 正确题数/(题目总数*学生人数)*100
|
||||
if (
|
||||
classWorkList[t].entpcourseworklistarray &&
|
||||
classWorkList[t].entpcourseworklistarray.length > 0
|
||||
) {
|
||||
var dd =
|
||||
(classWorkList[t].rightAnswerCount /
|
||||
(classWorkList[t].entpcourseworklistarray.length *
|
||||
classWorkList[t].workdatacount)) *
|
||||
100
|
||||
classWorkList[t].scoingRate = dd.toFixed(0) + '%'
|
||||
} else {
|
||||
classWorkList[t].scoingRate = '0%'
|
||||
}
|
||||
|
||||
|
||||
// 设定典型作答,需要获取每个题目的类型,找出主观题
|
||||
// 暂缓
|
||||
}
|
||||
return classWorkList
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue