Commit 140dd793 by Jose Antonio

Issue #243, endsession from angular

parent 550f8c66
...@@ -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
......
...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment