Ver código fonte

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

OnePsycho 4 anos atrás
pai
commit
861b2db5dc

TEAMModelFunction/MQActivity.cs → TEAMModelOS.SDK/Models/Cosmos/Common/MQActivity.cs


+ 5 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/Snode.cs

@@ -36,6 +36,11 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         //public List<string> points { get; set; } = new List<string> { "" };
         public List<Rnode> rnodes { get; set; } = new List<Rnode>();
         public List<string> cids { get; set; } = new List<string>();
+        /// <summary>
+        /// 谁创建的该节点
+        /// </summary>
+        public string creatorId { get; set; }
+        public long updateTime { get; set; }
         //public string code { get; set; }
 
     }

+ 0 - 2
TEAMModelOS.SDK/Models/Cosmos/Common/Syllabus.cs

@@ -19,7 +19,5 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         public List<Tnode> children { get; set; }
-      
-
     }
 }

+ 4 - 3
TEAMModelOS.SDK/Models/Cosmos/Teacher/Favorite.cs

@@ -107,6 +107,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos
         /// </summary>
         [Required(ErrorMessage = "opt 必须设置")]
         public string opt { get; set; }
+
         [Required(ErrorMessage = "tmdid 必须设置")]
         public string tmdid { get; set; }
         /// <summary>
@@ -114,17 +115,17 @@ namespace TEAMModelOS.SDK.Models.Cosmos
         /// </summary>
         public string name { get; set; }
         /// <summary>
-        /// 课纲的id
+        /// 课纲册别的id
         /// </summary>
         [Required(ErrorMessage = "sid 必须设置")]
         public string sid { get; set; }
         /// <summary>
-        /// 课纲的分区键
+        /// 课纲册别的分区键
         /// </summary>
         [Required(ErrorMessage = "socde 必须设置")]
         public string scode { get; set; }
         /// <summary>
-        /// 课纲的名称
+        /// 课纲册别的名称
         /// </summary>
         [Required(ErrorMessage = "sname 必须设置")]
         public string sname { get; set; }

TEAMModelFunction/ItemService.cs → TEAMModelOS.SDK/Models/Service/ItemService.cs


+ 1 - 1
TEAMModelFunction/StuListService.cs

@@ -1,5 +1,5 @@
 using Azure.Cosmos;
-using Microsoft.Azure.WebJobs;
+
 using System;
 using System.Collections.Generic;
 using System.Text;

+ 3 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue

@@ -127,7 +127,7 @@
                     </div>-->
 
                     <!-- 保存阅卷配置 -->
-                    <div style="float:right;" class="common-save-btn" v-show="curBarIndex == 2">
+                    <div style="float:right;" class="common-save-btn" v-show="curBarIndex == 2 && isSetting">
                         <Button class="mock-stu-answer" type="text" :loading="btnLoading" @click="saveMarkSetting" icon="ios-albums-outline">
                             {{$t('schoolBaseInfo.saveInfo')}}
                         </Button>
@@ -167,7 +167,7 @@
                             {{item.name}}
                         </span>
                     </div> -->
-                    <MarkSetting ref="markSetting" v-if="evaListShow[curEvaIndex]" :evInfo="evaListShow[curEvaIndex]"></MarkSetting>
+                    <MarkSetting ref="markSetting" v-if="evaListShow[curEvaIndex]" :evInfo="evaListShow[curEvaIndex]" v-model="isSetting"></MarkSetting>
                 </div>
                 <!-- 阅卷数据 -->
                 <div :class="curBarIndex == 3 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 3">
@@ -189,6 +189,7 @@ export default {
     inject: ['reload'],
     data() {
         return {
+            isSetting:false,
             btnLoading: false,
             keyword: '',
             isSearch: false,

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

@@ -152,6 +152,10 @@ import ScanProgress from '../echarts/ScanProgress.vue'
 import CptCount from '../echarts/CptCount.vue'
 import PersonalPhoto from "@/components/public/personalPhoto/Index.vue"
 export default {
+    model: {
+        prop: 'isShow',
+        event: 'statusChange'
+    },
     props: {
         evInfo: {
             type: Object,
@@ -161,7 +165,8 @@ export default {
                     name: ''
                 }
             }
-        }
+        },
+        isShow: Boolean //父组件是否显示保存按钮 对应isSetting的值
     },
     data() {
         let _this = this
@@ -430,6 +435,7 @@ export default {
                 res => {
                     if (res.correct) {
                         this.setting = res.correct
+                        this.isSetting = true
                     } else {
                         this.isSetting = false
                         if (this.evInfo.subjects) {
@@ -486,6 +492,13 @@ export default {
 
             },
             deep: true
+        },
+        isSetting: {
+            handler(n, o) {
+                console.log('watch', n, o)
+                this.$emit('statusChange', this.isSetting)
+            },
+            immediate: true
         }
     },
     computed: {

+ 1 - 26
TEAMModelOS/ClientApp/src/view/task/index.less

@@ -129,30 +129,7 @@
     }
 }
 
-.qu-info-item{
-    display: flex;
-    width: 100%;
-    justify-content: space-around;
-    align-items: center;
-    padding: 20px 0px;
-    border-bottom: 1px solid #424242;
-    .qu-index{
-        display: block;
-        // width: 80px;
-        text-align: center;
-        color: white;
-        font-size: 20px;
-        font-weight: 600;
-    }
-    .to-mark{
-        width: 120px;
-        text-align: center;
-    }
-    .progress-wrap{
-        width: ~"calc(100% - 300px)";
-        max-width: 400px;
-    }
-}
+
 .circle-content{
     .percent-text{
         color: white;
@@ -162,8 +139,6 @@
 .progress-circle{
     margin: 10px 20px;
 }
-.stu-wrap{
-}
 .stu-list-wrap{
     min-height: 120px;
 }

+ 26 - 75
TEAMModelOS/ClientApp/src/view/task/index.vue

@@ -123,60 +123,10 @@
                                 {{$t('task.markProg')}}
                                 <Icon type="ios-arrow-down" :class="['show-full-icon', fullQuProg ? 'full-qu-prog' : '']" @click="fullQuProg = !fullQuProg" />
                             </p>
-                            <div class="setting-content" :style="{height: fullQuProg ? 'fit-content' : '300px'}">
+                            <div class="setting-content" :style="{height: fullQuProg ? 'fit-content' : '420px'}">
                                 <vuescroll>
-                                    <div v-for="(item,index) in fullPaper.item" :key="index">
-                                        <!-- 综合题 -->
-                                        <div v-if="item.children.length">
-                                            <div class="qu-info-item" v-for="(childItem,childIndex) in item.children" :key="childIndex">
-                                                <span class="qu-index" :style="{color:objectiveQu.includes(childItem.type) ? '#606060' : '#fff'}">
-                                                    {{`${index + 1}-${childIndex + 1}`}}
-                                                </span>
-                                                <div class="progress-wrap">
-                                                    <Progress :percent="objectiveQu.includes(childItem.type) ? 100 : byQuPct[getScoreIndex(index,childIndex)]" />
-                                                    <!-- <Progress :percent="byQuPct[getScoreIndex(index,childIndex)]" /> -->
-                                                    <p v-if="objectiveQu.includes(childItem.type)" class="prog-tips" style="color: #19be6b">
-                                                        客观题已由系统自动完成评分。
-                                                    </p>
-                                                    <p v-else class="prog-tips">
-                                                        <span style="margin-right:10px">
-                                                            {{$t('task.mLabel2')}}:{{byQuCount[getScoreIndex(index,childIndex)]}}
-                                                        </span>
-                                                        <span>
-                                                            {{$t('task.mLabel3')}}:{{markList[curTaskIndex].count - byQuCount[getScoreIndex(index,childIndex)]}}
-                                                        </span>
-                                                    </p>
-                                                </div>
-                                                <div class="to-mark">
-                                                    <Button type="primary" shape="circle" :disabled="objectiveQu.includes(childItem.type)" size="small" style="width:120px" @click="toByQuView(index, childIndex)">
-                                                        {{$t('task.mark')}}
-                                                    </Button>
-                                                </div>
-                                            </div>
-                                        </div>
-                                        <!-- 其他题 -->
-                                        <div v-else class="qu-info-item">
-                                            <span class="qu-index" :style="{color:objectiveQu.includes(item.type) ? '#606060' : '#fff'}">
-                                                {{index + 1}}
-                                            </span>
-                                            <div class="progress-wrap">
-                                                <Progress :percent="objectiveQu.includes(item.type) ? 100 : byQuPct[getScoreIndex(index)]" />
-                                                <!-- <Progress :percent="byQuPct[getScoreIndex(index)]" /> -->
-                                                <p v-if="objectiveQu.includes(item.type)" class="prog-tips" style="color: #19be6b">
-                                                    客观题已由系统自动完成评分。
-                                                </p>
-                                                <p v-else class="prog-tips">
-                                                    <span>{{$t('task.mLabel2')}}:4</span>
-                                                    <span>{{$t('task.mLabel3')}}:8</span>
-                                                </p>
-                                            </div>
-                                            <div class="to-mark">
-                                                <Button type="primary" shape="circle" :disabled="objectiveQu.includes(item.type)" size="small" style="width:120px" @click="toByQuView(index, -1)">
-                                                    {{$t('task.mark')}}
-                                                </Button>
-                                            </div>
-                                        </div>
-                                    </div>
+                                    <!-- 按题阅卷题目进度条 -->
+                                    <QuProg :paperData="fullPaper" :stusData="markData ? markData.attr : []" :total="markList[curTaskIndex] ? markList[curTaskIndex].count : 1" @getQuIndex="toByQuView"></QuProg>
                                 </vuescroll>
                             </div>
                         </div>
@@ -212,9 +162,10 @@
 <script>
 import DataCompare from './mark/Compare.vue'
 import ProgPie from './mark/ProgPie.vue'
+import QuProg from './mark/QuProg.vue'
 export default {
     components: {
-        DataCompare, ProgPie
+        DataCompare, ProgPie, QuProg
     },
     data() {
         return {
@@ -312,15 +263,25 @@ export default {
          * childIndex 小题index 非必传 
          */
         getScoreIndex(index, childIndex) {
-            let realIndex = index
+            let realIndex = 0
             this.fullPaper.item.forEach((item, itemIndex) => {
-                if (itemIndex < index && item.children.length) {
-                    realIndex += item.children.length
-                } else if (itemIndex == index && item.children.length) {
-                    realIndex += childIndex
+                if (itemIndex <= index) {
+                    //综合题
+                    if (item.children.length) {
+                        item.children.forEach((childItem, cIndex) => {
+                            if (itemIndex < index) {
+                                realIndex++
+                            } else if (cIndex <= childIndex) {
+                                realIndex++
+                            }
+                        })
+                    }
+                    else {
+                        realIndex++
+                    }
                 }
             })
-            return realIndex
+            return --realIndex
         },
         rowClassName(row, index) {
             if (index % 2 == 0) {
@@ -347,12 +308,10 @@ export default {
                 sId = stuId
             } else {
                 let resData = await this.getNextStu()
-                console.log('API返回了', resData)
                 answer = resData.ans.ans ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${resData.ans.ans}?${sas}`)) : []
                 score = resData.ans.score
                 sId = resData.stuId
             }
-            console.log('跳转了')
             this.$router.push({
                 name: 'ByStu',
                 params: {
@@ -367,19 +326,19 @@ export default {
         },
         /**
         * 按题阅卷
-        * 
         * quIndex 必传
         * childIndex 非必传
         */
-        async toByQuView(quIndex, childIndex) {
+        async toByQuView(data) {
+            let {quIndex, childIndex} = data
+            console.log(data,quIndex, childIndex)
             sessionStorage.setItem('markFrom', this.$route.name)
             let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
             let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
             // 获取学生作答数据
             this.markData.attr.forEach(async item => {
-                item.info.answer = item.info.ans ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${item.info.ans}?${sas}`)) : []
+                this.$set(item.info, 'answer', item.info.ans ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${item.info.ans}?${sas}`)) : [])
             })
-            console.log(this.markData)
             this.$router.push({
                 name: 'ByQu',
                 params: {
@@ -406,14 +365,6 @@ export default {
                 stuId
             }
             return this.$api.mark.FindNextStu(requestData)
-            // this.$api.mark.FindNextStu(requestData).then(
-            //     res => {
-            //         console.log(res)
-            //     },
-            //     err => {
-            //         console.log(err)
-            //     }
-            // )
         },
         /**获取type对应的label */
         getTypeLabel(code) {
@@ -471,7 +422,6 @@ export default {
                         this.fullPaper = await this.$evTools.getFullPaper({
                             blob: this.markData.paper
                         }, 'school')
-                        console.log('试卷数据', this.fullPaper)
                     }
                 },
                 err => {
@@ -482,6 +432,7 @@ export default {
         selectTask(index) {
             this.curTaskIndex = index
             sessionStorage.setItem('markIndex', index)
+            this.findTaskData()
         },
 
     },

+ 69 - 23
TEAMModelOS/ClientApp/src/view/task/mark/ByQu.vue

@@ -6,7 +6,7 @@
             <span class="quit-marking-text">
                 <Icon type="ios-arrow-back" class="quit-marking-icon" title="退出阅卷" @click="quit" />
             </span>
-            <span class="info-label">考试名称123:</span>
+            <span class="info-label">考试名称:</span>
             <span class="info-value">{{taskInfo.name}}</span>
             <span class="info-label">阅卷方式:</span>
             <span class="info-value">按题阅卷</span>
@@ -62,38 +62,45 @@
                     <Button size="small" type="error" ghost @click="score = 0">零分</Button>
                     <Icon :type="isShowNum ? 'md-eye-off' : 'md-eye'" class="toggle-num-status" @click="isShowNum = !isShowNum" />
                     <div :class="['score-key-box', isShowNum ? '':'hind-key-box']">
-                        <span v-for="(item,index) in quScoreArr" :key="index" class="score-key" @click="setScore(index)">
-                            {{item}}
-                        </span>
+                        <vuescroll>
+                            <span v-for="(item,index) in quScoreArr" :key="index" class="score-key" @click="setScore(index)">
+                                {{item}}
+                            </span>
+                        </vuescroll>
                     </div>
                 </div>
                 <Button type="success" class="submit-score" @click="submit()">提交分数</Button>
                 <div class="score-setting-wrap">
                     <div class="score-setting-item">
-                        <span>提交分数自动切换题目</span>
-                        <i-switch v-model="autoQu" size="small" />
+                        <span>打分自动切换学生</span>
+                        <i-switch v-model="autoStu" size="small" />
                     </div>
                     <div class="score-setting-item">
-                        <span>完成阅卷自动获取新学生</span>
-                        <i-switch v-model="autoStu" size="small" />
+                        <span>完成整题批阅自动弹出切换</span>
+                        <i-switch v-model="autoQu" size="small" />
                     </div>
                 </div>
             </div>
         </div>
         <!-- 用来单独渲染学生作答数据,提高tocanvas 的效率 -->
         <iframe id="markIframe1" :srcdoc="curAnswer" v-if="curAnswer"></iframe>
-        <Modal v-model="toggleStatus" title="切换学生">
-            进行中
+        <Modal v-model="toggleStatus" title="切换题目" :width="800" footer-hide>
+            <div class="qu-prog-wrap" style="height:600px">
+                <vuescroll>
+                    <QuProg :paperData="paperData" :stusData="stusInfo" :total="taskInfo.count || 1" @getQuIndex="setQuIndex"></QuProg>
+                </vuescroll>
+            </div>
         </Modal>
     </div>
 </template>
 <script>
 import html2canvas from 'html2canvas';
 import MarkCanvas from './MarkCanvas';
+import QuProg from './QuProg';
 export default {
     name: 'ByStu',
     components: {
-        MarkCanvas
+        MarkCanvas, QuProg
     },
     data() {
         return {
@@ -118,6 +125,12 @@ export default {
         }
     },
     methods: {
+        setQuIndex(data) {
+            let { quIndex, childIndex } = data
+            this.quIndex = quIndex
+            this.childIndex = childIndex
+            this.toggleStatus = false
+        },
         drawImg(imgIndex) {
         },
         //清除所有批注
@@ -153,7 +166,10 @@ export default {
         setScore(score) {
             this.score = score
             let index = this.getScoreIndex(this.quIndex, this.childIndex)
-            this.stusInfo[this.stuIndex].info.score[index] = score
+            this.$set(this.stusInfo[this.stuIndex].info.score, index, score)
+            if (this.autoStu) {
+                this.submit()
+            }
         },
         //提交分数
         submit() {
@@ -193,15 +209,26 @@ export default {
          * childIndex 小题index 非必传 
          */
         getScoreIndex(index, childIndex) {
-            let realIndex = index
+            let realIndex = 0
             this.paperData.item.forEach((item, itemIndex) => {
-                if (itemIndex < index && item.children.length) {
-                    realIndex += item.children.length
-                } else if (itemIndex == index && item.children.length) {
-                    realIndex += childIndex
+                if (itemIndex <= index) {
+                    //综合题
+                    if (item.children.length) {
+                        item.children.forEach((childItem, cIndex) => {
+                            if (itemIndex < index) {
+                                realIndex++
+                            } else if (cIndex <= childIndex) {
+                                realIndex++
+                            }
+                        })
+                    }
+                    else {
+                        realIndex++
+                    }
                 }
             })
-            return realIndex
+            console.log('输出', realIndex)
+            return --realIndex
         },
         //获取批阅学生数据
         getDefStu() {
@@ -218,7 +245,11 @@ export default {
             //当前数据没有未评,并且人数==阅卷任务量 —> 说明这道题目已阅完
             if (!has && this.stusInfo.length == this.taskInfo.count) {
                 // 提示当前题目已阅完,切换题目
-                this.$Message.warning('当前题目已阅完,请切换题目')
+                if (this.autoQu) {
+                    this.toggleStatus = true
+                } else {
+                    this.$Message.warning('当前题目已阅完,请切换题目')
+                }
             } else if (!has && this.stusInfo.length < this.taskInfo.count) {
                 //当前学生数据已阅,需要继续随机获取学生进行阅卷
                 this.getNextStu()
@@ -239,7 +270,6 @@ export default {
             }
             this.$api.mark.FindNextStu(requestData).then(
                 async res => {
-                    console.log(res)
                     let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
                     let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
                     this.stusInfo.push({
@@ -251,7 +281,7 @@ export default {
                         }
                     })
                     this.stuIndex = this.stusInfo.length - 1
-                    this.score = res.ans.score[this.getScoreIndex(this.quIndex,this.childIndex)] == -1 ? null : res.ans.score[this.getScoreIndex(this.quIndex,this.childIndex)]
+                    this.score = res.ans.score[this.getScoreIndex(this.quIndex, this.childIndex)] == -1 ? null : res.ans.score[this.getScoreIndex(this.quIndex, this.childIndex)]
                 },
                 err => {
                     console.log(err)
@@ -281,9 +311,12 @@ export default {
     },
     computed: {
         curAnswer() {
+            // console.log('计算作答数据',this.stuIndex, this.quIndex, this.childIndex)
             if (this.stusInfo && this.stusInfo[this.stuIndex]) {
-                if (this.stusInfo[this.stuIndex].ans) {
-                    return this.stusInfo[this.stuIndex].answer[this.getScoreIndex(this.quIndex, this.childIndex)]
+                console.log(JSON.stringify(this.stusInfo[this.stuIndex]))
+                console.log(this.stusInfo[this.stuIndex])
+                if (this.stusInfo[this.stuIndex].info.answer) {
+                    return this.stusInfo[this.stuIndex].info.answer[this.getScoreIndex(this.quIndex, this.childIndex)]
                 } else {
                     return this.stusInfo[this.stuIndex].stuId + '未作答'
                 }
@@ -294,6 +327,7 @@ export default {
         /**当期题目分数数组 */
         quScoreArr() {
             let score = 0
+            console.log(this.quIndex, this.childIndex)
             if (this.paperData.item) {
                 if (this.childIndex > -1 && this.paperData.item[this.quIndex] && this.paperData.item[this.quIndex].children) {
                     score = this.paperData.item[this.quIndex].children[this.childIndex].score
@@ -307,6 +341,9 @@ export default {
 }
 </script>
 <style scoped lang="less">
+#container {
+    max-width: 100%;
+}
 .score-setting-wrap {
     margin-top: 50px;
     padding: 0px 5px;
@@ -604,6 +641,15 @@ export default {
 }
 </style>
 <style>
+.qu-prog-wrap .qu-info-item {
+    border-color: #ccc;
+}
+.qu-prog-wrap .obj-index {
+    color: #c1c1c1;
+}
+.qu-prog-wrap .other-index {
+    color: #606060;
+}
 .mark-tools-wrap .ivu-poptip-title::after {
     display: none;
 }

+ 32 - 27
TEAMModelOS/ClientApp/src/view/task/mark/ByStu.vue

@@ -53,7 +53,7 @@
                 <!-- <Icon :custom="isFull ? 'iconfont icon-cancel-full' : 'iconfont icon-full-screen'" class="tool-icon" :title="isFull ? '取消全屏' : '全屏'" @click="togglefull" /> -->
             </div>
             <div class="mark-stage">
-                <MarkCanvas :mouseStatus="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData"></MarkCanvas>
+                <MarkCanvas :mouseStatus="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData" style="padding-bottom:85px"></MarkCanvas>
                 <!-- 题号显示部分 -->
                 <div class="qu-index-box">
                     <div class="qu-tips-box">
@@ -91,15 +91,17 @@
                     <Button size="small" type="error" ghost @click="score = 0">零分</Button>
                     <Icon :type="isShowNum ? 'md-eye-off' : 'md-eye'" class="toggle-num-status" @click="isShowNum = !isShowNum" />
                     <div :class="['score-key-box', isShowNum ? '':'hind-key-box']">
-                        <span v-for="(item,index) in quScoreArr" :key="index" :class="['score-key', stuScore[getScoreIndex(quIndex,childIndex)] == index ? 'score-key-active':'']" @click="setScore(index)">
-                            {{item}}
-                        </span>
+                        <vuescroll>
+                            <span v-for="(item,index) in quScoreArr" :key="index" :class="['score-key', stuScore[getScoreIndex(quIndex,childIndex)] == index ? 'score-key-active':'']" @click="setScore(index)">
+                                {{item}}
+                            </span>
+                        </vuescroll>
                     </div>
                 </div>
                 <Button type="success" class="submit-score" @click="submit()">提交分数</Button>
                 <div class="score-setting-wrap">
                     <div class="score-setting-item">
-                        <span>提交分数自动切换题目</span>
+                        <span>打分自动切换题目</span>
                         <i-switch v-model="autoQu" size="small" />
                     </div>
                     <div class="score-setting-item">
@@ -174,7 +176,7 @@ export default {
             let answerIframe = document.getElementById('markIframe')
             answerIframe.onload = () => {
                 answerIframe.style.width = '850px'
-                answerIframe.contentWindow.document.body.style.margin = '0px 20px'
+                // answerIframe.contentWindow.document.body.style.margin = '0px 20px'
                 answerIframe.contentWindow.document.body.style.padding = '10px'
                 answerIframe.contentWindow.document.body.style.minWidth = '600px'
                 answerIframe.contentWindow.document.body.style.minHeight = '240px'
@@ -183,12 +185,10 @@ export default {
                 let bodyWidth = answerIframe.contentWindow.document.body.clientWidth
                 answerIframe.style.width = (bodyWidth + 20) + 'px'
                 answerIframe.contentWindow.document.body.style.backgroundColor = '#f5f5f5'
-                console.log('markIframe', answerIframe)
                 html2canvas(answerIframe.contentWindow.document.body, {}).then((canvas) => {
                     canvas.id = "canvas" + this.getScoreIndex(this.quIndex, this.childIndex)
                     this.ansImg = canvas.toDataURL()
                     // 将转出来的答案绘制到canvas上
-                    console.log(this.ansImg)
                 })
             }
         },
@@ -200,25 +200,40 @@ export default {
         setScore(score) {
             this.score = score
             this.$set(this.stuScore, this.getScoreIndex(this.quIndex, this.childIndex), score)
+            if (this.autoQu) {
+                this.submit()
+            }
         },
         toQu(index, childIndex) {
             this.quIndex = index
             this.childIndex = childIndex
+            this.score = this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)] == -1 ? null : this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)]
         },
         /**
          * index 题目index 必传
          * childIndex 小题index 非必传 
          */
         getScoreIndex(index, childIndex) {
-            let realIndex = index
+            let realIndex = 0
             this.paperData.item.forEach((item, itemIndex) => {
-                if (itemIndex < index && item.children.length) {
-                    realIndex += item.children.length
-                } else if (itemIndex == index && item.children.length) {
-                    realIndex += childIndex
+                if (itemIndex <= index) {
+                    //综合题
+                    if (item.children.length) {
+                        item.children.forEach((childItem, cIndex) => {
+                            if (itemIndex < index) {
+                                realIndex++
+                            } else if (cIndex <= childIndex) {
+                                realIndex++
+                            }
+                        })
+                    }
+                    else {
+                        realIndex++
+                    }
                 }
             })
-            return realIndex
+            console.log('输出', realIndex)
+            return --realIndex
         },
         //提交分数
         submit() {
@@ -259,7 +274,7 @@ export default {
                     }
                     //当前小题是最后一个,需要判断下一个题目类型
                     //下一个题目是综合题
-                    if (this.paperData.item[this.quIndex + 1].children.length) {
+                    else if (this.childIndex == this.paperData.item[this.quIndex].children.length - 1 && this.paperData.item[this.quIndex + 1].children.length) {
                         this.quIndex++
                         this.childIndex = 0
                     }
@@ -330,7 +345,7 @@ export default {
                         })
                     } else {
                         this.$Message.success('已阅完')
-                        if(this.autoStu){
+                        if (this.autoStu) {
                             //TODE 随机获取下一位学生
                         }
                     }
@@ -355,11 +370,9 @@ export default {
     },
     mounted() {
         this.ansToImg()
-
     },
     created() {
         let routeData = this.$route.params
-        console.log('路由数据', routeData)
         this.paperData = routeData.fullPaper
         this.stuAnswer = routeData.answer
         this.stuScore = routeData.score
@@ -466,15 +479,7 @@ export default {
     margin: 10px;
     height: auto;
 }
-.container-box {
-    display: flex;
-    justify-content: center;
-    width: 100%;
-    padding: 10px;
-}
-#container {
-    max-width: 100%;
-}
+
 .qu-tips-box {
     & :nth-child(1)::before {
         background: #19be6b;

+ 9 - 0
TEAMModelOS/ClientApp/src/view/task/mark/MarkCanvas.vue

@@ -444,6 +444,11 @@ export default {
                 this.myScale()
             }
         },
+        //还原比例
+        restore() {
+            this.scaleDefault = 1
+            this.myScale()
+        },
         myScale() {
             this.stage.children.forEach(item => {
                 item.scale({
@@ -635,6 +640,7 @@ export default {
         bgImg: {
             handler(n, o) {
                 this.$nextTick(() => {
+                    // this.restore()
                     this.orgLayer.removeChildren()
                     this.markLayer.removeChildren()
                     let imageObj = new Image()
@@ -680,6 +686,9 @@ export default {
     width: 100%;
     padding: 10px;
 }
+#container {
+    max-width: 100%;
+}
 </style>
 <style>
 .textarea:focus {

+ 194 - 0
TEAMModelOS/ClientApp/src/view/task/mark/QuProg.vue

@@ -0,0 +1,194 @@
+<template>
+    <div>
+        <div v-for="(item,index) in paperData.item" :key="index">
+            <!-- 综合题 -->
+            <div v-if="item.children.length">
+                <div class="qu-info-item" v-for="(childItem,childIndex) in item.children" :key="childIndex">
+                    <span :class="['qu-index', objectiveQu.includes(childItem.type) ? 'obj-index' : 'other-index']">
+                        {{`${index + 1}-${childIndex + 1}`}}
+                    </span>
+                    <div class="progress-wrap">
+                        <Progress :percent="objectiveQu.includes(childItem.type) ? 100 : byQuPct[getScoreIndex(index,childIndex)]" />
+                        <!-- <Progress :percent="byQuPct[getScoreIndex(index,childIndex)]" /> -->
+                        <p v-if="objectiveQu.includes(childItem.type)" class="prog-tips" style="color: #19be6b">
+                            客观题已由系统自动完成评分。
+                        </p>
+                        <p v-else class="prog-tips">
+                            <span style="margin-right:10px">
+                                {{$t('task.mLabel2')}}:{{byQuCount[getScoreIndex(index,childIndex)]}}
+                            </span>
+                            <span>
+                                {{$t('task.mLabel3')}}:{{total - byQuCount[getScoreIndex(index,childIndex)]}}
+                            </span>
+                        </p>
+                    </div>
+                    <div class="to-mark">
+                        <Button type="primary" shape="circle" :disabled="objectiveQu.includes(childItem.type)" size="small" style="width:120px" @click="setQuIndex(index, childIndex)">
+                            {{$t('task.mark')}}
+                        </Button>
+                    </div>
+                </div>
+            </div>
+            <!-- 其他题 -->
+            <div v-else class="qu-info-item">
+                <span :class="['qu-index', objectiveQu.includes(item.type) ? 'obj-index' : 'other-index']">
+                    {{index + 1}}
+                </span>
+                <div class="progress-wrap">
+                    <Progress :percent="objectiveQu.includes(item.type) ? 100 : byQuPct[getScoreIndex(index)]" />
+                    <!-- <Progress :percent="byQuPct[getScoreIndex(index)]" /> -->
+                    <p v-if="objectiveQu.includes(item.type)" class="prog-tips" style="color: #19be6b">
+                        客观题已由系统自动完成评分。
+                    </p>
+                    <p v-else>
+                        <span style="margin-right:10px">
+                            {{$t('task.mLabel2')}}:{{byQuCount[getScoreIndex(index,-1)]}}
+                        </span>
+                        <span>
+                            {{$t('task.mLabel3')}}:{{total - byQuCount[getScoreIndex(index,-1)]}}
+                        </span>
+                    </p>
+                </div>
+                <div class="to-mark">
+                    <Button type="primary" shape="circle" :disabled="objectiveQu.includes(item.type)" size="small" style="width:120px" @click="setQuIndex(index, -1)">
+                        {{$t('task.mark')}}
+                    </Button>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    props: {
+        // 试卷
+        paperData: {
+            type: Object,
+            default: () => {
+                return {
+                    item: []
+                }
+            },
+            required: true
+        },
+        // 当前学生数据
+        stusData: {
+            type: Array,
+            default: () => {
+                return []
+            },
+            required: true
+        },
+        //任务量,总数
+        total: {
+            type: Number,
+            default: 1,
+            required: true
+        }
+    },
+    data() {
+        return {
+            objectiveQu: ['single', 'multiple', 'judge'],
+        }
+    },
+    methods: {
+        /**
+         * index 题目index 必传
+         * childIndex 小题index 非必传 
+         */
+        getScoreIndex(index, childIndex) {
+            let realIndex = 0
+            this.paperData.item.forEach((item, itemIndex) => {
+                if (itemIndex <= index) {
+                    //综合题
+                    if (item.children.length) {
+                        item.children.forEach((childItem, cIndex) => {
+                            if (itemIndex < index) {
+                                realIndex++
+                            } else if (cIndex <= childIndex) {
+                                realIndex++
+                            }
+                        })
+                    }
+                    else {
+                        realIndex++
+                    }
+                }
+            })
+            return --realIndex
+        },
+        setQuIndex(quIndex, childIndex) {
+            this.$emit('getQuIndex', { quIndex, childIndex })
+        }
+    },
+    computed: {
+        //试卷题目数量,包括小题
+        quLength() {
+            if (this.paperData && this.paperData.item) {
+                let count = 0
+                this.paperData.item.forEach(item => {
+                    if (item.children.length) {
+                        count += item.children.length
+                    } else {
+                        count++
+                    }
+                })
+                return count
+            }
+            return 0
+        },
+        //题目进度百分比
+        byQuPct() {
+            let total = this.total || 1
+            return this.byQuCount.map(item => {
+                return item * 100 / total
+            })
+        },
+        //题目进度count
+        byQuCount() {
+            let res = new Array(this.quLength).fill(0)
+            if (this.stusData) {
+                for (let i = 0; i < this.quLength; i++) {
+                    this.stusData.forEach(item => {
+                        if (item.info.score[i] > -1) {
+                            res[i]++
+                        }
+                    })
+                }
+
+            }
+            return res
+        },
+    }
+}
+</script>
+<style scoped lang="less">
+.qu-info-item {
+    display: flex;
+    width: 100%;
+    justify-content: space-around;
+    align-items: center;
+    padding: 20px 0px;
+    border-bottom: 1px solid #424242;
+    .qu-index {
+        display: block;
+        width: 80px;
+        // text-align: center;
+        font-size: 20px;
+        font-weight: 600;
+    }
+    .to-mark {
+        width: 120px;
+        text-align: center;
+    }
+    .progress-wrap {
+        width: 380px;
+    }
+}
+.obj-index{
+    color: #606060;
+}
+.other-index{
+    color: white;
+}
+</style>

+ 4 - 4
TEAMModelOS/Controllers/Syllabus/ShareController.cs

@@ -45,7 +45,7 @@ namespace TEAMModelOS.Controllers
             "tmdid":"分享给谁,邀请谁的tmdid",
             "name":"分享给谁,邀请谁的name",
             "sid":"课纲的id",
-            "scode":"课纲的分区键",
+            "scode":"课纲册别的分区键",
             "sname":"课纲分享节点的名称",
             "coedit":true,
             "share":true,
@@ -61,7 +61,7 @@ namespace TEAMModelOS.Controllers
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("to")]
-        [AuthToken(Roles = "Teacher")]
+       // [AuthToken(Roles = "Teacher")]
         public async Task<IActionResult> To(ShareData request) {
             // var (id, _, _, _) = HttpContext.GetAuthTokenInfo();
 
@@ -193,7 +193,7 @@ namespace TEAMModelOS.Controllers
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("find")]
-        [AuthToken(Roles = "Teacher")]
+       // [AuthToken(Roles = "Teacher")]
         public async Task<IActionResult> Find(JsonElement request)
         {
             try
@@ -332,7 +332,7 @@ namespace TEAMModelOS.Controllers
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("qrcode")]
-        [AuthToken(Roles = "Teacher")]
+        //[AuthToken(Roles = "Teacher")]
         public async Task<IActionResult> Qrcode(Favorite request)
         {
             return Ok();