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
cde7a3cb
authored
Mar 15, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://scm.ujaen.es/softuno/pictogram
parents
7737f075
889b9572
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
32 deletions
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/SerialActivity.java
android/Pictogram/app/src/main/res/values-es/strings.xml
android/Pictogram/app/src/main/res/values/strings.xml
sails/src/api/controllers/StudentController.js
sails/src/assets/app/i18n/en-gb.json
sails/src/assets/app/i18n/es-es.json
sails/src/assets/app/modules/student/controllers/addpicto.js
sails/src/assets/app/modules/student/controllers/student.js
sails/src/assets/app/modules/student/views/header.html
android/Pictogram/app/src/main/java/com/yottacode/pictogram/gui/SerialActivity.java
View file @
cde7a3cb
This diff is collapsed.
Click to expand it.
android/Pictogram/app/src/main/res/values-es/strings.xml
View file @
cde7a3cb
...
...
@@ -46,9 +46,9 @@
<!--Semantic grammar -->
<string
name=
"loadingGrammar"
>
Por favor espere, cargando gramática semántica
</string>
<string
name=
"naturalgrammar"
>
SUpO_ES
</string>
<string
name=
"pictogrammar"
>
SUpO_PICTOES
</string>
<string
name=
"grammar"
>
SUpO_ES
</string>
<string
name=
"nogrammar"
>
Advertencia: Lenguaje no soportado
</string>
<string
name=
"pictogrammar"
>
SUpO_PICTOES
</string>
<item
type=
"integer"
name=
"maxInTape"
>
8
</item>
...
...
android/Pictogram/app/src/main/res/values/strings.xml
View file @
cde7a3cb
...
...
@@ -45,8 +45,10 @@
<!--Semantic grammar -->
<string
name=
"loadingGrammar"
>
Please wait, loading semmantic grammar
</string>
<string
name=
"naturalgrammar"
>
SUpO_EN
</string>
<string
name=
"grammar"
>
SUpO_EN
</string>
<string
name=
"nogrammar"
>
Warning: unknown language
</string>
<string
name=
"pictogrammar"
>
SUpO_PICTOEN
</string>
<!--Upload local img -->
<string
name=
"enterImgLabel"
>
Introduzca etiqueta de la imagen
</string>
...
...
sails/src/api/controllers/StudentController.js
View file @
cde7a3cb
...
...
@@ -538,6 +538,7 @@ module.exports = {
//
delete_picto
:
function
(
req
,
res
)
{
var
params
=
req
.
allParams
();
console
.
log
(
JSON
.
stringify
(
params
));
StuPicto
.
destroy
({
id
:
params
.
id_stuPicto
}).
exec
(
function
(
err
,
destroyed
)
{
if
(
err
)
{
...
...
@@ -545,11 +546,11 @@ module.exports = {
return
res
.
json
(
500
,
{
error
:
'Not removed picto for student'
});
}
if
(
destroyed
)
{
console
.
log
(
"Removed picto
for the student"
);
console
.
log
(
"Removed picto
"
+
destroyed
[
0
].
id_pic
+
"for the student "
);
return
res
.
json
({
"id"
:
destroyed
[
0
].
id
,
"attributes"
:
JSON
.
parse
(
destroyed
[
0
].
attributes
),
"picto"
:
destroyed
[
0
].
id_pic
id
:
destroyed
[
0
].
id
,
attributes
:
JSON
.
parse
(
destroyed
[
0
].
attributes
),
picto
:
{
id
:
destroyed
[
0
].
id_pic
}
});
}
});
...
...
@@ -560,7 +561,7 @@ module.exports = {
//
update_picto
:
function
(
req
,
res
)
{
var
params
=
req
.
allParams
();
console
.
log
(
"Updating attributes for picto student "
+
params
);
console
.
log
(
"Updating attributes for picto student "
+
JSON
.
stringify
(
params
)
);
console
.
log
(
JSON
.
stringify
(
params
));
query
=
params
.
id_stuPicto
?
{
id
:
params
.
id_stuPicto
}
...
...
@@ -572,7 +573,12 @@ module.exports = {
}
if
(
updated
)
{
console
.
log
(
"Updated attributes for picto student:"
+
JSON
.
stringify
(
updated
[
0
]));
return
res
.
json
(
updated
[
0
]);
// return res.json(updated[0]);
return
res
.
json
({
id
:
updated
[
0
].
id
,
attributes
:
updated
[
0
].
attributes
,
picto
:
{
id
:
updated
[
0
].
picto
}
});
}
});
},
...
...
@@ -665,6 +671,11 @@ module.exports = {
if
(
req
.
isSocket
)
{
sails
.
log
.
debug
(
"Inside /stu/subscribe - isSocket"
);
sails
.
sockets
.
join
(
req
.
socket
,
roomName
);
sails
.
io
.
sockets
.
in
(
roomName
).
clients
(
function
(
err
,
ids
)
{
sails
.
log
.
debug
(
"number of clients in room: "
+
ids
.
length
);
if
(
!
err
)
sails
.
io
.
to
(
roomName
).
emit
(
'update_peers'
,
{
count
:
ids
.
length
});
});
res
.
json
({
msg
:
"Subscribed to student "
+
roomName
});
...
...
@@ -691,8 +702,8 @@ module.exports = {
sails
.
sockets
.
leave
(
req
.
socket
,
rooms
[
i
]);
sails
.
log
.
debug
(
"Unsusbscribe from room "
+
rooms
[
i
]);
}
res
.
json
({
res
.
json
({
msg
:
"Unsubscribed from all rooms"
});
}
...
...
sails/src/assets/app/i18n/en-gb.json
View file @
cde7a3cb
...
...
@@ -143,6 +143,7 @@
"normal"
:
"Normal"
,
"notes"
:
"Notes"
,
"November"
:
"November"
,
"num_peers"
:
"Peers"
,
"num_sessions_per_day_in"
:
"Sessions per day in"
,
"num_sessions_per_month_in"
:
"Sessions per months in"
,
"objetive"
:
"Objetive"
,
...
...
sails/src/assets/app/i18n/es-es.json
View file @
cde7a3cb
...
...
@@ -143,6 +143,7 @@
"normal"
:
"Normal"
,
"notes"
:
"Notas"
,
"November"
:
"Noviembre"
,
"num_peers"
:
"Conectados"
,
"num_sessions_per_day_in"
:
"Número de sesiones por día en"
,
"num_sessions_per_month_in"
:
"Número de sesiones por meses en"
,
"objetive"
:
"Objetivo"
,
...
...
sails/src/assets/app/modules/student/controllers/addpicto.js
View file @
cde7a3cb
...
...
@@ -136,7 +136,7 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
};
$scope
.
alert
=
{
type
:
'danger'
,
msg
:
'Category is full of pictos.'
,
show
:
false
};
//
// Close alert message
//
...
...
@@ -352,6 +352,7 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
})
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
console
.
log
(
"Error from API: "
+
data
.
error
);
alert
(
'Pictogram is already part of this vocabulary'
);
});
}
...
...
sails/src/assets/app/modules/student/controllers/student.js
View file @
cde7a3cb
...
...
@@ -23,7 +23,8 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl($scope, conf
id
:
''
,
name
:
''
},
stuSup
:
[]
stuSup
:
[],
num_peers
:
1
};
// For the user form data in setup section
...
...
@@ -34,6 +35,30 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl($scope, conf
// from the abstract parent (it has no url)
$scope
.
studentData
.
id
=
$state
.
$current
.
locals
.
globals
.
$stateParams
.
idStudent
;
//
// WebSockets communication
//
io
.
socket
.
on
(
'update_peers'
,
function
(
data
)
{
console
.
log
(
data
.
count
+
' peers connected'
);
$scope
.
studentData
.
num_peers
=
data
.
count
;
});
io
.
socket
.
on
(
'reconnect'
,
function
()
{
// Subscribe to student's socket room
console
.
log
(
"reconnecting to socket"
);
io
.
socket
.
post
(
'/stu/subscribe'
,
{
action
:
'subscribe'
,
attributes
:{
id_stu
:
$scope
.
studentData
.
id
},
token
:
$window
.
sessionStorage
.
token
},
function
(
res
)
{
console
.
log
(
"Connected to student: "
+
res
.
msg
);
});
});
// ----------------------------------------------------------------------
//
// Load student account information
...
...
@@ -244,24 +269,6 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl($scope, conf
console
.
log
(
"Error from API: "
+
data
.
error
);
});
//
// WebSockets communication
//
io
.
socket
.
on
(
'reconnect'
,
function
()
{
// Subscribe to student's socket room
console
.
log
(
"reconnecting to socket"
);
io
.
socket
.
post
(
'/stu/subscribe'
,
{
action
:
'subscribe'
,
attributes
:{
id_stu
:
$scope
.
studentData
.
id
},
token
:
$window
.
sessionStorage
.
token
},
function
(
res
)
{
console
.
log
(
"Connected to student: "
+
res
.
msg
);
});
});
/*
// Events handling
io.socket.on('action', function(data) {
...
...
sails/src/assets/app/modules/student/views/header.html
View file @
cde7a3cb
...
...
@@ -23,6 +23,7 @@
<div
style=
"margin-left: 5px"
><h4>
{{studentData.name}} {{studentData.surname}}
</h4></div>
<div
style=
"margin-left: 5px"
class=
"text-left"
>
{{studentData.current_method | translate}}
</div>
<div
style=
"margin-left: 5px"
class=
"text-left"
>
{{studentData.current_instruction | translate}}
</div>
<div
style=
"margin-left: 5px; color: green"
class=
"text-left"
>
{{ 'num_peers' | translate}} : {{studentData.num_peers}}
</div>
</div>
</div>
<div
class=
"row"
>
...
...
@@ -49,4 +50,4 @@
</div>
</div>
</nav>
<!-- Fin cabecera alumno -->
\ No newline at end of file
<!-- Fin cabecera alumno -->
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