Browse Source

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

SanHQin 3 months ago
parent
commit
59d8d5aba6
1 changed files with 110 additions and 13 deletions
  1. 110 13
      src/components/works.vue

+ 110 - 13
src/components/works.vue

@@ -215,6 +215,7 @@
                         <div v-if="l.tool[0] == 15">
                           <div class="toolBlk">
                             <img
+                              class="toolImg"
                               src="../assets/icon/thirdToolList/answer.png"
                               alt=""
                             />
@@ -230,6 +231,7 @@
                         <div v-if="l.tool[0] == 52">
                           <div class="toolBlk">
                             <img
+                              class="toolImg"
                               src="../assets/icon/fourthToolList/text.png"
                               alt=""
                             />
@@ -245,11 +247,13 @@
                         <div v-if="l.tool[0] == 16 || l.tool[0] == 50">
                           <div class="toolBlk">
                             <img
+                              class="toolImg"
                               v-if="l.tool[0] == 16"
                               src="../assets/icon/thirdToolList/work.png"
                               alt=""
                             />
                             <img
+                              class="toolImg"
                               v-if="l.tool[0] == 50"
                               src="../assets/icon/thirdToolList/plwork.png"
                               alt=""
@@ -274,16 +278,19 @@
                         >
                           <div class="toolBlk">
                             <img
+                              class="toolImg"
                               v-if="l.tool[0] == 1"
                               src="../assets/icon/secondToolList/whiteBoard.png"
                               alt=""
                             />
                             <img
+                              class="toolImg"
                               v-if="l.tool[0] == 3"
                               src="../assets/icon/secondToolList/mindMapping.png"
                               alt=""
                             />
                             <img
+                              class="toolImg"
                               v-if="l.tool[0] == 7"
                               src="../assets/icon/secondToolList/mindNetwork.png"
                               alt=""
@@ -314,6 +321,7 @@
                         <div v-if="l.tool[0] == 48">
                           <div class="toolBlk">
                             <img
+                              class="toolImg"
                               src="../assets/icon/fourthToolList/table.png"
                               alt=""
                             />
@@ -331,6 +339,7 @@
                         <div v-if="l.tool[0] == 4">
                           <div class="toolBlk">
                             <img
+                              class="toolImg"
                               src="../assets/icon/thirdToolList/ask.png"
                               alt=""
                             />
@@ -379,6 +388,7 @@
                         <div v-if="l.tool[0] == 45">
                           <div class="toolBlk">
                             <img
+                              class="toolImg"
                               src="../assets/icon/thirdToolList/choose.png"
                               alt=""
                             />
@@ -393,7 +403,22 @@
                             v-for="(i, index) in l.content[0].testJson"
                             :key="index + 'm'"
                           >
-                            <div>题目:{{ i.teststitle }}</div>
+                            <div>题目:{{ i.teststitle }} 
+
+                              <span                             
+                                style="color: #868ce4"
+                                >答案:</span
+                              >
+                              <span
+                                v-if="
+                                  JSON.stringify(l.content[0].radio[index]) ==
+                                    JSON.stringify(i.answer)
+                                "
+                                style="color: #868ce4"
+                                >回答正确</span
+                              >
+                              <span v-else style="color: red">回答错误</span>
+                            </div>
                             <div
                               v-if="i.type == 1"
                               style="display: flex; flex-direction: column"
@@ -478,6 +503,7 @@
                         <div v-if="l.tool[0] == 41">
                           <div class="toolBlk">
                             <img
+                              class="toolImg"
                               src="../assets/icon/thirdToolList/select.png"
                               alt=""
                             />
@@ -502,15 +528,38 @@
                               :key="itInd"
                               >{{ item }}</span
                             >
+                           
+                          </div>
+                          <div style="margin: 10px 0;">
+                            <span style="margin-right: 10px">回答:</span>
+
+                            <div
+                              style="margin-right: 10px"
+                              v-for="(item, itInd) in l.content[0]"
+                              :key="itInd"
+                              >选项{{ itInd + 1 }}:{{ l.selectJson.select[item] }}
+                              <span
+                                v-if="
+                                  l.selectJson.answer[itInd] ==
+                                    l.content[0][itInd]
+                                "
+                                style="color: #868ce4"
+                                >回答正确</span
+                              >
+                              <span v-else style="color: red">回答错误</span>
+                              </div
+                            >
+
+                            
                           </div>
                           <div>
                             <span style="margin-right: 10px">答案:</span>
 
                             <span
                               style="margin-right: 10px"
-                              v-for="(item, itInd) in l.content[0]"
+                              v-for="(item, itInd) in l.selectJson.answer"
                               :key="itInd"
-                              >{{ itInd + 1 }}、{{ l.selectJson.select[item] }}</span
+                              >选项{{ itInd + 1 }}:{{ l.selectJson.select[item] }}</span
                             >
                           </div>
                         </div>
@@ -519,6 +568,7 @@
                         <div v-if="l.tool[0] == 47">
                           <div class="toolBlk">
                             <img
+                              class="toolImg"
                               src="../assets/icon/fourthToolList/conSentences.png"
                               alt=""
                             />
@@ -568,7 +618,7 @@
                                   flex-wrap: wrap;
                                 "
                             >
-                              学生回答:
+                              回答:
                               <div
                                 class="sortTool"
                                 v-for="(i, index) in i.chooseSenList"
@@ -599,7 +649,7 @@
                             }}</span>
                           </div>
-                          <div>提交时间:{{ l.time }}</div>
+                          <div>作业提交时间:{{ workTime(k.toolEList) }}</div>
                         </div>
 
                         <!-- 作业评分 -->
@@ -678,7 +728,7 @@
                             }}</span>
                           </div>
-                          <div>提交时间:{{ l.time }}</div>
+                          <div>作业提交时间:{{ workTime(k.toolEList) }}</div>
                         </div>
 
                         <!-- 作业评分 -->
@@ -1296,9 +1346,46 @@ export default {
 
         return (new1 / data.length).toFixed(1);
       };
+    },
+    workTime(){
+      return function(val) {
+        if (!val.length) return ''
+        let TimeList = []
+        val.forEach(e=>{
+          if (e.time) {
+            const timestamp = new Date(e.time).getTime();
+            TimeList.push(timestamp)
+          }
+        })
+
+        console.log('TimeList',TimeList);
+        TimeList.sort(function(a,b){
+          return a-b;//从小到大排序
+        })
+
+
+        return this.convertToTimestamp(TimeList[0]);
+      };
     }
   },
   methods: {
+    // 时间戳转时间
+    convertToTimestamp(val) {
+      const date = new Date(val);
+
+      // 使用Date对象的方法获取年、月、日、时、分、秒
+      const year = date.getFullYear();
+      const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1
+      const day = String(date.getDate()).padStart(2, '0');
+      const hours = String(date.getHours()).padStart(2, '0');
+      const minutes = String(date.getMinutes()).padStart(2, '0');
+      const seconds = String(date.getSeconds()).padStart(2, '0');
+
+      // 格式化后的日期时间字符串
+      const formattedDateTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+      
+      return formattedDateTime
+    },
     handleOpen(key, keyPath) {
       console.log(key, keyPath);
     },
@@ -1801,6 +1888,7 @@ export default {
 
               k.content = t;
             });
+            
 
             res.data[8].forEach((k, i) => {
               k.content = k.content.split(",");
@@ -2297,6 +2385,12 @@ export default {
 </script>
 
 <style scoped>
+.eliP {
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  width: 80%;
+}
 .body_student {
   margin: 0px auto;
   width: 98%;
@@ -2884,10 +2978,10 @@ export default {
   margin-left: 10px;
 }
 
-.courseTitle span:nth-child(2) {
+/* .courseTitle span:nth-child(2) { */
   /* font-size: 14px;
   cursor: pointer; */
-}
+/* } */
 
 .bigImg {
   margin-top: 10px;
@@ -3128,9 +3222,9 @@ export default {
   font-weight: 700;
 }
 
-.ask_Answer {
+/* .ask_Answer { */
   /* margin-top: 10px; */
-}
+/* } */
 
 .ask_Answer_title {
   font-size: 18px;
@@ -3576,10 +3670,10 @@ export default {
   align-items: baseline;
 }
 
-.fullBox {
+/* .fullBox { */
   /* overflow: unset !important;
   height: auto !important; */
-}
+/* } */
 
 .fullZyBox {
   width: 60% !important;
@@ -3904,10 +3998,13 @@ export default {
 .toolBlk {
   display: flex;
   height: 44px;
-  padding-left: 5px;
+  /* padding-left: 5px; */
   box-sizing: border-box;
   margin: 15px 0;
 }
+.toolImg{
+  background-color: bisque;
+}
 .toolBlk img {
   height: 100%;
   margin-right: 8px;