|
@@ -9,7 +9,6 @@ import {
|
9
|
9
|
IonItem,
|
10
|
10
|
IonLabel,
|
11
|
11
|
IonList,
|
12
|
|
- IonCheckbox,
|
13
|
12
|
IonCard,
|
14
|
13
|
IonCardContent,
|
15
|
14
|
IonCardHeader,
|
|
@@ -20,14 +19,309 @@ import {
|
20
|
19
|
IonRow,
|
21
|
20
|
IonCol,
|
22
|
21
|
IonButtons,
|
23
|
|
- IonBackButton
|
|
22
|
+ IonBackButton,
|
|
23
|
+ useIonViewWillEnter,
|
|
24
|
+ IonRadioGroup,
|
|
25
|
+ IonRadio,
|
|
26
|
+ IonIcon,
|
|
27
|
+ IonChip
|
24
|
28
|
} from '@ionic/react';
|
25
|
|
-import React from 'react';
|
|
29
|
+import { useParams } from 'react-router';
|
|
30
|
+import React, { useState } from 'react';
|
26
|
31
|
import './Questions.css';
|
27
|
32
|
import EnciclopediaPR from '../assets/EnciclopediaPR.png';
|
28
|
33
|
import RobertoClemente from '../assets/RobertoClemente.jpg';
|
|
34
|
+import { QuizInfo, getQuiz } from '../data/QuizInfo';
|
|
35
|
+import { thumbsDown, thumbsUp } from 'ionicons/icons';
|
|
36
|
+
|
29
|
37
|
|
30
|
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>();
|
|
66
|
+
|
|
67
|
+ const [icon41, setIcon41] = useState<any>();
|
|
68
|
+ const [icon42, setIcon42] = useState<any>();
|
|
69
|
+ const [icon43, setIcon43] = useState<any>();
|
|
70
|
+ const [icon44, setIcon44] = useState<any>();
|
|
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
|
+ */
|
|
82
|
+ const verificarRes = () => {
|
|
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 por si hubo seleccion anterior
|
|
88
|
+ let count = 0;
|
|
89
|
+ setCountRes(count);
|
|
90
|
+ setVerResPresionado(true); // buton verificar respuestas precionado
|
|
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);
|
|
314
|
+ };
|
|
315
|
+
|
|
316
|
+ // State para desplegar la info del quiz
|
|
317
|
+ const [quizInfo, setQuiz] = useState<QuizInfo>();
|
|
318
|
+ const params = useParams<{ id: string }>();
|
|
319
|
+
|
|
320
|
+ useIonViewWillEnter(() => {
|
|
321
|
+ const quiz = getQuiz(parseInt(params.id, 10));
|
|
322
|
+ setQuiz(quiz);
|
|
323
|
+ });
|
|
324
|
+
|
31
|
325
|
return (
|
32
|
326
|
<IonPage>
|
33
|
327
|
<IonHeader>
|
|
@@ -44,134 +338,175 @@ const Questions: React.FC = () => {
|
44
|
338
|
</IonGrid>
|
45
|
339
|
</IonToolbar>
|
46
|
340
|
</IonHeader>
|
47
|
|
-
|
|
341
|
+
|
48
|
342
|
<IonContent fullscreen className="ion-padding">
|
49
|
343
|
<IonImg style={{ height: 300, width: 600 }} src={RobertoClemente} alt='Logo'></IonImg>
|
50
|
|
- <h1>Quiz sobre la biografia de Roberto Clemente</h1>
|
51
|
|
-
|
52
|
|
- <p>Marque una respuesta por pregunta</p>
|
53
|
|
-
|
54
|
|
- <IonCard>
|
55
|
|
- <IonCardHeader>
|
56
|
|
- <IonCardTitle>¿En que año nació Roberto Clemente?</IonCardTitle>
|
57
|
|
- <IonCardSubtitle></IonCardSubtitle>
|
58
|
|
- </IonCardHeader>
|
59
|
|
- <IonCardContent>
|
60
|
|
- <IonList>
|
61
|
|
- <IonItem>
|
62
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
63
|
|
- <IonLabel>1934</IonLabel>
|
64
|
|
- </IonItem>
|
65
|
|
-
|
66
|
|
- <IonItem>
|
67
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
68
|
|
- <IonLabel>1950</IonLabel>
|
69
|
|
- </IonItem>
|
70
|
|
-
|
71
|
|
- <IonItem>
|
72
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
73
|
|
- <IonLabel>1943</IonLabel>
|
74
|
|
- </IonItem>
|
75
|
|
-
|
76
|
|
- <IonItem>
|
77
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
78
|
|
- <IonLabel>2022</IonLabel>
|
79
|
|
- </IonItem>
|
80
|
|
- </IonList>
|
81
|
|
- </IonCardContent>
|
82
|
|
- </IonCard>
|
83
|
|
-
|
84
|
|
- <IonCard>
|
85
|
|
- <IonCardHeader>
|
86
|
|
- <IonCardTitle>¿En que pueblo se crió?</IonCardTitle>
|
87
|
|
-
|
88
|
|
- </IonCardHeader>
|
89
|
|
- <IonCardContent>
|
90
|
|
- <IonList>
|
91
|
|
- <IonItem>
|
92
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
93
|
|
- <IonLabel>Caguas</IonLabel>
|
94
|
|
- </IonItem>
|
95
|
|
-
|
96
|
|
- <IonItem>
|
97
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
98
|
|
- <IonLabel>Cabo Rojo</IonLabel>
|
99
|
|
- </IonItem>
|
100
|
|
-
|
101
|
|
- <IonItem>
|
102
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
103
|
|
- <IonLabel>Luquillo</IonLabel>
|
104
|
|
- </IonItem>
|
105
|
|
-
|
106
|
|
- <IonItem>
|
107
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
108
|
|
- <IonLabel>Carolina</IonLabel>
|
109
|
|
- </IonItem>
|
110
|
|
- </IonList>
|
111
|
|
- </IonCardContent>
|
112
|
|
- </IonCard>
|
113
|
|
-
|
114
|
|
- <IonCard>
|
115
|
|
- <IonCardHeader>
|
116
|
|
- <IonCardTitle>¿Para qué equipo de la liga de beisbol profesional de Puerto Rico jugó?</IonCardTitle>
|
117
|
|
-
|
118
|
|
- </IonCardHeader>
|
119
|
|
- <IonCardContent>
|
120
|
|
- <IonList>
|
121
|
|
- <IonItem>
|
122
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
123
|
|
- <IonLabel>Bacalaos de Fajardo</IonLabel>
|
124
|
|
- </IonItem>
|
125
|
|
-
|
126
|
|
- <IonItem>
|
127
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
128
|
|
- <IonLabel>Alcapurrias de Loiza</IonLabel>
|
129
|
|
- </IonItem>
|
130
|
|
-
|
131
|
|
- <IonItem>
|
132
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
133
|
|
- <IonLabel>Cangrejeros de Santurce</IonLabel>
|
134
|
|
- </IonItem>
|
135
|
|
-
|
136
|
|
- <IonItem>
|
137
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
138
|
|
- <IonLabel>Brujos de Guayama</IonLabel>
|
139
|
|
- </IonItem>
|
140
|
|
- </IonList>
|
141
|
|
- </IonCardContent>
|
142
|
|
- </IonCard>
|
143
|
|
-
|
144
|
|
- <IonCard>
|
145
|
|
- <IonCardHeader>
|
146
|
|
- <IonCardTitle>¿Para que equipo de la MLB jugó?</IonCardTitle>
|
147
|
|
-
|
148
|
|
- </IonCardHeader>
|
149
|
|
- <IonCardContent>
|
150
|
|
- <IonList>
|
151
|
|
- <IonItem>
|
152
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
153
|
|
- <IonLabel>New York Yankees</IonLabel>
|
154
|
|
- </IonItem>
|
155
|
|
-
|
156
|
|
- <IonItem>
|
157
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
158
|
|
- <IonLabel>Houston Astros</IonLabel>
|
159
|
|
- </IonItem>
|
160
|
|
-
|
161
|
|
- <IonItem>
|
162
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
163
|
|
- <IonLabel>Chicago Cubs</IonLabel>
|
164
|
|
- </IonItem>
|
165
|
|
-
|
166
|
|
- <IonItem>
|
167
|
|
- <IonCheckbox slot="start"></IonCheckbox>
|
168
|
|
- <IonLabel>Pittsburgh Pirates</IonLabel>
|
169
|
|
- </IonItem>
|
170
|
|
- </IonList>
|
171
|
|
- </IonCardContent>
|
172
|
|
- </IonCard>
|
173
|
|
-
|
174
|
|
- <IonButton>Verificar respuestas</IonButton>
|
|
344
|
+
|
|
345
|
+ {
|
|
346
|
+ quizInfo ?
|
|
347
|
+ <>
|
|
348
|
+ <h1>Quiz sobre la biografia de {quizInfo.title}</h1>
|
|
349
|
+
|
|
350
|
+ <p>Marque una respuesta por pregunta</p>
|
|
351
|
+
|
|
352
|
+ <IonCard>
|
|
353
|
+ <IonCardHeader>
|
|
354
|
+ <IonCardTitle>{quizInfo.pregunta1}</IonCardTitle>
|
|
355
|
+ <IonCardSubtitle></IonCardSubtitle>
|
|
356
|
+ </IonCardHeader>
|
|
357
|
+ <IonCardContent>
|
|
358
|
+ <IonList>
|
|
359
|
+ <IonRadioGroup value={qres1} onIonChange={(e) => setQRes1(e.detail.value)}>
|
|
360
|
+ <IonItem>
|
|
361
|
+ <IonLabel>{quizInfo.res1[0]}</IonLabel>
|
|
362
|
+ <IonRadio slot="end" value={quizInfo.res1[0]}></IonRadio>
|
|
363
|
+ {icon11}
|
|
364
|
+ </IonItem>
|
|
365
|
+
|
|
366
|
+ <IonItem>
|
|
367
|
+ <IonLabel>{quizInfo.res1[1]}</IonLabel>
|
|
368
|
+ <IonRadio slot="end" value={quizInfo.res1[1]}></IonRadio>
|
|
369
|
+ {icon12}
|
|
370
|
+ </IonItem>
|
|
371
|
+
|
|
372
|
+ <IonItem>
|
|
373
|
+ <IonLabel>{quizInfo.res1[2]}</IonLabel>
|
|
374
|
+ <IonRadio slot="end" value={quizInfo.res1[2]}></IonRadio>
|
|
375
|
+ {icon13}
|
|
376
|
+ </IonItem>
|
|
377
|
+
|
|
378
|
+ <IonItem>
|
|
379
|
+ <IonLabel>{quizInfo.res1[3]}</IonLabel>
|
|
380
|
+ <IonRadio slot="end" value={quizInfo.res1[3]}></IonRadio>
|
|
381
|
+ {icon14}
|
|
382
|
+ </IonItem>
|
|
383
|
+ </IonRadioGroup>
|
|
384
|
+ </IonList>
|
|
385
|
+ </IonCardContent>
|
|
386
|
+ </IonCard>
|
|
387
|
+
|
|
388
|
+ <IonCard>
|
|
389
|
+ <IonCardHeader>
|
|
390
|
+ <IonCardTitle>{quizInfo.pregunta2}</IonCardTitle>
|
|
391
|
+ <IonCardSubtitle></IonCardSubtitle>
|
|
392
|
+ </IonCardHeader>
|
|
393
|
+ <IonCardContent>
|
|
394
|
+ <IonList>
|
|
395
|
+ <IonRadioGroup value={qres2} onIonChange={(e) => setQRes2(e.detail.value)}>
|
|
396
|
+ <IonItem>
|
|
397
|
+ <IonLabel>{quizInfo.res2[0]}</IonLabel>
|
|
398
|
+ <IonRadio slot="end" value={quizInfo.res2[0]}></IonRadio>
|
|
399
|
+ {icon21}
|
|
400
|
+ </IonItem>
|
|
401
|
+
|
|
402
|
+ <IonItem>
|
|
403
|
+ <IonLabel>{quizInfo.res2[1]}</IonLabel>
|
|
404
|
+ <IonRadio slot="end" value={quizInfo.res2[1]}></IonRadio>
|
|
405
|
+ {icon22}
|
|
406
|
+ </IonItem>
|
|
407
|
+
|
|
408
|
+ <IonItem>
|
|
409
|
+ <IonLabel>{quizInfo.res2[2]}</IonLabel>
|
|
410
|
+ <IonRadio slot="end" value={quizInfo.res2[2]}></IonRadio>
|
|
411
|
+ {icon23}
|
|
412
|
+ </IonItem>
|
|
413
|
+
|
|
414
|
+ <IonItem>
|
|
415
|
+ <IonLabel>{quizInfo.res2[3]}</IonLabel>
|
|
416
|
+ <IonRadio slot="end" value={quizInfo.res2[3]}></IonRadio>
|
|
417
|
+ {icon24}
|
|
418
|
+ </IonItem>
|
|
419
|
+ </IonRadioGroup>
|
|
420
|
+ </IonList>
|
|
421
|
+ </IonCardContent>
|
|
422
|
+ </IonCard>
|
|
423
|
+
|
|
424
|
+ <IonCard>
|
|
425
|
+ <IonCardHeader>
|
|
426
|
+ <IonCardTitle>{quizInfo.pregunta3}</IonCardTitle>
|
|
427
|
+ <IonCardSubtitle></IonCardSubtitle>
|
|
428
|
+ </IonCardHeader>
|
|
429
|
+ <IonCardContent>
|
|
430
|
+ <IonList>
|
|
431
|
+ <IonRadioGroup value={qres3} onIonChange={(e) => setQRes3(e.detail.value)}>
|
|
432
|
+ <IonItem>
|
|
433
|
+ <IonLabel>{quizInfo.res3[0]}</IonLabel>
|
|
434
|
+ <IonRadio slot="end" value={quizInfo.res3[0]}></IonRadio>
|
|
435
|
+ {icon31}
|
|
436
|
+ </IonItem>
|
|
437
|
+
|
|
438
|
+ <IonItem>
|
|
439
|
+ <IonLabel>{quizInfo.res3[1]}</IonLabel>
|
|
440
|
+ <IonRadio slot="end" value={quizInfo.res3[1]}></IonRadio>
|
|
441
|
+ {icon32}
|
|
442
|
+ </IonItem>
|
|
443
|
+
|
|
444
|
+ <IonItem>
|
|
445
|
+ <IonLabel>{quizInfo.res3[2]}</IonLabel>
|
|
446
|
+ <IonRadio slot="end" value={quizInfo.res3[2]}></IonRadio>
|
|
447
|
+ {icon33}
|
|
448
|
+ </IonItem>
|
|
449
|
+
|
|
450
|
+ <IonItem>
|
|
451
|
+ <IonLabel>{quizInfo.res3[3]}</IonLabel>
|
|
452
|
+ <IonRadio slot="end" value={quizInfo.res3[3]}></IonRadio>
|
|
453
|
+ {icon34}
|
|
454
|
+ </IonItem>
|
|
455
|
+ </IonRadioGroup>
|
|
456
|
+ </IonList>
|
|
457
|
+ </IonCardContent>
|
|
458
|
+ </IonCard>
|
|
459
|
+
|
|
460
|
+ <IonCard>
|
|
461
|
+ <IonCardHeader>
|
|
462
|
+ <IonCardTitle>{quizInfo.pregunta4}</IonCardTitle>
|
|
463
|
+ <IonCardSubtitle></IonCardSubtitle>
|
|
464
|
+ </IonCardHeader>
|
|
465
|
+ <IonCardContent>
|
|
466
|
+ <IonList>
|
|
467
|
+ <IonRadioGroup value={qres4} onIonChange={(e) => setQRes4(e.detail.value)}>
|
|
468
|
+ <IonItem>
|
|
469
|
+ <IonLabel>{quizInfo.res4[0]}</IonLabel>
|
|
470
|
+ <IonRadio slot="end" value={quizInfo.res4[0]}></IonRadio>
|
|
471
|
+ {icon41}
|
|
472
|
+ </IonItem>
|
|
473
|
+
|
|
474
|
+ <IonItem>
|
|
475
|
+ <IonLabel>{quizInfo.res4[1]}</IonLabel>
|
|
476
|
+ <IonRadio slot="end" value={quizInfo.res4[1]}></IonRadio>
|
|
477
|
+ {icon42}
|
|
478
|
+ </IonItem>
|
|
479
|
+
|
|
480
|
+ <IonItem>
|
|
481
|
+ <IonLabel>{quizInfo.res4[2]}</IonLabel>
|
|
482
|
+ <IonRadio slot="end" value={quizInfo.res4[2]}></IonRadio>
|
|
483
|
+ {icon43}
|
|
484
|
+ </IonItem>
|
|
485
|
+
|
|
486
|
+ <IonItem>
|
|
487
|
+ <IonLabel>{quizInfo.res4[3]}</IonLabel>
|
|
488
|
+ <IonRadio slot="end" value={quizInfo.res4[3]}></IonRadio>
|
|
489
|
+ {icon44}
|
|
490
|
+ </IonItem>
|
|
491
|
+ </IonRadioGroup>
|
|
492
|
+ </IonList>
|
|
493
|
+ </IonCardContent>
|
|
494
|
+ </IonCard>
|
|
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
|
+
|
|
506
|
+ }
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+ <IonButton onClick={verificarRes}>Verificar respuestas</IonButton>
|
175
|
510
|
|
176
|
511
|
</IonContent>
|
177
|
512
|
|