提交 fd08c714 authored 作者: zfl's avatar zfl

新增一致性功能

上级 b354214f
......@@ -92,6 +92,16 @@ export function viewExamResults(id) {
})
}
//考试结果查看
export function consistency_evaluation_data_api(data) {
return request({
url: `/student/test_results/getUserconsistency_evaluation_data/${data.id}`,
method: 'post',
data
})
}
//注册
export function userLogon(data) {
return request({
......
......@@ -87,9 +87,11 @@
trigger="click"
v-if="item[e.key].length > 0"
>
<div style="max-height: 40vh; overflow:auto">
<div v-for="(h, j) in item[e.key]" :key="j">
{{ h }}
</div>
</div>
<el-button slot="reference" type="text" size="mini"
>...</el-button
>
......
......@@ -31,6 +31,9 @@
</el-row>
</div>
<div class="content_container" v-if="original_data.type == 'table'">
<el-select style="width: 100%;" v-if="original_data.use_user" v-model="original_data.student_id" @change="selectChange_suser">
<el-option v-for="(e, i) in original_data.use_user" :label="e.type?'第一名':e.name" :value="e.student_id" :key="i"></el-option>
</el-select>
<Table
:merge_fields="original_data.merge_fields"
:table_data="original_data.list"
......@@ -139,6 +142,9 @@ export default {
selectChange(val) {
this.position_data = val;
},
selectChange_suser(){
this.$emit('selectChange_suser', this.original_data.student_id);
}
},
};
</script>
......
......@@ -46,6 +46,9 @@ export function toPercent(num, total) {
export function countOccurrences(arr) {
// 创建一个空对象用于存储每个数据的出现次数
const result = {};
if(!arr){
return result;
}
// 遍历数组
for (let i = 0; i < arr.length; i++) {
// 获取当前数据
......
......@@ -187,6 +187,22 @@
</AnalyseModule>
</div>
</el-col>
<el-col
:span="12"
:xs="24"
v-if="review_conditions"
class="unit_container"
>
<div class="centenr_container">
<AnalyseModule
:module_data="consistency_evaluation_data"
:key="consistency_evaluation_data.key"
@selectChange_suser="selectChange_suser"
v-if="consistency_evaluation_data"
>
</AnalyseModule>
</div>
</el-col>
</el-row>
</div>
</div>
......@@ -204,7 +220,7 @@
<script>
import { toPercent, countOccurrences } from '@/utils/tool';
import AnalyseModule from '@/components/AnalyseModule/index.vue';
import { consistency_evaluation_data_api } from '@/api/user';
export default {
props: ['summary_data'],
data() {
......@@ -240,8 +256,12 @@ export default {
wrongG_group_data: null,
//学员得分
transcript_data: null,
// 一致性评价
consistency_evaluation_data:null,
//老师点评
found_remark: null,
UserbList:[],
};
},
......@@ -256,6 +276,15 @@ export default {
},
methods: {
selectChange_suser(student_id){
// this.consistency_evaluation_data=null
consistency_evaluation_data_api({
"student_id":student_id,
'id':this.$route.query.id
}).then((res) => {
this.consistency_evaluation_data=this.consistency_evaluation_dataHandle(res);
})
},
//获取批阅试题列表-详情
getReadOverDetail() {
this.is_loading = true;
......@@ -307,10 +336,86 @@ export default {
this.wrongG_group_data = this.changeWrongGroup(
this.summary_data.WrongGroup
); //错误组别
this.consistency_evaluation_data=this.consistency_evaluation_dataHandle(this.summary_data.consistency_evaluation_data);
// console.log('处理好的数据');
// console.log(this.wrong_position_data);
},
consistency_evaluation_dataHandle(data){
let list=[]
let info=[]
if(data.data && data.data.consistency_evaluation){
info=[]
for(let i of data.data.consistency_evaluation){
info.push(`${i.num}:${i.my}`)
}
list.push({
p:'一致性',
score:((data.data.consistency_evaluation.length/data.num)*100).toFixed(2)+'%',
info:info,
});
}
if(data.data && data.data.no_consistency_evaluation && data.data.no_consistency_evaluation.err_color){
info=[`题号:我的结果-比较人`]
for(let i of data.data.no_consistency_evaluation.err_color){
info.push(`${i.num}:${i.my}-${i.ther}`)
}
list.push({
p:'错颜色情况',
score:((data.data.no_consistency_evaluation.err_color.length/data.num)*100).toFixed(2)+'%',
info:info,
});
}
if(data.data && data.data.no_consistency_evaluation && data.data.no_consistency_evaluation.err_level){
info=[`题号:我的结果-比较人`]
for(let i of data.data.no_consistency_evaluation.err_level){
info.push(`${i.num}:${i.my}-${i.ther}`)
}
list.push({
p:'错颜色情况',
score:((data.data.no_consistency_evaluation.err_level.length/data.num)*100).toFixed(2)+'%',
info:info,
});
}
if(data.data && data.data.no_consistency_evaluation && data.data.no_consistency_evaluation.err_position){
info=[`题号:我的结果-比较人`]
for(let i of data.data.no_consistency_evaluation.err_position){
info.push(`${i.num}:${i.my}-${i.ther}`)
}
list.push({
p:'错颜色情况',
score:((data.data.no_consistency_evaluation.err_position.length/data.num)*100).toFixed(2)+'%',
info:info,
});
}
if(data.data && data.data.no_consistency_evaluation && data.data.no_consistency_evaluation.other){
info=[`题号:我的结果-比较人`]
for(let i of data.data.no_consistency_evaluation.other){
info.push(`${i.num}:${i.my}-${i.ther}`)
}
list.push({
p:'其他情况',
score:((data.data.no_consistency_evaluation.other.length/data.num)*100).toFixed(2)+'%',
info:info,
});
}
let labers = [
{ label: '项目', key: 'p' },
{ label: '得分(%)', key: 'score' },
{ label: '详情', key: 'info' },
];
this.UserbList=data.use_list?data.use_list:this.UserbList
return {
key:Math.random(),
type: 'table',
chart_id: 'consistency_evaluation_data',
color: '#99A9BF',
title: '一致性评价',
use_user:this.UserbList,
student_id:data.student_id,
labers,
list,
};
},
//计算百分比
toPercent,
//处理分段值
......@@ -574,16 +679,21 @@ export default {
{ label: '错误答案内容', key: 'distribute' },
];
keys.forEach((element, index) => {
for (let s in datas[element]) {
for (let i in datas[element][s]) {
list.push({
position: element,
answer: datas[element].answer,
wrong_num: datas[element].wrong_num,
// distribute: datas[element].distribute,
distribute: countOccurrences(datas[element].distribute),
wrong_position: s,
answer: datas[element][s][i].answer,
wrong_num: datas[element][s][i].wrong_num,
distribute: countOccurrences(datas[element][s][i].distribute),
});
}
}
});
return {
type: 'table',
merge_fields: ['position'],
chart_id: 'wrong_position',
color: '#E6A23C',
title: '错误部位',
......@@ -603,16 +713,25 @@ export default {
{ label: '错误答案内容', key: 'distribute' },
];
keys.forEach((element, index) => {
for (let s in datas[element]) {
list.push({
level: element,
answer: datas[element].answer,
wrong_num: datas[element].wrong_num,
// distribute: datas[element].distribute,
distribute: countOccurrences(datas[element].distribute),
answer: datas[element][s].answer,
wrong_num: datas[element][s].wrong_num,
distribute: countOccurrences(datas[element][s].distribute),
});
}
//list.push({
// level: element,
// answer: datas[element].answer,
// wrong_num: datas[element].wrong_num,
// // distribute: datas[element].distribute,
// distribute: countOccurrences(datas[element].distribute),
//});
});
return {
type: 'table',
merge_fields: ['level'],
chart_id: 'wrong_level',
color: '#505F79',
title: '错误上下一级',
......@@ -632,16 +751,25 @@ export default {
{ label: '错误答案内容', key: 'distribute' },
];
keys.forEach((element, index) => {
for (let s in datas[element]) {
list.push({
color: element,
answer: datas[element].answer,
wrong_num: datas[element].wrong_num,
// distribute: datas[element].distribute,
distribute: countOccurrences(datas[element].distribute),
answer: datas[element][s].answer,
wrong_num: datas[element][s].wrong_num,
distribute: countOccurrences(datas[element][s].distribute),
});
}
//list.push({
// color: element,
// answer: datas[element].answer,
// wrong_num: datas[element].wrong_num,
// // distribute: datas[element].distribute,
// distribute: countOccurrences(datas[element].distribute),
//});
});
return {
type: 'table',
merge_fields: ['color'],
chart_id: 'wrong_color',
color: '#99A9BF',
title: '错误颜色',
......@@ -661,15 +789,18 @@ export default {
{ label: '错误答案内容', key: 'distribute' },
];
keys.forEach((element, index) => {
for (let s in datas[element]) {
list.push({
group: element,
answer: datas[element].answer,
wrong_num: datas[element].wrong_num,
// distribute: datas[element].distribute,
distribute: countOccurrences(datas[element].distribute),
answer: datas[element][s].answer,
wrong_num: datas[element][s].wrong_num,
distribute: countOccurrences(datas[element][s].distribute),
});
}
});
return {
merge_fields: ['group'],
type: 'table',
chart_id: 'wrong_group',
color: '#529B2E',
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论