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,9 +235,18 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr ...@@ -235,9 +235,18 @@ 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 $http
.post( .post(config.backend+'/action', {
config.backend+'/ws/' + $scope.ws.id + '/close', "type": "endsession",
"student": $scope.studentData.id,
"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 "id_stu": $scope.studentData.id
} }
...@@ -252,6 +261,10 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr ...@@ -252,6 +261,10 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
}); });
})
.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