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
140dd793
authored
May 25, 2017
by
Jose Antonio
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Issue
#243
, endsession from angular
parent
550f8c66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
15 deletions
sails/src/api/controllers/StudentController.js
sails/src/assets/scripts/modules/student/controllers/session.js
sails/src/api/controllers/StudentController.js
View file @
140dd793
...
@@ -1438,7 +1438,7 @@ module.exports = {
...
@@ -1438,7 +1438,7 @@ module.exports = {
Action
.
create
({
Action
.
create
({
type
:
action
,
type
:
action
,
timestamp
:
attributes
.
timestamp
,
// it comes already in ISO format
timestamp
:
new
Date
().
toISOString
()
,
// it comes already in ISO format
supervisor
:
sup
,
supervisor
:
sup
,
student
:
attributes
.
id_stu
,
student
:
attributes
.
id_stu
,
description
:
desc
description
:
desc
...
...
sails/src/assets/scripts/modules/student/controllers/session.js
View file @
140dd793
...
@@ -235,22 +235,35 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
...
@@ -235,22 +235,35 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
$scope
.
wsessions
[
$scope
.
wsessions
.
length
-
1
].
tries
.
pop
();
$scope
.
wsessions
[
$scope
.
wsessions
.
length
-
1
].
tries
.
pop
();
$scope
.
ws
.
end
=
new
Date
();
$scope
.
ws
.
end
=
new
Date
();
$http
.
post
(
config
.
backend
+
'/ws/'
+
$scope
.
ws
.
id
+
'/close'
,
{
"id_stu"
:
$scope
.
studentData
.
id
}
)
.
success
(
function
(
data
,
status
,
headers
,
config
)
{
// Empty actual WS and actual try
$http
$scope
.
ws
=
{};
.
post
(
config
.
backend
+
'/action'
,
{
$scope
.
actual_try
=
{};
"type"
:
"endsession"
,
})
"student"
:
$scope
.
studentData
.
id
,
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
"supervisor"
:
$scope
.
user
.
id
,
})
.
success
(
function
(
data
,
status
,
headers
,
_config
)
{
// Adding resume action to the list of actions
$scope
.
actual_try
.
actions
.
push
({
action
:
'endsession'
}
);
});
$http
.
post
(
config
.
backend
+
'/ws/'
+
$scope
.
ws
.
id
+
'/close'
,
{
"id_stu"
:
$scope
.
studentData
.
id
}
)
.
success
(
function
(
data
,
status
,
headers
,
config
)
{
// Empty actual WS and actual try
$scope
.
ws
=
{};
$scope
.
actual_try
=
{};
})
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
});
})
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
});
// Cancel the mark of the device connected (with a new session will be connected again)
// Cancel the mark of the device connected (with a new session will be connected again)
//$scope.active_device = null;
//$scope.active_device = null;
...
...
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