Browse Source

Merge branch 'beta' of https://git.cocorobo.cn/CocoRoboLabs/pbl-student-table into beta

SanHQin 7 months ago
parent
commit
1fc56b7827

+ 1 - 1
dist/index.html

@@ -27,7 +27,7 @@
     html,
     body{
       font-family: '黑体';
-    }</style><link href=./static/css/app.84c6151f28a452186069a88463bc230a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.0eb3ff1f4c979300a113.js></script><script type=text/javascript src=./static/js/app.563bd68592dd64ae6718.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.e8d96211e2589436ebcae182b1aba0e9.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.7707b4b07bf11db2f61a.js></script><script type=text/javascript src=./static/js/app.1b96f3ecb10cd0388000.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.84c6151f28a452186069a88463bc230a.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.e8d96211e2589436ebcae182b1aba0e9.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.e8d96211e2589436ebcae182b1aba0e9.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.1b96f3ecb10cd0388000.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.1b96f3ecb10cd0388000.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.7707b4b07bf11db2f61a.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.7707b4b07bf11db2f61a.js.map


+ 66 - 71
src/components/easy2/commpont/markScore.vue

@@ -20,21 +20,6 @@
             <el-rate v-model="e.cog"></el-rate>
           </div>
         </div>
-
-        <!-- <div
-          v-if="scoTitList.length > 2"
-          style="color:#4188FC;cursor: pointer;width: 30%;"
-          @click="allList"
-        >
-          <div>
-            <span style="margin-right:5px;">{{
-              !showAll ? "全部" : "折叠"
-            }}</span>
-            <i
-              :class="!showAll ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
-            ></i>
-          </div>
-        </div> -->
       </div>
       <div style="width:100%;display:flex;justify-content: flex-end;">
         <el-button size="mini" @click="reset">重置</el-button>
@@ -76,6 +61,7 @@ export default {
       total: 0
     };
   },
+
   computed: {
     totalScore() {
       let a = 0;
@@ -89,20 +75,13 @@ export default {
         val2: this.wIndex,
         val3: data
       });
-
+    
       return data;
     }
   },
-  watch: {
-    refreshKey(newV, old) {
-      this.getData();
-    }
-  },
+
   mounted() {
     this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
-    // console.log("scoCon", this.scoCon);
-    // console.log("scoTit", this.scoTit);
-
     this.getData();
   },
 
@@ -116,7 +95,7 @@ export default {
       this.ajax
         .get(this.$store.state.api + "selectWorksEvaScore", params)
         .then(res => {
-          console.log(res);
+          // console.log(res);
           if (res.data[0].length > 0) {
             let data2 = [];
             res.data[0].forEach((val, index) => {
@@ -125,9 +104,6 @@ export default {
               }
             });
 
-            console.log("this.task", this.task);
-            console.log("data2", data2);
-
             let data = JSON.parse(data2.rate);
 
             this.scoTitList.forEach((e, index) => {
@@ -138,6 +114,8 @@ export default {
                 }
               }
             });
+
+            // console.log("this.scoTitList", this.scoTitList);
           }
         })
         .catch(err => {
@@ -146,35 +124,40 @@ export default {
     },
     // 重置
     reset() {
-      let data = this.scoTitList.map(e => {
-        return e.value + ":" + e.cog;
+      console.log("this.scoTitList", this.scoTitList);
+      this.scoTitList.forEach(e => {
+        e.cog = 0;
       });
-      // console.log("data", data);
-      const processedData = {};
+      // let data = this.scoTitList.map(e => {
+      //   return e.value + ":" + e.cog;
+      // });
+      // // console.log("data", data);
+      // const processedData = {};
 
-      data.forEach(item => {
-        const [key, value] = item.split(":");
-        processedData[key] = 0;
-      });
-      processedData.content = "";
-      // return console.log(processedData);
-      let params = {
-        cid: this.id,
-        s: this.stage,
-        t: this.task,
-        rate: JSON.stringify(processedData),
-        uid: this.stUid
-      };
-      // return console.log(params);
-      this.ajax
-        .get(this.$store.state.api + "updateWorksEva", params)
-        .then(res => {
-          this.getData();
-        })
-        .catch(err => {
-          this.$message.error("重置失败");
-          console.error(err);
-        });
+      // data.forEach(item => {
+      //   const [key, value] = item.split(":");
+      //   processedData[key] = 0;
+      // });
+      // processedData.content = "";
+      // this.scoTitList = processedData
+      // // return console.log(processedData);
+      // let params = {
+      //   cid: this.id,
+      //   s: this.stage,
+      //   t: this.task,
+      //   rate: JSON.stringify(processedData),
+      //   uid: this.stUid
+      // };
+      // // return console.log(params);
+      // this.ajax
+      //   .get(this.$store.state.api + "updateWorksEva", params)
+      //   .then(res => {
+      //     this.getData();
+      //   })
+      //   .catch(err => {
+      //     this.$message.error("重置失败");
+      //     console.error(err);
+      //   });
     },
     // 老师提交评分
     submit() {
@@ -228,29 +211,25 @@ export default {
       }
       // console.log(_text);
       let msg = `NOTICE
-      Role: 你是一个专业的项目式学习导师,你要对学生的评价高度负责。你要根据“五级评价细则”给学生作品评分。
+      Role: 你是一个专业的项目式学习导师,你要对学生的评价高度负责。你要根据“五级评价细则”给学生作品评分,并生成需要的JSON数据
       Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
       ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
       Instruction: Based on the context, follow "Format example", write content.
 
       #Context
-      ## 评价细则
-      ${_text}
-
-      ## 作业题目
-      ${this.toolDetail}
-
-      ## 作业内容
-      ${con.text}
-
-      ## 要求
-      根据评价细则和作业内容与作业题目的相关性评价作业,判断该作业属于五级中的哪个等级。
+      ##要求
+      根据<评价细则>和<作业内容>与<作业题目>的相关性评价作业,判断该作业属于五级中的哪个等级。
       具体的评价标准分为5级——1级,2级,3级,4级,5级。
       1 级,没有识别问题和需求;
       2 级,问题或需求没有被清晰理解或准确识别;
       3 级,问题或需求的一部分被识别;
       4 级,问题或需求的大部分被识别;
       5 级,问题或需求都被识别。
+      
+      ##评分资料
+      评价细则:${_text}
+      作业题目:${this.toolDetail}
+      作业内容:${con.text}
 
       # Format example
       [{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'}]
@@ -260,6 +239,7 @@ export default {
     },
     // ai打分
     aiGet2(messages, callback) {
+      console.log(this.toolIndex,this.wIndex);
       let _this = this;
       // let parm = {
       //   assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
@@ -295,7 +275,7 @@ export default {
         .post("https://gpt4.cocorobo.cn/chat", params)
         .then(response => {
           let data = response.data.FunctionResponse;
-          console.log("data", data);
+          // console.log("data", data);
           if (data.choices && data.choices.length && data.choices[0].message) {
             let dArray = {};
             try {
@@ -308,7 +288,7 @@ export default {
               console.log("error_________________" + error);
               try {
                 let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
-                console.log("dArray666", data.choices[0].message.content);
+                // console.log("dArray666", data.choices[0].message.content);
 
                 let match = data.choices[0].message.content.match(regex);
                 // console.log("dArray2", match);
@@ -336,7 +316,7 @@ export default {
                 console.log("error_________________" + error);
               }
             }
-            console.log("dArray3", dArray);
+            // console.log("dArray3", dArray);
             // _this.submit2(dArray);
             // 提交评分
             // if (!dArray) {
@@ -350,8 +330,13 @@ export default {
               processedData[key] = value;
             });
 
+            for (const key in processedData) {
+              if (!Number.isFinite(processedData[key]*1)) {
+                processedData[key] = 0
+              }
+            }
+
             processedData.content = "";
-            console.log("processedData", processedData);
 
             let params = {
               cid: _this.id,
@@ -486,8 +471,18 @@ export default {
                 let value = item[key];
                 processedData[key] = value;
               });
+
+              for (const key in processedData) {
+                if (!Number.isFinite(processedData[key]*1)) {
+                  processedData[key] = 0
+                }
+              }
+
+
+
               processedData.content = "";
 
+
               let params = {
                 cid: _this.id,
                 s: stage,

+ 54 - 27
src/components/easy2/studyStudent.vue

@@ -6558,7 +6558,7 @@
                         </div>
                       </div>
                       <div v-if="courseDetail.userid == userid && chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList && courseDetail.state == 5">
-                        <div class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail)" >
+                        <div class="ScoreBtn" v-if="!loopLoading[toolIndex].loading" @click="loopEva(worksStudent[toolIndex],chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList,courseType,taskCount,toolIndex,tool.toolDetail,worksStudent)" >
                           <img src="../../assets/icon/newIcons/rootImg.png" alt="">
                           AI评分
                         </div>
@@ -6634,11 +6634,12 @@
                               width="300"
                               :disabled="AIloading[toolIndex][wIndex].loading"
                               trigger="click"
+                              @show="handleShow(toolIndex,wIndex)"
+                              @hide="handleHide(toolIndex,wIndex,worksStudent)"
                               >
-                              <!-- {{w}} -->
                             <markScore 
                               :loading="AIloading[toolIndex][wIndex].loading" 
-                              ref="markSco" 
+                              :ref="`markSco${toolIndex}${wIndex}`"
                               @updateLoading=updateLoading
                               @updateDocSco=updateDocSco
                               :wIndex="wIndex"
@@ -6650,12 +6651,12 @@
                               :toolDetail="tool.toolDetail"
                               :stage="courseType"
                               :task="taskCount"  
-                              :scoTit="chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList">
+                              :scoTit="chapInfoList[courseType].chapterInfo[0].taskJson[taskCount].eList"
+                              >
                             </markScore>
                               <div
                                 class="answerScore"
                                 slot="reference"
-                                @click="refreshAssembly(wIndex)"
                                 :class="{
                                   rightW:
                                     w.userid == userid ||
@@ -6664,8 +6665,8 @@
                                     w.ateacher == userid,
                                 }"
                               >
-                              <span v-if="AIloading[toolIndex][wIndex].sco">
-                                {{ AIloading[toolIndex][wIndex].loading? '评分中' : AIloading[toolIndex][wIndex].sco + "分" }}
+                              <span v-if="AIloading[toolIndex][wIndex].sco && AIloading[toolIndex][wIndex].sco*1 != 0">
+                                {{ AIloading[toolIndex][wIndex].loading  ? '评分中' : AIloading[toolIndex][wIndex].sco + "分" }}
                               </span>
                               <span v-else>
                                 {{AIloading[toolIndex][wIndex].loading? '评分中' :'评分'}}{{w.Total}}
@@ -12455,7 +12456,7 @@ export default {
     };
   },
   methods: {
-    async loopEva(con,tit,stage,task,toolIndex,toolDetail){
+    async loopEva(con,tit,stage,task,toolIndex,toolDetail,worksStudent){
         console.log(con,tit,stage,task,toolIndex,toolDetail);
 
         let jude = false
@@ -12492,31 +12493,39 @@ export default {
         Instruction: Based on the context, follow "Format example", write content.
 
         #Context
-        ## 评价细则
-        ${_text}
-
-        ## 作业题目
-        ${toolDetail}
-
-        ## 作业内容
-        ${JSON.parse(con[i].works).text}
-
-        ## 要求
-        根据评价细则和作业内容与作业题目的相关性评价作业,判断该作业属于五级中的哪个等级。
+        ##要求
+        根据<评价细则>和<作业内容>与<作业题目>的相关性评价作业,判断该作业属于五级中的哪个等级。
         具体的评价标准分为5级——1级,2级,3级,4级,5级。
         1 级,没有识别问题和需求;
         2 级,问题或需求没有被清晰理解或准确识别;
         3 级,问题或需求的一部分被识别;
         4 级,问题或需求的大部分被识别;
-        5 级,问题或需求都被识别。 
+        5 级,问题或需求都被识别。
+
+        ##评分资料
+        评价细则:${_text}
+        作业题目:${toolDetail}
+        作业内容:${JSON.parse(con[i].works).text}
 
         # Format example
         [{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'}]
         `
-        await this.$refs.markSco[0].aiupdetaSco(msg,con[i].userid,stage,task)
-        this.refreshKey++
+        let mk = `markSco${toolIndex}${i}`
+
+        await this.$refs[mk][0].aiupdetaSco(msg,con[i].userid,stage,task)
+        // this.refreshKey++
+        this.$refs[mk][0].getData()
+
         this.AIloading[toolIndex][i].loading=false
       }
+      worksStudent.forEach((e,index)=>{
+          if(toolIndex != index){
+            e.forEach((i,inx)=>{
+              let mk = `markSco${index}${inx}`
+              this.$refs[mk][0].getData()
+            })
+          }
+        })
       this.loopLoading[toolIndex].loading = false;
 
     },
@@ -12527,14 +12536,32 @@ export default {
       console.log(this.refreshKey)
     },
     updateLoading(payload){
-      // console.log('payloadpayloadpayloadpayload',payload);
       this.AIloading[payload.val][payload.val2].loading=payload.val3
     },
-    updateDocSco(payload){
-      // console.log('payloadpayloadpayloadpayload',payload);
+    handleShow(toolIndex,val) {
+      let mk = `markSco${toolIndex}${val}`
+      // console.log(mk);
+      this.$refs[mk][0].getData()
+    },
+    handleHide(toolIndex,val,worksStudent) {
+      console.log(worksStudent)
+      let mk = `markSco${toolIndex}${val}`
+      this.$refs[mk][0].getData()
+
+      worksStudent.forEach((e,index)=>{
+        if(toolIndex != index){
+          e.forEach((i,inx)=>{
+            let mk = `markSco${index}${inx}`
+            this.$refs[mk][0].getData()
+          })
+        }
+      })
 
-      this.AIloading[payload.val][payload.val2].sco=payload.val3*1
-      this.$forceUpdate();
+
+    },
+    updateDocSco(payload){
+      // console.log(this.AIloading[payload.val][payload.val2].sco , payload.val3);
+      this.AIloading[payload.val][payload.val2].sco=payload.val3
     },
     gx(){
       this.$forceUpdate();

Some files were not shown because too many files changed in this diff