Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ba8008de
authored
May 17, 2017
by
Jose Antonio
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Some Fixes
parent
ef655788
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
sails/src/assets/scripts/modules/student/controllers/reports.js
sails/src/assets/scripts/modules/student/controllers/reports.js
View file @
ba8008de
...
@@ -118,7 +118,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
...
@@ -118,7 +118,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
$scope
.
method_chart_dates
=
[[]];
$scope
.
method_chart_dates
=
[[]];
$scope
.
error_rate_rate
=
[[]];
$scope
.
error_rate_rate
=
[[]];
$scope
.
average_time_tr
ie
=
[[]];
$scope
.
average_time_tr
y
=
[[]];
$scope
.
average_time_pictos
=
[[]];
$scope
.
average_time_pictos
=
[[]];
$scope
.
vocab_size
=
[[]];
$scope
.
vocab_size
=
[[]];
$scope
.
vocab_size_aux
=
[];
$scope
.
vocab_size_aux
=
[];
...
@@ -306,7 +306,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
...
@@ -306,7 +306,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
//*** Average time per trie chart***
//*** Average time per trie chart***
$scope
.
labels2
=
$scope
.
method_chart_dates
[
0
];
$scope
.
labels2
=
$scope
.
method_chart_dates
[
0
];
$scope
.
series2
=
[
$translate
.
instant
(
'seconds'
)];
$scope
.
series2
=
[
$translate
.
instant
(
'seconds'
)];
$scope
.
dataChart2
=
$scope
.
average_time_tr
ie
;
$scope
.
dataChart2
=
$scope
.
average_time_tr
y
;
//*** Average time between pictos chart***
//*** Average time between pictos chart***
$scope
.
labels3
=
$scope
.
method_chart_dates
[
0
];
$scope
.
labels3
=
$scope
.
method_chart_dates
[
0
];
...
@@ -351,7 +351,8 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
...
@@ -351,7 +351,8 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
var
instruction_phrase_average_build_time
=
0
;
var
instruction_phrase_average_build_time
=
0
;
for
(
var
i
=
0
;
i
<
working_sessions
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
working_sessions
.
length
;
i
++
){
var
error_rate
=
0
;
//error_rate for this working session
var
error_rate
=
0
;
//error_rate for this working session
var
success
=
0
;
var
count
=
0
;
var
success
=
0
;
var
tries_average_time
=
0
;
var
tries_average_time
=
0
;
var
average_time_pictos_ws
=
0
;
var
average_time_pictos_ws
=
0
;
var
phrase_average_size
=
0
;
var
phrase_average_size
=
0
;
...
@@ -368,8 +369,6 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
...
@@ -368,8 +369,6 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
//La primera accion es initsession
//La primera accion es initsession
var
before
=
moment
(
new
Date
(
working_sessions
[
i
].
tries
[
j
].
actions
[
0
].
timestamp
),
"DD/MM/YYYY HH:mm:ss.SSS"
);
var
before
=
moment
(
new
Date
(
working_sessions
[
i
].
tries
[
j
].
actions
[
0
].
timestamp
),
"DD/MM/YYYY HH:mm:ss.SSS"
);
for
(
var
k
=
1
;
k
<
working_sessions
[
i
].
tries
[
j
].
actions
.
length
;
k
++
){
for
(
var
k
=
1
;
k
<
working_sessions
[
i
].
tries
[
j
].
actions
.
length
;
k
++
){
console
.
log
(
"action="
+
working_sessions
[
i
].
tries
[
j
].
actions
[
k
].
type
);
console
.
log
(
"Before="
+
before
+
" timestamp="
+
working_sessions
[
i
].
tries
[
j
].
actions
[
0
].
timestamp
);
if
(
working_sessions
[
i
].
tries
[
j
].
actions
[
k
].
type
==
"pausesession"
){
if
(
working_sessions
[
i
].
tries
[
j
].
actions
[
k
].
type
==
"pausesession"
){
//Saltar esta action. La siguiente action a pausesession será before
//Saltar esta action. La siguiente action a pausesession será before
if
(
k
+
1
<
working_sessions
[
i
].
tries
[
j
].
actions
.
length
){
if
(
k
+
1
<
working_sessions
[
i
].
tries
[
j
].
actions
.
length
){
...
@@ -381,10 +380,8 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
...
@@ -381,10 +380,8 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
}
}
}
else
{
}
else
{
var
now
=
moment
(
new
Date
(
working_sessions
[
i
].
tries
[
j
].
actions
[
k
].
timestamp
),
"DD/MM/YYYY HH:mm:ss.SSS"
);
var
now
=
moment
(
new
Date
(
working_sessions
[
i
].
tries
[
j
].
actions
[
k
].
timestamp
),
"DD/MM/YYYY HH:mm:ss.SSS"
);
console
.
log
(
"Now="
+
now
+
" timestamp="
+
working_sessions
[
i
].
tries
[
j
].
actions
[
k
].
timestamp
);
var
dif
=
moment
(
now
).
diff
(
before
);
var
dif
=
moment
(
now
).
diff
(
before
);
var
miliseconds
=
moment
.
duration
(
dif
).
asMilliseconds
();
var
miliseconds
=
moment
.
duration
(
dif
).
asMilliseconds
();
console
.
log
(
"dif miliseconds="
+
miliseconds
);
average_time_pictos_action
+=
miliseconds
;
average_time_pictos_action
+=
miliseconds
;
before
=
now
;
before
=
now
;
var
count_pictos
=
0
;
var
count_pictos
=
0
;
...
@@ -410,8 +407,6 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
...
@@ -410,8 +407,6 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
}
}
}
}
average_time_pictos_ws
+=
average_time_pictos_action
/
working_sessions
[
i
].
tries
[
j
].
actions
.
length
;
average_time_pictos_ws
+=
average_time_pictos_action
/
working_sessions
[
i
].
tries
[
j
].
actions
.
length
;
console
.
log
(
"average_time_pictos_action="
+
average_time_pictos_action
);
console
.
log
(
"average_time_pictos_ws="
+
average_time_pictos_ws
);
}
}
};
};
...
@@ -419,14 +414,19 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
...
@@ -419,14 +414,19 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
switch
(
working_sessions
[
i
].
tries
[
j
].
result
)
{
switch
(
working_sessions
[
i
].
tries
[
j
].
result
)
{
case
"SUCCESS"
:
case
"SUCCESS"
:
$scope
.
tries_count
[
"success"
]
++
;
$scope
.
tries_count
[
"success"
]
++
;
count
++
;
success
++
;
success
++
;
calc
();
calc
();
break
;
break
;
case
"SUPERVISED SUCCESS"
:
case
"SUPERVISED SUCCESS"
:
$scope
.
tries_count
[
"supervised_success"
]
++
;
$scope
.
tries_count
[
"supervised_success"
]
++
;
count
++
;
calc
();
break
;
break
;
case
"SPONTANEOUS SUCCESS"
:
case
"SPONTANEOUS SUCCESS"
:
$scope
.
tries_count
[
"spontaneous_success"
]
++
;
$scope
.
tries_count
[
"spontaneous_success"
]
++
;
count
++
;
calc
();
break
;
break
;
case
"FAIL"
:
case
"FAIL"
:
$scope
.
tries_count
[
"fail"
]
++
;
$scope
.
tries_count
[
"fail"
]
++
;
...
@@ -446,23 +446,21 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
...
@@ -446,23 +446,21 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
default
:
default
:
$scope
.
tries_count
[
"null"
]
++
;
$scope
.
tries_count
[
"null"
]
++
;
}
}
}
}
$scope
.
tries_count
[
"total"
]
+=
working_sessions
[
i
].
tries
.
length
;
$scope
.
tries_count
[
"total"
]
+=
working_sessions
[
i
].
tries
.
length
;
error_rate
=
success
/
working_sessions
[
i
].
tries
.
length
;
error_rate
=
success
/
working_sessions
[
i
].
tries
.
length
;
tries_average_time
=
tries_average_time
/
success
;
//average time per trie per ws
tries_average_time
=
tries_average_time
/
count
;
//average time per trie per ws
average_time_pictos_ws
=
average_time_pictos_ws
/
success
;
average_time_pictos_ws
=
average_time_pictos_ws
/
count
;
phrase_average_build_time
=
phrase_average_build_time
/
success
;
//milliseconds
phrase_average_build_time
=
phrase_average_build_time
/
count
;
//milliseconds
phrase_average_size
=
phrase_average_size
/
success
;
phrase_average_size
=
phrase_average_size
/
count
;
$scope
.
method_chart_dates
[
0
].
push
(
moment
(
working_sessions
[
i
].
begin
).
format
(
"YYYY-MM-DD"
));
//https://github.com/moment/moment/issues/1407
$scope
.
method_chart_dates
[
0
].
push
(
moment
(
working_sessions
[
i
].
begin
).
format
(
"YYYY-MM-DD"
));
//https://github.com/moment/moment/issues/1407
$scope
.
error_rate_rate
[
0
].
push
(
round
((
1
-
error_rate
)
*
100
,
2
));
$scope
.
error_rate_rate
[
0
].
push
(
round
((
1
-
error_rate
)
*
100
,
2
));
$scope
.
average_time_tr
ie
[
0
].
push
(
round
(
moment
.
duration
(
tries_average_time
).
asSeconds
(),
2
));
$scope
.
average_time_tr
y
[
0
].
push
(
round
(
moment
.
duration
(
tries_average_time
).
asSeconds
(),
2
));
$scope
.
average_time_pictos
[
0
].
push
(
round
(
moment
.
duration
(
average_time_pictos_ws
).
asSeconds
(),
2
));
$scope
.
average_time_pictos
[
0
].
push
(
round
(
moment
.
duration
(
average_time_pictos_ws
).
asSeconds
(),
2
));
$scope
.
vocab_size
[
0
].
push
(
$scope
.
vocab_size_aux
.
length
);
$scope
.
vocab_size
[
0
].
push
(
$scope
.
vocab_size_aux
.
length
);
$scope
.
phrase_average_time
[
0
].
push
(
round
(
moment
.
duration
(
phrase_average_build_time
).
asSeconds
(),
2
));
$scope
.
phrase_average_time
[
0
].
push
(
round
(
moment
.
duration
(
phrase_average_build_time
).
asSeconds
(),
2
));
$scope
.
phrase_average_size
[
0
].
push
(
phrase_average_size
);
$scope
.
phrase_average_size
[
0
].
push
(
round
(
phrase_average_size
,
2
)
);
}
}
}
}
...
@@ -483,9 +481,9 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
...
@@ -483,9 +481,9 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
$scope
.
error_rate_rate
[
0
][
firstIndex
]
=
$scope
.
error_rate_rate
[
0
][
secondIndex
];
$scope
.
error_rate_rate
[
0
][
firstIndex
]
=
$scope
.
error_rate_rate
[
0
][
secondIndex
];
$scope
.
error_rate_rate
[
0
][
secondIndex
]
=
temp
;
$scope
.
error_rate_rate
[
0
][
secondIndex
]
=
temp
;
temp
=
$scope
.
average_time_tr
ie
[
0
][
firstIndex
];
temp
=
$scope
.
average_time_tr
y
[
0
][
firstIndex
];
$scope
.
average_time_tr
ie
[
0
][
firstIndex
]
=
$scope
.
average_time_trie
[
0
][
secondIndex
];
$scope
.
average_time_tr
y
[
0
][
firstIndex
]
=
$scope
.
average_time_try
[
0
][
secondIndex
];
$scope
.
average_time_tr
ie
[
0
][
secondIndex
]
=
temp
;
$scope
.
average_time_tr
y
[
0
][
secondIndex
]
=
temp
;
temp
=
$scope
.
average_time_pictos
[
0
][
firstIndex
];
temp
=
$scope
.
average_time_pictos
[
0
][
firstIndex
];
$scope
.
average_time_pictos
[
0
][
firstIndex
]
=
$scope
.
average_time_pictos
[
0
][
secondIndex
];
$scope
.
average_time_pictos
[
0
][
firstIndex
]
=
$scope
.
average_time_pictos
[
0
][
secondIndex
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment