Просмотр исходного кода

task-1592 考试阅卷功能优化

cfort 2 лет назад
Родитель
Сommit
dd6495d52b
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/views/platform/examination/question/judge.vue

+ 3 - 2
src/views/platform/examination/question/judge.vue

@@ -214,8 +214,9 @@ export default {
         },
         getQuestionData () {
             this.loading = true
-            const param = this.id ? ` and find_in_set(exam_id_, '${this.id}')` : ''
-            const sql = `select id_ as dataId, parent_id_ as paperId, ti_mu_id_ as questionId, ti_gan_ as stem, ti_xing_ as questionType, fu_tu_ as img, xuan_xiang_lei_xi as optionType, fen_zhi_ as score, ping_fen_fang_shi as rateType, ping_fen_ren_ as rater, hui_da_ as answer, can_kao_da_an_ as rightKey, shi_fou_yi_yue_ as isRate from t_examination_detail where ping_fen_ren_ = '${this.userId}' and shi_fou_yi_yue_ = '否' and parent_id_ in (select id_ from t_examination where zhuang_tai_ = '已交卷'${param}) order by field(ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
+            const param = this.id ? ` and find_in_set(ex.exam_id_, '${this.id}')` : ''
+            // const sql = `select id_ as dataId, parent_id_ as paperId, ti_mu_id_ as questionId, ti_gan_ as stem, ti_xing_ as questionType, fu_tu_ as img, xuan_xiang_lei_xi as optionType, fen_zhi_ as score, ping_fen_fang_shi as rateType, ping_fen_ren_ as rater, hui_da_ as answer, can_kao_da_an_ as rightKey, shi_fou_yi_yue_ as isRate from t_examination_detail where ping_fen_ren_ = '${this.userId}' and shi_fou_yi_yue_ = '否' and parent_id_ in (select id_ from t_examination where zhuang_tai_ = '已交卷'${param}) order by field(ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
+            const sql = `select ed.id_ as dataId, ed.parent_id_ as paperId, ed.ti_mu_id_ as questionId, ed.ti_gan_ as stem, ed.ti_xing_ as questionType, ed.fu_tu_ as img, ed.xuan_xiang_lei_xi as optionType, ed.fen_zhi_ as score, ed.ping_fen_fang_shi as rateType, ed.ping_fen_ren_ as rater, ed.hui_da_ as answer, ed.can_kao_da_an_ as rightKey, ed.shi_fou_yi_yue_ as isRate from t_examination_detail ed join t_examination ex on ed.parent_id_ = ex.id_ left join t_question_bank qb on ex.ti_ku_id_ = qb.id_ where ex.zhuang_tai_ = '已交卷' and ed.shi_fou_yi_yue_ = '否' and (ed.ping_fen_ren_ like '%${this.userId}%' or qb.ping_fen_ren_ like '%${this.userId}%')${param} order by field(ed.ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
             return new Promise((resolve, reject) => {
                 this.$common.request('sql', sql).then(res => {
                     const { data = [] } = res.variables || {}