Преглед на файлове

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

lsc преди 2 години
родител
ревизия
820b4f4b41
променени са 3 файла, в които са добавени 420 реда и са изтрити 22 реда
  1. BIN
      src/assets/icon/thirdToolList/select.png
  2. 10 7
      src/components/study.vue
  3. 410 15
      src/components/studyStudent.vue

BIN
src/assets/icon/thirdToolList/select.png


+ 10 - 7
src/components/study.vue

@@ -180,9 +180,6 @@
                     <div
                     <div
                       style="
                       style="
                         padding: 20px;
                         padding: 20px;
-                        line-height: 30px;
-                        max-height: 105px;
-                        overflow: auto;
                       "
                       "
                       v-if="rw.taskDetail != ''"
                       v-if="rw.taskDetail != ''"
                       v-html="rw.taskDetail ? rw.taskDetail : '暂无描述'"
                       v-html="rw.taskDetail ? rw.taskDetail : '暂无描述'"
@@ -2527,6 +2524,15 @@
           <div class="commentList">
           <div class="commentList">
             <div class="commentImg">
             <div class="commentImg">
               <img
               <img
+              @click="
+                  isLikes(
+                    commentDetail.wid,
+                    commentDetail.userid,
+                    1,
+                    null,
+                    commentDetail.isLikes
+                  )
+                "
                 :src="commentDetail.isLikes == true ? likes : noLikes"
                 :src="commentDetail.isLikes == true ? likes : noLikes"
                 alt=""
                 alt=""
               />
               />
