Browse Source

question cleaver mokup

amenpunk 2 years ago
parent
commit
cbb6a80f35
2 changed files with 48 additions and 13 deletions
  1. 3 0
      src/App.css
  2. 45 13
      src/Components/Test/Cleaver/Question.jsx

+ 3 - 0
src/App.css

307
   justify-content: flex-start;
307
   justify-content: flex-start;
308
 }
308
 }
309
 
309
 
310
+.checkbox_label_question{
311
+  font-weight:bold;
312
+}

+ 45 - 13
src/Components/Test/Cleaver/Question.jsx

1
 import * as React from 'react';
1
 import * as React from 'react';
2
-// import Box from '@mui/material/Box';
2
+
3
 import Card from '@mui/material/Card';
3
 import Card from '@mui/material/Card';
4
-import CardActions from '@mui/material/CardActions';
4
+// import CardActions from '@mui/material/CardActions';
5
 import CardContent from '@mui/material/CardContent';
5
 import CardContent from '@mui/material/CardContent';
6
-import Button from '@mui/material/Button';
7
-import Typography from '@mui/material/Typography';
8
-import Avatar from '@mui/material/Avatar';
6
+// import Button from '@mui/material/Button';
7
+// import Typography from '@mui/material/Typography';
8
+// import Avatar from '@mui/material/Avatar';
9
 import Checkbox from '@mui/material/Checkbox';
9
 import Checkbox from '@mui/material/Checkbox';
10
-import { deepPurple } from '@mui/material/colors';
10
+// import { deepPurple } from '@mui/material/colors';
11
 
11
 
12
 import List from '@mui/material/List';
12
 import List from '@mui/material/List';
13
 import ListItem from '@mui/material/ListItem';
13
 import ListItem from '@mui/material/ListItem';
15
 import ListItemIcon from '@mui/material/ListItemIcon';
15
 import ListItemIcon from '@mui/material/ListItemIcon';
16
 import ListItemText from '@mui/material/ListItemText';
16
 import ListItemText from '@mui/material/ListItemText';
17
 
17
 
18
+import AddIcon from '@mui/icons-material/Add';
19
+import RemoveIcon from '@mui/icons-material/Remove';
20
+
21
+
22
+function CheckboxexHeader(prop) {
23
+  return (
24
+    <List sx={{ width: '100%', bgcolor: 'background.paper' }}>
25
+      <ListItem>
26
+        <ListItemButton role={undefined} dense>
27
+          <ListItemText style={{marginRight :25, color:'silver'}} primary={prop.title} />
28
+          <ListItemIcon>
29
+            <AddIcon />
30
+          </ListItemIcon>
31
+          <ListItemIcon>
32
+            <RemoveIcon />
33
+          </ListItemIcon>
34
+        </ListItemButton>
35
+      </ListItem>
36
+    </List>
37
+  );
38
+}
39
+
18
 function CheckboxesGroup(props) {
40
 function CheckboxesGroup(props) {
19
 
41
 
20
   const [checked, setChecked] = React.useState([0]);
42
   const [checked, setChecked] = React.useState([0]);
39
         return (
61
         return (
40
           <ListItem key={value.id}>
62
           <ListItem key={value.id}>
41
             <ListItemButton role={undefined} onClick={handleToggle(value)} dense>
63
             <ListItemButton role={undefined} onClick={handleToggle(value)} dense>
42
-              <ListItemText id={labelId} primary={value.nombre} />
64
+              <ListItemText className="checkbox_label_question" id={labelId} primary={value.nombre} />
43
               <ListItemIcon>
65
               <ListItemIcon>
44
                 <Checkbox
66
                 <Checkbox
45
                   edge="start"
67
                   edge="start"
47
                   tabIndex={-1}
69
                   tabIndex={-1}
48
                   disableRipple
70
                   disableRipple
49
                   inputProps={{ 'aria-labelledby': labelId }}
71
                   inputProps={{ 'aria-labelledby': labelId }}
50
-                  />
72
+                />
51
               </ListItemIcon>
73
               </ListItemIcon>
52
               <ListItemIcon>
74
               <ListItemIcon>
53
                 <Checkbox
75
                 <Checkbox
56
                   tabIndex={-1}
78
                   tabIndex={-1}
57
                   disableRipple
79
                   disableRipple
58
                   inputProps={{ 'aria-labelledby': labelId }}
80
                   inputProps={{ 'aria-labelledby': labelId }}
59
-                  />
81
+                />
60
               </ListItemIcon>
82
               </ListItemIcon>
61
             </ListItemButton>
83
             </ListItemButton>
62
           </ListItem>
84
           </ListItem>
67
 }
89
 }
68
 
90
 
69
 export function Question({ quiz }) {
91
 export function Question({ quiz }) {
70
-  let { instrucciondepregunta, id, respuestas } = quiz
92
+  console.log('quiz: ', quiz)
93
+  let { instrucciondepregunta,respuestas } = quiz
71
   return (
94
   return (
72
-    <Card sx={{ minWidth: 275, margin: 5 }}>
95
+
96
+    <Card sx={{ minWidth: 275, margin: 5 , borderLeft: '5px solid var(--main)'}}>
73
       <CardContent>
97
       <CardContent>
74
 
98
 
99
+        {/*
75
         <div sx={{ fontSize: 17 }}>
100
         <div sx={{ fontSize: 17 }}>
76
           <div className="quiz_title_text">
101
           <div className="quiz_title_text">
77
             <Avatar sx={{ bgcolor: deepPurple[500] }}>{id}</Avatar>
102
             <Avatar sx={{ bgcolor: deepPurple[500] }}>{id}</Avatar>
80
             </Typography>
105
             </Typography>
81
           </div>
106
           </div>
82
         </div>
107
         </div>
108
+      */}
83
 
109
 
84
         <div variant="body2">
110
         <div variant="body2">
85
-          <CheckboxesGroup quiz={respuestas}/>
111
+          <List>
112
+            <CheckboxexHeader title={instrucciondepregunta}/>
113
+          </List>
114
+          <CheckboxesGroup quiz={respuestas} />
86
         </div>
115
         </div>
87
       </CardContent>
116
       </CardContent>
88
 
117
 
118
+        {/*
89
       <CardActions>
119
       <CardActions>
90
-        <Button size="small">Siguiente Pregunta</Button>
120
+        <Button variant="contained" size="small">Anterior</Button>
121
+        <Button variant="contained" size="small">Siguiente</Button>
91
       </CardActions>
122
       </CardActions>
123
+      */}
92
 
124
 
93
     </Card>
125
     </Card>
94
   );
126
   );