瀏覽代碼

调整个人评测评分

liqk 4 年之前
父節點
當前提交
95dfbe37ea

+ 4 - 0
TEAMModelOS/ClientApp/src/api/schoolSetting.js

@@ -59,4 +59,8 @@ export default {
     upsertGroup: function (data) {
         return post('/school/classroom/upsert-group', data)
     },
+    //根据私有班级id集合查询班级详细信息
+    getClassByIds: function (data) {
+        return post('/school/classroom/name', data)
+    },
 }

+ 42 - 9
TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.vue

@@ -59,15 +59,26 @@
                         <div v-if="item.type != 'compose'" style="display:flex;width:100%;" class="not-compose-box" :id="'qustion'+ getScoreIndex(typeIndex,index)">
                             <div class="scoring-input-box" @click.stop v-if="studentAnswer.scores && studentAnswer.scores.length">
                                 <InputNumber v-model="studentAnswer.scores[getScoreIndex(typeIndex,index)]" size="small" :formatter="value => value < 0 ? '' : `${value}分`" :parser="value => value.replace('分', '')" :min="0" :max="item.score" placeholder="0分" class="score-input" />
+                                <!-- 快速打分 满分 零分 -->
                                 <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
                                     <span class="fast-score-tag" title="满分" @click="fastSetScore((typeIndex + index),item.score)">
                                         <!-- 题目分数 -->{{item.score}}
                                     </span>
-                                    <span class="fast-score-tag" title="零分" @click="fastSetScore((typeIndex + index),0)">
+                                    <span class="fast-score-tag" title="零分" @click="fastSetScore((typeIndex + index),0)" style="background:#ed4014">
                                         0
                                     </span>
                                 </div>
-                                <div style="display:flex;justify-content: space-evenly;margin-top:5px;" v-show="showQu">
+                                <!-- 加分 减分 -->
+                                <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
+                                    <span class="fast-score-tag" @click="fastSetScore((typeIndex + index + childIndex),childItem.score)">
+                                        <Icon type="md-add" />
+                                    </span>
+                                    <span class="fast-score-tag" @click="fastSetScore((typeIndex + index + childIndex),0)" style="background:#ed4014">
+                                        <Icon type="md-remove" />
+                                    </span>
+                                </div>
+                                <!-- 滚动上下题目去掉 -->
+                                <div style="display:flex;justify-content: space-evenly;margin-top:5px;display:none;" v-show="showQu">
                                     <span class="fast-score-tag" title="上一题" :style="{'background':'#aeaeae','cursor':(typeIndex + index) == 0 ? 'not-allowed':''}" @click="goToQuestion(getQuIndex(typeIndex,index) - 1)">
                                         <!-- 上一题-->
                                         <Icon type="md-arrow-round-back" />
@@ -184,6 +195,7 @@
                             <div class="child-item" v-for="(childItem,childIndex) in item.children" :key="childIndex" :id="'qustion'+getScoreIndex(typeIndex,index,childIndex)">
                                 <div class="scoring-input-box" @click.stop v-if="item.type == 'compose' && studentAnswer.scores && studentAnswer.scores.length">
                                     <InputNumber v-model="studentAnswer.scores[getScoreIndex(typeIndex,index,childIndex)]" size="small" :formatter="value => value < 0 ? '' : `${value}分`" :parser="value => value.replace('分', '')" :min="0" :max="childItem.score" placeholder="0分" class="score-input" />
+                                    <!-- 快速打分 满分 零分 -->
                                     <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
                                         <span class="fast-score-tag" title="满分" @click="fastSetScore((typeIndex + index + childIndex),childItem.score)">
                                             <!-- 题目分数 -->{{childItem.score}}
@@ -192,7 +204,17 @@
                                             0
                                         </span>
                                     </div>
-                                    <div style="display:flex;justify-content: space-evenly;margin-top:5px;" v-show="showQu">
+                                    <!-- 加分 减分 -->
+                                    <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
+                                        <span class="fast-score-tag" @click="fastSetScore((typeIndex + index + childIndex),childItem.score)">
+                                            <Icon type="md-add" />
+                                        </span>
+                                        <span class="fast-score-tag" @click="fastSetScore((typeIndex + index + childIndex),0)">
+                                            <Icon type="md-remove" />
+                                        </span>
+                                    </div>
+                                    <!-- 滚动上下题目去掉 -->
+                                    <div style="display:flex;justify-content: space-evenly;margin-top:5px;display:none;" v-show="showQu">
                                         <span class="fast-score-tag" title="上一题" :style="{'background':'#aeaeae','cursor':(typeIndex + index + childIndex) == 0 ? 'not-allowed':''}" @click="goToQuestion((getQuIndex(typeIndex,index) + childIndex) - 1)">
                                             <!-- 上一题-->
                                             <Icon type="md-arrow-round-back" />
