|
|
@@ -7,7 +7,7 @@ import TableHead from '@mui/material/TableHead';
|
|
|
import TableRow from '@mui/material/TableRow';
|
|
|
import Paper from '@mui/material/Paper';
|
|
|
import { } from '@mui/material'
|
|
|
-import { useNavigate } from 'react-router-dom'
|
|
|
+// import { useNavigate } from 'react-router-dom'
|
|
|
import { useSelector } from 'react-redux';
|
|
|
import { Service } from './Utils/HTTP';
|
|
|
|
|
|
@@ -27,7 +27,9 @@ import {
|
|
|
|
|
|
function IconStatus(props) {
|
|
|
|
|
|
- let navigate = useNavigate()
|
|
|
+ let { pwd, setId } = props
|
|
|
+ // let navigate = useNavigate()
|
|
|
+ // console.log('MPROP',props)
|
|
|
let auth = useSelector((state) => state.token)
|
|
|
|
|
|
const calificar = () => {
|
|
|
@@ -36,7 +38,10 @@ function IconStatus(props) {
|
|
|
rest
|
|
|
.getQuery(auth.token)
|
|
|
.then(r => {
|
|
|
- navigate('/dashboard/resultados/' + props.pwd)
|
|
|
+ console.log("SENDING ID:", pwd)
|
|
|
+ setId(pwd)()
|
|
|
+ // console.log('RESULTADO:',r)
|
|
|
+ // navigate('/dashboard/resultados/' + props.pwd)
|
|
|
})
|
|
|
.catch(e => {
|
|
|
// navigate('/dashboard/resultados/' + props.pwd)
|
|
|
@@ -64,7 +69,7 @@ function IconStatus(props) {
|
|
|
|
|
|
|
|
|
|
|
|
-function getOperation(estado, SuperPWD) {
|
|
|
+function getOperation(estado, SuperPWD,setId) {
|
|
|
// Patrik: 100 -> Significa que el examen esta completo
|
|
|
// Patrik: 99 -> Que el candidato lo esta haciendo (como "doing test" del otro servicio)
|
|
|
// Patrik: 97 -> Que hay un error y que hay mas respuestas de las que deberian
|
|
|
@@ -77,7 +82,7 @@ function getOperation(estado, SuperPWD) {
|
|
|
case 99: // el candidato se encuentra realizndolo
|
|
|
return <IconStatus color="#f5f511" icon={AssignmentTurnedInIcon} message="El candidato se encuentra realizando la prueba" />
|
|
|
case 100: // finalizado
|
|
|
- return <IconStatus color="#0bd641" estado={100} icon={CheckBoxIcon} message="Calificar el examen" pwd={SuperPWD} />
|
|
|
+ return <IconStatus setId={setId} color="#0bd641" estado={100} icon={CheckBoxIcon} message="Calificar el examen" pwd={SuperPWD} />
|
|
|
default: return null
|
|
|
}
|
|
|
}
|
|
|
@@ -85,7 +90,8 @@ function getOperation(estado, SuperPWD) {
|
|
|
|
|
|
function Asignaciones(props) {
|
|
|
|
|
|
- let { estado, cattest, id: SuperPWD } = props.asign;
|
|
|
+ let { asign, setId } = props;
|
|
|
+ let { estado, cattest, id: SuperPWD } = asign;
|
|
|
|
|
|
return (
|
|
|
<tr>
|
|
|
@@ -106,7 +112,7 @@ function Asignaciones(props) {
|
|
|
) : null
|
|
|
*/}
|
|
|
{
|
|
|
- getOperation(estado, SuperPWD)
|
|
|
+ getOperation(estado, SuperPWD, setId)
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
|
@@ -117,8 +123,8 @@ function Asignaciones(props) {
|
|
|
|
|
|
|
|
|
export function DenseTable(props) {
|
|
|
- let { users} = props
|
|
|
- console.log("users", users)
|
|
|
+ let { users,setId } = props
|
|
|
+ // console.log("users", users)
|
|
|
return (
|
|
|
<TableContainer component={Paper}>
|
|
|
<Table sx={{ minWidth: 650 }} size="small" aria-label="a dense table">
|
|
|
@@ -138,7 +144,7 @@ export function DenseTable(props) {
|
|
|
{row.candi.nombre + " " + row.candi.apellidos}
|
|
|
</TableCell>
|
|
|
<TableCell align="left">
|
|
|
- {row.asignaciones.map(a => <Asignaciones key={a.id} asign={a}/>)}
|
|
|
+ {row.asignaciones.map(a => <Asignaciones setId={setId} key={a.id} asign={a}/>)}
|
|
|
</TableCell>
|
|
|
</TableRow>
|
|
|
))}
|