Explorar el Código

all questions in validations button

amenpunk hace 2 años
padre
commit
096e11262a
Se han modificado 2 ficheros con 9 adiciones y 6 borrados
  1. 3 3
      src/Components/Test/Cleaver/Question.jsx
  2. 6 3
      src/Pages/Pruebas/Cleaver.jsx

+ 3 - 3
src/Components/Test/Cleaver/Question.jsx

@@ -93,9 +93,9 @@ function CheckboxesGroup(props) {
93 93
   );
94 94
 }
95 95
 
96
-export function Question({ quiz }) {
96
+export function Question({ quiz, group }) {
97 97
   // console.log('quiz: ', quiz)
98
-  let { instrucciondepregunta, respuestas} = quiz
98
+  let { instrucciondepregunta, respuestas } = quiz
99 99
   return (
100 100
 
101 101
     <Card sx={{ minWidth: 275, margin: '30px !important', borderLeft: '5px solid var(--main)'}}>
@@ -114,7 +114,7 @@ export function Question({ quiz }) {
114 114
 
115 115
         <div variant="body2">
116 116
           <List>
117
-            <CheckboxexHeader title={instrucciondepregunta}/>
117
+            <CheckboxexHeader title={group + " - " + instrucciondepregunta}/>
118 118
           </List>
119 119
           <CheckboxesGroup quiz={respuestas} />
120 120
         </div>

+ 6 - 3
src/Pages/Pruebas/Cleaver.jsx

@@ -42,6 +42,9 @@ var scroll = Scroll.animateScroll;
42 42
       let temp = nextHiddenItem.shift()
43 43
       setRespondidas([...totalRespondidas,temp]);
44 44
     }
45
+
46
+    // console.log("RESPONDIDAS: ", totalRespondidas.length)
47
+    // console.log("RESTANTES: ", totalPreguntas.length)
45 48
   };
46 49
 
47 50
   return (
@@ -53,7 +56,7 @@ var scroll = Scroll.animateScroll;
53 56
             <TransitionGroup >
54 57
               {totalRespondidas.map((item) => (
55 58
                 <Collapse key={item.id} >
56
-                  <Question key={item.id} quiz={item} />
59
+                  <Question key={item.id} quiz={item} group={item.nombre}/>
57 60
                 </Collapse>
58 61
               ))
59 62
             }
@@ -61,10 +64,10 @@ var scroll = Scroll.animateScroll;
61 64
           </List>
62 65
         </Box>
63 66
 
64
-        <div class="question_btn">
67
+        <div className="question_btn">
65 68
         <Button
66 69
           variant="contained"
67
-          disabled={totalRespondidas.length >= totalPreguntas.length}
70
+          disabled={totalPreguntas.length <= 0}
68 71
           onClick={handleAddQuestion}
69 72
         >
70 73
             Siguiente Pregunta