@@ -343,16 +365,16 @@ export default {
                 complete: '填空题',
                 subjective: '问答题',
                 compose: '综合题',
-                correct:'改错题',
-                connector:'连线题'
+                correct: '改错题',
+                connector: '连线题'
             },
             collapseList: [],
             groupList: [],
-            typeList: ['single', 'multiple', 'judge', 'complete', 'subjective', 'connector', 'correct','compose'],
+            typeList: ['single', 'multiple', 'judge', 'complete', 'subjective', 'connector', 'correct', 'compose'],
             showAnswer: false,
             showQu: false,
-            showOption: false
-
+            showOption: false,
+            scope: ''
         }
     },
     methods: {
@@ -499,6 +521,7 @@ export default {
     watch: {
         paper: {
             handler(newValue, oldValue) {
+                console.log('newValue', newValue)
                 this.paperInfo = newValue
             },
             deep: true
@@ -544,7 +567,9 @@ export default {
                 if (!this.studentAnswer.status) {
                     if (newValue.answers.length) {
                         try {
-                            let a = await this.$tools.getFile(newValue.answers[0] + this.$store.state.schoolSas.sas)
+                            console.log(this.scope)
+                            let sas = this.scope == 'school' ? this.$store.state.user.schoolProfile.blob_sas : this.$store.state.user.userProfile.blob_sas
+                            let a = await this.$tools.getFile(newValue.answers[0] + '?' +sas)
                             console.log('a', JSON.parse(a))
                             if (a) {
                                 this.$set(this.studentAnswer, 'answers', JSON.parse(a))
@@ -583,6 +608,14 @@ export default {
             return 0
         }
     },
+    created() {
+        console.log('router', this.$route)
+        if (this.$route.name == 'privateEvaluation') {
+            this.scope = 'private'
+        } else {
+            this.scope = 'school'
+        }
+    }
 }
 </script>
 

+ 62 - 33
TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.vue

@@ -26,7 +26,7 @@
             </span>
         </div>
         <div class="scoring-main-wrap dark-iview-table">
-            <Table v-show="!showTest" class="score-box" border :columns="tableColumn" :data="studentScore" :loading="tableLoading" :max-height="tableHeight">
+            <Table v-show="!showTest" class="score-box" border :columns="tableColumn" :data="studentScore" :loading="tableLoading" :max-height="tableHeight" no-data-text="班级暂无学生">
                 <template slot-scope="{ row,index }" :slot="'qu'+qIndex" v-for="(item,qIndex) in quCount">
                     <div :key="'qu'+qIndex" @click="getStuScore(row,qIndex)">
                         <span style="cursor:pointer;" @click="noAnswer" v-if="row.data[qIndex] == -1 && row.status == 1">- -</span>
@@ -40,7 +40,7 @@
                 <!-- 1: 未作答 2:未评分 3:已评分 -->
                 <template slot-scope="{ row,index }" slot="status">
                     <span class="stu-status-tag" @click="getStuScore(row,0)" :style="{'background':row.status == 1 ? '#ed4014' : row.status == 2 ? '#ff9900' : '#19be6b', 'cursor':row.status == 2 ? 'pointer':'text'}">
-                        {{row.status == 1 ? '暂未作答' : row.status == 2 ? '前往评分' : '查看分'}}
+                        {{row.status == 1 ? '暂未作答' : row.status == 2 ? '前往评分' : '查看分'}}
                     </span>
                 </template>
                 <Loading slot="loading" :top="-50"></Loading>
@@ -110,7 +110,8 @@ export default {
             studentScore: [],
             quCount: [],
             paperInfo: {},
-            students: []
+            students: [],
+            privClassList: []
         };
     },
     methods: {
@@ -222,7 +223,7 @@ export default {
             this.dataLoading = true;
             let requestData = {
                 id: this.examInfo.id,
-                school: this.$store.state.user.schoolCode,
+                code: this.examInfo.scope == 'school' ? this.$store.state.user.schoolCode : this.$store.state.userInfo.TEAMModelId,
                 subjectId: this.chooseSubject,
                 classId: this.chooseClass,
             };
@@ -238,6 +239,14 @@ export default {
                 }
             ).finally(() => {
                 setTimeout(() => {
+                    this.$nextTick(() => {
+                        let fixed = document.getElementsByClassName('ivu-table-fixed-body')
+                        console.log(fixed)
+                        for (let iterator of fixed) {
+                            console.log(iterator)
+                            iterator.style.maxHeight =  (this.tableHeight - 40) + 'px'
+                        }
+                    })
                     this.dataLoading = false
                     this.tableLoading = false
                 }, 500);
@@ -360,21 +369,23 @@ export default {
                 if (n.subjects && n.subjects.length) {
                     this.chooseSubject = n.subjects[0].id;
                 }
+
                 if (n.grades && n.grades.length) {
                     this.chooseGrade = n.grades[0].id;
                 }
-                // if (n.targetClassIds && n.targetClassIds.length) {
-                //     this.chooseClass = n.targetClassIds[0];
-                // }
+
                 if (n.papers && n.papers.length) {
-                    let res = n.papers.find((item) => {
-                        return item.subjectId == this.chooseSubject;
-                    });
-                    this.paperInfo = res ? this._.cloneDeep(res) : {};
+                    if (n.scope == 'school') {
+                        let res = n.papers.find((item) => {
+                            return item.subjectId == this.chooseSubject;
+                        });
+                        this.paperInfo = res ? this._.cloneDeep(res) : {};
+                    } else {
+                        this.paperInfo = n.papers[0]
+                    }
                 } else {
                     this.paperInfo = {};
                 }
-                // this.getClassStudent();
             },
             deep: true,
         },
@@ -389,35 +400,49 @@ export default {
         }
     },
     computed: {
-        classList() {
-            if (this.examInfo && this.examInfo.targetClassIds) {
-                if (this.examInfo.scope == 'school') {
-                    this.showTest = false
-                    let classes = this.$store.state.user.schoolProfile.school_classes.filter(
-                        (item) => {
-                            return (this.examInfo.targetClassIds.indexOf(item.id) >= 0 && item.gradeId == this.chooseGrade);
+        classList: {
+            get: function () {
+                if (this.examInfo && this.examInfo.targetClassIds) {
+                    if (this.examInfo.scope == 'school') {
+                        this.showTest = false
+                        let classes = this.$store.state.user.schoolProfile.school_classes.filter(
+                            (item) => {
+                                return (this.examInfo.targetClassIds.indexOf(item.id) >= 0 && item.gradeId == this.chooseGrade);
+                            }
+                        );
+                        return classes;
+                    } else {
+                        //根据targetClassIds查询班级信息
+                        if (!this.privClassList.length) {
+                            this.$api.schoolSetting.getClassByIds({
+                                code: this.$store.state.userInfo.TEAMModelId,
+                                ids: this.examInfo.targetClassIds
+                            }).then(
+                                res => {
+                                    console.log('list', res)
+                                    this.privClassList = res.className
+                                },
+                                err => {
+                                    console.log(err)
+                                }
+                            )
                         }
-                    );
-                    return classes;
+                        return this.privClassList
+                    }
                 } else {
-                    let list = this.examInfo.targetClassIds.map(item => {
-                        return {
-                            id: item,
-                            name: item
-                        }
-                    })
-                    console.log('list',list)
-                    return list
-                    //根据targetClassIds查询班级信息
+                    return []
                 }
-            } else {
-                return [];
+            },
+            set: function (newValue) {
+                // this.classList = newValue
             }
+
         },
     },
     mounted() {
         let tableWrap = document.getElementsByClassName('scoring-main-wrap')
         this.tableHeight = tableWrap[0].offsetHeight - 27
+
     }
 };
 </script>
@@ -428,7 +453,11 @@ export default {
 <style lang="less">
 .scoring-main-wrap .ivu-table-fixed-body {
     background: #2b2b2e;
-    max-height: 701px;
+    // max-height: 701px;
+}
+.scoring-main-wrap .ivu-table-tip{
+    position: relative;
+    z-index: 9999;
 }
 .scoring-main-wrap .ivu-table-fixed-right::before,
 .scoring-main-wrap .ivu-table-fixed::before {

+ 1 - 1
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -244,7 +244,7 @@ namespace TEAMModelOS.Controllers
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamInfo> examInfo = new List<ExamInfo>();
                 //var query = $"select value(c) from c ";
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{code}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)