Jelajahi Sumber

完成配置阅卷老师、查看阅卷任务功能

liqk 4 tahun lalu
induk
melakukan
8c8e6011ee

+ 1 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/Correct.cs

@@ -102,6 +102,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos
     }
     }
     public class CorTmd{
     public class CorTmd{
         public string id { get; set; }
         public string id { get; set; }
+        public string name { get; set; }
         public int count { get; set; }
         public int count { get; set; }
     }
     }
 }
 }

+ 2 - 0
TEAMModelOS/ClientApp/src/api/index.js

@@ -27,6 +27,7 @@ import classroom from './classroom'
 import serviceDriveAuth from './serviceDriveAuth'
 import serviceDriveAuth from './serviceDriveAuth'
 import spaceAuth from './spaceAuth'
 import spaceAuth from './spaceAuth'
 import room from './room'
 import room from './room'
+import mark from './mark'
 
 
 export default {
 export default {
     accessToken,
     accessToken,
@@ -55,6 +56,7 @@ export default {
     serviceDriveAuth,
     serviceDriveAuth,
     spaceAuth,
     spaceAuth,
     room,
     room,
+    mark,
 
 
     // 获取登录跳转链接
     // 获取登录跳转链接
     getLoginLink: function (data) {
     getLoginLink: function (data) {

+ 22 - 0
TEAMModelOS/ClientApp/src/api/mark.js

@@ -0,0 +1,22 @@
+import { post } from '@/api/http'
+export default {
+    /*
+     *保存阅卷设置
+     */
+    UpsertMarkSet: function (data) {
+        return post('/school/correct/upsert', data)
+    },
+    /*
+     *根据评测id查询评测阅卷配置信息
+     */
+     FindById: function (data) {
+        return post('/school/correct/find-id', data)
+    },
+    /*
+     *根据评测id查询评测阅卷配置信息
+     */
+     FindTask: function (data) {
+        return post('/school/correct/find-task', data)
+    }
+
+}

+ 1 - 1
TEAMModelOS/ClientApp/src/router/routes.js

@@ -346,7 +346,7 @@ export const routes = [
 			component: resolve => require(['@/view/task/index.vue'], resolve),
 			component: resolve => require(['@/view/task/index.vue'], resolve),
 			meta: {
 			meta: {
 				activeName: 'taskList',
 				activeName: 'taskList',
-				isKeep: true
+				// isKeep: true
 			}
 			}
 		},
 		},
 		//自定义名单管理页面
 		//自定义名单管理页面

+ 14 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue

@@ -116,6 +116,13 @@
                             <Button type="warning" size="small" :loading="scoreLoading" class="mock-tea-scoring" @click="mockScoring">{{$t('learnActivity.mgtScEv.autoScore')}}</Button>
                             <Button type="warning" size="small" :loading="scoreLoading" class="mock-tea-scoring" @click="mockScoring">{{$t('learnActivity.mgtScEv.autoScore')}}</Button>
                         </Tooltip>
                         </Tooltip>
                     </div>-->
                     </div>-->
+                    <!-- 保存阅卷配置 -->
+                    <div style="float:right;" class="common-save-btn" v-show="curBarIndex == 2">
+                        <Button class="mock-stu-answer" type="text" :loading="btnLoading" @click="saveMarkSetting" icon="ios-albums-outline">
+                            {{$t('schoolBaseInfo.saveInfo')}}
+                        </Button>
+                    </div>
+
                 </div>
                 </div>
                 <!--试卷信息-->
                 <!--试卷信息-->
                 <div :class="curBarIndex == 1 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 1">
                 <div :class="curBarIndex == 1 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 1">
@@ -150,7 +157,7 @@
                             {{item.name}}
                             {{item.name}}
                         </span>
                         </span>
                     </div>
                     </div>
-                    <MarkSetting></MarkSetting>
+                    <MarkSetting ref="markSetting" v-if="evaListShow[curEvaIndex]" :evInfo="evaListShow[curEvaIndex]" :subjectId="evaListShow[curEvaIndex].subjects[curSubIndex].id"></MarkSetting>
                 </div>
                 </div>
                 <!-- 阅卷数据 -->
                 <!-- 阅卷数据 -->
                 <div :class="curBarIndex == 3 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 3">
                 <div :class="curBarIndex == 3 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 3">
@@ -172,6 +179,7 @@ export default {
     inject: ['reload'],
     inject: ['reload'],
     data() {
     data() {
         return {
         return {
+            btnLoading:false,
             keyword: '',
             keyword: '',
             isSearch: false,
             isSearch: false,
             answerLoading: false,
             answerLoading: false,
@@ -199,6 +207,11 @@ export default {
         }
         }
     },
     },
     methods: {
     methods: {
+        //保存阅卷配置
+        saveMarkSetting(){
+            console.log(this.$refs['markSetting'])
+            this.$refs['markSetting'].saveSetting()
+        },
         filterByName() {
         filterByName() {
             let curPdEv = this.evaluationList.filter(item => item.period.id === this.filterPeriod)
             let curPdEv = this.evaluationList.filter(item => item.period.id === this.filterPeriod)
             this.evaListShow = curPdEv.filter(item => {
             this.evaListShow = curPdEv.filter(item => {

+ 156 - 37
TEAMModelOS/ClientApp/src/view/learnactivity/markpaper/MarkSetting.vue

@@ -57,15 +57,15 @@
                     <div class="role-item-wrap dark-iview-table">
                     <div class="role-item-wrap dark-iview-table">
                         <span class="role-label" style="vertical-align: top;">{{$t('learnActivity.mark.markRole')}}</span>
                         <span class="role-label" style="vertical-align: top;">{{$t('learnActivity.mark.markRole')}}</span>
                         <div class="scan-tea-table">
                         <div class="scan-tea-table">
-                            <Table :columns="teaCol" :data="teaData" border :no-data-text="$t('learnActivity.mark.noTea')">
+                            <Table :columns="teaCol" :data="markers" border :no-data-text="$t('learnActivity.mark.noTea')">
                                 <template slot-scope="{ row }" slot="header">
                                 <template slot-scope="{ row }" slot="header">
                                     <PersonalPhoto :name="row.name" :picture="row.picture" />
                                     <PersonalPhoto :name="row.name" :picture="row.picture" />
                                 </template>
                                 </template>
                                 <template slot-scope="{ row }" slot="action">
                                 <template slot-scope="{ row }" slot="action">
                                     <Button type="error" size="small">{{$t('learnActivity.mark.remove')}}</Button>
                                     <Button type="error" size="small">{{$t('learnActivity.mark.remove')}}</Button>
                                 </template>
                                 </template>
-                                <template slot-scope="{ row }" slot="num">
-                                    <span>{{`${row.num}/24`}}</span>
+                                <template slot-scope="{ row }" slot="count">
+                                    <span>{{`${row.count}/${evInfo.stuCount}`}}</span>
                                 </template>
                                 </template>
                             </Table>
                             </Table>
                             <span class="add-tea-btn" @click="addTeaStatus = true">
                             <span class="add-tea-btn" @click="addTeaStatus = true">
@@ -114,16 +114,54 @@ import ScanProgress from '../echarts/ScanProgress.vue'
 import CptCount from '../echarts/CptCount.vue'
 import CptCount from '../echarts/CptCount.vue'
 import PersonalPhoto from "@/components/public/personalPhoto/Index.vue"
 import PersonalPhoto from "@/components/public/personalPhoto/Index.vue"
 export default {
 export default {
+    props: {
+        evInfo: {
+            type: Object,
+            default: () => {
+                return {
+                    id: '',
+                    name: ''
+                }
+            }
+        },
+        subjectId: {
+            type: String,
+            default: ''
+        }
+    },
     data() {
     data() {
         return {
         return {
             setting: {
             setting: {
-                mode: '',//阅卷模式
-                num: 0,//阅卷次数
-                err: [],//处理异常卷人员
-                arb: [],//处理冲裁卷人员
-                marker: [],//阅卷老师
-                point: 2,//分差(仲裁条件)
-                quRule: [],//题目分配规则
+                id: '',
+                code: '',
+                name: '',
+                owner: 'school',
+                school: '',
+                creatorId: '',
+                scope: 'school',
+                startTime: '',
+                createTime: '',
+                endTime: '',
+                scode: '',//评测的分区键
+                subs: [
+                    // {
+                    //     id: '',//科目id,
+                    //     name: '',//科目名称
+                    //     markers: [ //阅卷老师
+                    //         {
+                    //             id: '',
+                    //             count: 0
+                    //         }
+                    //     ],
+                    //     mode: '',//阅卷模式
+                    //     num: 0,//阅卷次数
+                    //     err: [],//处理异常卷人员
+                    //     arb: [],//处理冲裁卷人员
+                    //     point: 2,//分差(仲裁条件)
+                    //     quRule: []//题目分配规则
+                    // }
+                ],
+
             },
             },
             addTeaStatus: false,
             addTeaStatus: false,
             teacherList: [],
             teacherList: [],
@@ -174,7 +212,7 @@ export default {
                 },
                 },
                 {
                 {
                     title: this.$t('learnActivity.mark.markNum'),
                     title: this.$t('learnActivity.mark.markNum'),
-                    slot: 'num',
+                    slot: 'count',
                     align: 'center'
                     align: 'center'
                 },
                 },
                 {
                 {
@@ -183,7 +221,6 @@ export default {
                     align: 'center'
                     align: 'center'
                 },
                 },
             ],
             ],
-            teaData: [],
             quCol: [
             quCol: [
                 {
                 {
                     title: this.$t('learnActivity.mark.quIndex'),
                     title: this.$t('learnActivity.mark.quIndex'),
@@ -202,46 +239,98 @@ export default {
                     slot: 'teachers',
                     slot: 'teachers',
                 },
                 },
             ],
             ],
-            quData: [
-                {
-                    quNo: [1, 2, 3],
-                    teachers: [
-                        'JK',
-                        '尹航',
-                        '向奕然',
-                        '高嘉妍',
-                        '刘雨菡',
-                        'jefftest',
-                        '李芷萱',
-                    ]
-                }
-            ]
+            quData: []
         }
         }
     },
     },
     components: {
     components: {
         MarkProgress, CptCount, ScanProgress, PersonalPhoto
         MarkProgress, CptCount, ScanProgress, PersonalPhoto
     },
     },
     methods: {
     methods: {
+        saveSetting() {
+            this.setting.code = this.$store.state.userInfo.schoolCode
+            this.$api.mark.UpsertMarkSet(this.setting).then(
+                res => {
+                    this.$Message.success('保存成功!')
+                },
+                err => {
+                    this.$Message.error('保存失败!')
+                }
+            )
+        },
         //确认添加老师
         //确认添加老师
         okAddTea() {
         okAddTea() {
-            let ids = this.teaData.map(item => {
-                return item.id
-            })
-            this.sltTeachers.forEach(item => {
-                if (ids.indexOf(item.id) == -1) {
-                    this.teaData.push(item)
-                }
-            })
-            this.teaData.map(item => {
-                item.num = 24 / this.teaData.length
+            let subject = this.setting.subs.find(item => {
+                return this.subjectId == item.id
             })
             })
+            if (subject) {
+                let ids = subject.marker.map(item => {
+                    return item.id
+                })
+                this.sltTeachers.forEach(item => {
+                    if (ids.indexOf(item.id) == -1) {
+                        subject.marker.push({
+                            id: item.id,
+                            name: item.name
+                        })
+                    }
+                })
+                let more = this.evInfo.stuCount % subject.marker.length
+                subject.marker.map((item, index) => {
+                    if (index < more) {
+                        item.count = Math.ceil(this.evInfo.stuCount / subject.marker.length)
+                    } else {
+                        item.count = Math.floor(this.evInfo.stuCount / subject.marker.length)
+                    }
+
+                })
+            }
+            console.log(this.setting)
             this.cancel()
             this.cancel()
         },
         },
         cancel() {
         cancel() {
             this.sltTeachers = []
             this.sltTeachers = []
             this.$refs.sltTea.selectAll(false)
             this.$refs.sltTea.selectAll(false)
         },
         },
-        
+        //查询评测阅卷配置信息
+        findSettingInfo() {
+            let requestData = {
+                id: this.evInfo.id,
+                code: this.$store.state.userInfo.schoolCode
+            }
+            this.$api.mark.FindById(requestData).then(
+                res => {
+                    if (res.correct) {
+                        this.setting = res.correct
+                    } else {
+                        if (this.evInfo.subjects) {
+                            this.setting.id = this.evInfo.id
+                            this.setting.name = this.evInfo.name
+                            this.setting.school = this.$store.state.userInfo.schoolCode
+                            this.setting.code = this.$store.state.userInfo.schoolCode
+                            this.setting.scode = this.evInfo.code
+                            this.setting.creatorId = this.$store.state.userInfo.TEAMModelId
+                            this.setting.createTime = new Date().getTime()
+                            this.setting.startTime = new Date().getTime()
+                            this.setting.endTime = new Date().getTime() + 86400000 * 2
+                            this.evInfo.subjects.forEach((item) => {
+                                this.setting.subs.push({
+                                    id: item.id,
+                                    name: item.name,
+                                    marker: []
+                                })
+                            })
+                            console.log('初始化配置数据')
+                        }
+                    }
+                },
+                err => {
+
+                }
+            ).finally(() => {
+
+            })
+
+        }
     },
     },
     created() {
     created() {
         this.$store.dispatch('teachers/getTeacherList').then(res => {
         this.$store.dispatch('teachers/getTeacherList').then(res => {
@@ -250,6 +339,36 @@ export default {
             })
             })
             console.log(this.teacherList)
             console.log(this.teacherList)
         })
         })
+
+    },
+    watch: {
+        'evInfo.id': {
+            handler(n, o) {
+                console.log('评测信息', this.evInfo)
+                if (this.evInfo.id) {
+                    this.findSettingInfo()
+                } else {
+                    this.$Message.warning('暂无评测id')
+                }
+
+            },
+            deep: true
+        }
+    },
+    computed: {
+        //从基础信息获取阅卷老师
+        markers() {
+            let arr = []
+            if (this.setting.subs) {
+                let subject = this.setting.subs.find(item => {
+                    return item.id == this.subjectId
+                })
+                if (subject) {
+                    arr = subject.marker
+                }
+            }
+            return arr
+        }
     }
     }
 }
 }
 </script>
 </script>

+ 6 - 5
TEAMModelOS/ClientApp/src/view/learnactivity/markpaper/MarkView.vue

@@ -2,7 +2,7 @@
     <!-- 未做多语言 -->
     <!-- 未做多语言 -->
     <div class="mark-area">
     <div class="mark-area">
         <!-- 头部基础信息 -->
         <!-- 头部基础信息 -->
-        <div class="mark-header" v-show="markMode == 'paper'">
+        <div class="mark-header">
             <span class="quit-marking-text">
             <span class="quit-marking-text">
                 <!-- <Icon custom="iconfont icon-quit2" class="quit-marking-icon" title="退出阅卷" @click="test"/> -->
                 <!-- <Icon custom="iconfont icon-quit2" class="quit-marking-icon" title="退出阅卷" @click="test"/> -->
                 <Icon type="ios-arrow-back" class="quit-marking-icon" title="退出阅卷" @click="test" />
                 <Icon type="ios-arrow-back" class="quit-marking-icon" title="退出阅卷" @click="test" />
@@ -10,6 +10,8 @@
             </span>
             </span>
             <span class="info-label">考试名称:</span>
             <span class="info-label">考试名称:</span>
             <span class="info-value">一年级数学期末考试</span>
             <span class="info-value">一年级数学期末考试</span>
+            <span class="info-label">阅卷方式:</span>
+            <span class="info-value">{{mode == 0 ? '按题阅卷' : '按人阅卷'}}</span>
             <span class="info-label">学生:</span>
             <span class="info-label">学生:</span>
             <span class="info-value">基金会</span>
             <span class="info-value">基金会</span>
             <span class="info-label">分数:</span>
             <span class="info-label">分数:</span>
@@ -106,7 +108,7 @@ export default {
             isShowNum: true,
             isShowNum: true,
             scores: [],
             scores: [],
             qus: [],
             qus: [],
-            mode: '',
+            mode: '0',//阅卷模式 1:按人阅卷 0:按题阅卷
             quIndex: 1,
             quIndex: 1,
             stage: undefined,
             stage: undefined,
             orgLayer: undefined,
             orgLayer: undefined,
@@ -135,7 +137,6 @@ export default {
             imgs: [],
             imgs: [],
             curImg: undefined,
             curImg: undefined,
             counter: 0,
             counter: 0,
-            markMode: 'paper', //阅卷模式 paper:按人阅卷 qu:按题阅卷
             isFull: false, //是否为全屏模式
             isFull: false, //是否为全屏模式
             examData:{
             examData:{
                 name:'期末考试',
                 name:'期末考试',
@@ -767,9 +768,9 @@ export default {
 
 
         //模拟按题阅卷和整体阅卷
         //模拟按题阅卷和整体阅卷
         let routeData = this.$route
         let routeData = this.$route
-        // this.mode = routeData.params.type
+        this.mode = routeData.params.type
         if (routeData.name == 'FullMarkView') this.isFull = true
         if (routeData.name == 'FullMarkView') this.isFull = true
-        this.mode = 1
+        // this.mode = 1
 
 
         //监听删除按键,删除图形
         //监听删除按键,删除图形
         document.onkeydown = e => {
         document.onkeydown = e => {

+ 4 - 0
TEAMModelOS/ClientApp/src/view/task/index.less

@@ -210,4 +210,8 @@
 }
 }
 .mark-info-content{
 .mark-info-content{
     height: ~"calc(100% - 45px)" !important;
     height: ~"calc(100% - 45px)" !important;
+}
+.prog-tips{
+    margin-top: 5px;
+    font-size: 12px;
 }
 }

+ 28 - 25
TEAMModelOS/ClientApp/src/view/task/index.vue

@@ -15,7 +15,7 @@
                         </span>
                         </span>
                     </div>
                     </div>
                     <vuescroll class="ev-list-content">
                     <vuescroll class="ev-list-content">
-                        <div :class="['ev-item','block-bg',index == curEvIndex ? 'block-bg-active':'']" v-for="(item,index) in evList" :key="index" @click="selectEvaluation(index)">
+                        <div :class="['ev-item','block-bg',index == curEvIndex ? 'block-bg-active':'']" v-for="(item,index) in markList" :key="index" @click="selectEvaluation(index)">
                             <p class="ev-name">
                             <p class="ev-name">
                                 <span>{{item.name}}</span>
                                 <span>{{item.name}}</span>
                                 <span class="mark-status-tag">{{$t('task.markStatus1')}}</span>
                                 <span class="mark-status-tag">{{$t('task.markStatus1')}}</span>
@@ -26,7 +26,7 @@
                             </p>
                             </p>
                             <p class="ev-info">
                             <p class="ev-info">
                                 <Icon type="ios-cube" style="margin-right:5px;" size="14" />
                                 <Icon type="ios-cube" style="margin-right:5px;" size="14" />
-                                <span>{{$t('learnActivity.mgtScEv.evType')}}{{getTypeLabel(item.type)}}</span>
+                                <span>批阅科目:{{item.subjectName}}</span>
                             </p>
                             </p>
                         </div>
                         </div>
                     </vuescroll>
                     </vuescroll>
@@ -47,7 +47,7 @@
                             <p class="block-title">{{$t('learnActivity.mark.dataView')}}</p>
                             <p class="block-title">{{$t('learnActivity.mark.dataView')}}</p>
                             <div class="setting-content count-content">
                             <div class="setting-content count-content">
                                 <div class="count-wrap">
                                 <div class="count-wrap">
-                                    <p class="count-num">12</p>
+                                    <p class="count-num">13</p>
                                     <p class="count-label">
                                     <p class="count-label">
                                         <Icon type="ios-paper" class="count-icon" size="16" />
                                         <Icon type="ios-paper" class="count-icon" size="16" />
                                         {{$t('task.mLabel5')}}
                                         {{$t('task.mLabel5')}}
@@ -87,14 +87,17 @@
                                         {{index + 1}}
                                         {{index + 1}}
                                     </span>
                                     </span>
                                     <div class="progress-wrap">
                                     <div class="progress-wrap">
-                                        <Progress :percent="25" />
-                                        <p>
+                                        <Progress :percent="index < 3 ? 100 : 25" />
+                                        <p v-if="index < 3" class="prog-tips" style="color: #19be6b">
+                                            客观题已由系统自动完成评分。
+                                        </p>
+                                        <p v-else class="prog-tips">
                                             <span>{{$t('task.mLabel2')}}:4</span>
                                             <span>{{$t('task.mLabel2')}}:4</span>
                                             <span>{{$t('task.mLabel3')}}:8</span>
                                             <span>{{$t('task.mLabel3')}}:8</span>
                                         </p>
                                         </p>
                                     </div>
                                     </div>
                                     <div class="to-mark">
                                     <div class="to-mark">
-                                        <Button type="primary" shape="circle" size="small" style="width:120px" @click="toMarkView">
+                                        <Button type="primary" shape="circle" size="small" style="width:120px" @click="toMarkView(0)">
                                             {{$t('task.mark')}}
                                             {{$t('task.mark')}}
                                         </Button>
                                         </Button>
                                     </div>
                                     </div>
@@ -109,7 +112,7 @@
                             <p class="block-title">{{$t('learnActivity.mark.dataView')}}</p>
                             <p class="block-title">{{$t('learnActivity.mark.dataView')}}</p>
                             <div class="setting-content count-content">
                             <div class="setting-content count-content">
                                 <div class="count-wrap">
                                 <div class="count-wrap">
-                                    <p class="count-num">12</p>
+                                    <p class="count-num">{{markList[curEvIndex] ? markList[curEvIndex].count : 0}}</p>
                                     <p class="count-label">
                                     <p class="count-label">
                                         <Icon type="ios-paper" class="count-icon" size="16" />
                                         <Icon type="ios-paper" class="count-icon" size="16" />
                                         {{$t('task.mLabel1')}}
                                         {{$t('task.mLabel1')}}
@@ -162,7 +165,7 @@
                                         </span>
                                         </span>
                                     </div>
                                     </div>
                                     <div class="stu-list-wrap">
                                     <div class="stu-list-wrap">
-                                        <span class="stu-name" v-for="(item,index) in names" :key="index" @click="toMarkView">学生{{index}}</span>
+                                        <span class="stu-name" v-for="(item,index) in names" :key="index" @click="toMarkView(1)">学生{{index}}</span>
                                     </div>
                                     </div>
                                 </div>
                                 </div>
                             </div>
                             </div>
@@ -182,18 +185,21 @@ export default {
             tabIndex: 0,
             tabIndex: 0,
             split1: 0.2,
             split1: 0.2,
             curBarIndex: 0,
             curBarIndex: 0,
-            evList: [],
+            markList: [],
             curEvIndex: 0,
             curEvIndex: 0,
             names: [],
             names: [],
             quCount: []
             quCount: []
         }
         }
     },
     },
     methods: {
     methods: {
-        toMarkView() {
+        /**
+         * mode 0:按题 1:按人
+         */
+        toMarkView(mode) {
             this.$router.push({
             this.$router.push({
                 name: 'MarkView',
                 name: 'MarkView',
                 params: {
                 params: {
-                    type: 1,
+                    type: mode,
                     from: this.$route.name
                     from: this.$route.name
                 }
                 }
             })
             })
@@ -216,30 +222,27 @@ export default {
         selectBar(index) {
         selectBar(index) {
             this.curBarIndex = index
             this.curBarIndex = index
         },
         },
-        //查询阅卷任务列表 现在暂无相关API,暂时查询所有评测
-        findEvaluation() {
+        //查询阅卷任务
+        findTask() {
             let requestData = {
             let requestData = {
-                code: this.$store.state.userInfo.schoolCode,
-                classIds: undefined
+                code: this.$store.state.userInfo.TEAMModelId
             }
             }
-            this.$api.learnActivity.FindExamInfo(requestData).then(
+            this.$api.mark.FindTask(requestData).then(
                 res => {
                 res => {
                     if (!res.error) {
                     if (!res.error) {
-                        res.examInfo = res.examInfo.sort((a, b) => {
-                            return a.createTime - b.createTime > 0 ? -1 : 1
-                        })
-                        this.evList = res.examInfo
-                        this.evList = res.examInfo
-                        this.selectEvaluation(0)
+                        this.markList = res.tasks
                     } else {
                     } else {
-                        this.$Message.error('API ERROR!')
+                        this.$Message.error('API error!')
                     }
                     }
+                },
+                err => {
+                    this.$Message.error('API error!')
                 }
                 }
             )
             )
         },
         },
         selectEvaluation(index) {
         selectEvaluation(index) {
             this.curEvIndex = index
             this.curEvIndex = index
-            // if (this.evList[this.curEvaIndex] && this.evList[this.curEvaIndex].papers.length == 0) {
+            // if (this.markList[this.curEvaIndex] && this.markList[this.curEvaIndex].papers.length == 0) {
             //     this.findExamPaper()
             //     this.findExamPaper()
             // } else {
             // } else {
             //     this.examDetaiInfo = this.evaListShow[this.curEvaIndex]
             //     this.examDetaiInfo = this.evaListShow[this.curEvaIndex]
@@ -247,7 +250,7 @@ export default {
         },
         },
     },
     },
     created() {
     created() {
-        this.findEvaluation()
+        this.findTask()
         this.quCount = Array.from(new Array(13).keys())
         this.quCount = Array.from(new Array(13).keys())
         this.names = Array.from(new Array(46).keys())
         this.names = Array.from(new Array(46).keys())
     }
     }

+ 45 - 31
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -1426,44 +1426,58 @@ namespace TEAMModelOS.Controllers
                 var redisClient = _azureRedis.GetRedisClient(8);
                 var redisClient = _azureRedis.GetRedisClient(8);
                 ExamInfo info = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"Exam-{code}"));
                 ExamInfo info = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"Exam-{code}"));
                 List<ExamClassResult> classResults = new();
                 List<ExamClassResult> classResults = new();
-                List<dynamic> recs = new List<dynamic>();
-                var record = await redisClient.HashGetAllAsync($"Exam:Scoring:{id}-{subjectId}");
-                foreach (var rcd in record)
-                {
-                    var value = JsonDocument.Parse(rcd.Value.ToString());
-                    recs.Add(new { stuId = rcd.Name.ToString(), ans = value });
-                }
-                //var json = JsonDocument.Parse(record);
-                /*if (info.scope.Equals("school"))
+				List<dynamic> recs = new List<dynamic>();
+				var record = await redisClient.HashGetAllAsync($"Exam:Scoring:{id}-{subjectId}");
+				foreach (var rcd in record)
+				{
+					var value = JsonDocument.Parse(rcd.Value.ToString());
+					recs.Add(new { stuId = rcd.Name.ToString(), ans = value });
+				}
+                int index = 0;
+                foreach (ExamSubject subject in info.subjects)
                 {
                 {
-
-                    await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ExamClassResult>(
-                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}'",
-                    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{info.school}") }))
+                    if (!subject.id.Equals(subjectId.ToString()))
                     {
                     {
-                        classResults.Add(item);
+                        index++;
                     }
                     }
-                }
-                else
-                {
-                    await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ExamClassResult>(
-                        queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}'",
-                        requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{info.creatorId}") }))
+                    else
                     {
                     {
-                        classResults.Add(item);
-                    }
-                }
-                List<Task<bool>> tasks = new List<Task<bool>>();
-                foreach (ExamClassResult examClass in classResults) {                  
-                    foreach (string stuId in examClass.studentIds) {
-                        int index = examClass.studentIds.IndexOf(stuId);
-                        tasks.Add(redisClient.HashSetAsync($"Exam:Scoring:{id}-{subjectId}", stuId, new { ans = examClass.studentAnswers[index][0] , score = examClass.studentScores[index] }.ToJsonString()));
+                        break;
                     }
                     }
-                   
                 }
                 }
-                await Task.WhenAll(tasks);*/
+                //var json = JsonDocument.Parse(record);
+                /*if (info.scope.Equals("school"))
+				{
+
+					await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ExamClassResult>(
+					queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}'",
+					requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{info.school}") }))
+					{
+						classResults.Add(item);
+					}
+				}
+				else
+				{
+					await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ExamClassResult>(
+						queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}'",
+						requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{info.creatorId}") }))
+					{
+						classResults.Add(item);
+					}
+				}
+				List<Task<bool>> tasks = new List<Task<bool>>();
+				foreach (ExamClassResult examClass in classResults)
+				{
+					foreach (string stuId in examClass.studentIds)
+					{
+						int index = examClass.studentIds.IndexOf(stuId);
+						tasks.Add(redisClient.HashSetAsync($"Exam:Scoring:{id}-{subjectId}", stuId, new { ans = examClass.studentAnswers[index].Count > 0 ? examClass.studentAnswers[index][0]: "", score = examClass.studentScores[index] }.ToJsonString()));
+					}
+
+				}
+				await Task.WhenAll(tasks);*/
                 //info = await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(info, info.id, new PartitionKey($"Exam-{code}"));
                 //info = await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(info, info.id, new PartitionKey($"Exam-{code}"));
-                return Ok(recs);
+                return Ok(new { recs,paper = info.papers[index].blob});
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {