Browse Source

Merge branch 'beta' into HK

SanHQin 5 months ago
parent
commit
523c0e2711

+ 4 - 0
dist/index.html

@@ -27,7 +27,11 @@
     html,
     html,
     body{
     body{
       font-family: '黑体';
       font-family: '黑体';
+<<<<<<< HEAD
     }</style><link href=./static/css/app.bcc91e4ca0669f133fe5a5f069a226ad.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.acc9cff1d5ed8d2b9ae3.js></script><script type=text/javascript src=./static/js/app.14e176c6a8dc7f97a657.js></script></body></html><script>function stopSafari() {
     }</style><link href=./static/css/app.bcc91e4ca0669f133fe5a5f069a226ad.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.acc9cff1d5ed8d2b9ae3.js></script><script type=text/javascript src=./static/js/app.14e176c6a8dc7f97a657.js></script></body></html><script>function stopSafari() {
+=======
+    }</style><link href=./static/css/app.04e80e5412965b9c726e0d5de9477644.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.b2299056e030e9dd4cb8.js></script><script type=text/javascript src=./static/js/app.440dad95a023c74b2e6b.js></script></body></html><script>function stopSafari() {
+>>>>>>> beta
     //阻止safari浏览器双击放大功能
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {
     document.documentElement.addEventListener("touchstart", function (event) {

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


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


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


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


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


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


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/app.440dad95a023c74b2e6b.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.b2299056e030e9dd4cb8.js


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


+ 1 - 2
src/components/components/askStatic2.vue

@@ -200,7 +200,7 @@ export default {
     };
     };
   },
   },
   computed: {
   computed: {
-    renderedFormula() {
+        renderedFormula() {
       return function(val){
       return function(val){
         try {
         try {
            // 判断是否含有HTML标签,<tag ...>...</tag>
            // 判断是否含有HTML标签,<tag ...>...</tag>
@@ -316,7 +316,6 @@ export default {
 
 
 .a_add_head >>> .katex {
 .a_add_head >>> .katex {
   font-size: 16px;
   font-size: 16px;
-  display: block;
   width: 100%;
   width: 100%;
   white-space: normal;
   white-space: normal;
 }
 }

+ 0 - 2
src/components/components/choseWorksDetailDialog.vue

@@ -56,7 +56,6 @@
                       v-if="[72].includes(toolType)"
                       v-if="[72].includes(toolType)"
                     @click="upLoadApp">作业提交</el-button>
                     @click="upLoadApp">作业提交</el-button>
                   </div>
                   </div>
-
                   <span v-if="testData.toolDetail"><span v-html="renderedFormula(testData.toolDetail)"></span></span>
                   <span v-if="testData.toolDetail"><span v-html="renderedFormula(testData.toolDetail)"></span></span>
 									<span v-else>无</span>
 									<span v-else>无</span>
                 </div>
                 </div>
@@ -4390,7 +4389,6 @@ ol {
 
 
 .a_add_head >>> .katex {
 .a_add_head >>> .katex {
   font-size: 16px;
   font-size: 16px;
-  display: block;
   width: 100%;
   width: 100%;
   white-space: normal;
   white-space: normal;
 }
 }

+ 25 - 16
src/components/components/sortToolWorkShow.vue

@@ -6,11 +6,11 @@
                     <div class="con" style="width: 30%;">
                     <div class="con" style="width: 30%;">
                         <div>句子</div>
                         <div>句子</div>
                         <div v-for="(i,index) in e" :key="index" style="display: flex;align-items: center;">
                         <div v-for="(i,index) in e" :key="index" style="display: flex;align-items: center;">
-                            <el-tooltip class="item" effect="dark" :content="i.value" placement="top-start">
-                             <div class="TitTimu" :style="{color:i.value == i.trA? '#409EFF' :'' }">{{ i.value }}</div>
+                            <el-tooltip class="item" effect="dark" :content="i.value.join(' ')" placement="top-start">
+                             <div class="TitTimu" :style="{color:JSON.stringify(i.value) == JSON.stringify(i.trA)? '#409EFF' :'' }">{{ i.value.join(' ') }}</div>
                             </el-tooltip>
                             </el-tooltip>
                             
                             
-                            <img style="height: 15px;width: 15px;margin-left: 10px;" v-if="i.value == i.trA" src="../../assets/right.png" alt="">
+                            <img style="height: 15px;width: 15px;margin-left: 10px;" v-if="JSON.stringify(i.value) == JSON.stringify(i.trA)" src="../../assets/right.png" alt="">
                         </div>
                         </div>
                         <div>
                         <div>
                             正确率
                             正确率
@@ -23,7 +23,7 @@
                         </div>
                         </div>
                         <template v-if="e.find(k => k.isD)">
                         <template v-if="e.find(k => k.isD)">
                             <span v-for="(i,index) in e" :key="index+'p'">
                             <span v-for="(i,index) in e" :key="index+'p'">
-                                <span v-if="i.value == i.trA">{{ i.pro }}%</span>
+                                <span v-if="JSON.stringify(i.value) == JSON.stringify(i.trA)">{{ i.pro }}%</span>
                             </span>
                             </span>
                         </template>
                         </template>
                         <span v-else>
                         <span v-else>
@@ -53,9 +53,9 @@
                         <div style="font-size: 18px;color: #000;margin-bottom: 10px;">
                         <div style="font-size: 18px;color: #000;margin-bottom: 10px;">
                             {{ item.sName }}:
                             {{ item.sName }}:
                         </div>
                         </div>
-                        <div>
+                        <div style="display: flex;align-items: center;">
                           答案:<span :style="{color:JSON.parse(item.works)[itemIndex].chooseSenList.join('') == JSON.parse(item.works)[itemIndex].rightAnswer.join('')? '#409EFF' :'' }">
                           答案:<span :style="{color:JSON.parse(item.works)[itemIndex].chooseSenList.join('') == JSON.parse(item.works)[itemIndex].rightAnswer.join('')? '#409EFF' :'' }">
-                                    {{ JSON.parse(item.works)[itemIndex].chooseSenList.join('') }}
+                                    {{ JSON.parse(item.works)[itemIndex].chooseSenList.join(' ') }}
                                 </span>
                                 </span>
                             <img style="height: 15px;width: 15px;margin-left: 10px;" 
                             <img style="height: 15px;width: 15px;margin-left: 10px;" 
                             v-if="JSON.parse(item.works)[itemIndex].chooseSenList.join('') == JSON.parse(item.works)[itemIndex].rightAnswer.join('')" 
                             v-if="JSON.parse(item.works)[itemIndex].chooseSenList.join('') == JSON.parse(item.works)[itemIndex].rightAnswer.join('')" 
@@ -115,40 +115,49 @@
 
 
                 this.PData.forEach(e => {
                 this.PData.forEach(e => {
                     JSON.parse(e.works).forEach((k,kin)=>{
                     JSON.parse(e.works).forEach((k,kin)=>{
-                        allWork[kin].push(k.chooseSenList.join(''))
+                        allWork[kin].push(k.chooseSenList)
                     })
                     })
                 });
                 });
 
 
+                // console.log('llllllll',JSON.parse(JSON.stringify(allWork)));
+                
                 for (let index = 0; index < allWork.length; index++) {
                 for (let index = 0; index < allWork.length; index++) {
                     groups[index] = this.countDuplicates(allWork[index])
                     groups[index] = this.countDuplicates(allWork[index])
                 }
                 }
 
 
+
+                // console.log('groups',JSON.parse(JSON.stringify(groups)));
+                
+
                 // let groups = this.countDuplicates(allWork)
                 // let groups = this.countDuplicates(allWork)
                 for (let index = 0; index < groups.length; index++) {
                 for (let index = 0; index < groups.length; index++) {
                     for (let kin = 0; kin < groups[index].length; kin++) {
                     for (let kin = 0; kin < groups[index].length; kin++) {
+                        console.log('groups[index][kin]',groups[index][kin]);
                         groups[index][kin].pro = 0
                         groups[index][kin].pro = 0
-                        groups[index][kin].isD = groups[index][kin].value == JSON.parse(this.PData[0].works)[index].rightAnswer.join('')
-                        groups[index][kin].trA = JSON.parse(this.PData[0].works)[index].rightAnswer.join('')
+
+                        groups[index][kin].isD = JSON.stringify(groups[index][kin].value) == JSON.stringify(JSON.parse(this.PData[0].works)[index].rightAnswer)
+                        groups[index][kin].trA = JSON.parse(this.PData[0].works)[index].rightAnswer
                         groups[index][kin].pro = ((groups[index][kin].count / this.PData.length) * 100).toFixed()
                         groups[index][kin].pro = ((groups[index][kin].count / this.PData.length) * 100).toFixed()
                     }
                     }
                 }
                 }
 
 
                 
                 
                 this.sortData = groups
                 this.sortData = groups
-                // console.log('allWork',allWork);
+                // console.log('sortData',sortData);
 
 
                 // console.log('groups',groups);
                 // console.log('groups',groups);
                 
                 
             },
             },
             countDuplicates(arr) {
             countDuplicates(arr) {
-                const countMap = {};
-                
-                arr.forEach(item => {
-                    countMap[item] = (countMap[item] || 0) + 1;
+                const map = new Map();
+    
+                arr.forEach(subArr => {
+                    const key = JSON.stringify(subArr);
+                    map.set(key, (map.get(key) || 0) + 1);
                 });
                 });
                 
                 
-                return Object.entries(countMap).map(([value, count]) => ({
-                    value,
+                return Array.from(map).map(([key, count]) => ({
+                    value: JSON.parse(key),
                     count
                     count
                 }));
                 }));
             },
             },

+ 0 - 1
src/components/components/studentWorkPreviewDialog.vue

@@ -511,7 +511,6 @@ export default {
 
 
 .studentWorkPreviewDialog >>> .katex {
 .studentWorkPreviewDialog >>> .katex {
   font-size: 16px;
   font-size: 16px;
-  display: block;
   width: 100%;
   width: 100%;
   white-space: normal;
   white-space: normal;
 }
 }

+ 0 - 1
src/components/easy2/commpont/evaTable.vue

@@ -4,7 +4,6 @@
         <el-table
         <el-table
           :data="eList"
           :data="eList"
           :header-cell-style="{ background: '#F0F4FA' }"
           :header-cell-style="{ background: '#F0F4FA' }"
-          :row-class-name="tableRowClassName"
           border
           border
           stripe
           stripe
           style="width: 100%"
           style="width: 100%"

+ 199 - 84
src/components/easy2/studyStudent.vue

@@ -258,9 +258,9 @@
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
-      <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }">
-        <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }"></div>
-        <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 47px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 18px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }">
+      <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }">
+        <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }"></div>
+        <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 47px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 18px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }">
           <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid))? '100%' : 'calc(100% - 745px)'}">
           <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid))? '100%' : 'calc(100% - 745px)'}">
             <div>任务{{ taskCount + 1 }}</div>
             <div>任务{{ taskCount + 1 }}</div>
             <el-tooltip
             <el-tooltip
@@ -485,10 +485,10 @@
           <div
           <div
             class="vedioBox"
             class="vedioBox"
             v-if="
             v-if="
-              chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+              (chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != '' ||
                 .taskDetail != '' ||
                 vChapterData[taskCount].length > 0 ||
                 vChapterData[taskCount].length > 0 ||
-                fileC[taskCount].length > 0
+                fileC[taskCount].length > 0) && (tType == 1 || (tType == 2 && IsStulook))
             "
             "
             style="border-radius: 0 0 20px 20px"
             style="border-radius: 0 0 20px 20px"
           >
           >
@@ -522,7 +522,7 @@
                   v-html="
                   v-html="
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                       .taskDetail
                       .taskDetail
-                      ? renderedFormula(chapInfoList[courseType].chapterInfo[0].taskJson[
+                      ? renderedFormula2(chapInfoList[courseType].chapterInfo[0].taskJson[
                           taskCount
                           taskCount
                         ].taskDetail)
                         ].taskDetail)
                       : '暂无描述'
                       : '暂无描述'
@@ -13492,6 +13492,15 @@
               @change="updateFollow"
               @change="updateFollow"
             ></el-switch>
             ></el-switch>
           </div>
           </div>
+          <div class="switch_box" v-if="courseDetail.userid == userid">
+            <span>允许学生查看内容资料</span>
+            <el-switch
+              v-model="IsStulook"
+              active-text=""
+              class="switchCss"
+              @change="updateIsStulook"
+            ></el-switch>
+          </div>
         </div>
         </div>
       </div>
       </div>
       <div slot="footer">
       <div slot="footer">
@@ -16370,6 +16379,8 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      // 是否允许学生查看内容资料 2不可以 1可以
+      IsStulook:false,
       homeWorkLoading:false,
       homeWorkLoading:false,
       wordCloudKey: 0,
       wordCloudKey: 0,
       bg: null,
       bg: null,
@@ -16756,6 +16767,7 @@ export default {
       oidArray: [],
       oidArray: [],
       refreshKey: 0,
       refreshKey: 0,
       AIloading: [],
       AIloading: [],
+      // 为了刷新ai评分loading的时候用的
       worksStudentCopy: [],
       worksStudentCopy: [],
       loopLoading: [],
       loopLoading: [],
       markScoreVisible: false,
       markScoreVisible: false,
@@ -16785,6 +16797,48 @@ export default {
       diffKey:"1"
       diffKey:"1"
     };
     };
   },
   },
+  watch:{
+    taskCount(newVal) {
+        console.log('newVal',newVal);
+        this.AIloading = [];
+        this.loopLoading = [];
+
+        this.worksStudent.forEach((e, index) => {
+          this.loopLoading.push({ loading: false });
+          this.AIloading.push([]);
+          e.forEach(k => {
+            this.AIloading[index].push({ loading: false, sco: 0 });
+          });
+        });    
+        if(this.tType == 1){
+          this.refreshAssembly();
+        }    
+    },
+    worksStudent: {
+      handler(newVal, oldVal) {
+          const sum1 = newVal.reduce((total, subArr) => total + subArr.length, 0);
+          const sum2 = oldVal.reduce((total, subArr) => total + subArr.length, 0);
+          // console.log('worksStudent',sum1,sum2);
+          
+          if(sum1 != sum2){
+              this.AIloading = [];
+              this.loopLoading = [];
+
+              this.worksStudent.forEach((e, index) => {
+                this.loopLoading.push({ loading: false });
+                this.AIloading.push([]);
+                e.forEach(k => {
+                  this.AIloading[index].push({ loading: false, sco: 0 });
+                });
+              });
+              if(this.tType == 1){
+                this.refreshAssembly();
+              }
+          }
+      },
+      deep:true,
+    }
+  },
   methods: {
   methods: {
     getAIJ() {
     getAIJ() {
       this.ajax.get(this.$store.state.api + "getAIJ", "").then(res => {
       this.ajax.get(this.$store.state.api + "getAIJ", "").then(res => {
@@ -16887,7 +16941,6 @@ export default {
       }
       }
 
 
       this.$message.success("重置完成");
       this.$message.success("重置完成");
-      // this.refreshAssembly();
 
 
       this.worksStudent.forEach((e, index) => {
       this.worksStudent.forEach((e, index) => {
         if (toolIndex == index) {
         if (toolIndex == index) {
@@ -17370,9 +17423,8 @@ export default {
       });
       });
     },
     },
     // 组件刷新
     // 组件刷新
-    refreshAssembly(val) {
+    refreshAssembly() {
       this.refreshKey++;
       this.refreshKey++;
-      // console.log(this.refreshKey)
     },
     },
     updateLoading(payload) {
     updateLoading(payload) {
       this.AIloading[payload.val][payload.val2].loading = payload.val3;
       this.AIloading[payload.val][payload.val2].loading = payload.val3;
@@ -17710,7 +17762,7 @@ export default {
       }
       }
     },
     },
     jumpGj(i, j, k, l) {
     jumpGj(i, j, k, l) {
-      this.refreshAssembly();
+      // this.refreshAssembly();
       for (var z = 0; z < this.navList.length; z++) {
       for (var z = 0; z < this.navList.length; z++) {
         for (var q = 0; q < this.navList[z].task.length; q++) {
         for (var q = 0; q < this.navList[z].task.length; q++) {
           for (var w = 0; w < this.navList[z].task[q].tool.length; w++) {
           for (var w = 0; w < this.navList[z].task[q].tool.length; w++) {
@@ -20795,24 +20847,14 @@ export default {
             this.joinGroup(gindex);
             this.joinGroup(gindex);
           }
           }
           this.worksStudent = _worksStudent;
           this.worksStudent = _worksStudent;
-          if (
-            JSON.stringify(this.worksStudentCopy) !=
-            JSON.stringify(this.worksStudent)
-          ) {
-            console.log("88888999999");
-            this.worksStudentCopy = this.worksStudent;
-            this.AIloading = [];
-            this.loopLoading = [];
-
-            this.worksStudent.forEach((e, index) => {
-              this.loopLoading.push({ loading: false });
-              this.AIloading.push([]);
-              e.forEach(k => {
-                this.AIloading[index].push({ loading: false, sco: 0 });
-              });
-            });
-            this.refreshAssembly();
-          }
+
+          // if (((this.worksStudentCopy.length == 0) &&
+          //   (this.worksStudent.length != 0)) ||
+          //   (this.worksStudentCopy[this.taskCount].length != this.worksStudent[this.taskCount].length)
+          // ) {
+          //   this.worksStudentCopy = this.worksStudent;
+           
+          // }
           this.selectWorksStudent();
           this.selectWorksStudent();
           for (let ci = 0; ci < this.isCloseList.length; ci++) {
           for (let ci = 0; ci < this.isCloseList.length; ci++) {
             this.$nextTick(() => {
             this.$nextTick(() => {
@@ -21588,7 +21630,6 @@ export default {
       }
       }
     },
     },
     openTask(s, n, i) {
     openTask(s, n, i) {
-      this.refreshAssembly();
       if (this.IsFollow && this.tType == 2) {
       if (this.IsFollow && this.tType == 2) {
         this.$message.error("已经开启跟随模式,请认真跟堂听讲");
         this.$message.error("已经开启跟随模式,请认真跟堂听讲");
         return;
         return;
@@ -22310,6 +22351,21 @@ export default {
           //   this.chapInfoList = JSON.parse(this.courseDetail.chapters);
           //   this.chapInfoList = JSON.parse(this.courseDetail.chapters);
           // }
           // }
 
 
+          // 判断进入课程是否是创建老师,如果去创建老师,就自动开启下面两个按钮
+          if (type == 10) {
+            console.log('this.courseDetail.userid',this.courseDetail.userid);
+            console.log('this.userid',this.userid);
+
+            
+            if (this.courseDetail.userid == this.userid) {
+            
+              // 开局关闭学生查看内容
+              this.StulookMode(false)
+              // 开局打开跟随模式
+              this.followingMode(true)
+            }
+          }
+
           let _this = this;
           let _this = this;
           if (_this.timer) {
           if (_this.timer) {
             clearInterval(_this.timer);
             clearInterval(_this.timer);
@@ -22693,6 +22749,35 @@ export default {
           console.error(err);
           console.error(err);
         });
         });
     },
     },
+    updateIsStulook(){
+      let params = [
+        {
+          sopen: this.IsStulook == false ? 2 : 1,
+          cid: this.id
+        }
+      ];
+
+      this.ajax
+        .post(this.$store.state.api + "updateCourseStulook", params)
+        .then(res => {
+          
+          if (this.IsStulook == true) {
+            this.$message({
+              message: "学生查看内容资料权限已开启",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              message: "关闭学生查看内容资料权限",
+              type: "success"
+            });
+          }
+          // this.setCTask();
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
     updateFollow() {
     updateFollow() {
       let params = [
       let params = [
         {
         {
@@ -22705,12 +22790,12 @@ export default {
         .then(res => {
         .then(res => {
           if (this.IsFollow == true) {
           if (this.IsFollow == true) {
             this.$message({
             this.$message({
-              message: "开启成功",
+              message: "跟随模式已开启",
               type: "success"
               type: "success"
             });
             });
           } else {
           } else {
             this.$message({
             this.$message({
-              message: "关闭成功",
+              message: "跟随模式已关闭",
               type: "success"
               type: "success"
             });
             });
           }
           }
@@ -22774,12 +22859,13 @@ export default {
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
+          this.IsStulook = res.data[0][0].isStulook == 2 ? false : true;
           if (!this.IsLookOpen) {
           if (!this.IsLookOpen) {
             this.setNavList();
             this.setNavList();
-          }
-          // else {
+          }else {
             this.getCourseState(1);
             this.getCourseState(1);
-          // }
+          }
+          
           //  || (this.splitScreenData.isOpen && this.splitScreenData.uid != this.splitScreenData.myUid)
           //  || (this.splitScreenData.isOpen && this.splitScreenData.uid != this.splitScreenData.myUid)
 					if ((this.IsFollow && this.tType == 2)) {
 					if ((this.IsFollow && this.tType == 2)) {
             this.setContent2(false);
             this.setContent2(false);
@@ -24798,8 +24884,9 @@ export default {
           document.getElementsByClassName("navBox")[0].style.height =
           document.getElementsByClassName("navBox")[0].style.height =
             a - 40 + 0 + "px";
             a - 40 + 0 + "px";
         } else {
         } else {
-          document.getElementsByClassName("navBox")[0].style.height =
-            a - 40 + "px";
+          if (document.getElementsByClassName("navBox") && document.getElementsByClassName("navBox")[0]) {
+              document.getElementsByClassName("navBox")[0].style.height = a - 40 + "px";
+          }
         }
         }
       }
       }
       this.Stbodywidth =
       this.Stbodywidth =
@@ -26146,6 +26233,25 @@ export default {
     followingMode(flag) {
     followingMode(flag) {
       this.IsFollow = flag;
       this.IsFollow = flag;
       this.updateFollow();
       this.updateFollow();
+    },
+    StulookMode(flag) {
+      this.IsStulook = flag;
+      this.updateIsStulook();
+    },
+    getScoreList() {
+      let params = {
+        cid: this.id
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTestCourseByCid", params)
+        .then(res => {
+          let result = res.data;
+          this.scoreList.datalist = result[0];
+          this.scoreList.isScoreList = result[1];
+        })
+        .catch(err => {
+          console.error(err);
+        });
     }
     }
   },
   },
   directives: {
   directives: {
@@ -26197,45 +26303,68 @@ export default {
     this.updateSplitScreenData(1);
     this.updateSplitScreenData(1);
   },
   },
   computed: {
   computed: {
+    renderedFormula2() {
+      return function(val){
+        // 处理换行符和HTML实体
+        const normalized = val
+          .replace(/&amp;/g, '&')
+          .replace(/<br\/?>/g, '\n');
+        
+        // 匹配行内公式($...$)和块级公式($$...$$)
+        return normalized.replace(/(\${1,2})([^$]+)(\${1,2})/g, (_, delim, expr) => {
+          try {
+            return katex.renderToString(expr.trim(), {
+              displayMode: false,
+              throwOnError: false,
+              macros: {
+                '\\aligned': '\\begin{aligned}#1\\end{aligned}'
+              }
+            });
+          } catch (e) {
+            console.warn('KaTeX渲染失败:', e);
+            return `<span style="color:red">${expr}</span>`;
+          }
+        })
+      }
+    },
     renderedFormula() {
     renderedFormula() {
       return function(val){
       return function(val){
         try {
         try {
-           // 判断是否含有HTML标签,<tag ...>...</tag>
+        // 判断是否含有HTML标签,<tag ...>...</tag>
             const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
             const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
             if (!hasTag) {
             if (!hasTag) {
-              // 纯文本,整体渲染
-              val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
+            val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
 
 
+            // 纯文本,整体渲染
+            try {
+              return katex.renderToString(val.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
+              });
+            } catch (e) {
+              return val; // 渲染失败原样输出
+            }
+            } else {
+            // 有标签,对每个标签内容渲染
+            return val.replace(
+              /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
+              (match, tag, attrs, inner) => {
+              let html;
+              val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
               try {
               try {
-                return katex.renderToString(val.trim(), {
-                  throwOnError: false,
-                  strict: false,
-                  output: "htmlAndMathml"
+                html = katex.renderToString(inner.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
                 });
                 });
               } catch (e) {
               } catch (e) {
-                return val; // 渲染失败原样输出
+                html = inner;
               }
               }
-            } else {
-              // 有标签,对每个标签内容渲染
-              return val.replace(
-                /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
-                (match, tag, attrs, inner) => {
-                  let html;
-                   val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
-
-                  try {
-                    html = katex.renderToString(inner.trim(), {
-                      throwOnError: false,
-                      strict: false,
-                      output: "htmlAndMathml"
-                    });
-                  } catch (e) {
-                    html = inner;
-                  }
-                  return `<${tag}${attrs}>${html}</${tag}>`;
-                }
-              );
-            }
+                return `<${tag}${attrs}>${html}</${tag}>`;
+              }
+            );
+          }
         } catch (e) {
         } catch (e) {
           console.error('KaTeX渲染错误:', e);
           console.error('KaTeX渲染错误:', e);
           return val;
           return val;
@@ -26380,23 +26509,10 @@ export default {
         return c;
         return c;
       };
       };
     },
     },
-    getScoreList() {
-      let params = {
-        cid: this.id
-      };
-      this.ajax
-        .get(this.$store.state.api + "selectTestCourseByCid", params)
-        .then(res => {
-          let result = res.data;
-          this.scoreList.datalist = result[0];
-          this.scoreList.isScoreList = result[1];
-        })
-        .catch(err => {
-          console.error(err);
-        });
-    }
+    
   },
   },
   mounted() {
   mounted() {
+
     this.updateSplitScreenData(2);
     this.updateSplitScreenData(2);
     this.splitScreenData.myUid = uuidv4();
     this.splitScreenData.myUid = uuidv4();
     document.body.addEventListener("click", e => {
     document.body.addEventListener("click", e => {
@@ -26420,12 +26536,12 @@ export default {
 
 
     this.setOperationTime();
     this.setOperationTime();
     this.selectEva();
     this.selectEva();
-    this.getCourseDetail();
+    this.getCourseDetail(10);
     this.selectCount();
     this.selectCount();
     this.getHomeWork();
     this.getHomeWork();
     this.selectUser();
     this.selectUser();
     this.getAIJ();
     this.getAIJ();
-    this.contentDialog = true;
+    this.contentDialog = false;
     this.setContent2(true);
     this.setContent2(true);
     if (this.tType == 4) {
     if (this.tType == 4) {
       this.pzDialog = true;
       this.pzDialog = true;
@@ -26522,7 +26638,7 @@ export default {
 }
 }
 
 
 .pb_left {
 .pb_left {
-  width: 20%;
+  width: 15%;
   margin-right: 10px;
   margin-right: 10px;
   background: rgb(255, 255, 255);
   background: rgb(255, 255, 255);
   position: fixed;
   position: fixed;
@@ -30960,7 +31076,6 @@ div::-webkit-scrollbar {
 }
 }
 .pb_content >>> .katex {
 .pb_content >>> .katex {
   font-size: 16px;
   font-size: 16px;
-  display: block;
   width: 100%;
   width: 100%;
   white-space: normal;
   white-space: normal;
 }
 }

+ 136 - 51
src/components/easy3/studyStudent.vue

@@ -235,9 +235,9 @@
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
-      <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }">
-        <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }"></div>
-        <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 47px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 18px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }">
+      <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }">
+        <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }"></div>
+        <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 47px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 18px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }">
           <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid))? '100%' : 'calc(100% - 745px)'}">
           <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid))? '100%' : 'calc(100% - 745px)'}">
             <div>任务{{ taskCount + 1 }}</div>
             <div>任务{{ taskCount + 1 }}</div>
             <el-tooltip
             <el-tooltip
@@ -462,10 +462,10 @@
           <div
           <div
             class="vedioBox"
             class="vedioBox"
             v-if="
             v-if="
-              chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+              (chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != '' ||
                 .taskDetail != '' ||
               vChapterData[0].length > 0 ||
               vChapterData[0].length > 0 ||
-              fileC[0].length > 0
+              fileC[0].length > 0) && (tType == 1 || (tType == 2 && IsStulook))
             "
             "
             style="border-radius: 0 0 20px 20px"
             style="border-radius: 0 0 20px 20px"
           >
           >
@@ -537,7 +537,7 @@
                   v-html="
                   v-html="
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                       .taskDetail
                       .taskDetail
-                      ? renderedFormula(chapInfoList[courseType].chapterInfo[0].taskJson[
+                      ? renderedFormula2(chapInfoList[courseType].chapterInfo[0].taskJson[
                           taskCount
                           taskCount
                         ].taskDetail)
                         ].taskDetail)
                       : '暂无描述'
                       : '暂无描述'
@@ -10124,6 +10124,15 @@
               @change="updateFollow"
               @change="updateFollow"
             ></el-switch>
             ></el-switch>
           </div>
           </div>
+          <div class="switch_box" v-if="courseDetail.userid == userid">
+            <span>允许学生查看内容资料</span>
+            <el-switch
+              v-model="IsStulook"
+              active-text=""
+              class="switchCss"
+              @change="updateIsStulook"
+            ></el-switch>
+          </div>
         </div>
         </div>
       </div>
       </div>
       <div slot="footer">
       <div slot="footer">
@@ -12714,6 +12723,8 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      // 是否允许学生查看内容资料 2不可以 1可以
+      IsStulook:false,
       homeWorkLoading:false,
       homeWorkLoading:false,
 			toolsList: toolsList,
 			toolsList: toolsList,
       wordCloudKey: 0,
       wordCloudKey: 0,
@@ -13172,7 +13183,7 @@ export default {
           {
           {
             role: "user",
             role: "user",
             content:
             content:
-               `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
+              `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
           },
           },
         ],
         ],
         uid: this.userid,
         uid: this.userid,
@@ -17737,7 +17748,20 @@ export default {
           //   this.courseDetail = res.data[0][0];
           //   this.courseDetail = res.data[0][0];
           //   this.chapInfoList = JSON.parse(this.courseDetail.chapters);
           //   this.chapInfoList = JSON.parse(this.courseDetail.chapters);
           // }
           // }
-
+           // 判断进入课程是否是创建老师,如果去创建老师,就自动开启下面两个按钮
+          if (type == 10) {
+            console.log('this.courseDetail.userid',this.courseDetail.userid);
+            console.log('this.userid',this.userid);
+
+            
+            if (this.courseDetail.userid == this.userid) {
+            
+              // 开局关闭学生查看内容
+              this.StulookMode(false)
+              // 开局打开跟随模式
+              this.followingMode(true)
+            }
+          }
           let _this = this;
           let _this = this;
           if (_this.timer) {
           if (_this.timer) {
             clearInterval(_this.timer);
             clearInterval(_this.timer);
@@ -18120,6 +18144,35 @@ export default {
           console.error(err);
           console.error(err);
         });
         });
     },
     },
+    updateIsStulook(){
+      let params = [
+        {
+          sopen: this.IsStulook == false ? 2 : 1,
+          cid: this.id
+        }
+      ];
+
+      this.ajax
+        .post(this.$store.state.api + "updateCourseStulook", params)
+        .then(res => {
+          
+          if (this.IsStulook == true) {
+            this.$message({
+              message: "学生查看内容资料权限已开启",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              message: "关闭学生查看内容资料权限",
+              type: "success"
+            });
+          }
+          // this.setCTask();
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
     updateFollow() {
     updateFollow() {
       let params = [
       let params = [
         {
         {
@@ -18132,12 +18185,12 @@ export default {
         .then((res) => {
         .then((res) => {
           if (this.IsFollow == true) {
           if (this.IsFollow == true) {
             this.$message({
             this.$message({
-              message: "开启成功",
+              message: "跟随模式已开启",
               type: "success",
               type: "success",
             });
             });
           } else {
           } else {
             this.$message({
             this.$message({
-              message: "关闭成功",
+              message: "跟随模式已关闭",
               type: "success",
               type: "success",
             });
             });
           }
           }
@@ -18201,13 +18254,12 @@ export default {
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
+          this.IsStulook = res.data[0][0].isStulook == 2 ? false : true;
           if (!this.IsLookOpen) {
           if (!this.IsLookOpen) {
             this.setNavList();
             this.setNavList();
-          }
-
+          }else {
             this.getCourseState(1);
             this.getCourseState(1);
-
-
+          }
 
 
 					if ((this.IsFollow && this.tType == 2)) {
 					if ((this.IsFollow && this.tType == 2)) {
             this.setContent2(false);
             this.setContent2(false);
@@ -20200,8 +20252,9 @@ export default {
           document.getElementsByClassName("navBox")[0].style.height =
           document.getElementsByClassName("navBox")[0].style.height =
             a - 40 + 0+ "px";
             a - 40 + 0+ "px";
         } else {
         } else {
-          document.getElementsByClassName("navBox")[0].style.height =
-            a - 40 + "px";
+          if (document.getElementsByClassName("navBox") && document.getElementsByClassName("navBox")[0]) {
+              document.getElementsByClassName("navBox")[0].style.height = a - 40 + "px";
+          }
         }
         }
       }
       }
       this.Stbodywidth =
       this.Stbodywidth =
@@ -21505,6 +21558,10 @@ export default {
     followingMode(flag) {
     followingMode(flag) {
       this.IsFollow = flag;
       this.IsFollow = flag;
       this.updateFollow();
       this.updateFollow();
+    },
+    StulookMode(flag) {
+      this.IsStulook = flag;
+      this.updateIsStulook();
     }
     }
   },
   },
   directives: {
   directives: {
@@ -21554,45 +21611,68 @@ export default {
 		this.updateSplitScreenData(1);
 		this.updateSplitScreenData(1);
   },
   },
   computed: {
   computed: {
+    renderedFormula2() {
+      return function(val){
+        // 处理换行符和HTML实体
+        const normalized = val
+          .replace(/&amp;/g, '&')
+          .replace(/<br\/?>/g, '\n');
+        
+        // 匹配行内公式($...$)和块级公式($$...$$)
+        return normalized.replace(/(\${1,2})([^$]+)(\${1,2})/g, (_, delim, expr) => {
+          try {
+            return katex.renderToString(expr.trim(), {
+              displayMode: false,
+              throwOnError: false,
+              macros: {
+                '\\aligned': '\\begin{aligned}#1\\end{aligned}'
+              }
+            });
+          } catch (e) {
+            console.warn('KaTeX渲染失败:', e);
+            return `<span style="color:red">${expr}</span>`;
+          }
+        })
+      }
+    },
     renderedFormula() {
     renderedFormula() {
       return function(val){
       return function(val){
         try {
         try {
-           // 判断是否含有HTML标签,<tag ...>...</tag>
+        // 判断是否含有HTML标签,<tag ...>...</tag>
             const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
             const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
             if (!hasTag) {
             if (!hasTag) {
+            val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
+
+            // 纯文本,整体渲染
+            try {
+              return katex.renderToString(val.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
+              });
+            } catch (e) {
+              return val; // 渲染失败原样输出
+            }
+            } else {
+            // 有标签,对每个标签内容渲染
+            return val.replace(
+              /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
+              (match, tag, attrs, inner) => {
+              let html;
               val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
               val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
-              // 纯文本,整体渲染
               try {
               try {
-                return katex.renderToString(val.trim(), {
-                  throwOnError: false,
-                  strict: false,
-                  output: "htmlAndMathml"
+                html = katex.renderToString(inner.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
                 });
                 });
               } catch (e) {
               } catch (e) {
-                return val; // 渲染失败原样输出
+                html = inner;
               }
               }
-            } else {
-
-              // 有标签,对每个标签内容渲染
-              return val.replace(
-                /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
-                (match, tag, attrs, inner) => {
-                  let html;
-                  val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
-
-                  try {
-                    html = katex.renderToString(inner.trim(), {
-                      throwOnError: false,
-                      strict: false,
-                      output: "htmlAndMathml"
-                    });
-                  } catch (e) {
-                    html = inner;
-                  }
-                  return `<${tag}${attrs}>${html}</${tag}>`;
-                }
-              );
-            }
+                return `<${tag}${attrs}>${html}</${tag}>`;
+              }
+            );
+          }
         } catch (e) {
         } catch (e) {
           console.error('KaTeX渲染错误:', e);
           console.error('KaTeX渲染错误:', e);
           return val;
           return val;
@@ -21735,6 +21815,12 @@ export default {
 
 
   },
   },
   mounted() {
   mounted() {
+    if (this.tType == 1) {
+       // 开局关闭学生查看内容
+      this.StulookMode(false)
+      // 开局打开跟随模式
+      this.followingMode(true)
+    }
     document.body.addEventListener("click", (e) => {
     document.body.addEventListener("click", (e) => {
       if (this.isUpdateToolDetail1) {
       if (this.isUpdateToolDetail1) {
         this.updateToolDetail(this.toolDetailIndex);
         this.updateToolDetail(this.toolDetailIndex);
@@ -21753,12 +21839,12 @@ export default {
     }
     }
     this.setOperationTime();
     this.setOperationTime();
     this.selectEva();
     this.selectEva();
-    this.getCourseDetail();
+    this.getCourseDetail(10);
     this.selectCount();
     this.selectCount();
     this.getHomeWork();
     this.getHomeWork();
     this.selectUser();
     this.selectUser();
 		this.getAIJ();
 		this.getAIJ();
-    this.contentDialog = true;
+    this.contentDialog = false;
     this.setContent2(true);
     this.setContent2(true);
     if (this.tType == 4) {
     if (this.tType == 4) {
       this.pzDialog = true;
       this.pzDialog = true;
@@ -21856,7 +21942,7 @@ export default {
 }
 }
 
 
 .pb_left {
 .pb_left {
-  width: 20%;
+  width: 15%;
   margin-right: 10px;
   margin-right: 10px;
   background: rgb(255, 255, 255);
   background: rgb(255, 255, 255);
   position: fixed;
   position: fixed;
@@ -22062,7 +22148,6 @@ export default {
 }
 }
 .pb_content >>> .katex {
 .pb_content >>> .katex {
   font-size: 16px;
   font-size: 16px;
-  display: block;
   width: 100%;
   width: 100%;
   white-space: normal;
   white-space: normal;
 }
 }
@@ -25697,7 +25782,7 @@ ol {
   width: 100%;
   width: 100%;
 }
 }
 
 
-.toolChild > div::before {
+/* .toolChild > div::before { */
   /* content: "";
   /* content: "";
   width: 15px;
   width: 15px;
   height: 1px;
   height: 1px;
@@ -25706,7 +25791,7 @@ ol {
   top: 24px;
   top: 24px;
   left: -20px;
   left: -20px;
   display: block; */
   display: block; */
-}
+/* } */
 
 
 .isGjCss {
 .isGjCss {
   /* color: #0061ff; */
   /* color: #0061ff; */

+ 153 - 66
src/components/studyStudent.vue

@@ -241,9 +241,9 @@
         </div>
         </div>
       </div>
       </div>
       <!-- :class="{ navLeftCss: !mlDialog }" -->
       <!-- :class="{ navLeftCss: !mlDialog }" -->
-      <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }">
-        <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }"></div>
-        <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 47px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 18px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }">
+      <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }">
+        <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }"></div>
+        <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 47px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 18px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }">
           <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid))? '100%' : 'calc(100% - 745px)'}">
           <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid))? '100%' : 'calc(100% - 745px)'}">
             <div>任务{{ taskCount + 1 }}</div>
             <div>任务{{ taskCount + 1 }}</div>
             <el-tooltip
             <el-tooltip
@@ -463,10 +463,10 @@
           <div
           <div
             class="vedioBox"
             class="vedioBox"
             v-if="
             v-if="
-              chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+              (chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != '' ||
                 .taskDetail != '' ||
               vChapterData[taskCount].length > 0 ||
               vChapterData[taskCount].length > 0 ||
-              fileC[taskCount].length > 0
+              fileC[taskCount].length > 0) && (tType == 1 || (tType == 2 && IsStulook))
             "
             "
             style="border-radius: 0 0 20px 20px"
             style="border-radius: 0 0 20px 20px"
           >
           >
@@ -500,9 +500,9 @@
                   v-html="
                   v-html="
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                       .taskDetail
                       .taskDetail
-                      ? renderedFormula(chapInfoList[courseType].chapterInfo[0].taskJson[
+                      ? renderedFormula2(chapInfoList[courseType].chapterInfo[0].taskJson[
                           taskCount
                           taskCount
-                        ].taskDetail)
+                        ].taskDetail)  
                       : '暂无描述'
                       : '暂无描述'
                   "
                   "
                 ></div>
                 ></div>
@@ -4425,7 +4425,7 @@
                               cursor: pointer;
                               cursor: pointer;
                             "
                             "
                           >
                           >
-                            {{ index + 1 + "、"  }} <span v-html="renderedFormula(item.teststitle)"></span>
+                              {{ index + 1 + "、"  }} <span v-html="renderedFormula(item.teststitle)"></span>
                           </div>
                           </div>
                         </el-tooltip>
                         </el-tooltip>
                       </div>
                       </div>
@@ -9603,7 +9603,7 @@
                 >
                 >
                   (多选题)
                   (多选题)
                 </div>
                 </div>
-                <div>题目:<span v-html="renderedFormula(testJson.testJson[index1].teststitle)"></span></div>
+                  <div>题目:<span v-html="renderedFormula(testJson.testJson[index1].teststitle)"></span></div>
               </div>
               </div>
               <img
               <img
                 v-if="testJson.testJson[index1].img"
                 v-if="testJson.testJson[index1].img"
@@ -10060,6 +10060,15 @@
               @change="updateFollow"
               @change="updateFollow"
             ></el-switch>
             ></el-switch>
           </div>
           </div>
+          <div class="switch_box" v-if="courseDetail.userid == userid">
+            <span>允许学生查看内容资料</span>
+            <el-switch
+              v-model="IsStulook"
+              active-text=""
+              class="switchCss"
+              @change="updateIsStulook"
+            ></el-switch>
+          </div>
         </div>
         </div>
       </div>
       </div>
       <div slot="footer">
       <div slot="footer">
@@ -12651,6 +12660,8 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      // 是否允许学生查看内容资料 2不可以 1可以
+      IsStulook:false,
       homeWorkLoading:false,
       homeWorkLoading:false,
       wordCloudKey: 0,
       wordCloudKey: 0,
       bg: null,
       bg: null,
@@ -13108,7 +13119,7 @@ export default {
           {
           {
             role: "user",
             role: "user",
             content:
             content:
-             `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
+            `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
           },
           },
         ],
         ],
         uid: this.userid,
         uid: this.userid,
@@ -17679,7 +17690,20 @@ export default {
           //   this.courseDetail = res.data[0][0];
           //   this.courseDetail = res.data[0][0];
           //   this.chapInfoList = JSON.parse(this.courseDetail.chapters);
           //   this.chapInfoList = JSON.parse(this.courseDetail.chapters);
           // }
           // }
-
+          // 判断进入课程是否是创建老师,如果去创建老师,就自动开启下面两个按钮
+          if (type == 10) {
+            console.log('this.courseDetail.userid',this.courseDetail.userid);
+            console.log('this.userid',this.userid);
+
+            
+            if (this.courseDetail.userid == this.userid) {
+            
+              // 开局关闭学生查看内容
+              this.StulookMode(false)
+              // 开局打开跟随模式
+              this.followingMode(true)
+            }
+          }
           let _this = this;
           let _this = this;
           if (_this.timer) {
           if (_this.timer) {
             clearInterval(_this.timer);
             clearInterval(_this.timer);
@@ -18063,6 +18087,35 @@ export default {
           console.error(err);
           console.error(err);
         });
         });
     },
     },
+    updateIsStulook(){
+      let params = [
+        {
+          sopen: this.IsStulook == false ? 2 : 1,
+          cid: this.id
+        }
+      ];
+
+      this.ajax
+        .post(this.$store.state.api + "updateCourseStulook", params)
+        .then(res => {
+          
+          if (this.IsStulook == true) {
+            this.$message({
+              message: "学生查看内容资料权限已开启",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              message: "关闭学生查看内容资料权限",
+              type: "success"
+            });
+          }
+          // this.setCTask();
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
     updateFollow() {
     updateFollow() {
       let params = [
       let params = [
         {
         {
@@ -18075,12 +18128,12 @@ export default {
         .then((res) => {
         .then((res) => {
           if (this.IsFollow == true) {
           if (this.IsFollow == true) {
             this.$message({
             this.$message({
-              message: "开启成功",
+              message: "跟随模式已开启",
               type: "success",
               type: "success",
             });
             });
           } else {
           } else {
             this.$message({
             this.$message({
-              message: "关闭成功",
+              message: "跟随模式已关闭",
               type: "success",
               type: "success",
             });
             });
           }
           }
@@ -18144,12 +18197,12 @@ export default {
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
+          this.IsStulook = res.data[0][0].isStulook == 2 ? false : true;
           if (!this.IsLookOpen) {
           if (!this.IsLookOpen) {
             this.setNavList();
             this.setNavList();
-          }
-          //  else {
+          }else {
             this.getCourseState(1);
             this.getCourseState(1);
-          // }
+          }
 
 
           if ((this.IsFollow && this.tType == 2)) {
           if ((this.IsFollow && this.tType == 2)) {
             this.setContent2(false);
             this.setContent2(false);
@@ -20135,8 +20188,9 @@ export default {
           document.getElementsByClassName("navBox")[0].style.height =
           document.getElementsByClassName("navBox")[0].style.height =
             a - 40 + 0+ "px";
             a - 40 + 0+ "px";
         } else {
         } else {
-          document.getElementsByClassName("navBox")[0].style.height =
-            a - 40 + "px";
+          if (document.getElementsByClassName("navBox") && document.getElementsByClassName("navBox")[0]) {
+              document.getElementsByClassName("navBox")[0].style.height = a - 40 + "px";
+          }
         }
         }
       }
       }
       this.Stbodywidth =
       this.Stbodywidth =
@@ -21457,7 +21511,11 @@ export default {
     followingMode(flag) {
     followingMode(flag) {
       this.IsFollow = flag;
       this.IsFollow = flag;
       this.updateFollow();
       this.updateFollow();
-    }
+    },
+    StulookMode(flag) {
+      this.IsStulook = flag;
+      this.updateIsStulook();
+    },
   },
   },
   directives: {
   directives: {
     // 使用局部注册指令的方式
     // 使用局部注册指令的方式
@@ -21506,44 +21564,68 @@ export default {
 		this.updateSplitScreenData(1);
 		this.updateSplitScreenData(1);
   },
   },
   computed: {
   computed: {
+    renderedFormula2() {
+      return function(val){
+        // 处理换行符和HTML实体
+        const normalized = val
+          .replace(/&amp;/g, '&')
+          .replace(/<br\/?>/g, '\n');
+        
+        // 匹配行内公式($...$)和块级公式($$...$$)
+        return normalized.replace(/(\${1,2})([^$]+)(\${1,2})/g, (_, delim, expr) => {
+          try {
+            return katex.renderToString(expr.trim(), {
+              displayMode: false,
+              throwOnError: false,
+              macros: {
+                '\\aligned': '\\begin{aligned}#1\\end{aligned}'
+              }
+            });
+          } catch (e) {
+            console.warn('KaTeX渲染失败:', e);
+            return `<span style="color:red">${expr}</span>`;
+          }
+        })
+      }
+    },
     renderedFormula() {
     renderedFormula() {
       return function(val){
       return function(val){
         try {
         try {
-           // 判断是否含有HTML标签,<tag ...>...</tag>
+        // 判断是否含有HTML标签,<tag ...>...</tag>
             const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
             const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
             if (!hasTag) {
             if (!hasTag) {
+            val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
+
+            // 纯文本,整体渲染
+            try {
+              return katex.renderToString(val.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
+              });
+            } catch (e) {
+              return val; // 渲染失败原样输出
+            }
+            } else {
+            // 有标签,对每个标签内容渲染
+            return val.replace(
+              /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
+              (match, tag, attrs, inner) => {
+              let html;
               val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
               val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
-
-              // 纯文本,整体渲染
               try {
               try {
-                return katex.renderToString(val.trim(), {
-                  throwOnError: false,
-                  strict: false,
-                  output: "htmlAndMathml"
+                html = katex.renderToString(inner.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
                 });
                 });
               } catch (e) {
               } catch (e) {
-                return val; // 渲染失败原样输出
+                html = inner;
               }
               }
-            } else {
-              // 有标签,对每个标签内容渲染
-              return val.replace(
-                /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
-                (match, tag, attrs, inner) => {
-                  let html;
-                  val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
-                  try {
-                    html = katex.renderToString(inner.trim(), {
-                      throwOnError: false,
-                      strict: false,
-                      output: "htmlAndMathml"
-                    });
-                  } catch (e) {
-                    html = inner;
-                  }
-                  return `<${tag}${attrs}>${html}</${tag}>`;
-                }
-              );
-            }
+                return `<${tag}${attrs}>${html}</${tag}>`;
+              }
+            );
+          }
         } catch (e) {
         } catch (e) {
           console.error('KaTeX渲染错误:', e);
           console.error('KaTeX渲染错误:', e);
           return val;
           return val;
@@ -21559,7 +21641,7 @@ export default {
           ? c
           ? c
               .replaceAll(/\r\n/g, "<br/>")
               .replaceAll(/\r\n/g, "<br/>")
               .replaceAll(/\n/g, "<br/>")
               .replaceAll(/\n/g, "<br/>")
-              .replaceAll(/\s/g, " &nbsp")
+              .replaceAll(/\s/g, "&nbsp")
           : "";
           : "";
       };
       };
     },
     },
@@ -21675,6 +21757,12 @@ export default {
 
 
   },
   },
   mounted() {
   mounted() {
+    if (this.tType == 1) {
+       // 开局关闭学生查看内容
+      this.StulookMode(false)
+      // 开局打开跟随模式
+      this.followingMode(true)
+    }
     document.body.addEventListener("click", (e) => {
     document.body.addEventListener("click", (e) => {
       if (this.isUpdateToolDetail1) {
       if (this.isUpdateToolDetail1) {
         this.updateToolDetail(this.toolDetailIndex);
         this.updateToolDetail(this.toolDetailIndex);
@@ -21683,7 +21771,7 @@ export default {
 
 
     this.setOperationTime();
     this.setOperationTime();
     this.selectEva();
     this.selectEva();
-    this.getCourseDetail();
+    this.getCourseDetail(10);
     this.selectCount();
     this.selectCount();
     this.getHomeWork();
     this.getHomeWork();
     this.selectUser();
     this.selectUser();
@@ -21692,7 +21780,7 @@ export default {
 		this.updateSplitScreenData(2);
 		this.updateSplitScreenData(2);
 		this.splitScreenData.myUid = uuidv4();
 		this.splitScreenData.myUid = uuidv4();
 
 
-    this.contentDialog = true;
+    this.contentDialog = false;
     this.setContent2(true);
     this.setContent2(true);
     if (this.tType == 4) {
     if (this.tType == 4) {
       this.pzDialog = true;
       this.pzDialog = true;
@@ -21799,7 +21887,7 @@ export default {
 }
 }
 
 
 .pb_left {
 .pb_left {
-  width: 20%;
+  width: 15%;
   margin-right: 10px;
   margin-right: 10px;
   background: rgb(255, 255, 255);
   background: rgb(255, 255, 255);
   position: fixed;
   position: fixed;
@@ -23543,10 +23631,10 @@ export default {
   justify-content: center;
   justify-content: center;
 }
 }
 
 
-.answerBg > div:nth-child(1) {
+/* .answerBg > div:nth-child(1) { */
   /* font-size: 22px;
   /* font-size: 22px;
   padding: 25px 0 10px; */
   padding: 25px 0 10px; */
-}
+/* } */
 
 
 .answerContent {
 .answerContent {
   width: 215px;
   width: 215px;
@@ -23716,8 +23804,8 @@ export default {
   width: 400px;
   width: 400px;
 }
 }
 
 
-.e_add_btn {
-}
+/* .e_add_btn {
+} */
 
 
 .e_add_content {
 .e_add_content {
   display: flex;
   display: flex;
@@ -25109,8 +25197,8 @@ ol {
   top: -25px;
   top: -25px;
 }
 }
 
 
-.group_workBox {
-}
+/* .group_workBox {
+} */
 
 
 .group_workBox + .group_workBox {
 .group_workBox + .group_workBox {
   margin-top: 20px;
   margin-top: 20px;
@@ -25233,8 +25321,8 @@ ol {
   border-radius: 5px;
   border-radius: 5px;
 }
 }
 
 
-.groupBox {
-}
+/* .groupBox {
+} */
 
 
 .groupContent + .groupContent {
 .groupContent + .groupContent {
   margin-top: 30px;
   margin-top: 30px;
@@ -25575,9 +25663,9 @@ ol {
   margin-left: 15px;
   margin-left: 15px;
   width: calc(100% - 50px);
   width: calc(100% - 50px);
 }
 }
-.stageNav{
+/* .stageNav{ */
   /* font-weight: bold; */
   /* font-weight: bold; */
-}
+/* } */
 .stageItemTitle > div:first-child {
 .stageItemTitle > div:first-child {
   min-width: 55px;
   min-width: 55px;
 }
 }
@@ -25624,11 +25712,11 @@ ol {
   overflow: hidden;
   overflow: hidden;
   transition: all 0.5s;
   transition: all 0.5s;
 }
 }
-.toolChild {
+/* .toolChild { */
   /* margin: 0 0 0 17px;
   /* margin: 0 0 0 17px;
   padding: 0 0 0 20px;
   padding: 0 0 0 20px;
   border-left: 1px solid #d7d7d7; */
   border-left: 1px solid #d7d7d7; */
-}
+/* } */
 
 
 .toolChild > div + div{
 .toolChild > div + div{
   margin-top:5px;
   margin-top:5px;
@@ -25651,7 +25739,7 @@ ol {
   width:100%;
   width:100%;
 }
 }
 
 
-.toolChild > div::before {
+/* .toolChild > div::before { */
   /* content: "";
   /* content: "";
   width: 15px;
   width: 15px;
   height: 1px;
   height: 1px;
@@ -25660,7 +25748,7 @@ ol {
   top: 24px;
   top: 24px;
   left: -20px;
   left: -20px;
   display: block; */
   display: block; */
-}
+/* } */
 
 
 .isGjCss {
 .isGjCss {
   /* color: #0061ff; */
   /* color: #0061ff; */
@@ -26194,7 +26282,6 @@ div::-webkit-scrollbar {
 }
 }
 .pb_content >>> .katex {
 .pb_content >>> .katex {
   font-size: 16px;
   font-size: 16px;
-  display: block;
   width: 100%;
   width: 100%;
   white-space: normal;
   white-space: normal;
 }
 }

+ 0 - 1
src/components/studySutdentClass/commpont/evaTable.vue

@@ -4,7 +4,6 @@
         <el-table
         <el-table
           :data="eList"
           :data="eList"
           :header-cell-style="{ background: '#F0F4FA' }"
           :header-cell-style="{ background: '#F0F4FA' }"
-          :row-class-name="tableRowClassName"
           border
           border
           stripe
           stripe
           style="width: 100%"
           style="width: 100%"

+ 179 - 75
src/components/studySutdentClass/studyStudent.vue

@@ -235,9 +235,9 @@
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
-      <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }">
-        <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }"></div>
-        <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 20% - 47px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 18px)', left: mlDialog  ? 'calc(20% + 35px)' : '10px' }">
+      <div class="body_student" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }">
+        <div class="new_topFixed" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 40px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 10px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }"></div>
+        <div class="new_top" :style="{width: mlDialog ? 'calc(100% - '+`${classRoomHelperWidth}`+' - 15% - 47px)' : 'calc(100% - '+`${classRoomHelperWidth}`+' - 18px)', left: mlDialog  ? 'calc(15% + 35px)' : '10px' }">
           <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid))? '100%' : 'calc(100% - 745px)'}">
           <div class="courseIndex" :style="{width: (orgArray.includes(org) || oidArray.includes(oid))? '100%' : 'calc(100% - 745px)'}">
             <div>任务{{ taskCount + 1 }}</div>
             <div>任务{{ taskCount + 1 }}</div>
             <el-tooltip
             <el-tooltip
@@ -462,10 +462,10 @@
           <div
           <div
             class="vedioBox"
             class="vedioBox"
             v-if="
             v-if="
-              chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
+              (chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                 .taskDetail != '' ||
                 .taskDetail != '' ||
               vChapterData[0].length > 0 ||
               vChapterData[0].length > 0 ||
-              fileC[0].length > 0
+              fileC[0].length > 0) && (tType == 1 || (tType == 2 && IsStulook))
             "
             "
             style="border-radius: 0 0 20px 20px"
             style="border-radius: 0 0 20px 20px"
           >
           >
@@ -537,7 +537,7 @@
                   v-html="
                   v-html="
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                       .taskDetail
                       .taskDetail
-                      ? renderedFormula(chapInfoList[courseType].chapterInfo[0].taskJson[
+                      ? renderedFormula2(chapInfoList[courseType].chapterInfo[0].taskJson[
                           taskCount
                           taskCount
                         ].taskDetail)
                         ].taskDetail)
                       : '暂无描述'
                       : '暂无描述'
@@ -13305,6 +13305,15 @@
               @change="updateFollow"
               @change="updateFollow"
             ></el-switch>
             ></el-switch>
           </div>
           </div>
+          <div class="switch_box" v-if="courseDetail.userid == userid">
+            <span>允许学生查看内容资料</span>
+            <el-switch
+              v-model="IsStulook"
+              active-text=""
+              class="switchCss"
+              @change="updateIsStulook"
+            ></el-switch>
+          </div>
         </div>
         </div>
       </div>
       </div>
       <div slot="footer">
       <div slot="footer">
@@ -15965,6 +15974,8 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      // 是否允许学生查看内容资料 2不可以 1可以
+      IsStulook:false,
       homeWorkLoading:false,
       homeWorkLoading:false,
 			toolsList: toolsList,
 			toolsList: toolsList,
       wordCloudKey: 0,
       wordCloudKey: 0,
@@ -16366,6 +16377,48 @@ export default {
       diffKey:"1"
       diffKey:"1"
     };
     };
   },
   },
+  watch:{
+    taskCount(newVal) {
+      console.log('newVal',newVal);
+        this.AIloading = [];
+        this.loopLoading = [];
+
+        this.worksStudent.forEach((e, index) => {
+          this.loopLoading.push({ loading: false });
+          this.AIloading.push([]);
+          e.forEach(k => {
+            this.AIloading[index].push({ loading: false, sco: 0 });
+          });
+        });   
+        if(this.tType == 1){
+          this.refreshAssembly();
+        }        
+    },
+    worksStudent: {
+      handler(newVal, oldVal) {
+          const sum1 = newVal.reduce((total, subArr) => total + subArr.length, 0);
+          const sum2 = oldVal.reduce((total, subArr) => total + subArr.length, 0);
+          // console.log('worksStudent',sum1,sum2);
+          
+          if(sum1 != sum2){
+              this.AIloading = [];
+              this.loopLoading = [];
+
+              this.worksStudent.forEach((e, index) => {
+                this.loopLoading.push({ loading: false });
+                this.AIloading.push([]);
+                e.forEach(k => {
+                  this.AIloading[index].push({ loading: false, sco: 0 });
+                });
+              });
+              if(this.tType == 1){
+                this.refreshAssembly();
+              }
+          }
+      },
+      deep:true,
+    }
+  },
   methods: {
   methods: {
     //查看应用中心作业
     //查看应用中心作业
     openCocoFlow(w){
     openCocoFlow(w){
@@ -16469,7 +16522,7 @@ export default {
       }
       }
 
 
       this.$message.success("重置完成");
       this.$message.success("重置完成");
-      // this.refreshAssembly();
+
 
 
       this.worksStudent.forEach((e, index) => {
       this.worksStudent.forEach((e, index) => {
         if (toolIndex == index) {
         if (toolIndex == index) {
@@ -16948,9 +17001,8 @@ export default {
       });
       });
     },
     },
     // 组件刷新
     // 组件刷新
-    refreshAssembly(val) {
+    refreshAssembly() {
       this.refreshKey++;
       this.refreshKey++;
-      // console.log(this.refreshKey)
     },
     },
     updateLoading(payload) {
     updateLoading(payload) {
       this.AIloading[payload.val][payload.val2].loading = payload.val3;
       this.AIloading[payload.val][payload.val2].loading = payload.val3;
@@ -17283,7 +17335,7 @@ export default {
       }
       }
     },
     },
     jumpGj(i, j, k, l) {
     jumpGj(i, j, k, l) {
-      this.refreshAssembly();
+      // this.refreshAssembly();
       for (var z = 0; z < this.navList.length; z++) {
       for (var z = 0; z < this.navList.length; z++) {
         for (var q = 0; q < this.navList[z].task.length; q++) {
         for (var q = 0; q < this.navList[z].task.length; q++) {
           for (var w = 0; w < this.navList[z].task[q].tool.length; w++) {
           for (var w = 0; w < this.navList[z].task[q].tool.length; w++) {
@@ -20273,24 +20325,7 @@ export default {
             this.joinGroup(gindex);
             this.joinGroup(gindex);
           }
           }
           this.worksStudent = _worksStudent;
           this.worksStudent = _worksStudent;
-          if (
-            JSON.stringify(this.worksStudentCopy) !=
-            JSON.stringify(this.worksStudent)
-          ) {
-            console.log("88888999999");
-            this.worksStudentCopy = this.worksStudent;
-            this.AIloading = [];
-            this.loopLoading = [];
-
-            this.worksStudent.forEach((e, index) => {
-              this.loopLoading.push({ loading: false });
-              this.AIloading.push([]);
-              e.forEach(k => {
-                this.AIloading[index].push({ loading: false, sco: 0 });
-              });
-            });
-            this.refreshAssembly();
-          }
+  
           this.selectWorksStudent();
           this.selectWorksStudent();
           for (let ci = 0; ci < this.isCloseList.length; ci++) {
           for (let ci = 0; ci < this.isCloseList.length; ci++) {
             this.$nextTick(() => {
             this.$nextTick(() => {
@@ -21763,7 +21798,20 @@ export default {
           }
           }
 
 
 
 
+          // 判断进入课程是否是创建老师,如果去创建老师,就自动开启下面两个按钮
+          if (type == 10) {
+            console.log('this.courseDetail.userid',this.courseDetail.userid);
+            console.log('this.userid',this.userid);
 
 
+            
+            if (this.courseDetail.userid == this.userid) {
+            
+              // 开局关闭学生查看内容
+              this.StulookMode(false)
+              // 开局打开跟随模式
+              this.followingMode(true)
+            }
+          }
 
 
 
 
           //  else {
           //  else {
@@ -22157,6 +22205,35 @@ export default {
           console.error(err);
           console.error(err);
         });
         });
     },
     },
+    updateIsStulook(){
+      let params = [
+        {
+          sopen: this.IsStulook == false ? 2 : 1,
+          cid: this.id
+        }
+      ];
+
+      this.ajax
+        .post(this.$store.state.api + "updateCourseStulook", params)
+        .then(res => {
+          
+          if (this.IsStulook == true) {
+            this.$message({
+              message: "学生查看内容资料权限已开启",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              message: "关闭学生查看内容资料权限",
+              type: "success"
+            });
+          }
+          // this.setCTask();
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
     updateFollow() {
     updateFollow() {
       let params = [
       let params = [
         {
         {
@@ -22169,12 +22246,12 @@ export default {
         .then((res) => {
         .then((res) => {
           if (this.IsFollow == true) {
           if (this.IsFollow == true) {
             this.$message({
             this.$message({
-              message: "开启成功",
+              message: "跟随模式已开启",
               type: "success",
               type: "success",
             });
             });
           } else {
           } else {
             this.$message({
             this.$message({
-              message: "关闭成功",
+              message: "跟随模式已关闭",
               type: "success",
               type: "success",
             });
             });
           }
           }
@@ -22238,12 +22315,12 @@ export default {
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
+          this.IsStulook = res.data[0][0].isStulook == 2 ? false : true;
           if (!this.IsLookOpen) {
           if (!this.IsLookOpen) {
             this.setNavList();
             this.setNavList();
-          }
-          // else {
+          } else {
             this.getCourseState(1);
             this.getCourseState(1);
-          // }
+          }
 
 
 					if ((this.IsFollow && this.tType == 2) || (this.splitScreenData.isOpen && this.splitScreenData.uid != this.splitScreenData.myUid)) {
 					if ((this.IsFollow && this.tType == 2) || (this.splitScreenData.isOpen && this.splitScreenData.uid != this.splitScreenData.myUid)) {
             this.setContent2(false);
             this.setContent2(false);
@@ -24238,8 +24315,9 @@ export default {
           document.getElementsByClassName("navBox")[0].style.height =
           document.getElementsByClassName("navBox")[0].style.height =
             a - 40 + 0+ "px";
             a - 40 + 0+ "px";
         } else {
         } else {
-          document.getElementsByClassName("navBox")[0].style.height =
-            a - 40 + "px";
+            if (document.getElementsByClassName("navBox") && document.getElementsByClassName("navBox")[0]) {
+              document.getElementsByClassName("navBox")[0].style.height = a - 40 + "px";
+            }
         }
         }
       }
       }
       this.Stbodywidth =
       this.Stbodywidth =
@@ -25542,7 +25620,11 @@ export default {
     followingMode(flag) {
     followingMode(flag) {
       this.IsFollow = flag;
       this.IsFollow = flag;
       this.updateFollow();
       this.updateFollow();
-    }
+    },
+    StulookMode(flag) {
+      this.IsStulook = flag;
+      this.updateIsStulook();
+    },
   },
   },
   directives: {
   directives: {
     // 使用局部注册指令的方式
     // 使用局部注册指令的方式
@@ -25593,45 +25675,68 @@ export default {
 		this.updateSplitScreenData(1);
 		this.updateSplitScreenData(1);
   },
   },
   computed: {
   computed: {
+    renderedFormula2() {
+      return function(val){
+        // 处理换行符和HTML实体
+        const normalized = val
+          .replace(/&amp;/g, '&')
+          .replace(/<br\/?>/g, '\n');
+        
+        // 匹配行内公式($...$)和块级公式($$...$$)
+        return normalized.replace(/(\${1,2})([^$]+)(\${1,2})/g, (_, delim, expr) => {
+          try {
+            return katex.renderToString(expr.trim(), {
+              displayMode: false,
+              throwOnError: false,
+              macros: {
+                '\\aligned': '\\begin{aligned}#1\\end{aligned}'
+              }
+            });
+          } catch (e) {
+            console.warn('KaTeX渲染失败:', e);
+            return `<span style="color:red">${expr}</span>`;
+          }
+        })
+      }
+    },
     renderedFormula() {
     renderedFormula() {
       return function(val){
       return function(val){
         try {
         try {
-           // 判断是否含有HTML标签,<tag ...>...</tag>
+        // 判断是否含有HTML标签,<tag ...>...</tag>
             const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
             const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
             if (!hasTag) {
             if (!hasTag) {
-              // 纯文本,整体渲染
-              val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
+            val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
 
 
+            // 纯文本,整体渲染
+            try {
+              return katex.renderToString(val.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
+              });
+            } catch (e) {
+              return val; // 渲染失败原样输出
+            }
+            } else {
+            // 有标签,对每个标签内容渲染
+            return val.replace(
+              /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
+              (match, tag, attrs, inner) => {
+              let html;
+              val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
               try {
               try {
-                return katex.renderToString(val.trim(), {
-                  throwOnError: false,
-                  strict: false,
-                  output: "htmlAndMathml"
+                html = katex.renderToString(inner.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
                 });
                 });
               } catch (e) {
               } catch (e) {
-                return val; // 渲染失败原样输出
+                html = inner;
               }
               }
-            } else {
-              // 有标签,对每个标签内容渲染
-              return val.replace(
-                /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
-                (match, tag, attrs, inner) => {
-                  let html;
-                  val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
-
-                  try {
-                    html = katex.renderToString(inner.trim(), {
-                      throwOnError: false,
-                      strict: false,
-                      output: "htmlAndMathml"
-                    });
-                  } catch (e) {
-                    html = inner;
-                  }
-                  return `<${tag}${attrs}>${html}</${tag}>`;
-                }
-              );
-            }
+                return `<${tag}${attrs}>${html}</${tag}>`;
+              }
+            );
+          }
         } catch (e) {
         } catch (e) {
           console.error('KaTeX渲染错误:', e);
           console.error('KaTeX渲染错误:', e);
           return val;
           return val;
@@ -25796,12 +25901,12 @@ export default {
     }
     }
     this.setOperationTime();
     this.setOperationTime();
     this.selectEva();
     this.selectEva();
-    this.getCourseDetail();
+    this.getCourseDetail(10);
     this.selectCount();
     this.selectCount();
     this.getHomeWork();
     this.getHomeWork();
     this.selectUser();
     this.selectUser();
 		this.getAIJ();
 		this.getAIJ();
-    this.contentDialog = true;
+    this.contentDialog = false;
     this.setContent2(true);
     this.setContent2(true);
     if (this.tType == 4) {
     if (this.tType == 4) {
       this.pzDialog = true;
       this.pzDialog = true;
@@ -25875,9 +25980,9 @@ export default {
   align-items: center !important;
   align-items: center !important;
 }
 }
 
 
-.dialog_diy >>> .el-dialog {
+/* .dialog_diy >>> .el-dialog { */
   /* margin-top: 10vh !important; */
   /* margin-top: 10vh !important; */
-}
+/* } */
 
 
 .body_student {
 .body_student {
   width: 77%;
   width: 77%;
@@ -25899,7 +26004,7 @@ export default {
 }
 }
 
 
 .pb_left {
 .pb_left {
-  width: 20%;
+  width: 15%;
   margin-right: 10px;
   margin-right: 10px;
   background: rgb(255, 255, 255);
   background: rgb(255, 255, 255);
   position: fixed;
   position: fixed;
@@ -27659,10 +27764,10 @@ export default {
   justify-content: center;
   justify-content: center;
 }
 }
 
 
-.answerBg > div:nth-child(1) {
+/* .answerBg > div:nth-child(1) { */
   /* font-size: 22px;
   /* font-size: 22px;
   padding: 25px 0 10px; */
   padding: 25px 0 10px; */
-}
+/* } */
 
 
 .answerContent {
 .answerContent {
   width: 215px;
   width: 215px;
@@ -27831,8 +27936,8 @@ export default {
   width: 400px;
   width: 400px;
 }
 }
 
 
-.e_add_btn {
-}
+/* .e_add_btn {
+} */
 
 
 .e_add_content {
 .e_add_content {
   display: flex;
   display: flex;
@@ -30313,7 +30418,6 @@ div::-webkit-scrollbar {
 }
 }
 .pb_content >>> .katex {
 .pb_content >>> .katex {
   font-size: 16px;
   font-size: 16px;
-  display: block;
   width: 100%;
   width: 100%;
   white-space: normal;
   white-space: normal;
 }
 }

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