钟日健
2021-10-16 9a3447819ccce94cf5051f038ea4f0e636f24a42
考试提交修改
1 files modified
52 ■■■■■ changed files
src/views/startexam/index.vue 52 ●●●●● patch | view | raw | blame | history
src/views/startexam/index.vue
@@ -86,7 +86,7 @@
                      type="primary"
                      >下一题</el-button
                    >
                    <el-button
                    <!-- <el-button
                      :disabled="timesIT"
                      type="success"
                      @click="submitExam"
@@ -98,12 +98,10 @@
                          : '点击完成考试'
                      "
                      >完成考试 {{ time }}</el-button
                    >
                    <!-- <el-button
                      type="success"
                      @click="submitExam"
                      >完成考试 {{ time }}</el-button
                    > -->
                    <el-button type="success" @click="submitExam"
                      >完成考试 {{ time }}</el-button
                    >
                  </div>
                </div>
              </el-col>
@@ -820,27 +818,37 @@
        examResultVOS: null,
      };
      var arr = [];
      // console.log(this.subjectIds);
      console.log(this.subjectIds);
      // debugger;
      console.log(this.subjectIds.length, 111);
      for (var i = 0; i < this.subjectIds.length; i++) {
        let item = this.subjectIds[i];
        // console.log(item.answer, i);
        if (item.type == 3 || item.type == 1) {
          var str = "";
          if (item.answer.length > 0) {
            item.answer.forEach((it) => {
              if (it.value != "") {
                str += it.value + ",";
              }
            });
            //如果是数组
            if (item.answer instanceof Array) {
              item.answer.forEach((it) => {
                if (it.value != "") {
                  str += it.value + ",";
                }
              });
            var a = str.substr(0, str.length - 1);
              var a = str.substr(0, str.length - 1);
            arr.push({
              subjectChoicesId: item.everyID,
              value: a,
              grade: item.score,
            });
              arr.push({
                subjectChoicesId: item.everyID,
                value: a,
                grade: item.score,
              });
            }else{
              arr.push({
                subjectChoicesId: item.everyID,
                value: item.answer,
                grade: item.score,
              });
            }
          }
        } else {
          arr.push({
@@ -850,11 +858,11 @@
          });
        }
      }
      // console.log(arr);
      // console.log(arr, 123);
      // return;
      obj.examResultVOS = arr;
      // console.log(this.subjectIds);
      // console.log(obj.examResultVOS);
      // console.log(this.subjectIds, 456);
      // console.log(obj.examResultVOS, 789);
      saveAndNext(obj)
        .then((response) => {