|
@@ -2,7 +2,7 @@ import React from 'react'
|
2
|
2
|
import {
|
3
|
3
|
Skeleton, Box, IconButton, TableCell, TableContainer,
|
4
|
4
|
Table, TableRow, Paper, TableBody,
|
5
|
|
- Tooltip,Button
|
|
5
|
+ Tooltip, Button
|
6
|
6
|
} from '@mui/material';
|
7
|
7
|
import {
|
8
|
8
|
CheckBox as CheckBoxIcon,
|
|
@@ -11,15 +11,46 @@ import {
|
11
|
11
|
Error as ErrorIcon,
|
12
|
12
|
AssignmentTurnedIn as AssignmentTurnedInIcon
|
13
|
13
|
} from '@mui/icons-material'
|
14
|
|
-// import { useNavigate } from 'react-router-dom'
|
|
14
|
+import { useNavigate } from 'react-router-dom'
|
15
|
15
|
|
16
|
16
|
import { Col, Row } from 'react-bootstrap'
|
|
17
|
+import { useSelector } from 'react-redux';
|
|
18
|
+import { Service } from '../../Utils/HTTP';
|
17
|
19
|
const big_as = 70
|
18
|
20
|
|
|
21
|
+
|
19
|
22
|
function IconStatus(props) {
|
|
23
|
+
|
|
24
|
+ let navigate = useNavigate()
|
|
25
|
+ let auth = useSelector((state) => state.token)
|
|
26
|
+
|
|
27
|
+ console.log(props)
|
|
28
|
+ const calificar = () => {
|
|
29
|
+ console.log('TOKEN: ',auth.token)
|
|
30
|
+ let rest = new Service(`/prueba/calificacion/cleaver/report/${props.pwd}`);
|
|
31
|
+
|
|
32
|
+ rest
|
|
33
|
+ .getQuery(auth.token)
|
|
34
|
+ .then(r => {
|
|
35
|
+ console.log("SUCCESS:", r)
|
|
36
|
+ navigate('/dashboard/resultados/' + props.pwd)
|
|
37
|
+ })
|
|
38
|
+ .catch(e => {
|
|
39
|
+ console.log("ERROR:", e.message)
|
|
40
|
+ // navigate('/dashboard/resultados/' + props.pwd)
|
|
41
|
+ })
|
|
42
|
+ }
|
|
43
|
+
|
|
44
|
+
|
20
|
45
|
return (
|
21
|
46
|
<Tooltip title={props.message}>
|
22
|
47
|
<IconButton
|
|
48
|
+ onClick={() => {
|
|
49
|
+ if (parseInt(props.estado) === 100) {
|
|
50
|
+ calificar()
|
|
51
|
+ // navigate('/dashboard/resultados/' + props.pwd)
|
|
52
|
+ }
|
|
53
|
+ }}
|
23
|
54
|
style={{ color: '#0bd641' }}
|
24
|
55
|
components="label">
|
25
|
56
|
{<props.icon />}
|
|
@@ -29,7 +60,7 @@ function IconStatus(props) {
|
29
|
60
|
)
|
30
|
61
|
}
|
31
|
62
|
|
32
|
|
-function getOperation(estado) {
|
|
63
|
+function getOperation(estado, SuperPWD) {
|
33
|
64
|
// Patrik: 100 -> Significa que el examen esta completo
|
34
|
65
|
// Patrik: 99 -> Que el candidato lo esta haciendo (como "doing test" del otro servicio)
|
35
|
66
|
// Patrik: 97 -> Que hay un error y que hay mas respuestas de las que deberian
|
|
@@ -42,16 +73,15 @@ function getOperation(estado) {
|
42
|
73
|
case 99: // el candidato se encuentra realizndolo
|
43
|
74
|
return <IconStatus icon={AssignmentTurnedInIcon} message="El candidato se encuentra realizando la prueba" />
|
44
|
75
|
case 100: // finalizado
|
45
|
|
- return <IconStatus icon={CheckBoxIcon} message="Calificar el examen" />
|
|
76
|
+ return <IconStatus estado={100} icon={CheckBoxIcon} message="Calificar el examen" pwd={SuperPWD} />
|
46
|
77
|
default: return null
|
47
|
78
|
}
|
48
|
79
|
}
|
49
|
80
|
|
50
|
81
|
function Asignaciones(props) {
|
51
|
82
|
|
52
|
|
- // let navigate = useNavigate()
|
53
|
83
|
let { estado, cattest, calificacionescleaver: test_result, id: SuperPWD } = props.asign;
|
54
|
|
- console.log(props,test_result,SuperPWD)
|
|
84
|
+ console.log(props, test_result, SuperPWD)
|
55
|
85
|
|
56
|
86
|
return (
|
57
|
87
|
<tr>
|
|
@@ -72,7 +102,7 @@ function Asignaciones(props) {
|
72
|
102
|
) : null
|
73
|
103
|
*/}
|
74
|
104
|
{
|
75
|
|
- getOperation(estado)
|
|
105
|
+ getOperation(estado, SuperPWD)
|
76
|
106
|
}
|
77
|
107
|
</td>
|
78
|
108
|
</tr>
|
|
@@ -124,9 +154,9 @@ export function Candidato(props) {
|
124
|
154
|
<div className="data_candidato">
|
125
|
155
|
<Row>
|
126
|
156
|
|
127
|
|
- <Col className="pwd_info"pwd_name_candi onClick={props.onClick} md="3" sm="12">
|
|
157
|
+ <Col className="pwd_info pwd_name_candi" onClick={props.onClick} md="3" sm="12">
|
128
|
158
|
<Button className="btn_pwd" variant="contained">
|
129
|
|
- <u><p><b style={{color:'white'}}>{password?.toUpperCase()}</b></p></u>
|
|
159
|
+ <u><p><b style={{ color: 'white' }}>{password?.toUpperCase()}</b></p></u>
|
130
|
160
|
</Button>
|
131
|
161
|
</Col>
|
132
|
162
|
|