liu tao há 1 mês atrás
pai
commit
7f6e15954b
1 ficheiros alterados com 88 adições e 88 exclusões
  1. 88 88
      uis/admin/examquestion/index.html

+ 88 - 88
uis/admin/examquestion/index.html

@@ -420,102 +420,102 @@
             dataType: 'json',
             data: _params,
             success: function (res) {
-                // var title = ['题型', '试题内容', '科目', '章节', '难度', '分数', '单选选项', '多选选项', '正确答案', '判断答案', '填空答案', '解析'];
-                // var data = [];
-                // for (var i = 0; i < res.data.length; i++) {
-                //     var res_item = res.data[i];
-                //     var data_item = [
-                //         res_item.type_text,
-                //         res_item.title,
-                //         res_item.subject_text,
-                //         res_item.chapter_text,
-                //         res_item.difficulty_text,
-                //         res_item.scores,
-                //     ];
-                //     if (res_item.type == 1 || res_item.type == 2) {
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push('');
-                //     } else if (res_item.type == 3) {
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push('');
-                //         if ( res_item.items.length >= 1) {
-                //             var option = res_item.items[0];
-                //             data_item.push(option.content);
-                //         }
+                 var title = ['题型', '试题内容', '科目', '章节', '难度', '分数', '单选选项', '多选选项', '正确答案', '判断答案', '填空答案', '解析'];
+                 var data = [];
+                 for (var i = 0; i < res.data.length; i++) {
+                     var res_item = res.data[i];
+                     var data_item = [
+                         res_item.type_text,
+                         res_item.title,
+                         res_item.subject_text,
+                         res_item.chapter_text,
+                         res_item.difficulty_text,
+                         res_item.scores,
+                     ];
+                     if (res_item.type == 1 || res_item.type == 2) {
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push('');
+                     } else if (res_item.type == 3) {
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push('');
+                         if ( res_item.items.length >= 1) {
+                             var option = res_item.items[0];
+                             data_item.push(option.content);
+                         }
 
-                //     } else if (res_item.type == 4) {
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push('');
-                //         if (res_item.judgment == '1') {
-                //             data_item.push('正确');
-                //         } else {
-                //             data_item.push('错误');
-                //         }
-                //         data_item.push('');
-                //     } else if (res_item.type == 5) {
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push(res_item.discuss_answer);
-                //         data_item.push('');
-                //         data_item.push('');
-                //     } else {
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push('');
-                //         data_item.push('');
-                //     }
+                     } else if (res_item.type == 4) {
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push('');
+                         if (res_item.judgment == '1') {
+                             data_item.push('正确');
+                         } else {
+                             data_item.push('错误');
+                         }
+                         data_item.push('');
+                     } else if (res_item.type == 5) {
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push(res_item.discuss_answer);
+                         data_item.push('');
+                         data_item.push('');
+                     } else {
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push('');
+                         data_item.push('');
+                     }
 
-                //     data_item.push(res_item.analysis);
+                     data_item.push(res_item.analysis);
 
-                //     data.push(data_item);
+                     data.push(data_item);
 
-                //     if (res_item.type == 1 || res_item.type == 2) {
-                //         for (var n = 0; n < res_item.items.length; n++) {
-                //             var option = res_item.items[n];
-                //             var option_item = ['', '', '', '', '', ''];
-                //             if (res_item.type == 1) {
-                //                 option_item.push(option.content);
-                //                 option_item.push('');
-                //             } else {
-                //                 option_item.push('');
-                //                 option_item.push(option.content);
-                //             }
-                //             if (option.right == true) {
-                //                 option_item.push('正确');
-                //             } else {
-                //                 option_item.push('');
-                //             }
-                //             option_item.push('');
-                //             option_item.push('');
-                //             option_item.push('');
+                     if (res_item.type == 1 || res_item.type == 2) {
+                         for (var n = 0; n < res_item.items.length; n++) {
+                             var option = res_item.items[n];
+                             var option_item = ['', '', '', '', '', ''];
+                             if (res_item.type == 1) {
+                                 option_item.push(option.content);
+                                 option_item.push('');
+                             } else {
+                                 option_item.push('');
+                                 option_item.push(option.content);
+                             }
+                             if (option.right == true) {
+                                 option_item.push('正确');
+                             } else {
+                                 option_item.push('');
+                             }
+                             option_item.push('');
+                             option_item.push('');
+                             option_item.push('');
 
-                //             data.push(option_item);
-                //         }
-                //     } else if (res_item.type == 3) {
-                //         for (var n = 1; n < res_item.items.length; n++) {
-                //             var option = res_item.items[n];
-                //             var option_item = ['', '', '', '', '', '', '', '', '', ''];
-                //             option_item.push(option.content);
-                //             option_item.push('');
+                             data.push(option_item);
+                         }
+                     } else if (res_item.type == 3) {
+                         for (var n = 1; n < res_item.items.length; n++) {
+                             var option = res_item.items[n];
+                             var option_item = ['', '', '', '', '', '', '', '', '', ''];
+                             option_item.push(option.content);
+                             option_item.push('');
 
-                //             data.push(option_item);
-                //         }
-                //     }
-                // }
+                             data.push(option_item);
+                         }
+                     }
+                 }
 
 
-                // table.exportFile(
-                //     title,
-                //     data,
-                //     '试题.xls'
-                // );
+                 table.exportFile(
+                     title,
+                     data,
+                     '试题.xls'
+                 );
             }
         })
     });