|
@@ -5,9 +5,6 @@ import {
|
5
|
5
|
IonTitle,
|
6
|
6
|
IonToolbar,
|
7
|
7
|
IonFooter,
|
8
|
|
- IonNavLink,
|
9
|
|
- IonTabButton,
|
10
|
|
- IonIcon,
|
11
|
8
|
IonImg,
|
12
|
9
|
IonItem,
|
13
|
10
|
IonLabel,
|
|
@@ -21,34 +18,314 @@ import {
|
21
|
18
|
IonGrid,
|
22
|
19
|
IonRow,
|
23
|
20
|
IonCol,
|
|
21
|
+ IonButtons,
|
|
22
|
+ IonBackButton,
|
|
23
|
+ useIonViewWillEnter,
|
24
|
24
|
IonRadioGroup,
|
25
|
|
- IonRadio
|
|
25
|
+ IonRadio,
|
|
26
|
+ IonIcon,
|
|
27
|
+ IonChip
|
26
|
28
|
} from '@ionic/react';
|
27
|
|
-import { arrowBack } from 'ionicons/icons';
|
28
|
|
-import React, {useState} from 'react';
|
29
|
|
-//import { Form } from 'react-bootstrap';
|
|
29
|
+import { useParams } from 'react-router';
|
|
30
|
+import React, { useState } from 'react';
|
30
|
31
|
import './Questions.css';
|
31
|
|
-import Biography from './Biography';
|
32
|
32
|
import EnciclopediaPR from '../assets/EnciclopediaPR.png';
|
33
|
33
|
import RobertoClemente from '../assets/RobertoClemente.jpg';
|
34
|
|
-import Quizzes from '../data/Quizzes.json';
|
|
34
|
+import { QuizInfo, getQuiz } from '../data/QuizInfo';
|
|
35
|
+import { thumbsDown, thumbsUp } from 'ionicons/icons';
|
35
|
36
|
|
36
|
37
|
|
37
|
38
|
const Questions: React.FC = () => {
|
|
39
|
+ // Estados para respuestas seleccionadas
|
|
40
|
+ const [qres1, setQRes1] = useState();
|
|
41
|
+ const [qres2, setQRes2] = useState();
|
|
42
|
+ const [qres3, setQRes3] = useState();
|
|
43
|
+ const [qres4, setQRes4] = useState();
|
|
44
|
+
|
|
45
|
+ // Arreglos para saber cual radio se selecciono en cada pregunta
|
|
46
|
+ const selected1:boolean[] = [false, false, false, false];
|
|
47
|
+ const selected2:boolean[] = [false, false, false, false];
|
|
48
|
+ const selected3:boolean[] = [false, false, false, false];
|
|
49
|
+ const selected4:boolean[] = [false, false, false, false];
|
|
50
|
+
|
|
51
|
+ // Estados para seleccionar iconos de las respuestas seleccionadas
|
|
52
|
+ const [icon11, setIcon11] = useState<any>();
|
|
53
|
+ const [icon12, setIcon12] = useState<any>();
|
|
54
|
+ const [icon13, setIcon13] = useState<any>();
|
|
55
|
+ const [icon14, setIcon14] = useState<any>();
|
|
56
|
+
|
|
57
|
+ const [icon21, setIcon21] = useState<any>();
|
|
58
|
+ const [icon22, setIcon22] = useState<any>();
|
|
59
|
+ const [icon23, setIcon23] = useState<any>();
|
|
60
|
+ const [icon24, setIcon24] = useState<any>();
|
|
61
|
+
|
|
62
|
+ const [icon31, setIcon31] = useState<any>();
|
|
63
|
+ const [icon32, setIcon32] = useState<any>();
|
|
64
|
+ const [icon33, setIcon33] = useState<any>();
|
|
65
|
+ const [icon34, setIcon34] = useState<any>();
|
38
|
66
|
|
39
|
|
- const [res1, setRes1] = useState();
|
40
|
|
- const [res2, setRes2] = useState();
|
41
|
|
- const [res3, setRes3] = useState();
|
42
|
|
- const [res4, setRes4] = useState();
|
|
67
|
+ const [icon41, setIcon41] = useState<any>();
|
|
68
|
+ const [icon42, setIcon42] = useState<any>();
|
|
69
|
+ const [icon43, setIcon43] = useState<any>();
|
|
70
|
+ const [icon44, setIcon44] = useState<any>();
|
43
|
71
|
|
|
72
|
+ // Estado para contar cuantas preguntas correctas se obtuvieron
|
|
73
|
+ const [countres, setCountRes] = useState<number>(0);
|
|
74
|
+
|
|
75
|
+ const [verResPresionado, setVerResPresionado] = useState<boolean>(false);
|
|
76
|
+
|
|
77
|
+ /* verificarRes()
|
|
78
|
+ Funcion se encarga de verificar si las respuestas seleccionadas
|
|
79
|
+ son correctas. Despliega ThumbsUp para seleccion correcta,
|
|
80
|
+ ThumbsDowmn para seleccion incorrecta.
|
|
81
|
+ */
|
44
|
82
|
const verificarRes = () => {
|
45
|
|
- return console.log([res1, res2, res3, res4])
|
|
83
|
+ // borrar console logs para el release
|
|
84
|
+ console.log([qres1, qres2, qres3, qres4]);
|
|
85
|
+ console.log(countres);
|
|
86
|
+
|
|
87
|
+ // reset a los icons, count y acertadas por si hubo seleccion anterior
|
|
88
|
+ let count = 0;
|
|
89
|
+ setCountRes(count);
|
|
90
|
+ setVerResPresionado(true);
|
|
91
|
+
|
|
92
|
+ setIcon11(null);
|
|
93
|
+ setIcon12(null);
|
|
94
|
+ setIcon13(null);
|
|
95
|
+ setIcon14(null);
|
|
96
|
+
|
|
97
|
+ setIcon21(null);
|
|
98
|
+ setIcon22(null);
|
|
99
|
+ setIcon23(null);
|
|
100
|
+ setIcon24(null);
|
|
101
|
+
|
|
102
|
+ setIcon31(null);
|
|
103
|
+ setIcon32(null);
|
|
104
|
+ setIcon33(null);
|
|
105
|
+ setIcon34(null);
|
|
106
|
+
|
|
107
|
+ setIcon41(null);
|
|
108
|
+ setIcon42(null);
|
|
109
|
+ setIcon43(null);
|
|
110
|
+ setIcon44(null);
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+ // loop para saber que radio escogio el usuario en cada pregunta
|
|
114
|
+ let num: number = 0;
|
|
115
|
+ let i: number;
|
|
116
|
+ for(i = num; i<4; i++){
|
|
117
|
+ if(qres1 === quizInfo?.res1[i]){
|
|
118
|
+ selected1[i] = true;
|
|
119
|
+ }
|
|
120
|
+
|
|
121
|
+ if(qres2 === quizInfo?.res2[i]){
|
|
122
|
+ selected2[i] = true;
|
|
123
|
+ }
|
|
124
|
+
|
|
125
|
+ if(qres3 === quizInfo?.res3[i]){
|
|
126
|
+ selected3[i] = true;
|
|
127
|
+ }
|
|
128
|
+
|
|
129
|
+ if(qres4 === quizInfo?.res4[i]){
|
|
130
|
+ selected4[i] = true;
|
|
131
|
+ }
|
|
132
|
+
|
|
133
|
+ }
|
|
134
|
+
|
|
135
|
+ // Para seleccionar si sale icono correccto o incorrecto en seleccion
|
|
136
|
+ // de radio.
|
|
137
|
+
|
|
138
|
+ // ======================= PREGUNTA 1 =========================================
|
|
139
|
+ // SI usuario seleccionio el primer radio en la pregunta 1
|
|
140
|
+ if(selected1[0] && quizInfo?.res1[0] === quizInfo?.correcta1){
|
|
141
|
+ setIcon11(<IonIcon icon={thumbsUp} />);
|
|
142
|
+ //setCountRes(countres + 1);
|
|
143
|
+ count++;
|
|
144
|
+ }
|
|
145
|
+ else if (selected1[0] && quizInfo?.res1[0] !== quizInfo?.correcta1){
|
|
146
|
+ setIcon11(<IonIcon icon={thumbsDown} />)
|
|
147
|
+ }
|
|
148
|
+
|
|
149
|
+ // SI usuario seleccionio el segundo radio en la pregunta 1
|
|
150
|
+ if(selected1[1] && quizInfo?.res1[1] === quizInfo?.correcta1){
|
|
151
|
+ setIcon12(<IonIcon icon={thumbsUp} />);
|
|
152
|
+ //setCountRes(countres + 1);
|
|
153
|
+ count++;
|
|
154
|
+ }
|
|
155
|
+ else if (selected1[1] && quizInfo?.res1[1] !== quizInfo?.correcta1){
|
|
156
|
+ setIcon12(<IonIcon icon={thumbsDown} />)
|
|
157
|
+ }
|
|
158
|
+
|
|
159
|
+ // SI usuario seleccionio el tercer radio en la pregunta 1
|
|
160
|
+ if(selected1[2] && quizInfo?.res1[2] === quizInfo?.correcta1){
|
|
161
|
+ setIcon13(<IonIcon icon={thumbsUp} />);
|
|
162
|
+ //setCountRes(countres + 1);
|
|
163
|
+ count++;
|
|
164
|
+ }
|
|
165
|
+ else if (selected1[2] && quizInfo?.res1[2] !== quizInfo?.correcta1){
|
|
166
|
+ setIcon13(<IonIcon icon={thumbsDown} />)
|
|
167
|
+ }
|
|
168
|
+
|
|
169
|
+ // SI usuario seleccionio el cuarto radio en la pregunta 1
|
|
170
|
+ if(selected1[3] && quizInfo?.res1[3] === quizInfo?.correcta1){
|
|
171
|
+ setIcon14(<IonIcon icon={thumbsUp} />);
|
|
172
|
+ //setCountRes(countres + 1);
|
|
173
|
+ count++;
|
|
174
|
+ }
|
|
175
|
+ else if (selected1[3] && quizInfo?.res1[3] !== quizInfo?.correcta1){
|
|
176
|
+ setIcon14(<IonIcon icon={thumbsDown} />)
|
|
177
|
+ }
|
|
178
|
+ // ======================= PREGUNTA 1 =========================================
|
|
179
|
+
|
|
180
|
+ // ======================= PREGUNTA 2 =========================================
|
|
181
|
+
|
|
182
|
+ // SI usuario seleccionio el primer radio en la pregunta 2
|
|
183
|
+ if(selected2[0] && quizInfo?.res2[0] === quizInfo?.correcta2){
|
|
184
|
+ setIcon21(<IonIcon icon={thumbsUp} />);
|
|
185
|
+ //setCountRes(countres + 1);
|
|
186
|
+ count++;
|
|
187
|
+ }
|
|
188
|
+ else if (selected2[0] && quizInfo?.res2[0] !== quizInfo?.correcta2){
|
|
189
|
+ setIcon21(<IonIcon icon={thumbsDown} />)
|
|
190
|
+ }
|
|
191
|
+
|
|
192
|
+ // SI usuario seleccionio el segundo radio en la pregunta 2
|
|
193
|
+ if(selected2[1] && quizInfo?.res2[1] === quizInfo?.correcta2){
|
|
194
|
+ setIcon22(<IonIcon icon={thumbsUp} />);
|
|
195
|
+ //setCountRes(countres + 1);
|
|
196
|
+ count++;
|
|
197
|
+ }
|
|
198
|
+ else if (selected2[1] && quizInfo?.res2[1] !== quizInfo?.correcta2){
|
|
199
|
+ setIcon22(<IonIcon icon={thumbsDown} />)
|
|
200
|
+ }
|
|
201
|
+
|
|
202
|
+ // SI usuario seleccionio el tercer radio en la pregunta 2
|
|
203
|
+ if(selected2[2] && quizInfo?.res2[2] === quizInfo?.correcta2){
|
|
204
|
+ setIcon23(<IonIcon icon={thumbsUp} />);
|
|
205
|
+ //setCountRes(countres + 1);
|
|
206
|
+ count++;
|
|
207
|
+ }
|
|
208
|
+ else if (selected2[2] && quizInfo?.res2[2] !== quizInfo?.correcta2){
|
|
209
|
+ setIcon23(<IonIcon icon={thumbsDown} />)
|
|
210
|
+ }
|
|
211
|
+
|
|
212
|
+ // SI usuario seleccionio el cuarto radio en la pregunta 2
|
|
213
|
+ if(selected2[3] && quizInfo?.res2[3] === quizInfo?.correcta2){
|
|
214
|
+ setIcon24(<IonIcon icon={thumbsUp} />);
|
|
215
|
+ //setCountRes(countres + 1);
|
|
216
|
+ count++;
|
|
217
|
+ }
|
|
218
|
+ else if (selected2[3] && quizInfo?.res2[3] !== quizInfo?.correcta2){
|
|
219
|
+ setIcon24(<IonIcon icon={thumbsDown} />)
|
|
220
|
+ }
|
|
221
|
+
|
|
222
|
+ // ======================= PREGUNTA 2 =========================================
|
|
223
|
+
|
|
224
|
+ // ======================= PREGUNTA 3 =========================================
|
|
225
|
+
|
|
226
|
+ // SI usuario seleccionio el primer radio en la pregunta 3
|
|
227
|
+ if(selected3[0] && quizInfo?.res3[0] === quizInfo?.correcta3){
|
|
228
|
+ setIcon31(<IonIcon icon={thumbsUp} />);
|
|
229
|
+ //setCountRes(countres + 1);
|
|
230
|
+ count++;
|
|
231
|
+ }
|
|
232
|
+ else if (selected3[0] && quizInfo?.res3[0] !== quizInfo?.correcta3){
|
|
233
|
+ setIcon31(<IonIcon icon={thumbsDown} />)
|
|
234
|
+ }
|
|
235
|
+
|
|
236
|
+ // SI usuario seleccionio el segundo radio en la pregunta 3
|
|
237
|
+ if(selected3[1] && quizInfo?.res3[1] === quizInfo?.correcta3){
|
|
238
|
+ setIcon32(<IonIcon icon={thumbsUp} />);
|
|
239
|
+ //setCountRes(countres + 1);
|
|
240
|
+ count++;
|
|
241
|
+ }
|
|
242
|
+ else if (selected3[1] && quizInfo?.res3[1] !== quizInfo?.correcta3){
|
|
243
|
+ setIcon32(<IonIcon icon={thumbsDown} />)
|
|
244
|
+ }
|
|
245
|
+
|
|
246
|
+ // SI usuario seleccionio el tercer radio en la pregunta 3
|
|
247
|
+ if(selected3[2] && quizInfo?.res3[2] === quizInfo?.correcta3){
|
|
248
|
+ setIcon33(<IonIcon icon={thumbsUp} />);
|
|
249
|
+ //setCountRes(countres + 1);
|
|
250
|
+ count++;
|
|
251
|
+ }
|
|
252
|
+ else if (selected3[2] && quizInfo?.res3[2] !== quizInfo?.correcta3){
|
|
253
|
+ setIcon33(<IonIcon icon={thumbsDown} />)
|
|
254
|
+ }
|
|
255
|
+
|
|
256
|
+ // SI usuario seleccionio el cuerto radio en la pregunta 3
|
|
257
|
+ if(selected3[3] && quizInfo?.res3[3] === quizInfo?.correcta3){
|
|
258
|
+ setIcon34(<IonIcon icon={thumbsUp} />);
|
|
259
|
+ //setCountRes(countres + 1);
|
|
260
|
+ count++;
|
|
261
|
+ }
|
|
262
|
+ else if (selected3[3] && quizInfo?.res3[3] !== quizInfo?.correcta3){
|
|
263
|
+ setIcon34(<IonIcon icon={thumbsDown} />)
|
|
264
|
+ }
|
|
265
|
+
|
|
266
|
+ // ======================= PREGUNTA 3 =========================================
|
|
267
|
+
|
|
268
|
+ // ======================= PREGUNTA 4 =========================================
|
|
269
|
+
|
|
270
|
+ // SI usuario seleccionio el primer radio en la pregunta 4
|
|
271
|
+ if(selected4[0] && quizInfo?.res4[0] === quizInfo?.correcta4){
|
|
272
|
+ setIcon41(<IonIcon icon={thumbsUp} />);
|
|
273
|
+ //setCountRes(countres + 1);
|
|
274
|
+ count++;
|
|
275
|
+ }
|
|
276
|
+ else if (selected4[0] && quizInfo?.res4[0] !== quizInfo?.correcta4){
|
|
277
|
+ setIcon41(<IonIcon icon={thumbsDown} />)
|
|
278
|
+ }
|
|
279
|
+
|
|
280
|
+ // SI usuario seleccionio el segundo radio en la pregunta 4
|
|
281
|
+ if(selected4[1] && quizInfo?.res4[1] === quizInfo?.correcta4){
|
|
282
|
+ setIcon42(<IonIcon icon={thumbsUp} />);
|
|
283
|
+ //setCountRes(countres + 1);
|
|
284
|
+ count++;
|
|
285
|
+ }
|
|
286
|
+ else if (selected4[1] && quizInfo?.res4[1] !== quizInfo?.correcta4){
|
|
287
|
+ setIcon42(<IonIcon icon={thumbsDown} />)
|
|
288
|
+ }
|
|
289
|
+
|
|
290
|
+ // SI usuario seleccionio el tercer radio en la pregunta 4
|
|
291
|
+ if(selected4[2] && quizInfo?.res4[2] === quizInfo?.correcta4){
|
|
292
|
+ setIcon43(<IonIcon icon={thumbsUp} />);
|
|
293
|
+ //setCountRes(countres + 1);
|
|
294
|
+ count++;
|
|
295
|
+ }
|
|
296
|
+ else if (selected4[2] && quizInfo?.res4[2] !== quizInfo?.correcta4){
|
|
297
|
+ setIcon43(<IonIcon icon={thumbsDown} />)
|
|
298
|
+ }
|
|
299
|
+
|
|
300
|
+ // SI usuario seleccionio el cuarto radio en la pregunta 4
|
|
301
|
+ if(selected4[3] && quizInfo?.res4[3] === quizInfo?.correcta4){
|
|
302
|
+ setIcon44(<IonIcon icon={thumbsUp} />);
|
|
303
|
+ //setCountRes(countres + 1);
|
|
304
|
+ count++;
|
|
305
|
+ }
|
|
306
|
+ else if (selected4[3] && quizInfo?.res4[3] !== quizInfo?.correcta4){
|
|
307
|
+ setIcon44(<IonIcon icon={thumbsDown} />)
|
|
308
|
+ }
|
|
309
|
+
|
|
310
|
+ // ======================= PREGUNTA 4 =========================================
|
|
311
|
+
|
|
312
|
+ // Para saber cueantas resspuestas acertó el usuario
|
|
313
|
+ setCountRes(count);
|
46
|
314
|
};
|
|
315
|
+
|
|
316
|
+ // State para desplegar la info del quiz
|
|
317
|
+ const [quizInfo, setQuiz] = useState<QuizInfo>();
|
|
318
|
+ const params = useParams<{ id: string }>();
|
47
|
319
|
|
|
320
|
+ useIonViewWillEnter(() => {
|
|
321
|
+ const quiz = getQuiz(parseInt(params.id, 10));
|
|
322
|
+ setQuiz(quiz);
|
|
323
|
+ });
|
|
324
|
+
|
48
|
325
|
return (
|
49
|
326
|
<IonPage>
|
50
|
327
|
<IonHeader>
|
51
|
|
- <IonToolbar>
|
|
328
|
+ <IonToolbar className="Header-Color">
|
52
|
329
|
<IonGrid fixed={true}>
|
53
|
330
|
<IonRow>
|
54
|
331
|
<IonCol></IonCol>
|
|
@@ -61,44 +338,47 @@ const Questions: React.FC = () => {
|
61
|
338
|
</IonGrid>
|
62
|
339
|
</IonToolbar>
|
63
|
340
|
</IonHeader>
|
64
|
|
-
|
|
341
|
+
|
65
|
342
|
<IonContent fullscreen className="ion-padding">
|
66
|
343
|
<IonImg style={{ height: 300, width: 600 }} src={RobertoClemente} alt='Logo'></IonImg>
|
67
|
344
|
|
68
|
345
|
{
|
69
|
|
- Quizzes && Quizzes.map(quizzes => {
|
70
|
|
- return (
|
71
|
|
- quizzes.id == 1 ? <>
|
72
|
|
- <h1>Quiz sobre la biografia de {quizzes.title}</h1>
|
|
346
|
+ quizInfo ?
|
|
347
|
+ <>
|
|
348
|
+ <h1>Quiz sobre la biografia de {quizInfo.title}</h1>
|
73
|
349
|
|
74
|
350
|
<p>Marque una respuesta por pregunta</p>
|
75
|
351
|
|
76
|
352
|
<IonCard>
|
77
|
353
|
<IonCardHeader>
|
78
|
|
- <IonCardTitle>{quizzes['pregunta-1']}</IonCardTitle>
|
|
354
|
+ <IonCardTitle>{quizInfo.pregunta1}</IonCardTitle>
|
79
|
355
|
<IonCardSubtitle></IonCardSubtitle>
|
80
|
356
|
</IonCardHeader>
|
81
|
357
|
<IonCardContent>
|
82
|
358
|
<IonList>
|
83
|
|
- <IonRadioGroup value={res1} onIonChange={(e) => setRes1(e.detail.value)}>
|
|
359
|
+ <IonRadioGroup value={qres1} onIonChange={(e) => setQRes1(e.detail.value)}>
|
84
|
360
|
<IonItem>
|
85
|
|
- <IonLabel>{quizzes['res-1-1']}</IonLabel>
|
86
|
|
- <IonRadio slot="end" value={quizzes['res-1-1']}></IonRadio>
|
|
361
|
+ <IonLabel>{quizInfo.res1[0]}</IonLabel>
|
|
362
|
+ <IonRadio slot="end" value={quizInfo.res1[0]}></IonRadio>
|
|
363
|
+ {icon11}
|
87
|
364
|
</IonItem>
|
88
|
365
|
|
89
|
366
|
<IonItem>
|
90
|
|
- <IonLabel>{quizzes['res-1-2']}</IonLabel>
|
91
|
|
- <IonRadio slot="end" value={quizzes['res-1-2']}></IonRadio>
|
|
367
|
+ <IonLabel>{quizInfo.res1[1]}</IonLabel>
|
|
368
|
+ <IonRadio slot="end" value={quizInfo.res1[1]}></IonRadio>
|
|
369
|
+ {icon12}
|
92
|
370
|
</IonItem>
|
93
|
371
|
|
94
|
372
|
<IonItem>
|
95
|
|
- <IonLabel>{quizzes['res-1-3']}</IonLabel>
|
96
|
|
- <IonRadio slot="end" value={quizzes['res-1-3']}></IonRadio>
|
|
373
|
+ <IonLabel>{quizInfo.res1[2]}</IonLabel>
|
|
374
|
+ <IonRadio slot="end" value={quizInfo.res1[2]}></IonRadio>
|
|
375
|
+ {icon13}
|
97
|
376
|
</IonItem>
|
98
|
377
|
|
99
|
378
|
<IonItem>
|
100
|
|
- <IonLabel>{quizzes['res-1-4']}</IonLabel>
|
101
|
|
- <IonRadio slot="end" value={quizzes['res-1-4']}></IonRadio>
|
|
379
|
+ <IonLabel>{quizInfo.res1[3]}</IonLabel>
|
|
380
|
+ <IonRadio slot="end" value={quizInfo.res1[3]}></IonRadio>
|
|
381
|
+ {icon14}
|
102
|
382
|
</IonItem>
|
103
|
383
|
</IonRadioGroup>
|
104
|
384
|
</IonList>
|
|
@@ -107,30 +387,34 @@ const Questions: React.FC = () => {
|
107
|
387
|
|
108
|
388
|
<IonCard>
|
109
|
389
|
<IonCardHeader>
|
110
|
|
- <IonCardTitle>{quizzes['pregunta-2']}</IonCardTitle>
|
|
390
|
+ <IonCardTitle>{quizInfo.pregunta2}</IonCardTitle>
|
111
|
391
|
<IonCardSubtitle></IonCardSubtitle>
|
112
|
392
|
</IonCardHeader>
|
113
|
393
|
<IonCardContent>
|
114
|
394
|
<IonList>
|
115
|
|
- <IonRadioGroup value={res2} onIonChange={(e) => setRes2(e.detail.value)}>
|
|
395
|
+ <IonRadioGroup value={qres2} onIonChange={(e) => setQRes2(e.detail.value)}>
|
116
|
396
|
<IonItem>
|
117
|
|
- <IonLabel>{quizzes['res-2-1']}</IonLabel>
|
118
|
|
- <IonRadio slot="end" value={quizzes['res-2-1']}></IonRadio>
|
|
397
|
+ <IonLabel>{quizInfo.res2[0]}</IonLabel>
|
|
398
|
+ <IonRadio slot="end" value={quizInfo.res2[0]}></IonRadio>
|
|
399
|
+ {icon21}
|
119
|
400
|
</IonItem>
|
120
|
401
|
|
121
|
402
|
<IonItem>
|
122
|
|
- <IonLabel>{quizzes['res-2-2']}</IonLabel>
|
123
|
|
- <IonRadio slot="end" value={quizzes['res-2-2']}></IonRadio>
|
|
403
|
+ <IonLabel>{quizInfo.res2[1]}</IonLabel>
|
|
404
|
+ <IonRadio slot="end" value={quizInfo.res2[1]}></IonRadio>
|
|
405
|
+ {icon22}
|
124
|
406
|
</IonItem>
|
125
|
407
|
|
126
|
408
|
<IonItem>
|
127
|
|
- <IonLabel>{quizzes['res-2-3']}</IonLabel>
|
128
|
|
- <IonRadio slot="end" value={quizzes['res-2-3']}></IonRadio>
|
|
409
|
+ <IonLabel>{quizInfo.res2[2]}</IonLabel>
|
|
410
|
+ <IonRadio slot="end" value={quizInfo.res2[2]}></IonRadio>
|
|
411
|
+ {icon23}
|
129
|
412
|
</IonItem>
|
130
|
413
|
|
131
|
414
|
<IonItem>
|
132
|
|
- <IonLabel>{quizzes['res-2-4']}</IonLabel>
|
133
|
|
- <IonRadio slot="end" value={quizzes['res-2-4']}></IonRadio>
|
|
415
|
+ <IonLabel>{quizInfo.res2[3]}</IonLabel>
|
|
416
|
+ <IonRadio slot="end" value={quizInfo.res2[3]}></IonRadio>
|
|
417
|
+ {icon24}
|
134
|
418
|
</IonItem>
|
135
|
419
|
</IonRadioGroup>
|
136
|
420
|
</IonList>
|
|
@@ -139,30 +423,34 @@ const Questions: React.FC = () => {
|
139
|
423
|
|
140
|
424
|
<IonCard>
|
141
|
425
|
<IonCardHeader>
|
142
|
|
- <IonCardTitle>{quizzes['pregunta-3']}</IonCardTitle>
|
|
426
|
+ <IonCardTitle>{quizInfo.pregunta3}</IonCardTitle>
|
143
|
427
|
<IonCardSubtitle></IonCardSubtitle>
|
144
|
428
|
</IonCardHeader>
|
145
|
429
|
<IonCardContent>
|
146
|
430
|
<IonList>
|
147
|
|
- <IonRadioGroup value={res3} onIonChange={(e) => setRes3(e.detail.value)}>
|
|
431
|
+ <IonRadioGroup value={qres3} onIonChange={(e) => setQRes3(e.detail.value)}>
|
148
|
432
|
<IonItem>
|
149
|
|
- <IonLabel>{quizzes['res-3-1']}</IonLabel>
|
150
|
|
- <IonRadio slot="end" value={quizzes['res-3-1']}></IonRadio>
|
|
433
|
+ <IonLabel>{quizInfo.res3[0]}</IonLabel>
|
|
434
|
+ <IonRadio slot="end" value={quizInfo.res3[0]}></IonRadio>
|
|
435
|
+ {icon31}
|
151
|
436
|
</IonItem>
|
152
|
437
|
|
153
|
438
|
<IonItem>
|
154
|
|
- <IonLabel>{quizzes['res-3-2']}</IonLabel>
|
155
|
|
- <IonRadio slot="end" value={quizzes['res-3-2']}></IonRadio>
|
|
439
|
+ <IonLabel>{quizInfo.res3[1]}</IonLabel>
|
|
440
|
+ <IonRadio slot="end" value={quizInfo.res3[1]}></IonRadio>
|
|
441
|
+ {icon32}
|
156
|
442
|
</IonItem>
|
157
|
443
|
|
158
|
444
|
<IonItem>
|
159
|
|
- <IonLabel>{quizzes['res-3-3']}</IonLabel>
|
160
|
|
- <IonRadio slot="end" value={quizzes['res-3-3']}></IonRadio>
|
|
445
|
+ <IonLabel>{quizInfo.res3[2]}</IonLabel>
|
|
446
|
+ <IonRadio slot="end" value={quizInfo.res3[2]}></IonRadio>
|
|
447
|
+ {icon33}
|
161
|
448
|
</IonItem>
|
162
|
449
|
|
163
|
450
|
<IonItem>
|
164
|
|
- <IonLabel>{quizzes['res-3-4']}</IonLabel>
|
165
|
|
- <IonRadio slot="end" value={quizzes['res-3-4']}></IonRadio>
|
|
451
|
+ <IonLabel>{quizInfo.res3[3]}</IonLabel>
|
|
452
|
+ <IonRadio slot="end" value={quizInfo.res3[3]}></IonRadio>
|
|
453
|
+ {icon34}
|
166
|
454
|
</IonItem>
|
167
|
455
|
</IonRadioGroup>
|
168
|
456
|
</IonList>
|
|
@@ -171,38 +459,50 @@ const Questions: React.FC = () => {
|
171
|
459
|
|
172
|
460
|
<IonCard>
|
173
|
461
|
<IonCardHeader>
|
174
|
|
- <IonCardTitle>{quizzes['pregunta-4']}</IonCardTitle>
|
|
462
|
+ <IonCardTitle>{quizInfo.pregunta4}</IonCardTitle>
|
175
|
463
|
<IonCardSubtitle></IonCardSubtitle>
|
176
|
464
|
</IonCardHeader>
|
177
|
465
|
<IonCardContent>
|
178
|
466
|
<IonList>
|
179
|
|
- <IonRadioGroup value={res4} onIonChange={(e) => setRes4(e.detail.value)}>
|
|
467
|
+ <IonRadioGroup value={qres4} onIonChange={(e) => setQRes4(e.detail.value)}>
|
180
|
468
|
<IonItem>
|
181
|
|
- <IonLabel>{quizzes['res-4-1']}</IonLabel>
|
182
|
|
- <IonRadio slot="end" value={quizzes['res-4-1']}></IonRadio>
|
|
469
|
+ <IonLabel>{quizInfo.res4[0]}</IonLabel>
|
|
470
|
+ <IonRadio slot="end" value={quizInfo.res4[0]}></IonRadio>
|
|
471
|
+ {icon41}
|
183
|
472
|
</IonItem>
|
184
|
473
|
|
185
|
474
|
<IonItem>
|
186
|
|
- <IonLabel>{quizzes['res-4-2']}</IonLabel>
|
187
|
|
- <IonRadio slot="end" value={quizzes['res-4-2']}></IonRadio>
|
|
475
|
+ <IonLabel>{quizInfo.res4[1]}</IonLabel>
|
|
476
|
+ <IonRadio slot="end" value={quizInfo.res4[1]}></IonRadio>
|
|
477
|
+ {icon42}
|
188
|
478
|
</IonItem>
|
189
|
479
|
|
190
|
480
|
<IonItem>
|
191
|
|
- <IonLabel>{quizzes['res-4-3']}</IonLabel>
|
192
|
|
- <IonRadio slot="end" value={quizzes['res-4-3']}></IonRadio>
|
|
481
|
+ <IonLabel>{quizInfo.res4[2]}</IonLabel>
|
|
482
|
+ <IonRadio slot="end" value={quizInfo.res4[2]}></IonRadio>
|
|
483
|
+ {icon43}
|
193
|
484
|
</IonItem>
|
194
|
485
|
|
195
|
486
|
<IonItem>
|
196
|
|
- <IonLabel>{quizzes['res-4-4']}</IonLabel>
|
197
|
|
- <IonRadio slot="end" value={quizzes['res-4-4']}></IonRadio>
|
|
487
|
+ <IonLabel>{quizInfo.res4[3]}</IonLabel>
|
|
488
|
+ <IonRadio slot="end" value={quizInfo.res4[3]}></IonRadio>
|
|
489
|
+ {icon44}
|
198
|
490
|
</IonItem>
|
199
|
491
|
</IonRadioGroup>
|
200
|
492
|
</IonList>
|
201
|
493
|
</IonCardContent>
|
202
|
494
|
</IonCard>
|
203
|
|
- </> : null
|
204
|
|
- )
|
205
|
|
- })
|
|
495
|
+
|
|
496
|
+ <IonItem lines="none">
|
|
497
|
+ {verResPresionado ? (
|
|
498
|
+ <>
|
|
499
|
+ <IonChip>{countres} / 4 respuestas correctas</IonChip>
|
|
500
|
+ </>
|
|
501
|
+ ) : null }
|
|
502
|
+ </IonItem>
|
|
503
|
+
|
|
504
|
+ </> : <div>Quiz not found</div>
|
|
505
|
+
|
206
|
506
|
}
|
207
|
507
|
|
208
|
508
|
|
|
@@ -211,12 +511,12 @@ const Questions: React.FC = () => {
|
211
|
511
|
</IonContent>
|
212
|
512
|
|
213
|
513
|
<IonFooter>
|
214
|
|
- <IonToolbar>
|
215
|
|
- <IonNavLink routerDirection="forward" component={() => <Biography />}>
|
216
|
|
- <IonTabButton tab="Biography" href="/Biography">
|
217
|
|
- <IonIcon icon={arrowBack} />
|
218
|
|
- </IonTabButton>
|
219
|
|
- </IonNavLink>
|
|
514
|
+ <IonToolbar className="Footer-Color">
|
|
515
|
+ <div className='Item-Center'>
|
|
516
|
+ <IonButtons slot="start">
|
|
517
|
+ <IonBackButton defaultHref="/ListBiographie"></IonBackButton>
|
|
518
|
+ </IonButtons>
|
|
519
|
+ </div>
|
220
|
520
|
</IonToolbar>
|
221
|
521
|
</IonFooter>
|
222
|
522
|
</IonPage>
|