Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TFG
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josborg
TFG
Commits
02b802ce
Commit
02b802ce
authored
May 2, 2022
by
josborg
Browse files
Options
Downloads
Patches
Plain Diff
Tu costentacion en stats
parent
66cc07ab
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/src/app/estadisticas/estadisticas.component.html
+9
-12
9 additions, 12 deletions
client/src/app/estadisticas/estadisticas.component.html
client/src/app/estadisticas/estadisticas.component.ts
+20
-3
20 additions, 3 deletions
client/src/app/estadisticas/estadisticas.component.ts
with
29 additions
and
15 deletions
client/src/app/estadisticas/estadisticas.component.html
+
9
−
12
View file @
02b802ce
...
...
@@ -29,20 +29,17 @@
<div
class=
"row mt-2"
>
<div
class=
"col-sm"
>
<h1>
Tus respuestas
</h1>
<div
*ngIf=
"encuesta.status.toString() == 'FINALIZADA'; else elseBlock"
>
<div
*ngFor=
"let solucion of aciertosPorEncuesta; let i = index"
>
<div
class=
"shadow-lg p-3 mb-1 bg-white rounded"
>
<p>
{{solucion.name}} - {{solucion.diff / 1000}} segundos
</p>
</div>
</div>
</div>
<ng-template
#elseBlock
>
<div
*ngFor=
"let solucion of soluciones; let i = index"
>
<div
*ngFor=
"let solucion of miSolucion; let i = index"
>
<div
class=
"shadow-lg p-3 mb-1 bg-white rounded"
>
<p>
{{solucion.name}} - {{solucion.diff / 1000}} segundos
</p>
<div
class=
"col"
>
Pregunta: {{solucion.pregunta}}
</div>
<div
class=
"col"
>
Respuesta: {{solucion.opcion}}
</div>
<div
class=
"col"
>
Correcta: {{solucion.correct}}
</div>
</div>
</div>
</ng-template>
</div>
</div>
</div>
This diff is collapsed.
Click to expand it.
client/src/app/estadisticas/estadisticas.component.ts
+
20
−
3
View file @
02b802ce
...
...
@@ -24,6 +24,7 @@ export class EstadisticasComponent implements OnInit {
id
:
Number
=
0
;
miSolucion
:
Array
<
any
>
=
[];
soluciones
:
Solucion
[]
=
[];
preguntas
:
Pregunta
[]
=
[];
encuesta
:
Encuesta
=
<
Encuesta
>
{};
...
...
@@ -31,6 +32,7 @@ export class EstadisticasComponent implements OnInit {
aciertosPorEncuesta
:
Array
<
any
>
=
[];
ranking
:
any
;
userId
:
string
=
""
;
map
=
new
Map
();
...
...
@@ -53,7 +55,10 @@ export class EstadisticasComponent implements OnInit {
}
ngOnInit
():
void
{
var
aux
=
localStorage
.
getItem
(
'
userId
'
)
if
(
aux
!=
null
){
this
.
userId
=
aux
;
}
}
initMap
(){
...
...
@@ -81,9 +86,21 @@ export class EstadisticasComponent implements OnInit {
}
}
this
.
miSolucion
=
[]
this
.
soluciones
.
sort
((
a
,
b
)
=>
<
number
>
a
.
diff
-
<
number
>
b
.
diff
);
this
.
soluciones
.
forEach
(
element
=>
{
console
.
log
(
"
kkkk
"
+
element
.
id
+
"
-
"
+
element
.
diff
);
this
.
soluciones
.
forEach
(
solucion
=>
{
if
(
solucion
.
userId
==
this
.
userId
){
solucion
.
respuestas
.
forEach
(
respuesta
=>
{
var
pregunta
=
this
.
encuesta
.
preguntas
.
find
(
p
=>
p
.
id
==
respuesta
.
idPregunta
)
var
opcion
;
if
(
pregunta
!=
undefined
){
opcion
=
pregunta
.
opciones
.
find
(
o
=>
o
.
id
==
respuesta
.
idOpcion
)
this
.
miSolucion
.
push
({
pregunta
:
pregunta
.
name
,
opcion
:
opcion
?.
name
,
correct
:
opcion
?.
correct
})
}
});
}
});
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment