作业批改:需求更新,界面调整

This commit is contained in:
白了个白 2024-11-04 15:36:00 +08:00
parent 4be888e39e
commit b07a4e07b9
4 changed files with 73 additions and 76 deletions

View File

@ -168,7 +168,6 @@ const getClassWorkList = async () => {
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
@ -200,19 +199,10 @@ const getClassWorkList = async () => {
} 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
// (workdataresultsum)>0
if (list && list.length > 0) {
classWorkList.value = list && list.filter((item) => item.workdatacount > 0)
classWorkList.value = list && list.filter((item) => item.workdataresultsum > 0)
//TODO total
total.value = 0
}else{
@ -305,29 +295,32 @@ const getStudentClassWorkData = async() => {
}
}
}
// workdatacount
// workdataresultsum
if (res.rows[i].classworkid == classWorkList.value[t].id) {
classWorkList.value[t].workdatalist.push(res.rows[i])
}
}
// workdatacount0
// workdataresultsum0
if (
classWorkList.value[t].workdataresultcount > 0 &&
classWorkList.value[t].workdatacount > 0
classWorkList.value[t].workdataresultsum > 0
) {
classWorkList.value[t].finishpercent = parseInt(
(classWorkList.value[t].workdataresultcount / classWorkList.value[t].workdatacount) * 100
)
// - : -
// teacherCorrectionProgress :
// workdataresultcount
// teacherrationgcount
// (-) / * 100
classWorkList.value[t].teacherCorrectionProgress = parseInt(
((classWorkList.value[t].teacherrationgcount) / classWorkList.value[t].workdataresultcount) * 100
(classWorkList.value[t].workdataresultcount / classWorkList.value[t].workdataresultsum) * 100
)
} else {
classWorkList.value[t].finishpercent = 0
}
/** 计算 已批阅进度 */
// workdataresultsum teacherrationgcount
// (-) / * 100
if (classWorkList.value[t].workdataresultsum > 0) {
// teacherCorrectionProgress :
classWorkList.value[t].teacherCorrectionProgress = parseInt(
((classWorkList.value[t].teacherrationgcount) / classWorkList.value[t].workdataresultsum) * 100
)
} else {
classWorkList.value[t].teacherCorrectionProgress = 0
}
@ -352,7 +345,7 @@ const getStudentClassWorkData = async() => {
var dd =
(classWorkList.value[t].rightAnswerCount /
(classWorkList.value[t].entpcourseworklistarray.length *
classWorkList.value[t].workdatacount)) *
classWorkList.value[t].workdataresultsum)) *
100
classWorkList.value[t].scoingRate = dd.toFixed(0) + '%'
} else {
@ -466,12 +459,12 @@ const getStudentVisible = async () => {
// }
// (index)
let curWork = curWorkList.find((work) => work.id === classWorkList.value[t].id)
// workdataresultcount workdatacount0
if (curWork && curWork.workdataresultcount > 0 && classWorkList.value[t].workdatacount > 0) {
// workdataresultcount workdataresultsum0
if (curWork && curWork.workdataresultcount > 0 && classWorkList.value[t].workdataresultsum > 0) {
classWorkList.value[t].workdataresultcount = curWork.workdataresultcount
//
classWorkList.value[t].finishpercent = parseInt(
(classWorkList.value[t].workdataresultcount / classWorkList.value[t].workdatacount) * 100
(classWorkList.value[t].workdataresultcount / classWorkList.value[t].workdataresultsum) * 100
)
//
if (classWorkList.value[t].workdatafeedbackcount > 0) {
@ -479,17 +472,7 @@ const getStudentVisible = async () => {
} else {
classWorkList.value[t].averagetime = 0
}
//
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
// - :
// teacherCorrectionProgress :
// workdataresultcount
// teacherrationgcount
// () / * 100
classWorkList.value[t].teacherCorrectionProgress = parseInt(
((curWork.teacherrationgcount) / curWork.workdataresultcount) * 100
)
} else {
//
if(curWork && curWork.workdataresultcount == 0){
@ -497,6 +480,20 @@ const getStudentVisible = async () => {
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
}
classWorkList.value[t].finishpercent = 0
}
/** 计算 已批阅进度 */
// workdataresultsum teacherrationgcount
// (-) / * 100
if (curWork && curWork.workdataresultsum > 0) {
//
classWorkList.value[t].teacherrationgcount = curWork.teacherrationgcount
// teacherCorrectionProgress :
classWorkList.value[t].teacherCorrectionProgress = parseInt(
((curWork.teacherrationgcount) / curWork.workdataresultsum) * 100
)
} else {
classWorkList.value[t].teacherCorrectionProgress = 0
}
}

View File

@ -15,27 +15,37 @@
</div>
</div>
<div class="class-reserv-item-progress">
<el-progress :text-inside="true" :stroke-width="26" :percentage="item.finishpercent" status="success" style="cursor: pointer"></el-progress>
<span>已交</span>
</div>
<div class="class-reserv-item-progress">
<el-progress :text-inside="true" :stroke-width="26" :percentage="item.teacherCorrectionProgress" status="success" style="cursor: pointer"></el-progress>
<span>已批阅</span>
</div>
<!-- <div class="class-reserv-item-tool">
<div v-if=" tabactive == '待批改' " class="class-reserv-item-progress">
<el-progress :text-inside="true" :stroke-width="26" :percentage="item.finishpercent" :color="'#000fff'" style="cursor: pointer"></el-progress>
<span>
已交(
<span>
<span v-if="item.workdataresultcount!=0" style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultcount }}</span>
<span v-if="item.workdataresultcount==0">{{ item.workdataresultcount }}</span>
/{{ item.workdatacount }}</span>
<span>已交</span>
/{{ item.workdataresultsum }}
</span>
)
</span>
</div>
<div class="class-reserv-item-tool">
<span style="color: #ff7f00; font-weight: 900; font-size: 15px">{{ item.teacherrationgcount?item.workdatacount - item.teacherrationgcount:item.workdatacount }}</span>
<span>待批阅</span>
</div> -->
<div v-if=" tabactive == '待批改' " class="class-reserv-item-progress">
<el-progress :text-inside="true" :stroke-width="26" :percentage="item.teacherCorrectionProgress" :color="'#ff7f00'" style="cursor: pointer"></el-progress>
<span>
已批阅(<span style="color: #ff7f00; font-weight: 900; font-size: 15px">{{ item.teacherrationgcount}}</span>)
</span>
</div>
<!-- TODO 练习次数\引用次数 这里随便的假数据-->
<div v-if=" tabactive == '已批改' " class="class-reserv-item-tool">
<span style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultsum }}</span>
<span>练习次数</span>
</div>
<div v-if=" tabactive == '已批改' " class="class-reserv-item-tool">
<span style="color: #ff7f00; font-weight: 900; font-size: 15px">{{ item.teacherrationgcount?item.workdataresultsum - item.teacherrationgcount:item.workdataresultsum }}</span>
<span>引用次数</span>
</div>
<div class="class-reserv-item-tool">
<span>
<span style="color: #007fff; font-weight: 900; font-size: 15px">{{ item.averagetime }}</span>分钟
@ -98,6 +108,7 @@ const props = defineProps({
}
.class-reserv-item-progress {
width: 200px;
padding: 0 10px;
font-size: 14px;
}
.class-reserv-item-tool {

View File

@ -21,7 +21,7 @@
<div class="class-time">{{ item.classcaption }} | 截止时间{{ item.deaddate }} </div>
</div>
<div class="class-right">
<div><span class="num">{{ item.workdataresultcount }}</span> / {{ item.workdatacount }}</div>
<div><span class="num">{{ item.workdataresultcount }}</span> / {{ item.workdataresultsum }}</div>
<div>已交</div>
</div>
</li>
@ -72,7 +72,6 @@ const getHomework = async () => {
item.workclass = ''
}
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
//
if (item.entpcourseworklist != '') {
item.entpcourseworklistarray = JSON.parse(

View File

@ -70,7 +70,6 @@ export const getClassWorkList = async (id) => {
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
@ -100,19 +99,10 @@ export const getClassWorkList = async (id) => {
} 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 的
// 显示分配人数(workdataresultsum)>0 的
if (list && list.length > 0) {
classWorkList = list && list.filter((item) => item.workdatacount > 0)
classWorkList = list && list.filter((item) => item.workdataresultsum > 0)
//TODO 这里没分页,貌似这个 total 不重要,后续看
} else {
classWorkList = []
@ -180,18 +170,18 @@ export const getStudentClassWorkData = async () => {
}
}
}
// 当前这个学习任务共推送给了几个学生workdatacount
// 当前这个学习任务共推送给了几个学生workdataresultsum
if (res.rows[i].classworkid == classWorkList[t].id) {
classWorkList[t].workdatalist.push(res.rows[i])
}
}
// 计算完成进度 workdatacount人数要大于0
// 计算完成进度 workdataresultsum 人数要大于0
if (
classWorkList[t].workdataresultcount > 0 &&
classWorkList[t].workdatacount > 0
classWorkList[t].workdataresultsum > 0
) {
classWorkList[t].finishpercent = parseInt(
(classWorkList[t].workdataresultcount / classWorkList[t].workdatacount) * 100
(classWorkList[t].workdataresultcount / classWorkList[t].workdataresultsum) * 100
)
} else {
classWorkList[t].finishpercent = 0
@ -220,7 +210,7 @@ export const getStudentClassWorkData = async () => {
var dd =
(classWorkList[t].rightAnswerCount /
(classWorkList[t].entpcourseworklistarray.length *
classWorkList[t].workdatacount)) *
classWorkList[t].workdataresultsum)) *
100
classWorkList[t].scoingRate = dd.toFixed(0) + '%'
} else {