Przeglądaj źródła

简单题的用户答案,用上面的方法最准确,下面的也修复了

lizhen_gitee 7 miesięcy temu
rodzic
commit
509fe8e0cb
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      application/admin/view/exam/grade/detail.html

+ 5 - 1
application/admin/view/exam/grade/detail.html

@@ -201,13 +201,17 @@
              */
             getUserShortAnswer() {
                 return function (questionIndex) {
+                    return this.row.user_answers && this.row.user_answers[questionIndex] ? this.row.user_answers[questionIndex].answer : '';
+
                     if (this.row.user_answers && this.row.user_answers[questionIndex]) {
                         let html = '';
-                        if (this.row.user_answers[questionIndex].answer_score) {
+                        if (this.row.user_answers[questionIndex].answer_score.length) {
                             for (let i = 0; i < this.row.user_answers[questionIndex].answer_score.length; i++) {
                                 let short_user_answer = this.row.user_answers[questionIndex].answer_score[i];
                                 html += '<p class="fill-answer-item">' + short_user_answer.answer + '</p>';
                             }
+                        }else{
+                            html = this.row.user_answers[questionIndex].answer;
                         }
                         return html
                         // return this.row.user_answers[questionIndex].answer.join(',');