|
@@ -7,7 +7,7 @@ import TableHead from '@mui/material/TableHead';
|
7
|
7
|
import TableRow from '@mui/material/TableRow';
|
8
|
8
|
import Paper from '@mui/material/Paper';
|
9
|
9
|
import { } from '@mui/material'
|
10
|
|
-import { useNavigate } from 'react-router-dom'
|
|
10
|
+// import { useNavigate } from 'react-router-dom'
|
11
|
11
|
import { useSelector } from 'react-redux';
|
12
|
12
|
import { Service } from './Utils/HTTP';
|
13
|
13
|
|
|
@@ -27,7 +27,9 @@ import {
|
27
|
27
|
|
28
|
28
|
function IconStatus(props) {
|
29
|
29
|
|
30
|
|
- let navigate = useNavigate()
|
|
30
|
+ let { pwd, setId } = props
|
|
31
|
+ // let navigate = useNavigate()
|
|
32
|
+ // console.log('MPROP',props)
|
31
|
33
|
let auth = useSelector((state) => state.token)
|
32
|
34
|
|
33
|
35
|
const calificar = () => {
|
|
@@ -36,7 +38,10 @@ function IconStatus(props) {
|
36
|
38
|
rest
|
37
|
39
|
.getQuery(auth.token)
|
38
|
40
|
.then(r => {
|
39
|
|
- navigate('/dashboard/resultados/' + props.pwd)
|
|
41
|
+ console.log("SENDING ID:", pwd)
|
|
42
|
+ setId(pwd)()
|
|
43
|
+ // console.log('RESULTADO:',r)
|
|
44
|
+ // navigate('/dashboard/resultados/' + props.pwd)
|
40
|
45
|
})
|
41
|
46
|
.catch(e => {
|
42
|
47
|
// navigate('/dashboard/resultados/' + props.pwd)
|
|
@@ -64,7 +69,7 @@ function IconStatus(props) {
|
64
|
69
|
|
65
|
70
|
|
66
|
71
|
|
67
|
|
-function getOperation(estado, SuperPWD) {
|
|
72
|
+function getOperation(estado, SuperPWD,setId) {
|
68
|
73
|
// Patrik: 100 -> Significa que el examen esta completo
|
69
|
74
|
// Patrik: 99 -> Que el candidato lo esta haciendo (como "doing test" del otro servicio)
|
70
|
75
|
// Patrik: 97 -> Que hay un error y que hay mas respuestas de las que deberian
|
|
@@ -77,7 +82,7 @@ function getOperation(estado, SuperPWD) {
|
77
|
82
|
case 99: // el candidato se encuentra realizndolo
|
78
|
83
|
return <IconStatus color="#f5f511" icon={AssignmentTurnedInIcon} message="El candidato se encuentra realizando la prueba" />
|
79
|
84
|
case 100: // finalizado
|
80
|
|
- return <IconStatus color="#0bd641" estado={100} icon={CheckBoxIcon} message="Calificar el examen" pwd={SuperPWD} />
|
|
85
|
+ return <IconStatus setId={setId} color="#0bd641" estado={100} icon={CheckBoxIcon} message="Calificar el examen" pwd={SuperPWD} />
|
81
|
86
|
default: return null
|
82
|
87
|
}
|
83
|
88
|
}
|
|
@@ -85,7 +90,8 @@ function getOperation(estado, SuperPWD) {
|
85
|
90
|
|
86
|
91
|
function Asignaciones(props) {
|
87
|
92
|
|
88
|
|
- let { estado, cattest, id: SuperPWD } = props.asign;
|
|
93
|
+ let { asign, setId } = props;
|
|
94
|
+ let { estado, cattest, id: SuperPWD } = asign;
|
89
|
95
|
|
90
|
96
|
return (
|
91
|
97
|
<tr>
|
|
@@ -106,7 +112,7 @@ function Asignaciones(props) {
|
106
|
112
|
) : null
|
107
|
113
|
*/}
|
108
|
114
|
{
|
109
|
|
- getOperation(estado, SuperPWD)
|
|
115
|
+ getOperation(estado, SuperPWD, setId)
|
110
|
116
|
}
|
111
|
117
|
</td>
|
112
|
118
|
</tr>
|
|
@@ -117,8 +123,8 @@ function Asignaciones(props) {
|
117
|
123
|
|
118
|
124
|
|
119
|
125
|
export function DenseTable(props) {
|
120
|
|
- let { users} = props
|
121
|
|
- console.log("users", users)
|
|
126
|
+ let { users,setId } = props
|
|
127
|
+ // console.log("users", users)
|
122
|
128
|
return (
|
123
|
129
|
<TableContainer component={Paper}>
|
124
|
130
|
<Table sx={{ minWidth: 650 }} size="small" aria-label="a dense table">
|
|
@@ -138,7 +144,7 @@ export function DenseTable(props) {
|
138
|
144
|
{row.candi.nombre + " " + row.candi.apellidos}
|
139
|
145
|
</TableCell>
|
140
|
146
|
<TableCell align="left">
|
141
|
|
- {row.asignaciones.map(a => <Asignaciones key={a.id} asign={a}/>)}
|
|
147
|
+ {row.asignaciones.map(a => <Asignaciones setId={setId} key={a.id} asign={a}/>)}
|
142
|
148
|
</TableCell>
|
143
|
149
|
</TableRow>
|
144
|
150
|
))}
|