lex 1 éve
szülő
commit
51fb86883e

+ 19 - 5
src/views/knowledge-library/error-question-mode/index.tsx

@@ -41,7 +41,7 @@ export default defineComponent({
       currentIndex: 0,
       questionList: [] as any,
       page: 1,
-      rows: 10,
+      rows: 50,
       total: 0,
       isFinish: false, // 是否完成加载
       visiableInfo: {
@@ -70,14 +70,17 @@ export default defineComponent({
     // 计时
     const { counter, resume, pause } = useInterval(1000, { controls: true });
 
-    const getExamDetails = async () => {
+    const getExamDetails = async (
+      maxStudentExaminationErrorEditionId?: string
+    ) => {
       try {
         const { data } = await request.post(
           '/edu-app/studentUnitExamination/errorEdition',
           {
             data: {
               page: state.page,
-              rows: state.rows
+              rows: state.rows,
+              maxStudentExaminationErrorEditionId
             }
           }
         );
@@ -110,8 +113,10 @@ export default defineComponent({
           state.currentIndex + 3 >= state.questionList.length &&
           !state.isFinish
         ) {
+          const lastQuestion =
+            state.questionList[state.questionList.length - 1];
           state.page = state.page + 1;
-          getExamDetails();
+          getExamDetails(lastQuestion.id);
         }
       }
     );
@@ -168,7 +173,16 @@ export default defineComponent({
 
         // 后面没有题
         if (state.questionList.length === state.currentIndex + 1) {
-          swipeRef.value?.prev();
+          const index = state.questionList.findIndex(
+            (item: any) =>
+              item.studentExaminationErrorEditionId ===
+              state.visiableInfo.graspItem.studentExaminationErrorEditionId
+          );
+          state.questionList.splice(index, 1);
+          state.total -= 1;
+          state.currentIndex -= 1;
+          resizeSwipeItemHeight();
+          // swipeRef.value?.prev();
           return;
         }
       } catch {

+ 4 - 2
src/views/knowledge-library/model/choice-question/index.tsx

@@ -45,14 +45,16 @@ export default defineComponent({
       default: () => ({
         message: '',
         topic: false, // 是否显示结果
-        userResult: true // 用户答题对错
+        userResult: true, // 用户答题对错
+        disabled: false // 是否禁用选项
       })
     }
   },
   emits: ['update:value'],
   setup(props, { emit, slots }) {
     const onSelect = (item: any) => {
-      if (props.readOnly) return;
+      if (props.readOnly || props.analysis.disabled) return;
+
       const value: any = props.value || [];
       const result = {
         answerId: item.examinationQuestionAnswerId,

+ 5 - 4
src/views/knowledge-library/model/drag-question/index.tsx

@@ -51,7 +51,8 @@ export default defineComponent({
       default: () => ({
         message: '',
         topic: false, // 是否显示结果
-        userResult: true // 用户答题对错
+        userResult: true, // 用户答题对错
+        disabled: false // 是否禁用选项
       })
     }
   },
@@ -86,7 +87,7 @@ export default defineComponent({
     // 修改题目逻辑
     const onSelectAnswer = (item: any) => {
       // 判断是否已经选中了
-      if (item.checked || props.readOnly) return;
+      if (item.checked || props.readOnly || props.analysis.disabled) return;
       const result: any = [];
       // console.log(state.options, 'state.options')
       state.options.forEach((option: any, index: any) => {
@@ -233,7 +234,7 @@ export default defineComponent({
               <Button
                 type="primary"
                 round
-                disabled={props.readOnly}
+                disabled={props.readOnly || props.analysis.disabled}
                 onClick={() => {
                   state.options = [];
                   state.list = [];
@@ -244,7 +245,7 @@ export default defineComponent({
               </Button>
             </div>
 
-            {props.readOnly ? (
+            {props.readOnly || props.analysis.disabled ? (
               state.options.map((item: any) => (
                 <div class={styles.itemsContainer}>
                   {item.leftType === AnswerType.TXT && (

+ 5 - 4
src/views/knowledge-library/model/keep-look-question/index.tsx

@@ -42,7 +42,8 @@ export default defineComponent({
       default: () => ({
         message: '',
         topic: false, // 是否显示结果
-        userResult: true // 用户答题对错
+        userResult: true, // 用户答题对错
+        disabled: false
       })
     }
   },
@@ -70,7 +71,7 @@ export default defineComponent({
     */
     const onLeftClick = (e: any, item: any) => {
       // 是否只读
-      if (props.readOnly) return;
+      if (props.readOnly || props.analysis.disabled) return;
       state.options.forEach((option: any) => {
         if (!option.leftLocked && item.index !== option.index) {
           option.left = false;
@@ -127,7 +128,7 @@ export default defineComponent({
 
     const onRightClick = (e: any, item: any) => {
       // 是否只读
-      if (props.readOnly) return;
+      if (props.readOnly || props.analysis.disabled) return;
       // 去掉
       state.options.forEach((option: any) => {
         if (!option.rightLocked && item.index !== option.index) {
@@ -478,7 +479,7 @@ export default defineComponent({
             <Button
               round
               type="primary"
-              disabled={props.readOnly}
+              disabled={props.readOnly || props.analysis.disabled}
               onClick={() => {
                 state.drawLineList = [];
                 renderDrawLine(canvasRef.value);

+ 5 - 2
src/views/knowledge-library/model/play-question/index.tsx

@@ -60,6 +60,7 @@ export default defineComponent({
         message: '',
         topic: false, // 是否显示结果
         userResult: true, // 用户答题对错
+        disabled: false,
         score: 0 // 分数
       })
     }
@@ -230,7 +231,7 @@ export default defineComponent({
                       class={styles.playBtn}
                       type="primary"
                       onClick={onEvaluation}
-                      disabled={props.readOnly}>
+                      disabled={props.readOnly || props.analysis.disabled}>
                       点击评测
                       <Icon name="play" />
                     </Button>
@@ -239,7 +240,9 @@ export default defineComponent({
               </Cell>
             )}
 
-            {(!props.readOnly || props.showScore) && (
+            {(!props.readOnly ||
+              props.showScore ||
+              !props.analysis.disabled) && (
               <div class={['van-hairline--top', styles.unitScoreNum]}>
                 <div class={styles.score}>{state.score}</div>
                 <div class={styles.scoreTitle}>评测分数</div>

+ 4 - 2
src/views/knowledge-library/practice-mode/index.tsx

@@ -85,7 +85,8 @@ export default defineComponent({
             message: item.answerAnalysis,
             topic: true, // 是否显示结果
             isAnswer: false, // 是否答题
-            userResult: false // 用户答题对错
+            userResult: false, // 用户答题对错
+            disabled: false // 是否禁用选项
           };
           item.userAnswer = []; // 用户答题
         });
@@ -131,6 +132,7 @@ export default defineComponent({
               question.showAnalysis = true;
               question.analysis.userResult = data;
               question.analysis.isAnswer = true; // 是否答题
+              question.analysis.disabled = true;
             }
           });
         }
@@ -297,7 +299,7 @@ export default defineComponent({
       state.visiableInfo.showCancelButton = true;
       state.visiableInfo.operationType = 'BACK';
       state.visiableInfo.cancelButtonText = '取消';
-      state.visiableInfo.confirmButtonText = '继续';
+      state.visiableInfo.confirmButtonText = '确定';
       state.visiableInfo.content = `您已经完成${
         answerResult.passCount + answerResult.noPassCount
       }道题了,继续做题可以巩固所学知识哦~`;