Browse Source

fix(all): 修复统一错误

Go 4 years ago
parent
commit
f3e0fb64c1
26 changed files with 156 additions and 67 deletions
  1. 12 3
      front/project/admin/routes/subject/examination/page.js
  2. 3 3
      front/project/www/components/Select/index.js
  3. 1 1
      front/project/www/routes/my/data/page.js
  4. 6 4
      front/project/www/routes/my/error/page.js
  5. 12 14
      front/project/www/routes/my/index.js
  6. 5 5
      front/project/www/routes/my/main/page.js
  7. 12 10
      front/project/www/routes/my/note/page.js
  8. 1 1
      front/project/www/routes/my/report/page.js
  9. 4 0
      front/project/www/routes/page/export/index.less
  10. 1 1
      front/project/www/routes/page/export/page.js
  11. 3 1
      front/project/www/routes/paper/process/page.js
  12. 3 3
      front/project/www/routes/question/search/page.js
  13. 4 4
      front/project/www/stores/my.js
  14. 4 3
      front/src/services/Tools.js
  15. 1 0
      server/data/src/main/java/com/qxgmat/data/relation/UserNoteQuestionRelationMapper.java
  16. 1 0
      server/data/src/main/java/com/qxgmat/data/relation/UserQuestionRelationMapper.java
  17. 2 0
      server/data/src/main/java/com/qxgmat/data/relation/mapping/QuestionNoRelationMapper.xml
  18. 20 1
      server/data/src/main/java/com/qxgmat/data/relation/mapping/UserNoteQuestionRelationMapper.xml
  19. 19 2
      server/data/src/main/java/com/qxgmat/data/relation/mapping/UserQuestionRelationMapper.xml
  20. 4 2
      server/gateway-api/src/main/java/com/qxgmat/controller/api/MyController.java
  21. 3 2
      server/gateway-api/src/main/java/com/qxgmat/controller/api/QuestionController.java
  22. 2 2
      server/gateway-api/src/main/java/com/qxgmat/service/UserNoteQuestionService.java
  23. 2 2
      server/gateway-api/src/main/java/com/qxgmat/service/UserQuestionService.java
  24. 11 2
      server/gateway-api/src/main/java/com/qxgmat/service/extend/ExaminationService.java
  25. 16 1
      server/gateway-api/src/main/java/com/qxgmat/service/extend/ExerciseService.java
  26. 4 0
      server/gateway-api/src/main/java/com/qxgmat/service/inline/ExercisePaperService.java

+ 12 - 3
front/project/admin/routes/subject/examination/page.js

@@ -87,13 +87,13 @@ export default class extends Page {
       title: '类别',
       dataIndex: 'second',
       render: (text, record) => {
-        return QuestionTypeMap[record.question.questionType] || text;
+        return this.categoryMap[record.moduleStruct[1]] || text;
       },
     }, {
       title: '试卷',
       dataIndex: 'three',
       render: (text, record) => {
-        return QuestionTypeMap[record.question.questionType] || text;
+        return this.categoryMap[record.moduleStruct[2]] || text;
       },
     }, {
       title: '题型',
@@ -102,14 +102,23 @@ export default class extends Page {
         return QuestionTypeMap[record.question.questionType] || text;
       },
     }, {
+      title: '题目ID',
+      sorter: true,
+      dataIndex: 'no',
+      render: (text, record) => {
+        return record.title;
+      },
+    }, {
       title: '难度',
-      dataIndex: 'difficlut',
+      dataIndex: 'difficult',
+      sorter: true,
       render: (text, record) => {
         return record.question.difficult;
       },
     }, {
       title: '错误率',
       dataIndex: 'correct',
+      sorter: true,
       render: (text, record) => {
         return formatPercent(record.totalNumber - record.totalCorrect, record.totalNumber, false);
       },

+ 3 - 3
front/project/www/components/Select/index.js

@@ -8,9 +8,9 @@ export default class Select extends Component {
     this.state = { selecting: false };
   }
 
-  componentWillMount() {}
+  componentWillMount() { }
 
-  componentWillUnmount() {}
+  componentWillUnmount() { }
 
   open() {
     this.setState({ selecting: true });
@@ -39,7 +39,7 @@ export default class Select extends Component {
         break;
       }
     }
-    if (!value) {
+    if (!value && value !== '') {
       index = -1;
     }
     // 未选中,显示占位符

+ 1 - 1
front/project/www/routes/my/data/page.js

@@ -305,7 +305,7 @@ export default class extends Page {
       tab: 'exercise',
       subject: 'verbal',
       questionType: '',
-      timerange: 'today',
+      timerange: 'all',
       info: 'base',
     };
   }

+ 6 - 4
front/project/www/routes/my/error/page.js

@@ -41,7 +41,7 @@ export default class extends Page {
   initState() {
     return {
       tab: 'exercise',
-      timerange: 'today',
+      timerange: 'all',
       filterMap: {},
       sortMap: {},
       data: [{}, {}],
@@ -132,6 +132,8 @@ export default class extends Page {
     data.filterMap = this.state.search;
     if (data.order) {
       data.sortMap = { [data.order]: data.direction };
+    } else {
+      data.sortMap = { latest_time: 'desc' };
     }
     if (data.timerange) {
       data.filterMap.timerange = data.timerange;
@@ -151,12 +153,12 @@ export default class extends Page {
     }).then(({ questionTypes }) => {
       return refreshStruct(this, questionTypes, data.tab, data.one, data.two, {
         all: true,
-        needPreview: false,
+        needPreview: true,
         needTextbook: true,
-      }).then(({ structIds, latest, year }) => {
+      }).then(({ courseModules, structIds, latest, year }) => {
         My.listError(
           Object.assign(
-            { module: data.tab, questionTypes, structIds, latest, year, startTime, endTime },
+            { module: data.tab, questionTypes, courseModules, structIds, latest, year, startTime, endTime },
             this.state.search,
             {
               order: Object.keys(data.sortMap)

+ 12 - 14
front/project/www/routes/my/index.js

@@ -29,16 +29,11 @@ export function refreshQuestionType(compontent, subject, questionType, { all, ne
     compontent.questionSubjectSelect = tree.filter(row => row.level === 1 && (allSubject ? true : row.children.length > 1));
     if (all) {
       compontent.questionSubjectSelect.forEach(row => {
-        if (row.children.length > 0) {
+        if (row.children.length > 1) {
           row.children.unshift({
             title: '全部',
             key: '',
           });
-        } else {
-          row.children.unshift({
-            title: row.title,
-            key: row.key,
-          });
         }
       });
       compontent.questionSubjectSelect.unshift({
@@ -62,14 +57,15 @@ export function refreshStruct(compontent, questionTypes, module, one, two, { all
       return Main.getExerciseAll().then(result => {
         const tmp = result.filter(row => row.level > 2).map(row => {
           row.title = `${row.titleZh}`;
-          row.key = row.titleEn;
+          row.key = `${row.titleEn}`;
+          row.u = `${row.titleEn}${row.level}`;
           return row;
         });
         const idsMap = getMap(tmp, 'id', 'key');
         const map = {};
         tmp.forEach(row => {
-          if (!map[row.key]) {
-            map[row.key] = {
+          if (!map[row.u]) {
+            map[row.u] = {
               title: row.title,
               key: row.key,
               structIds: [],
@@ -77,7 +73,7 @@ export function refreshStruct(compontent, questionTypes, module, one, two, { all
               questionTypes: [],
             };
           }
-          const item = map[row.key];
+          const item = map[row.u];
           item.structIds.push(row.id);
           if (item.questionTypes.indexOf(row.extend) < 0) {
             item.questionTypes.push(row.extend);
@@ -128,10 +124,12 @@ export function refreshStruct(compontent, questionTypes, module, one, two, { all
         const twoSelectMap = getMap(tree, 'key', 'children');
         if (all) {
           oneSelect.forEach(row => {
-            row.children.unshift({
-              title: '全部',
-              key: '',
-            });
+            if (row.children.length > 1) {
+              row.children.unshift({
+                title: '全部',
+                key: '',
+              });
+            }
           });
           oneSelect.unshift({
             title: '全部',

+ 5 - 5
front/project/www/routes/my/main/page.js

@@ -286,7 +286,7 @@ export default class extends Page {
             title: result.exerciseTime
               ? formatSeconds(result.exerciseTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '<b>$1</b>$2')
               : '<b>-</b>',
-            width: 90,
+            width: 150,
           },
           { title: `<b>${result.exerciseQuestion || '-'}</b>题`, width: 80 },
           {
@@ -323,7 +323,7 @@ export default class extends Page {
             title: result.examinationTime
               ? formatSeconds(result.examinationTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '<b>$1</b>$2')
               : '<b>-</b>',
-            width: 90,
+            width: 150,
           },
           { title: `<b>${result.examinationPaper || '-'}</b>套卷`, width: 80 },
           {
@@ -347,7 +347,7 @@ export default class extends Page {
             title: result.courseTime
               ? formatSeconds(result.courseTime).replace(/([0-9]+)(min|m|hour|h|s)/g, '<b>$1</b>$2')
               : '<b>-</b>',
-            width: 90,
+            width: 150,
           },
           { title: `<b>${result.courseNumber || '-'}</b>课时`, width: 80 },
           {
@@ -425,10 +425,10 @@ export default class extends Page {
               }}
             />
             <span>
-              同比上周<b>{diffLastPercent}</b>% <Assets name={diffLast > 0 ? 'down' : 'up'} />
+              同比上周<b>{diffLastPercent}</b>% <Assets name={diffLast > 0 ? 'up' : 'down'} />
             </span>
             <span>
-              同比全站<b>{diffPercent}</b>% <Assets name={diff > 0 ? 'down' : 'up'} />
+              同比全站<b>{diffPercent}</b>% <Assets name={diff > 0 ? 'up' : 'down'} />
             </span>
           </div>
         </div>

+ 12 - 10
front/project/www/routes/my/note/page.js

@@ -33,7 +33,7 @@ const exportType = [
 const questionColumns = [
   {
     key: 'questionType',
-    width: 140,
+    width: 200,
     render(text, row) {
       return <div className="group">
         <a href={row.userQuestionId ? `/paper/question/${row.userQuestionId}` : `/question/detail/${row.questionNoId}`} target="_blank">{QuestionTypeMap[text]}</a>
@@ -51,7 +51,7 @@ const questionColumns = [
   },
   {
     key: 'content',
-    width: 540,
+    width: 520,
     render(text) {
       return <div className="group text-hidden t-16" style={{ width: '540px' }}>{text}</div>;
     },
@@ -62,13 +62,13 @@ const contentColumns = [
   {
     key: 'title',
     title: '笔记对象',
-    width: 120,
+    width: 110,
     render(text) {
       return <div className="sub">{AskTargetMap[text]}</div>;
     },
   },
   {
-    key: 'updateTime',
+    key: 'update_time',
     title: '更新时间',
     width: 105,
     render(text) {
@@ -81,7 +81,7 @@ const contentColumns = [
   {
     key: 'content',
     title: '内容',
-    width: 540,
+    width: 520,
     render(text) {
       return <OpenText>{text}</OpenText>;
     },
@@ -102,7 +102,7 @@ export default class extends Page {
       contentSelectList: [],
       allChecked: false,
       tab: 'exercise',
-      timerange: 'today',
+      timerange: 'all',
     };
   }
 
@@ -111,6 +111,8 @@ export default class extends Page {
     data.filterMap = this.state.search;
     if (data.order) {
       data.sortMap = { [data.order]: data.direction };
+    } else {
+      data.sortMap = { update_time: 'desc' };
     }
     if (data.timerange) {
       data.filterMap.timerange = data.timerange;
@@ -123,12 +125,12 @@ export default class extends Page {
     }).then(({ questionTypes }) => {
       return refreshStruct(this, questionTypes, data.tab, data.one, data.two, {
         all: true,
-        needPreview: false,
+        needPreview: true,
         needTextbook: false,
-      }).then(({ structIds, latest, year }) => {
+      }).then(({ courseModules, structIds, latest, year }) => {
         My.listQuestionNote(
           Object.assign(
-            { module: data.tab, questionTypes, structIds, latest, year, startTime, endTime },
+            { module: data.tab, questionTypes, courseModules, structIds, latest, year, startTime, endTime },
             this.state.search,
             {
               order: Object.keys(data.sortMap)
@@ -152,7 +154,7 @@ export default class extends Page {
               row.list.push({
                 title: r.value,
                 key: `${row.key}|${r.value}`,
-                updateTime: formatDate(row[`${r.value}Time`], 'YYYY-MM-DD HH:mm:ss'),
+                update_time: formatDate(row[`${r.value}Time`], 'YYYY-MM-DD HH:mm:ss'),
                 content: row[`${r.value}Content`],
               });
             });

+ 1 - 1
front/project/www/routes/my/report/page.js

@@ -90,7 +90,7 @@ export default class extends Page {
   initState() {
     return {
       tab: 'exercise',
-      timerange: 'today',
+      timerange: 'all',
       filterMap: {},
       sortMap: {},
       list: [], // { children: [{}, {}], title: 'channgnanjue' }, {}, {}, {}

+ 4 - 0
front/project/www/routes/page/export/index.less

@@ -123,4 +123,8 @@
   #export .content {
     width: 600px !important;
   }
+
+  body {
+    height: auto !important;
+  }
 }

+ 1 - 1
front/project/www/routes/page/export/page.js

@@ -78,7 +78,7 @@ export default class extends Page {
     return (
       <div className="head-layout">
         <div className="content p-r">
-          <div className="t-1 t-s-30">千行GMAR</div>
+          <div className="t-1 t-s-30">千行GMAT</div>
           <div className="t-1 t-s-18">
             <span>{info.nickname}</span> <span>ID {info.id}</span>
           </div>

+ 3 - 1
front/project/www/routes/paper/process/page.js

@@ -141,7 +141,6 @@ export default class extends Page {
     }
     // 更新模考做题进度
     if (report.paperModule === 'examination') {
-      this.stageNumber += 1;
       if (this.stageNumber >= this.stageProcess.number) {
         const { order } = report.setting;
         // 进入休息
@@ -201,6 +200,9 @@ export default class extends Page {
     }
     return Question.submit(userQuestion.id, answer, singleTime, questionSetting).then(() => {
       this.singleQuestionTime(true);
+      if (report.paperModule === 'examination') {
+        this.stageNumber += 1;
+      }
     });
   }
 

+ 3 - 3
front/project/www/routes/question/search/page.js

@@ -1,6 +1,6 @@
 import React, { Component } from 'react';
 import './index.less';
-import { Icon } from 'antd';
+import { Icon, Typography } from 'antd';
 import { Link } from 'react-router-dom';
 import Page from '@src/containers/Page';
 import Assets from '@src/components/Assets';
@@ -302,7 +302,7 @@ export default class extends Page {
               {
                 right: true,
                 placeholder: '难度',
-                key: 'level',
+                key: 'difficult',
                 select: difficultSelect,
               },
             ]}
@@ -378,7 +378,7 @@ class SearchItem extends Component {
             <span>收藏 {data.collectNumber || 0}</span>
           </div>
         </div>
-        <div className="t-1 p-20">{data.question.description}</div>
+        <div className="t-1 p-20" ><Typography.Paragraph ellipsis={{ rows: 3, expandable: false }}>{data.question.description}</Typography.Paragraph></div>
       </div>
     );
   }

+ 4 - 4
front/project/www/stores/my.js

@@ -198,8 +198,8 @@ export default class MyStore extends BaseStore {
    * @param {*} page
    * @param {*} size
    */
-  listError({ keyword, module, questionTypes, structIds, latest, year, page, size, startTime, endTime, order }) {
-    return this.apiGet('/my/error/list', { keyword, module, questionTypes, structIds, latest, year, page, size, startTime, endTime, order });
+  listError({ keyword, module, questionTypes, courseModules, structIds, latest, year, page, size, startTime, endTime, order }) {
+    return this.apiGet('/my/error/list', { keyword, module, questionTypes, courseModules, structIds, latest, year, page, size, startTime, endTime, order });
   }
 
   /**
@@ -272,8 +272,8 @@ export default class MyStore extends BaseStore {
    * @param {*} endTime
    * @param {*} order
    */
-  listQuestionNote({ keyword, module, questionTypes, structIds, latest, year, page, size, startTime, endTime, order }) {
-    return this.apiGet('/my/note/question/list', { keyword, module, questionTypes, structIds, latest, year, page, size, startTime, endTime, order });
+  listQuestionNote({ keyword, module, questionTypes, courseModules, structIds, latest, year, page, size, startTime, endTime, order }) {
+    return this.apiGet('/my/note/question/list', { keyword, module, questionTypes, courseModules, structIds, latest, year, page, size, startTime, endTime, order });
   }
 
   /**

+ 4 - 3
front/src/services/Tools.js

@@ -591,8 +591,6 @@ export function timeRange(timerange) {
   let startTime = null;
   let endTime = null;
   switch (timerange) {
-    case 'all':
-      return [null, null];
     case 'week':
       endTime = new Date();
       endTime.setHours(0, 0, 0, 0);
@@ -616,10 +614,13 @@ export function timeRange(timerange) {
       startTime.setMonth(startTime.getMonth() - 3);
       break;
     case 'today':
-    default:
       startTime = new Date();
       startTime.setHours(0, 0, 0, 0);
       endTime = new Date(startTime.getTime() + 86400000);
+      break;
+    case 'all':
+    default:
+      return [null, null];
   }
   return [formatDate(startTime, 'YYYY-MM-DD'), formatDate(endTime, 'YYYY-MM-DD')];
 }

+ 1 - 0
server/data/src/main/java/com/qxgmat/data/relation/UserNoteQuestionRelationMapper.java

@@ -14,6 +14,7 @@ public interface UserNoteQuestionRelationMapper {
             @Param("userId") Number userId,
             @Param("keyword") String keyword,
             @Param("questionTypes") String[] questionTypes,
+            @Param("courseModules") String[] courseModules,
             @Param("structIds") Integer[] structIds,
             @Param("startTime") Date startTime,
             @Param("endTime") Date endTime,

+ 1 - 0
server/data/src/main/java/com/qxgmat/data/relation/UserQuestionRelationMapper.java

@@ -18,6 +18,7 @@ public interface UserQuestionRelationMapper {
             @Param("userId") Number userId,
             @Param("keyword") String keyword,
             @Param("questionTypes") String[] questionTypes,
+            @Param("courseModules") String[] courseModules,
             @Param("structIds") Integer[] structIds,
             @Param("startTime") Date startTime,
             @Param("endTime") Date endTime,

+ 2 - 0
server/data/src/main/java/com/qxgmat/data/relation/mapping/QuestionNoRelationMapper.xml

@@ -252,6 +252,8 @@
   <select id="listExaminationAdmin" resultMap="IdMap">
     select
     <include refid="Id_Column_List" />
+    ,if(qn.`total_number` > 0, qn.`total_correct`- qn.`total_number` / qn.`total_number`,0) as `correct`
+    ,if(qn.`total_number`>0, qn.`total_time` / qn.`total_number`,0) as `time`
     from `question_no` qn
     left join `question` q on q.`id` = qn.`question_id`
     <if test="paperId != null">

+ 20 - 1
server/data/src/main/java/com/qxgmat/data/relation/mapping/UserNoteQuestionRelationMapper.xml

@@ -20,7 +20,7 @@
     </if>
     select
     <include refid="Id_Column_List" />,
-    unq.`update_time`
+    unq.`update_time` as `update_time`
     from `user_note_question` unq
     left join `question` q on q.`id` = unq.`question_id`
     and (q.`question_module` = 'base' or q.`question_module` = 'sentence')
@@ -40,6 +40,22 @@
     </if>
     left join `sentence_question` sq on sq.`question_id` = q.`id`
     and (q.`question_module` = 'sentence')
+    left join `user_question` uq on uq.`question_id` = unq.`question_id`
+    left join `user_paper` up on up.`id` = uq.`paper_id`
+    left join `preview_assign` pa on up.`paper_origin` = 'preview' and pa.`id` = up.`origin_id`
+    <if test="courseModules != null">
+      and pa.`course_module` in
+      <foreach collection="courseModules" item="item" index="index" open="(" close=")" separator=",">
+        #{item}
+      </foreach>
+    </if>
+    left join `preview_paper` pp on pa.`paper_id` = pp.`id`
+    <if test="questionTypes != null">
+      and
+      <foreach collection="questionTypes" item="item" index="index" open="(" close=")" separator=" or ">
+        pp.`question_type` = #{item}
+      </foreach>
+    </if>
     where
     q.`id` > 0 and unq.`user_id` = #{userId,jdbcType=VARCHAR}
     <if test="keyword != null">
@@ -50,6 +66,9 @@
     <if test="structIds != null">
       and qn.`id` > 0
     </if>
+    <if test="courseModules != null">
+      and (pa.`id` > 0)
+    </if>
     <if test="structIds == null">
       and (qn.`id` > 0 or sq.`id` > 0)
     </if>

+ 19 - 2
server/data/src/main/java/com/qxgmat/data/relation/mapping/UserQuestionRelationMapper.xml

@@ -62,6 +62,21 @@
       and upq.`question_no_id` = qn.`id`
       and upq.`question_module` = uq.`question_module`
       and upq.`question_origin` = 'remove_error'
+    left join `user_paper` up on up.`id` = uq.`paper_id`
+    left join `preview_assign` pa on up.`paper_origin` = 'preview' and pa.`id` = up.`origin_id`
+    <if test="courseModules != null">
+      and pa.`course_module` in
+      <foreach collection="courseModules" item="item" index="index" open="(" close=")" separator=",">
+        #{item}
+      </foreach>
+    </if>
+    left join `preview_paper` pp on pa.`paper_id` = pp.`id`
+    <if test="questionTypes != null">
+      and
+      <foreach collection="questionTypes" item="item" index="index" open="(" close=")" separator=" or ">
+        pp.`question_type` = #{item}
+      </foreach>
+    </if>
     where
     q.`id` > 0 and qn.`id` > 0 and upq.`id` is null and uq.`user_id` = #{userId,jdbcType=VARCHAR}
     <if test="keyword != null">
@@ -75,6 +90,9 @@
     <if test="structIds == null">
       and (qn.`id` > 0 or sq.`id` > 0)
     </if>
+    <if test="courseModules != null">
+      and (pa.`id` > 0)
+    </if>
     <if test="startTime != null">
       and uq.`create_time` &gt; #{startTime,jdbcType=TIMESTAMP}
     </if>
@@ -214,11 +232,10 @@
   -->
   <select id="statLimit" resultMap="limitMap">
     select
-    sum(`user_number`) as `user_number`, sum(`user_correct`) as `user_correct`
+    sum(`id`) as `user_number`, sum(`is_correct`) as `user_correct`
     from `user_question`
     where
     `user_time` &lt; `time`
-    and `user_number` = `question_number`
     and `report_id` = #{reportId,jdbcType=INTEGER}
   </select>
 </mapper>

+ 4 - 2
server/gateway-api/src/main/java/com/qxgmat/controller/api/MyController.java

@@ -1045,6 +1045,7 @@ public class MyController {
             @RequestParam(required = false) String keyword,
             @RequestParam(required = false) String module,
             @RequestParam(required = false) String[] questionTypes,
+            @RequestParam(required = false) String[] courseModules,
             @RequestParam(required = false) Integer[] structIds,
             @RequestParam(required = false) String startTime,
             @RequestParam(required = false) String endTime,
@@ -1056,7 +1057,7 @@ public class MyController {
         QuestionNoModule questionNoModule = QuestionNoModule.ValueOf(module);
         Page<UserQuestion> p = null;
         if(questionNoModule == QuestionNoModule.EXERCISE){
-            p = userQuestionService.listExerciseError(page, size, user.getId(), keyword, questionTypes, structIds, Tools.baseDate(startTime), Tools.baseDate(endTime), order != null ? order.replace("|", " ") : null);
+            p = userQuestionService.listExerciseError(page, size, user.getId(), keyword, questionTypes, courseModules, structIds, Tools.baseDate(startTime), Tools.baseDate(endTime), order != null ? order.replace("|", " ") : null);
         }else if (questionNoModule == QuestionNoModule.EXAMINATION){
             Integer libraryId = null;
             if (latest != null){
@@ -1206,6 +1207,7 @@ public class MyController {
             @RequestParam(required = false) String keyword,
             @RequestParam(required = false) String module,
             @RequestParam(required = false) String[] questionTypes,
+            @RequestParam(required = false) String[] courseModules,
             @RequestParam(required = false) Integer[] structIds,
             @RequestParam(required = false) String startTime,
             @RequestParam(required = false) String endTime,
@@ -1217,7 +1219,7 @@ public class MyController {
         QuestionNoModule questionNoModule = QuestionNoModule.ValueOf(module);
         Page<UserNoteQuestion> p = null;
         if(questionNoModule == QuestionNoModule.EXERCISE){
-            p = userNoteQuestionService.listExercise(page, size, user.getId(), keyword, questionTypes, structIds, Tools.baseDate(startTime), Tools.baseDate(endTime), order != null ? order.replace("|", " ") : null);
+            p = userNoteQuestionService.listExercise(page, size, user.getId(), keyword, questionTypes, courseModules, structIds, Tools.baseDate(startTime), Tools.baseDate(endTime), order != null ? order.replace("|", " ") : null);
         }else if (questionNoModule == QuestionNoModule.EXAMINATION){
             Integer libraryId = null;
             if (latest != null){

+ 3 - 2
server/gateway-api/src/main/java/com/qxgmat/controller/api/QuestionController.java

@@ -480,6 +480,7 @@ public class QuestionController {
                 }
                 Collection ids = Transform.getIds(paperList, ExaminationPaper.class, "id");
                 List<UserPaper> userPaperList = userPaperService.listWithOrigin(user.getId(), PaperOrigin.EXAMINATION, ids, null);
+                userPaperList = userPaperList.stream().filter((q)-> q.getFinishTimes()>0).collect(Collectors.toList());
 
                 if (paperList.size() > userPaperList.size()){
                     dto.setUserNumber(userPaperList.size());
@@ -488,11 +489,11 @@ public class QuestionController {
                     int minTimes = 0;
                     // 统计最小轮的已做题数
                     for(UserPaper userPaper : userPaperList){
-                        if(userPaper.getTimes() < minTimes || minTimes == 0) minTimes = userPaper.getTimes();
+                        if(userPaper.getFinishTimes() < minTimes || minTimes == 0) minTimes = userPaper.getFinishTimes();
                     }
                     int userNumber = 0;
                     for(UserPaper userPaper : userPaperList){
-                        if(userPaper.getTimes() > minTimes) userNumber += 1;
+                        if(userPaper.getFinishTimes() > minTimes) userNumber += 1;
                     }
                     dto.setUserNumber(userNumber);
                 }

+ 2 - 2
server/gateway-api/src/main/java/com/qxgmat/service/UserNoteQuestionService.java

@@ -42,9 +42,9 @@ public class UserNoteQuestionService extends AbstractService {
      * @param order
      * @return
      */
-    public Page<UserNoteQuestion> listExercise(int page, int size, Integer userId, String keyword, String[] questionTypes, Integer[] structIds, Date startTime, Date endTime, String order){
+    public Page<UserNoteQuestion> listExercise(int page, int size, Integer userId, String keyword, String[] questionTypes, String[] courseModule, Integer[] structIds, Date startTime, Date endTime, String order){
         Page<UserNoteQuestion> p = page(()->{
-            userNoteQuestionRelationMapper.listExercise(userId, keyword, questionTypes, structIds, startTime, endTime, order);
+            userNoteQuestionRelationMapper.listExercise(userId, keyword, questionTypes, courseModule, structIds, startTime, endTime, order);
         }, page, size);
 
         Collection ids = Transform.getIds(p, UserNoteQuestion.class, "id");

+ 2 - 2
server/gateway-api/src/main/java/com/qxgmat/service/UserQuestionService.java

@@ -51,9 +51,9 @@ public class UserQuestionService extends AbstractService {
      * @param order
      * @return
      */
-    public Page<UserQuestion> listExerciseError(int page, int size, Integer userId, String keyword, String[] questionTypes, Integer[] structIds, Date startTime, Date endTime, String order){
+    public Page<UserQuestion> listExerciseError(int page, int size, Integer userId, String keyword, String[] questionTypes, String[] courseModule, Integer[] structIds, Date startTime, Date endTime, String order){
         Page<UserQuestion> p = page(()->{
-            userQuestionRelationMapper.listExerciseError(userId, keyword, questionTypes, structIds, startTime, endTime, order);
+            userQuestionRelationMapper.listExerciseError(userId, keyword, questionTypes, courseModule, structIds, startTime, endTime, order);
         }, page, size);
 
         Collection ids = Transform.getIds(p, UserQuestion.class, "id");

+ 11 - 2
server/gateway-api/src/main/java/com/qxgmat/service/extend/ExaminationService.java

@@ -154,6 +154,10 @@ public class ExaminationService extends AbstractService {
 
     private Map<String, String> adminMap = new HashMap<String, String>(){{
         put("updateTime", "q");
+        put("number", "");
+        put("time", "");
+        put("correct", "");
+        put("difficult", "q");
         put("", "qn");
     }};
 
@@ -176,7 +180,12 @@ public class ExaminationService extends AbstractService {
             order = "id";
         }
         if(adminMap.containsKey(order)){
-            order = adminMap.get(order)+".`"+Tools.underscoreName(order)+"`";
+            String o = adminMap.get(order);
+            if (o.equals("")){
+                order = "`"+Tools.underscoreName(order)+"`";
+            }else{
+                order = adminMap.get(order)+".`"+Tools.underscoreName(order)+"`";
+            }
         }else{
             order = adminMap.get("")+".`"+Tools.underscoreName(order)+"`";
         }
@@ -387,7 +396,7 @@ public class ExaminationService extends AbstractService {
      */
     public boolean verbalRC(Integer number){
         for(Integer n : verbalRCPosition){
-            if (n == number) return true;
+            if (n.equals(number)) return true;
         }
         return false;
     }

+ 16 - 1
server/gateway-api/src/main/java/com/qxgmat/service/extend/ExerciseService.java

@@ -165,8 +165,14 @@ public class ExerciseService extends AbstractService {
         List<ExercisePaper> list = new ArrayList<>();
         if (questionList == null || questionList.size() == 0) return list;
         List<Integer> tmp = new ArrayList<>(length);
+        int min = 0;
+        int max = 0;
         for(QuestionNo question : questionList){
             tmp.add(question.getId());
+            if (tmp.size() == 0){
+                min = question.getNo();
+            }
+            max = question.getNo();
             if (tmp.size() == length){
                 no += 1;
                 ExercisePaper paper = ExercisePaper.builder()
@@ -179,7 +185,11 @@ public class ExerciseService extends AbstractService {
                         .questionNumber(tmp.size())
                         .status(0)
                         .questionNoIds(tmp.toArray(new Integer[0])).build();
-                paper.setTitle(exercisePaperService.generateTitle(prefixTitle, length, paper.getNo(), paper.getQuestionNumber()));
+                if (logic == ExerciseLogic.NO){
+                    paper.setTitle(exercisePaperService.generateOriginTitle(prefixTitle, min, max));
+                }else{
+                    paper.setTitle(exercisePaperService.generateTitle(prefixTitle, length, paper.getNo(), paper.getQuestionNumber()));
+                }
                 paper = exercisePaperService.add(paper);
                 list.add(paper);
                 tmp.clear();
@@ -197,6 +207,11 @@ public class ExerciseService extends AbstractService {
                     .questionNumber(tmp.size())
                     .status(0)
                     .questionNoIds(tmp.toArray(new Integer[0])).build();
+            if (logic == ExerciseLogic.NO){
+                paper.setTitle(exercisePaperService.generateOriginTitle(prefixTitle, min, max));
+            }else{
+                paper.setTitle(exercisePaperService.generateTitle(prefixTitle, length, paper.getNo(), paper.getQuestionNumber()));
+            }
             paper.setTitle(exercisePaperService.generateTitle(prefixTitle, length, paper.getNo(), paper.getQuestionNumber()));
             paper = exercisePaperService.add(paper);
             list.add(paper);

+ 4 - 0
server/gateway-api/src/main/java/com/qxgmat/service/inline/ExercisePaperService.java

@@ -83,6 +83,10 @@ public class ExercisePaperService extends AbstractService {
         return String.format("%s(%d-%d)", prefixTitle, (no - 1) * length + 1, (no - 1) * length + questionNumber);
     }
 
+    public String generateOriginTitle(String prefixTitle, Integer min, Integer max){
+        return String.format("%s(%d-%d)", prefixTitle, min, max);
+    }
+
     /**
      * 获取考点分组所有可用考点信息
      * @return