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
416b52da
authored
Nov 29, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on issue
#376
parent
e8ea01d6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
94 additions
and
51 deletions
sails/src/CHANGES.md
sails/src/assets/app/bower.json
sails/src/assets/app/i18n/en-gb.json
sails/src/assets/app/i18n/es-es.json
sails/src/assets/scripts/app.js
sails/src/assets/scripts/modules/student/controllers/reports.js
sails/src/assets/scripts/modules/student/views/reports.html
sails/src/tasks/config/concat.js
sails/src/CHANGES.md
View file @
416b52da
# Acciones a realizar
-
En /sails/src/assets lanzar "bower install"
# Changes for new grid system
Solo hay que l
anzar, desde MySQL el archivo roles/database/files/new-grid-system-adapt.sql
-
L
anzar, desde MySQL el archivo roles/database/files/new-grid-system-adapt.sql
sails/src/assets/app/bower.json
View file @
416b52da
...
...
@@ -30,7 +30,8 @@
"ngMask"
:
"angular-mask#~3.1.1"
,
"angular-recaptcha"
:
"^4.0.1"
,
"ui-bootstrap"
:
"~2.5.0"
,
"ngInfiniteScroll"
:
"^1.3.4"
"ngInfiniteScroll"
:
"^1.3.4"
,
"angular-file-saver"
:
"^1.1.3"
},
"resolutions"
:
{
"angular"
:
">=1 <1.3.0"
,
...
...
sails/src/assets/app/i18n/en-gb.json
View file @
416b52da
...
...
@@ -122,6 +122,7 @@
"disclaimer_requested"
:
"Conditions of use must be read and accepted"
,
"double_click"
:
"Double click"
,
"down"
:
"Down"
,
"download"
:
"Download"
,
"duplicate"
:
"Duplicate"
,
"duration_in_months"
:
"Duration (months)"
,
"drag"
:
"Drag"
,
...
...
@@ -164,6 +165,7 @@
"finished"
:
"Finished"
,
"firmware"
:
"Firmware id"
,
"free_category"
:
"Free category"
,
"from"
:
"from"
,
"gender"
:
"Gender"
,
"general_labels"
:
"General labels"
,
"generate"
:
"Generate"
,
...
...
@@ -466,6 +468,7 @@
"time_tries_per_days"
:
"Time of tries per days in"
,
"time_tries_per_month"
:
"Time of tries per months in"
,
"title"
:
"Title"
,
"to"
:
"to"
,
"totals"
:
"Totals"
,
"to_add"
:
"To add"
,
"tpl_date_frame"
:
"de {{ begin | date:'dd-MM-yyyy' }} a {{ end | date:'dd-MM-yyyy' }}"
,
...
...
sails/src/assets/app/i18n/es-es.json
View file @
416b52da
...
...
@@ -121,6 +121,7 @@
"disclaimer_requested"
:
"Las condiciones de uso deben ser leídas y aceptadas"
,
"double_click"
:
"Doble clic"
,
"down"
:
"Abajo"
,
"download"
:
"Descargar"
,
"duplicate"
:
"Duplicar"
,
"duration_in_months"
:
"Duración (meses)"
,
"drag"
:
"Arrastrar"
,
...
...
@@ -163,6 +164,7 @@
"finished"
:
"Completada"
,
"firmware"
:
"Id firmware"
,
"free_category"
:
"Categoría libre"
,
"from"
:
"desde"
,
"gender"
:
"Género"
,
"general_labels"
:
"Generales"
,
"generate"
:
"Generar"
,
...
...
@@ -464,6 +466,7 @@
"time_tries_per_days"
:
"Tiempo de ensayos por días en"
,
"time_tries_per_month"
:
"Tiempo de ensayos por meses en"
,
"title"
:
"Título"
,
"to"
:
"hasta"
,
"totals"
:
"Totales"
,
"to_add"
:
"Para añadir"
,
"tpl_date_frame"
:
"de {{ begin | date:'dd-MM-yyyy' }} a {{ end | date:'dd-MM-yyyy' }}"
,
...
...
sails/src/assets/scripts/app.js
View file @
416b52da
...
...
@@ -20,7 +20,8 @@ var dashboardApp = angular.module('dashboardApp', [
'ngLodash'
,
'ngMask'
,
'vcRecaptcha'
,
'infinite-scroll'
'infinite-scroll'
,
'ngFileSaver'
]);
/* Main constants */
...
...
@@ -226,6 +227,5 @@ dashboardApp.factory('newconfirm', function ($window, $q, $timeout) {
return
newconfirm
;
});
// force websocket transport protocol
//io.sails.transports=['polling'];
sails/src/assets/scripts/modules/student/controllers/reports.js
View file @
416b52da
...
...
@@ -10,7 +10,9 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
config
,
ngToast
,
$filter
,
$translate
)
{
$translate
,
FileSaver
,
Blob
)
{
// --------------------------------------------------------------------------
//
...
...
@@ -43,6 +45,9 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
$scope
.
elems
=
[];
var
tsvData
=
""
;
const
SEPARATOR
=
'\t'
;
// --------------------------------------------------------------------------
...
...
@@ -55,21 +60,47 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
.
get
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/tries'
)
.
success
(
function
(
data
)
{
$scope
.
fulldata
=
data
;
for
(
var
i
=
0
;
i
<
$scope
.
fulldata
.
methods
.
length
;
i
++
){
$scope
.
elems
.
push
({
id
:
$scope
.
fulldata
.
methods
[
i
].
id
,
class
:
"method-opt"
,
name
:
$scope
.
fulldata
.
methods
[
i
].
name
});
for
(
var
j
=
0
;
j
<
$scope
.
fulldata
.
methods
[
i
].
instructions
.
length
;
j
++
){
if
(
$scope
.
fulldata
.
methods
[
i
].
instructions
[
j
].
working_sessions
)
$scope
.
elems
.
push
({
id
:
$scope
.
fulldata
.
methods
[
i
].
instructions
[
j
].
id
,
class
:
"instruction-opt"
,
name
:
"- - "
+
$scope
.
fulldata
.
methods
[
i
].
instructions
[
j
].
name
,
id_method
:
$scope
.
fulldata
.
methods
[
i
].
id
});
tsvData
=
"method"
+
SEPARATOR
+
"instruction"
+
SEPARATOR
+
"instruction_begin"
+
SEPARATOR
+
"instruction_end"
+
SEPARATOR
+
"session_begin"
+
SEPARATOR
+
"session_end"
+
SEPARATOR
+
"try_begin"
+
SEPARATOR
+
"try_end"
+
SEPARATOR
+
"action"
+
SEPARATOR
+
"action_timestamp"
+
SEPARATOR
+
"action_expression\n"
;
for
(
var
i
=
0
;
i
<
data
.
methods
.
length
;
i
++
){
$scope
.
elems
.
push
({
id
:
data
.
methods
[
i
].
id
,
class
:
"method-opt"
,
name
:
data
.
methods
[
i
].
name
});
for
(
var
j
=
0
;
j
<
data
.
methods
[
i
].
instructions
.
length
;
j
++
){
if
(
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
)
{
$scope
.
elems
.
push
({
id
:
data
.
methods
[
i
].
instructions
[
j
].
id
,
class
:
"instruction-opt"
,
name
:
"- - "
+
data
.
methods
[
i
].
instructions
[
j
].
name
,
id_method
:
data
.
methods
[
i
].
id
});
for
(
var
k
=
0
;
k
<
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
.
length
;
k
++
)
for
(
var
l
=
0
;
l
<
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
tries
.
length
;
l
++
)
for
(
var
m
=
0
;
m
<
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
tries
[
l
].
actions
.
length
;
m
++
)
tsvData
+=
data
.
methods
[
i
].
name
+
SEPARATOR
+
data
.
methods
[
i
].
instructions
[
j
].
name
+
SEPARATOR
+
data
.
methods
[
i
].
instructions
[
j
].
begin
+
SEPARATOR
+
data
.
methods
[
i
].
instructions
[
j
].
end
+
SEPARATOR
+
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
begin
+
SEPARATOR
+
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
end
+
SEPARATOR
+
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
tries
[
l
].
begin
+
SEPARATOR
+
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
tries
[
l
].
end
+
SEPARATOR
+
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
tries
[
l
].
actions
[
m
].
timestamp
+
SEPARATOR
+
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
tries
[
l
].
actions
[
m
].
description
&&
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
tries
[
l
].
actions
[
m
].
description
.
attributes
&&
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
tries
[
l
].
actions
[
m
].
description
.
attributes
.
expression
?
data
.
methods
[
i
].
instructions
[
j
].
working_sessions
[
k
].
tries
[
l
].
actions
[
m
].
description
.
attributes
.
expression
:
''
+
'\n'
;
}
}
}
$scope
.
filter
();
})
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
console
.
log
(
"Error from API: "
+
data
.
error
);
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
console
.
log
(
"Error from API: "
+
data
.
error
);
});
/**
* Download data in CSV format
*/
$scope
.
download
=
function
()
{
var
data
=
new
Blob
([
tsvData
],
{
type
:
'text/plain;charset=utf-8'
});
FileSaver
.
saveAs
(
data
,
'report.tsv'
);
};
/**
* Opens the calendar for selecting student's birthdate.
* Prevents the propagation of the click event.
* @param {event} Click event
...
...
sails/src/assets/scripts/modules/student/views/reports.html
View file @
416b52da
...
...
@@ -20,14 +20,9 @@
<!-- filter selector -->
<div
id=
"filter"
>
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<h1
class=
"page-header"
>
{{'filter' | translate}}
</h1>
</div>
</div>
<!-- selectors -->
<div
class=
"row"
>
<div
class=
"col-xs-3
col-xs-offset-1
"
>
<div
class=
"col-xs-3"
>
<div
class=
"form-group"
>
<p
class=
"input-group"
>
<select
class=
"form-control"
name=
"method_select"
id=
"method_select"
ng-model=
"selected_method"
>
...
...
@@ -40,6 +35,7 @@
<div
class=
"col-xs-3"
>
<div
class=
"form-group"
>
<p
class=
"input-group"
>
<span
class=
"input-group-addon"
translate
>
from
</span>
<input
type=
"text"
class=
"form-control"
datepicker-popup=
" {{ 'day_format' | translate }}"
ng-model=
"reportDateSince"
placeholder=
"{{ 'since' | translate }}"
is-open=
"openedSince"
close-text=
"{{'close' | translate}}"
/>
<span
class=
"input-group-btn"
>
<button
type=
"button"
class=
"btn btn-default"
ng-click=
"openCalendar($event,1)"
><i
class=
"glyphicon glyphicon-calendar"
></i></button>
...
...
@@ -50,6 +46,7 @@
<div
class=
"col-xs-3"
>
<div
class=
"form-group"
>
<p
class=
"input-group"
>
<span
class=
"input-group-addon"
translate
>
to
</span>
<input
type=
"text"
class=
"form-control"
datepicker-popup=
" {{ 'day_format' | translate }}"
ng-model=
"reportDateTo"
placeholder=
"{{ 'to' | translate }}"
is-open=
"openedTo"
close-text=
"{{'close' | translate}}"
/>
<span
class=
"input-group-btn"
>
<button
type=
"button"
class=
"btn btn-default"
ng-click=
"openCalendar($event,2)"
><i
class=
"glyphicon glyphicon-calendar"
></i></button>
...
...
@@ -74,38 +71,15 @@
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<h1
ng-if=
"!showPrint"
class=
"page-header"
>
{{'methods' | translate}}
</h1>
<h1
ng-if=
"showPrint"
class=
"page-header"
>
{{printName | translate}}
<small
id=
"inform-content-date"
>
{{ 'tpl_date_frame' | translate:{'begin':reportDateSince, 'end':reportDateTo} }}
</small></h1>
</div>
</div>
<!-- graphics headers -->
<div
class=
"row"
>
<div
class=
"col-xs-4"
>
<h1
class=
"text-center"
><small>
{{'error_rate' | translate}}
</small></h1>
</div>
<div
class=
"col-xs-4"
>
<h1
class=
"text-center"
><small>
{{'average_time_per_try' | translate}}
</small></h1>
</div>
<div
class=
"col-xs-4"
>
<h1
class=
"text-center"
><small>
{{'average_time_between_pictos' | translate}}
</small></h1>
</div>
</div>
<!-- graphics -->
<div
class=
"row"
>
<div
class=
"col-xs-4 bg-light-gray"
>
<canvas
id=
"error_rate"
class=
"chart chart-line"
chart-options=
"optionsChartDateRate"
chart-data=
"dataChart1"
chart-labels=
"labels1"
chart-series=
"series1"
></canvas>
</div>
<div
class=
"col-xs-4"
>
<canvas
id=
"avg_time_trie"
class=
"chart chart-line"
chart-options=
"optionsChartDateSeconds"
chart-data=
"dataChart2"
chart-labels=
"labels2"
chart-series=
"series2"
></canvas>
</div>
<div
class=
"col-xs-4 bg-light-gray"
>
<canvas
id=
"avg_time_pictos"
class=
"chart chart-line"
chart-options=
"optionsChartDateSeconds"
chart-data=
"dataChart3"
chart-labels=
"labels3"
chart-series=
"series3"
></canvas>
<h2
ng-if=
"!showPrint"
>
{{'methods' | translate}}
</h2>
<h2
ng-if=
"showPrint"
>
{{printName | translate}}
<small
id=
"inform-content-date"
>
{{ 'tpl_date_frame' | translate:{'begin':reportDateSince, 'end':reportDateTo} }}
</small></h2>
<a
target=
"_self"
ng-click=
"download()"
download=
"report.csv"
class=
"btn btn-default btn-sm"
popover=
"{{ 'download' | translate }}"
popover-trigger=
"mouseenter"
>
<span
class=
"glyphicon glyphicon-download-alt"
aria-hidden=
"true"
></span>
{{ 'download' | translate }} TSV
</a>
</div>
</div>
<br>
<br
/
>
<!-- table -->
<div
class=
"row"
>
...
...
@@ -143,16 +117,42 @@
</div>
</div>
<!-- graphics headers -->
<div
class=
"row"
>
<div
class=
"col-xs-4"
>
<h2
class=
"text-center"
><small>
{{'error_rate' | translate}}
</small></h2>
</div>
<div
class=
"col-xs-4"
>
<h2
class=
"text-center"
><small>
{{'average_time_per_try' | translate}}
</small></h2>
</div>
<div
class=
"col-xs-4"
>
<h2
class=
"text-center"
><small>
{{'average_time_between_pictos' | translate}}
</small></h2>
</div>
</div>
<!-- graphics -->
<div
class=
"row"
>
<div
class=
"col-xs-4 bg-light-gray"
>
<canvas
id=
"error_rate"
class=
"chart chart-line"
chart-options=
"optionsChartDateRate"
chart-data=
"dataChart1"
chart-labels=
"labels1"
chart-series=
"series1"
></canvas>
</div>
<div
class=
"col-xs-4"
>
<canvas
id=
"avg_time_trie"
class=
"chart chart-line"
chart-options=
"optionsChartDateSeconds"
chart-data=
"dataChart2"
chart-labels=
"labels2"
chart-series=
"series2"
></canvas>
</div>
<div
class=
"col-xs-4 bg-light-gray"
>
<canvas
id=
"avg_time_pictos"
class=
"chart chart-line"
chart-options=
"optionsChartDateSeconds"
chart-data=
"dataChart3"
chart-labels=
"labels3"
chart-series=
"series3"
></canvas>
</div>
</div>
<!-- graphics headers 2 -->
<div
class=
"row"
>
<div
class=
"col-xs-4 bg-light-gray"
>
<h
1
class=
"text-center"
><small>
{{'vocabulary_size' | translate}}
</small></h1
>
<h
2
class=
"text-center"
><small>
{{'vocabulary_size' | translate}}
</small></h2
>
</div>
<div
class=
"col-xs-4"
>
<h
1
class=
"text-center"
><small>
{{'phrase_size' | translate}}
</small></h1
>
<h
2
class=
"text-center"
><small>
{{'phrase_size' | translate}}
</small></h2
>
</div>
<div
class=
"col-xs-4"
>
<h
1
class=
"text-center"
><small>
{{'phrase_build_time' | translate}}
</small></h1
>
<h
2
class=
"text-center"
><small>
{{'phrase_build_time' | translate}}
</small></h2
>
</div>
</div>
...
...
sails/src/tasks/config/concat.js
View file @
416b52da
...
...
@@ -31,6 +31,7 @@ module.exports = function (grunt) {
'assets/app/bower_components/ngImgCrop/compile/minified/ng-img-crop.js'
,
'assets/app/bower_components/bootstrap-filestyle/src/bootstrap-filestyle.min.js'
,
'assets/app/bower_components/ngMask/dist/ngMask.min.js'
,
'assets/app/bower_components/angular-file-saver/dist/angular-file-saver.bundle.min.js'
,
'assets/scripts/lib/sails.io.js'
];
...
...
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