|
@@ -4,9 +4,21 @@ import { Remove as RemoveIcon, Add as AddIcon } from '@mui/icons-material';
|
|
|
import {
|
|
import {
|
|
|
Card,CardContent,Avatar,Checkbox,List,Tooltip,Fade,
|
|
Card,CardContent,Avatar,Checkbox,List,Tooltip,Fade,
|
|
|
ListItem,ListItemButton,ListItemIcon,ListItemText,
|
|
ListItem,ListItemButton,ListItemIcon,ListItemText,
|
|
|
|
|
+ Box,LinearProgress,
|
|
|
} from '@mui/material'
|
|
} from '@mui/material'
|
|
|
|
|
+
|
|
|
import { deepPurple } from '@mui/material/colors';
|
|
import { deepPurple } from '@mui/material/colors';
|
|
|
|
|
|
|
|
|
|
+function LinearProgressWithLabel(props) {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <Box sx={{ display: 'flex', alignItems: 'center' }}>
|
|
|
|
|
+ <Box sx={{ width: '100%', mr: 0 }}>
|
|
|
|
|
+ <LinearProgress variant="determinate" {...props} />
|
|
|
|
|
+ </Box>
|
|
|
|
|
+ </Box>
|
|
|
|
|
+ );
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function CheckboxexHeader(prop) {
|
|
function CheckboxexHeader(prop) {
|
|
|
return (
|
|
return (
|
|
|
<List sx={{ width: '100%', bgcolor: 'background.paper' }}>
|
|
<List sx={{ width: '100%', bgcolor: 'background.paper' }}>
|
|
@@ -44,7 +56,7 @@ function CheckboxesGroup(props) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
let final = Object.assign(resp,temp);
|
|
let final = Object.assign(resp,temp);
|
|
|
- console.log('Change A:',final)
|
|
|
|
|
|
|
+ // console.log('Change A:',final)
|
|
|
save(final)
|
|
save(final)
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -60,7 +72,7 @@ function CheckboxesGroup(props) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
let final = Object.assign(resp,temp)
|
|
let final = Object.assign(resp,temp)
|
|
|
- console.log('Change B: ', final);
|
|
|
|
|
|
|
+ // console.log('Change B: ', final);
|
|
|
save(final)
|
|
save(final)
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -119,16 +131,17 @@ function CheckboxesGroup(props) {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export function Question({quiz, index, current, save, responses}) {
|
|
|
|
|
|
|
+export function Question({quiz, index, current, save, responses, progress}) {
|
|
|
let { instrucciondepregunta, respuestas,id } = quiz
|
|
let { instrucciondepregunta, respuestas,id } = quiz
|
|
|
let checked = index === current;
|
|
let checked = index === current;
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<Fade in={checked} unmountOnExit>
|
|
<Fade in={checked} unmountOnExit>
|
|
|
<Card className="question_form">
|
|
<Card className="question_form">
|
|
|
<CardContent>
|
|
<CardContent>
|
|
|
<div variant="body2">
|
|
<div variant="body2">
|
|
|
<List>
|
|
<List>
|
|
|
- <CheckboxexHeader group={id} title={instrucciondepregunta}/>
|
|
|
|
|
|
|
+ <CheckboxexHeader group={index + 1} title={instrucciondepregunta}/>
|
|
|
</List>
|
|
</List>
|
|
|
<CheckboxesGroup
|
|
<CheckboxesGroup
|
|
|
id={id}
|
|
id={id}
|
|
@@ -138,6 +151,7 @@ export function Question({quiz, index, current, save, responses}) {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</CardContent>
|
|
</CardContent>
|
|
|
|
|
+ <LinearProgressWithLabel value={progress} />
|
|
|
</Card>
|
|
</Card>
|
|
|
</Fade>
|
|
</Fade>
|
|
|
);
|
|
);
|