Browse Source

all questions in validations button

amenpunk 3 năm trước cách đây
mục cha
commit
096e11262a
2 tập tin đã thay đổi với 9 bổ sung6 xóa
  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) {
   );
 }
 
-export function Question({ quiz }) {
+export function Question({ quiz, group }) {
   // console.log('quiz: ', quiz)
-  let { instrucciondepregunta, respuestas} = quiz
+  let { instrucciondepregunta, respuestas } = quiz
   return (
 
     <Card sx={{ minWidth: 275, margin: '30px !important', borderLeft: '5px solid var(--main)'}}>
@@ -114,7 +114,7 @@ export function Question({ quiz }) {
 
         <div variant="body2">
           <List>
-            <CheckboxexHeader title={instrucciondepregunta}/>
+            <CheckboxexHeader title={group + " - " + instrucciondepregunta}/>
           </List>
           <CheckboxesGroup quiz={respuestas} />
         </div>

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

@@ -42,6 +42,9 @@ var scroll = Scroll.animateScroll;
       let temp = nextHiddenItem.shift()
       setRespondidas([...totalRespondidas,temp]);
     }
+
+    // console.log("RESPONDIDAS: ", totalRespondidas.length)
+    // console.log("RESTANTES: ", totalPreguntas.length)
   };
 
   return (
@@ -53,7 +56,7 @@ var scroll = Scroll.animateScroll;
             <TransitionGroup >
               {totalRespondidas.map((item) => (
                 <Collapse key={item.id} >
-                  <Question key={item.id} quiz={item} />
+                  <Question key={item.id} quiz={item} group={item.nombre}/>
                 </Collapse>
               ))
             }
@@ -61,10 +64,10 @@ var scroll = Scroll.animateScroll;
           </List>
         </Box>
 
-        <div class="question_btn">
+        <div className="question_btn">
         <Button
           variant="contained"
-          disabled={totalRespondidas.length >= totalPreguntas.length}
+          disabled={totalPreguntas.length <= 0}
           onClick={handleAddQuestion}
         >
             Siguiente Pregunta