@@ -3170,6 +3176,7 @@ export default {
       this.commentDetail = [];
       this.commentDetail = [];
       this.commentDialogVisible = true;
       this.commentDialogVisible = true;
       if (w.works && w.type == 1) {
       if (w.works && w.type == 1) {
+        this.commentDetail = w;
         this.pptImgUrl = "";
         this.pptImgUrl = "";
         var a = ["PPT", "PPTX", "XLSX", "XLS", "DOC", "DOCX"];
         var a = ["PPT", "PPTX", "XLSX", "XLS", "DOC", "DOCX"];
         if (
         if (
@@ -3223,7 +3230,6 @@ export default {
             type: "success",
             type: "success",
           });
           });
           this.commentText = "";
           this.commentText = "";
-          this.commentDialogVisible = false;
           this.selectSWorks();
           this.selectSWorks();
         })
         })
         .catch((err) => {
         .catch((err) => {
@@ -5174,9 +5180,6 @@ export default {
   background: rgb(247, 247, 247);
   background: rgb(247, 247, 247);
   padding: 20px;
   padding: 20px;
   line-height: 30px;
   line-height: 30px;
-  max-height: 105px;
-  overflow: auto;
-  height: 70px;
   word-break: break-word;
   word-break: break-word;
 }
 }
 
 

+ 410 - 15
src/components/studyStudent.vue

@@ -185,12 +185,7 @@
                   "
                   "
                 >
                 >
                   <div
                   <div
-                    style="
-                      padding: 20px;
-                      line-height: 30px;
-                      max-height: 105px;
-                      overflow: auto;
-                    "
+                    style="padding: 20px"
                     v-if="
                     v-if="
                       chapInfoList[courseType].chapterInfo[0].taskJson[
                       chapInfoList[courseType].chapterInfo[0].taskJson[
                         taskCount
                         taskCount
@@ -857,6 +852,14 @@
                             />
                             />
                             <div style="margin: 5px 0">学生评价</div>
                             <div style="margin: 5px 0">学生评价</div>
                           </div>
                           </div>
+                          <div v-if="tooC == 41">
+                            <img
+                              @click="addTools(tooC, toolIndex, taskCount)"
+                              src="../assets/icon/thirdToolList/select.png"
+                              alt
+                            />
+                            <div style="margin: 5px 0">选择填空</div>
+                          </div>
                         </div>
                         </div>
                       </div>
                       </div>
                     </div>
                     </div>
@@ -1952,7 +1955,10 @@
                               <div>{{ w.likesCount }}</div>
                               <div>{{ w.likesCount }}</div>
                             </div>
                             </div>
                             <div class="commentList" style="margin-right: 15px">
                             <div class="commentList" style="margin-right: 15px">
-                              <div class="commentImg" @click="commentOther(w, toolIndex)">
+                              <div
+                                class="commentImg"
+                                @click="commentOther(w, toolIndex)"
+                              >
                                 <img
                                 <img
                                   src="../assets/icon/comment/comment.png"
                                   src="../assets/icon/comment/comment.png"
                                   alt=""
                                   alt=""
@@ -2012,6 +2018,136 @@
                       </div>
                       </div>
                     </div>
                     </div>
                   </div>
                   </div>
+                  <div
+                    v-if="
+                      tType &&
+                      ((tType == 2 && sIsOpen == true) || tType == 1) &&
+                      tool.tool.indexOf(41) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      style="padding-top: 15px; font-size: 18px"
+                      v-if="
+                        worksStudent.length &&
+                        worksStudent[toolIndex].length > 0
+                      "
+                    >
+                      作业预览
+                    </div>
+                    <div
+                      class="worksDetailBox"
+                      v-if="
+                        worksStudent.length &&
+                        worksStudent[toolIndex].length > 0
+                      "
+                    >
+                      <div
+                        class="works"
+                        style="
+                          width: 200px;
+                          height: 140px;
+                          margin: 10px 10px 10px 0;
+                          border-radius: 15px;
+                          box-shadow: 0 0 6px 1px #dfdada;
+                        "
+                        v-for="(w, wIndex) in worksStudent[toolIndex]"
+                        :key="wIndex"
+                        :class="w.type == 5 ? 'isTypeOne' : ''"
+                      >
+                        <div class="workImg">
+                          <img
+                            src="../assets/icon/works/noImg.png"
+                            @click="openXz(w, toolIndex)"
+                            alt
+                          />
+                        </div>
+                        <div class="worksName">
+                          <div>{{ w.sName }}</div>
+                        </div>
+                        <!-- <div class="comment" style="min-width: 200px">
+                          <div class="worksName">
+                            <div>{{ w.sName }}</div>
+                          </div>
+                          <div class="commentList">
+                            <div class="commentList">
+                              <div
+                                class="commentImg"
+                                @click="
+                                  isLikes(w.wid, userid, 1, null, w.isLikes)
+                                "
+                              >
+                                <img
+                                  :src="w.isLikes == true ? likes : noLikes"
+                                  alt=""
+                                />
+                              </div>
+                              <div>{{ w.likesCount }}</div>
+                            </div>
+                            <div class="commentList" style="margin-right: 15px">
+                              <div
+                                class="commentImg"
+                                @click="commentOther(w, toolIndex)"
+                              >
+                                <img
+                                  src="../assets/icon/comment/comment.png"
+                                  alt=""
+                                />
+                              </div>
+                              <div>{{ w.commentCount }}</div>
+                            </div>
+                          </div>
+                        </div> -->
+                      </div>
+                    </div>
+                    <div style="padding-top: 15px; font-size: 18px">未提交</div>
+                    <div class="noWorksS">
+                      <div
+                        v-for="(s, sIndex) in noWorksS[toolIndex]"
+                        :key="sIndex"
+                        class="noWorksName"
+                      >
+                        {{ s.student }}
+                      </div>
+                    </div>
+                  </div>
+                  <div
+                    v-if="tType && tType == 2 && tool.tool.indexOf(41) != -1"
+                    class="worksBox"
+                  >
+                    <div
+                      style="padding-top: 15px; font-size: 18px"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      作业预览
+                    </div>
+                    <div
+                      class="worksDetailBox"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <div
+                        class="works"
+                        style="
+                          width: 200px;
+                          height: 140px;
+                          margin: 10px 10px 10px 0;
+                        "
+                        v-for="(w, wIndex) in workStudent[toolIndex]"
+                        :key="wIndex"
+                      >
+                        <div class="workImg">
+                          <img
+                            src="../assets/icon/works/noImg.png"
+                            @click="openPj(w.works, toolIndex)"
+                            alt
+                          />
+                        </div>
+                        <div class="worksName">
+                          <div>{{ w.sName }}</div>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
                 </div>
                 </div>
                 <!-- <div class="upload_toolBtn" @click="addImg($event)">
                 <!-- <div class="upload_toolBtn" @click="addImg($event)">
                   上传文件
                   上传文件
@@ -2754,6 +2890,15 @@
           <div class="commentList">
           <div class="commentList">
             <div class="commentImg">
             <div class="commentImg">
               <img
               <img
+                @click="
+                  isLikes(
+                    commentDetail.wid,
+                    commentDetail.userid,
+                    1,
+                    null,
+                    commentDetail.isLikes
+                  )
+                "
                 :src="commentDetail.isLikes == true ? likes : noLikes"
                 :src="commentDetail.isLikes == true ? likes : noLikes"
                 alt=""
                 alt=""
               />
               />
@@ -2938,6 +3083,87 @@
         <el-button type="primary" @click="addBzWorks">确 定</el-button>
         <el-button type="primary" @click="addBzWorks">确 定</el-button>
       </div>
       </div>
     </el-dialog>
     </el-dialog>
+    <el-dialog
+      title="选择填空"
+      :visible.sync="dialogVisibleSelect"
+      :append-to-body="true"
+      :width="isSelect ? '1000px' : '800px'"
+      :before-close="handleClose"
+      class="dialog_diy dialog_diy3"
+    >
+      <div v-if="selectJson">
+        <div class="select_box2">
+          <div class="select_box2_title">
+            <div>选择填空</div>
+            <div>请选择对应的答案进行答题!</div>
+          </div>
+          <div class="select_box2_box">
+            <div class="select_box2_img">
+              <img :src="selectJson.url" alt="" />
+            </div>
+            <div :class="isSelect ? 'rightWidthCss' : 'select_box2_answer'">
+              <div style="padding-top: 15px">
+                <div class="select_answer_title" v-if="isSelect">
+                  {{ selectAnswer.stu }}
+                </div>
+                <div class="select_answer_title" v-else>
+                  根据题目选择对应答案
+                </div>
+                <div
+                  class="select_box2_answer_box"
+                  v-for="(item2, checkIndex) in selectJson.select"
+                  :key="checkIndex"
+                >
+                  <span>{{ checkIndex + 1 }}、</span>
+                  <el-select
+                    :disabled="isSelect"
+                    v-model="selectAnswer.answer[checkIndex]"
+                    placeholder="请选择正确答案"
+                  >
+                    <el-option
+                      v-for="(e, eIndex) in selectJson.select"
+                      :key="eIndex"
+                      :label="e"
+                      :value="eIndex"
+                    ></el-option>
+                  </el-select>
+                </div>
+              </div>
+              <div class="rightAnswerCss">
+                <div
+                  v-for="(a, aIndex) in selectJson.answer"
+                  :key="aIndex"
+                  class="rightAnswer"
+                >
+                  <div
+                    v-if="
+                      selectAnswer.answer[aIndex] ==
+                      selectJson.answer[a]
+                    "
+                    style="color:#767DE1"
+                  >
+                    回答正确
+                  </div>
+                  <div v-else>回答错误</div>
+                  <div style="margin-left:10px;" v-if="
+                      selectAnswer.answer[aIndex] !=
+                      selectJson.answer[a]
+                    ">正确答案:</div>
+                  <div :class="selectAnswer.answer[aIndex] ==
+                      selectJson.answer[a] ? 'blueCss' : 'redCss'">{{ selectJson.select[a] }}</div>
+                </div>
+              </div>
+
+              <div class="upAnswerCss">
+                <el-button type="primary" @click="addSelectAnswer"
+                  >提交答案</el-button
+                >
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -2959,9 +3185,12 @@ export default {
       videoVisible: false,
       videoVisible: false,
       isStar: false,
       isStar: false,
       studentEvalDialogVisible: false,
       studentEvalDialogVisible: false,
+      dialogVisibleSelect: false,
       bzText: "",
       bzText: "",
       commentDetail: [],
       commentDetail: [],
+      selectAnswer: [],
       videoDetail: {},
       videoDetail: {},
+      selectJson: {},
       eScore: { eBzText: "", eStar: [] },
       eScore: { eBzText: "", eStar: [] },
       id: this.$route.query.courseId,
       id: this.$route.query.courseId,
       userid: this.$route.query.userid,
       userid: this.$route.query.userid,
@@ -3006,6 +3235,7 @@ export default {
       noLikes: require("../assets/icon/comment/noLikes.png"),
       noLikes: require("../assets/icon/comment/noLikes.png"),
       likes: require("../assets/icon/comment/likes.png"),
       likes: require("../assets/icon/comment/likes.png"),
       courseDetail: {},
       courseDetail: {},
+      isSelect: false,
       chapInfo: [],
       chapInfo: [],
       chapInfoList: [],
       chapInfoList: [],
       taskCount: 0,
       taskCount: 0,
@@ -3190,7 +3420,33 @@ export default {
       // this.$message.success('触发上传')
       // this.$message.success('触发上传')
       el.getElementsByTagName("input")[0].click();
       el.getElementsByTagName("input")[0].click();
     },
     },
-
+    addSelectAnswer() {
+      let params = [
+        {
+          uid: this.userid,
+          cid: this.id,
+          stage: this.courseType,
+          task: this.taskCount,
+          tool: this.toolindex,
+          content: this.selectAnswer,
+          type: 7,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addCourseWorks", params)
+        .then((res) => {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          this.selectAnswer = [];
+          this.dialogVisibleSelect = false;
+        })
+        .catch((err) => {
+          this.$message.error("提交失败");
+          console.error(err);
+        });
+    },
     addCourseWorks(i) {
     addCourseWorks(i) {
       var typesql;
       var typesql;
       if (this.fileType === 0) {
       if (this.fileType === 0) {
@@ -3426,6 +3682,7 @@ export default {
       this.commentDetail = [];
       this.commentDetail = [];
       this.commentDialogVisible = true;
       this.commentDialogVisible = true;
       if (w.works && w.type == 1) {
       if (w.works && w.type == 1) {
+        this.commentDetail = w;
         this.pptImgUrl = "";
         this.pptImgUrl = "";
         var a = ["PPT", "PPTX", "XLSX", "XLS", "DOC", "DOCX"];
         var a = ["PPT", "PPTX", "XLSX", "XLS", "DOC", "DOCX"];
         if (
         if (
@@ -3479,7 +3736,6 @@ export default {
             type: "success",
             type: "success",
           });
           });
           this.commentText = "";
           this.commentText = "";
-          this.commentDialogVisible = false;
           this.selectSWorks();
           this.selectSWorks();
         })
         })
         .catch((err) => {
         .catch((err) => {
@@ -3487,6 +3743,25 @@ export default {
           console.error(err);
           console.error(err);
         });
         });
     },
     },
+    openXz(w, i) {
+      this.selectJson = this.chapInfoList[this.courseType].chapterInfo[0]
+        .taskJson[this.taskCount].toolChoose[i].selectJson
+        ? JSON.parse(
+            JSON.stringify(
+              this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+                this.taskCount
+              ].toolChoose[i].selectJson
+            )
+          )
+        : { url: "", select: [], answer: [] };
+      var a = w.works.split(",");
+      for (var k = 0; k < a.length; k++) {
+        a[k] = parseInt(a[k]);
+      }
+      this.selectAnswer = { answer: a, stu: w.sName };
+      this.isSelect = true;
+      this.dialogVisibleSelect = true;
+    },
     openPj(w, toolindex) {
     openPj(w, toolindex) {
       this.isStar = true;
       this.isStar = true;
       this.eScore = JSON.parse(w);
       this.eScore = JSON.parse(w);
@@ -3611,7 +3886,8 @@ export default {
                   (b[j].type == 1 ||
                   (b[j].type == 1 ||
                     b[j].type == 4 ||
                     b[j].type == 4 ||
                     b[j].type == 5 ||
                     b[j].type == 5 ||
-                    b[j].type == 6) &&
+                    b[j].type == 6 ||
+                    b[j].type == 7) &&
                   a[i].tool[0] != 15 &&
                   a[i].tool[0] != 15 &&
                   a[i].tool[0] != 4
                   a[i].tool[0] != 4
                 ) {
                 ) {
@@ -3666,6 +3942,19 @@ export default {
                       isLikes: isLikes,
                       isLikes: isLikes,
                       commentJson: commentJson,
                       commentJson: commentJson,
                     });
                     });
+                  } else if (b[j].type == 7) {
+                    this.worksStudent[i].push({
+                      userid: b[j].userid,
+                      wid: b[j].id,
+                      works: b[j].content,
+                      sName: b[j].name,
+                      type: 5,
+                      time: b[j].time,
+                      likesCount: likesCount,
+                      commentCount: commentCount,
+                      isLikes: isLikes,
+                      commentJson: commentJson,
+                    });
                   } else {
                   } else {
                     this.worksStudent[i].push({
                     this.worksStudent[i].push({
                       userid: b[j].userid,
                       userid: b[j].userid,
@@ -5013,6 +5302,19 @@ export default {
 
 
         this.isStar = false;
         this.isStar = false;
         this.studentEvalDialogVisible = true;
         this.studentEvalDialogVisible = true;
+      } else if (t == 41) {
+        this.selectJson = this.chapInfoList[this.courseType].chapterInfo[0]
+          .taskJson[index].toolChoose[i].selectJson
+          ? JSON.parse(
+              JSON.stringify(
+                this.chapInfoList[this.courseType].chapterInfo[0].taskJson[
+                  index
+                ].toolChoose[i].selectJson
+              )
+            )
+          : { url: "", select: [], answer: [] };
+        this.isSelect = false;
+        this.dialogVisibleSelect = true;
       }
       }
     },
     },
     toolsCount(a, t) {
     toolsCount(a, t) {
@@ -5177,7 +5479,10 @@ export default {
     flex-direction: column !important;
     flex-direction: column !important;
     align-items: center !important;
     align-items: center !important;
   }
   }
-  .dialog_diy1 >>> .el-dialog{
+  .dialog_diy1 >>> .el-dialog {
+    width: 100% !important;
+  }
+  .rightWidthCss {
     width: 100% !important;
     width: 100% !important;
   }
   }
   /* .textTitle >>> .el-form-item__label {
   /* .textTitle >>> .el-form-item__label {
@@ -5352,9 +5657,6 @@ export default {
   background: rgb(247, 247, 247);
   background: rgb(247, 247, 247);
   padding: 20px;
   padding: 20px;
   line-height: 30px;
   line-height: 30px;
-  max-height: 105px;
-  overflow: auto;
-  height: 70px;
   word-break: break-word;
   word-break: break-word;
 }
 }
 
 
@@ -6834,4 +7136,97 @@ export default {
 .bz > div {
 .bz > div {
   padding: 0 10px;
   padding: 0 10px;
 }
 }
-</style>
+.select_box2_title {
+  background: #fff;
+  border-radius: 5px;
+  padding: 15px 10px;
+  box-sizing: border-box;
+  margin-bottom: 10px;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+.select_box2_title > div:nth-child(2) {
+  margin-left: 10px;
+  color: #c4c4c4;
+}
+.select_box2_box {
+  display: flex;
+  height: 500px;
+}
+.select_box2_img {
+  width: calc(100% - 310px);
+  height: 100%;
+  overflow: auto;
+  background: #fff;
+  border-radius: 5px;
+}
+.select_box2_img img {
+  width: 100%;
+}
+.select_box2_answer {
+  background: #fff;
+  margin-left: 10px;
+  border-radius: 5px;
+  width: 300px;
+  overflow: auto;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: flex-start;
+  padding-top: 10px;
+  box-sizing: border-box;
+  position: relative;
+}
+.select_answer_title {
+  padding: 0 0 15px 20px;
+  color: #c4c4c4;
+}
+.select_box2_answer_box {
+  margin: 0 0 10px 20px;
+  width: 85%;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+.upAnswerCss {
+  position: absolute;
+  bottom: 15px;
+  right: 15px;
+}
+.upAnswerCss >>> .el-button {
+  width: 95px;
+  height: 35px;
+  line-height: 35px;
+  padding: 0;
+}
+.rightWidthCss {
+  width: 60%;
+  display: flex;
+  flex-direction: row;
+  align-items: flex-start;
+}
+.rightAnswer {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  color: red;
+  margin-bottom: 31px;
+}
+.rightAnswerCss {
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  padding-top: 60px;
+}
+.blueCss{
+  color: #767DE1;
+  margin-left: 10px;
+}
+.redCss{
+  color:red;
+}
+</style>