issue #595 fixed

parent 63b19fa7
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
signingConfigs { /*signingConfigs {
config { config {
keyAlias 'Pictogram' keyAlias 'Pictogram'
keyPassword 'danoia' keyPassword 'danoia'
storeFile file('C:/Users/Fernando/pictogramkeys.jks') storeFile file('C:/Users/Fernando/pictogramkeys.jks')
storePassword 'danoia' storePassword 'danoia'
} }
} }*/
compileSdkVersion 24 compileSdkVersion 24
buildToolsVersion "23.0.2" buildToolsVersion "23.0.2"
defaultConfig { defaultConfig {
...@@ -17,7 +18,7 @@ android { ...@@ -17,7 +18,7 @@ android {
targetSdkVersion 22 targetSdkVersion 22
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
signingConfig signingConfigs.config // signingConfig signingConfigs.config
} }
productFlavors { productFlavors {
CIFlavor { CIFlavor {
......
...@@ -669,6 +669,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -669,6 +669,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
@Override @Override
public void onClick(View arg0) { public void onClick(View arg0) {
LinkedList<Picto> lp = tapeAdapter.getAll(); LinkedList<Picto> lp = tapeAdapter.getAll();
// This triggers the "Show" websocket action
PCBcontext.getActionLog().log(new PictosAction(lp)); PCBcontext.getActionLog().log(new PictosAction(lp));
tapeAdapter.ttsAllNew(tts); tapeAdapter.ttsAllNew(tts);
} }
......
...@@ -125,11 +125,9 @@ ...@@ -125,11 +125,9 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.1.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.1.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads-lite/9.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads-lite/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/9.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth-base/9.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth-base/9.2.1/jars" />
...@@ -161,32 +159,32 @@ ...@@ -161,32 +159,32 @@
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="wearable-2.0.0-alpha2" level="project" /> <orderEntry type="library" exported="" name="wearable-2.0.0-alpha2" level="project" />
<orderEntry type="library" exported="" name="okhttp-ws-2.3.0" level="project" /> <orderEntry type="library" exported="" name="okhttp-ws-2.3.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.1.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="socket.io-client-0.5.0" level="project" /> <orderEntry type="library" exported="" name="socket.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.3.0" level="project" /> <orderEntry type="library" exported="" name="okhttp-2.3.0" level="project" />
<orderEntry type="library" exported="" name="androidasync-2.1.9" level="project" /> <orderEntry type="library" exported="" name="androidasync-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-clearcut-9.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.1.1" level="project" />
<orderEntry type="library" exported="" name="play-services-wearable-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-wearable-9.2.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" /> <orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="okio-1.3.0" level="project" /> <orderEntry type="library" exported="" name="okio-1.3.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-gcm-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-auth-base-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-gass-9.2.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" /> <orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-iid-9.2.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-24.1.1" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-basement-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-tasks-9.2.1" level="project" />
<orderEntry type="library" exported="" name="engine.io-client-0.5.0" level="project" /> <orderEntry type="library" exported="" name="engine.io-client-0.5.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-24.1.1" level="project" /> <orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-24.1.1" level="project" />
<orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-auth-9.2.1" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-ads-9.2.1" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.9" level="project" /> <orderEntry type="library" exported="" name="ion-2.1.9" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" /> <orderEntry type="library" exported="" name="play-services-ads-lite-9.2.1" level="project" />
<orderEntry type="module" module-name="commonlibrary" exported="" /> <orderEntry type="module" module-name="commonlibrary" exported="" />
<orderEntry type="library" exported="" name="support-v4-23.0.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" /> <orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" /> <orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" /> <orderEntry type="library" exported="" scope="TEST" name="json-20090211" level="project" />
......
...@@ -58,14 +58,17 @@ CREATE TRIGGER TRG_NEW_TRY ...@@ -58,14 +58,17 @@ CREATE TRIGGER TRG_NEW_TRY
AFTER INSERT ON try AFTER INSERT ON try
FOR EACH ROW FOR EACH ROW
thisTrigger: BEGIN thisTrigger: BEGIN
DECLARE idstu INT; DECLARE idstu INT;
DECLARE idsup INT; DECLARE idsup INT;
IF ((@TRIGGER_CHECKS = FALSE) IF ((@TRIGGER_CHECKS = FALSE)
OR (@TRIGGER_AFTER_INSERT_CHECKS = FALSE)) OR (@TRIGGER_AFTER_INSERT_CHECKS = FALSE))
AND (USER() = 'root@localhost') AND (USER() = 'root@localhost')
THEN THEN
LEAVE thisTrigger; LEAVE thisTrigger;
END IF; END IF;
SELECT DISTINCT M.id_stu,W.id_sup INTO idstu, idsup SELECT DISTINCT M.id_stu,W.id_sup INTO idstu, idsup
FROM FROM
instruction I, instruction I,
...@@ -83,7 +86,7 @@ thisTrigger: BEGIN ...@@ -83,7 +86,7 @@ thisTrigger: BEGIN
NEW.id_ws, NEW.id_ws,
NEW.id, NEW.id,
0, 0,
NOW() NOW(3)
) )
ON DUPLICATE KEY UPDATE id_stu=idstu, id_sup=idsup, id_ws=NEW.id_ws, id_opentry=NEW.id; ON DUPLICATE KEY UPDATE id_stu=idstu, id_sup=idsup, id_ws=NEW.id_ws, id_opentry=NEW.id;
END;; END;;
...@@ -153,7 +156,7 @@ thisTrigger: BEGIN ...@@ -153,7 +156,7 @@ thisTrigger: BEGIN
END;; END;;
-- Integrity rule 3: every event is required to have the id try whenver a try happens -- Integrity rule 3: every event is required to have the id try whenever a try happens
-- when: state COM, event a4 -- when: state COM, event a4
-- Additional rule: resume event does not belog to any try -- Additional rule: resume event does not belog to any try
-- --
...@@ -171,14 +174,15 @@ thisTrigger: BEGIN ...@@ -171,14 +174,15 @@ thisTrigger: BEGIN
THEN THEN
LEAVE thisTrigger; LEAVE thisTrigger;
END IF; END IF;
SET idstu=NEW.id_stu;
SELECT id_opentry INTO idtry SELECT id_opentry INTO idtry
FROM FROM
stu_opentry stu_opentry
WHERE WHERE
id_stu = idstu; id_stu = NEW.id_stu;
IF (idtry IS NOT NULL) THEN IF (idtry IS NOT NULL) THEN
SET NEW.id_try=idtry; SET NEW.id_try = idtry;
END IF; END IF;
IF (NEW.type = 'resumesession') IF (NEW.type = 'resumesession')
...@@ -209,37 +213,41 @@ thisTrigger: BEGIN ...@@ -209,37 +213,41 @@ thisTrigger: BEGIN
LEAVE thisTrigger; LEAVE thisTrigger;
END IF; END IF;
CASE NEW.type -- get opentry
WHEN 'Show' THEN
SELECT id_ws, id_opentry INTO idws, idopentry SELECT id_ws, id_opentry INTO idws, idopentry
FROM FROM
stu_opentry stu_opentry
WHERE WHERE
id_stu = NEW.id_stu; id_stu = NEW.id_stu;
IF (idopentry IS NOT NULL and NEW.id_sup IS NULL) THEN
-- a new action updates try's end field
IF (NEW.id_try IS NOT NULL) THEN
UPDATE `try` UPDATE `try`
SET end=NOW() SET
WHERE id=idopentry; end = NEW.timestamp
WHERE
id = idopentry;
END IF;
-- Show and resumesession actions creates new tries
CASE NEW.type
WHEN 'Show' THEN
INSERT INTO try(`id_ws`) INSERT INTO try(`id_ws`)
VALUES (idws); VALUES (idws);
END IF;
WHEN 'pausesession' THEN WHEN 'pausesession' THEN
SELECT id_ws, id_opentry INTO idws, idopentry
FROM
stu_opentry
WHERE
id_stu = NEW.id_stu;
IF (idopentry IS NOT NULL) THEN IF (idopentry IS NOT NULL) THEN
UPDATE try set end=NOW(), result='DISCARDED' where id=idopentry; UPDATE try
SET
result = 'DISCARDED'
WHERE
id = idopentry;
END IF; END IF;
WHEN 'resumesession' THEN WHEN 'resumesession' THEN
SELECT id_ws INTO idws
FROM
stu_opentry
WHERE
id_stu = NEW.id_stu;
INSERT INTO try(`id_ws`) INSERT INTO try(`id_ws`)
VALUES (idws); VALUES (idws);
...@@ -265,6 +273,16 @@ thisTrigger: BEGIN ...@@ -265,6 +273,16 @@ thisTrigger: BEGIN
IF ((new.end IS NOT NULL) AND (new.current IS NOT NULL)) THEN IF ((new.end IS NOT NULL) AND (new.current IS NOT NULL)) THEN
SET new.current=NULL; SET new.current=NULL;
-- Remove opentry record
DELETE FROM stu_opentry
WHERE id_ws = new.id;
-- Remove tries with no actions
DELETE FROM `try`
WHERE
end = NULL AND
id_ws = new.id
END IF; END IF;
END;; END;;
...@@ -278,6 +296,7 @@ FOR EACH ROW ...@@ -278,6 +296,7 @@ FOR EACH ROW
thisTrigger: BEGIN thisTrigger: BEGIN
DECLARE idws INT; DECLARE idws INT;
DECLARE ws_end DATE; DECLARE ws_end DATE;
DECLARE ws_old_end DATE;
IF ((@TRIGGER_CHECKS = FALSE) IF ((@TRIGGER_CHECKS = FALSE)
OR (@TRIGGER_AFTER_UPDATE_CHECKS = FALSE)) OR (@TRIGGER_AFTER_UPDATE_CHECKS = FALSE))
...@@ -285,16 +304,37 @@ thisTrigger: BEGIN ...@@ -285,16 +304,37 @@ thisTrigger: BEGIN
THEN THEN
LEAVE thisTrigger; LEAVE thisTrigger;
END IF; END IF;
SELECT id_ws, end INTO idws, ws_end
-- Get open try for that session
SELECT end INTO ws_end
FROM FROM
stu_opentry stu_opentry
WHERE WHERE
id_ws = NEW.id_ws; id_ws = NEW.id_ws;
-- Update open try end timestamp and total_tries
IF ( (old.result IS NULL) and (new.result IS NOT NULL) and (new.end>ws_end)) THEN IF ( (old.result IS NULL) and (new.result IS NOT NULL) and (new.end>ws_end)) THEN
UPDATE stu_opentry UPDATE stu_opentry
SET end=new.end, total_tries=total_tries+1 SET
WHERE id_ws=idws; end = new.end,
total_tries = total_tries + 1
WHERE
id_ws = NEW.id_ws;
END IF;
-- Update working session end timestamp
SELECT end INTO ws_old_end
FROM
working_session
WHERE
id = NEW.id_ws;
IF (ws_old_end < NEW.end) THEN
UPDATE working_session
SET end = NEW.end
WHERE id = NEW.id_ws;
END IF; END IF;
END;; END;;
......
...@@ -120,6 +120,9 @@ module.exports = { ...@@ -120,6 +120,9 @@ module.exports = {
}); });
}, },
/**
* Returns the working sessions related to that instruction
*/
ws: function(req, res) { ws: function(req, res) {
if (!req.params.id_ins) { if (!req.params.id_ins) {
return res.json(500, {error: "No instruction defined"}); return res.json(500, {error: "No instruction defined"});
......
...@@ -6,8 +6,8 @@ module.exports = { ...@@ -6,8 +6,8 @@ module.exports = {
create: function(req, res) { create: function(req, res) {
var params = req.allParams(); var params = req.allParams();
if (!params.ws) return res.json(500, {error: "No workingSession defined"}); if (!params.ws) return res.badRequest("No workingSession defined");
if (!params.begin) return res.json(500, {error: "No begin defined"}); if (!params.begin) return res.badRequest("No begin defined");
Try.create({ Try.create({
"workingSession":params.ws, "workingSession":params.ws,
...@@ -15,11 +15,27 @@ module.exports = { ...@@ -15,11 +15,27 @@ module.exports = {
}).exec(function(err, tr){ }).exec(function(err, tr){
if(err || !tr){ if(err || !tr){
sails.log.debug("Creating new Try: " + err); sails.log.debug("Creating new Try: " + err);
return res.json(500, {error: 'Try not created: '+err}); return res.serverError('Try not created');
} }
return res.json({ return res.ok({"id": tr.id});
"id": tr.id
}); });
},
/**
* Update a try
*/
update: function(req, res) {
var params = req.allParams();
if (!params.id) return res.badRequest("No try defined");
Try.update(params.id, params)
.then(function (t) {
return res.ok(t);
})
.catch(function (err) {
if (err)
return res.serverError(err);
}); });
} }
......
...@@ -19,12 +19,7 @@ module.exports = { ...@@ -19,12 +19,7 @@ module.exports = {
if (!req.params.id_ws) if (!req.params.id_ws)
res.badRequest("No working session defined"); res.badRequest("No working session defined");
StuOpenTry.findOne( { id_ws : req.params.id_ws } )
.then(function(t) {
var ws_end = req.params.end ? req.params.end : new Date().toISOString(); var ws_end = req.params.end ? req.params.end : new Date().toISOString();
if (t && t.openTry) /*WS recovery*/ {
ws_end = t.end ? t.end.toISOString() : t.begin.toISOString();
}
WorkingSession.update({id: req.params.id_ws}, {end: ws_end}) WorkingSession.update({id: req.params.id_ws}, {end: ws_end})
.then(function(t) { .then(function(t) {
res.ok({end: ws_end}); res.ok({end: ws_end});
...@@ -33,10 +28,17 @@ module.exports = { ...@@ -33,10 +28,17 @@ module.exports = {
console.log("could not update " + req.params.id_ws); console.log("could not update " + req.params.id_ws);
throw err; throw err;
}); });
/*
StuOpenTry.findOne( { id_ws : req.params.id_ws } )
.then(function(t) {
if (t && t.openTry) { // WS recovery
ws_end = t.end ? t.end.toISOString() : t.begin.toISOString();
}
}) })
.fail(function(err) { .fail(function(err) {
res.serverError('Error closing working session: ' + err); res.serverError('Error closing working session: ' + err);
}); });
*/
}, },
/** /**
...@@ -109,7 +111,8 @@ module.exports = { ...@@ -109,7 +111,8 @@ module.exports = {
return action; return action;
}); });
return [action, ws]; return [action, ws];
}).spread(function(action, ws) { })
.spread(function(action, ws) {
StuOpenTry.findOne({id_stu : params.id_stu }) StuOpenTry.findOne({id_stu : params.id_stu })
.then(function(opentry) { .then(function(opentry) {
if (!opentry) if (!opentry)
......
...@@ -80,8 +80,11 @@ module.exports = { ...@@ -80,8 +80,11 @@ module.exports = {
// { result: null }, // This is necessary here because it's not enough with the following query to recover null results // { result: null }, // This is necessary here because it's not enough with the following query to recover null results
// { result: { '!' : ['BROKEN', 'DISCARDED'] }} // And without this results // { result: { '!' : ['BROKEN', 'DISCARDED'] }} // And without this results
// ] // ]
}).populate('actions').exec(function(err, tries) { })
if (!err && tries && tries.length > 0) .sort("end DESC")
.populate('actions')
.then(function(tries) {
if (tries && tries.length > 0)
l_ws.push({ l_ws.push({
"id": ws.id, "id": ws.id,
"student": ws.student, "student": ws.student,
......
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
"totals": "Totals", "totals": "Totals",
"to_add": "To add", "to_add": "To add",
"tpl_day": "{{ day | date:'yyyy-MM-dd' }}", "tpl_day": "{{ day | date:'yyyy-MM-dd' }}",
"tpl_hours_frame": "from {{ begin | date:'HH:mm' }} to {{ end | date:'HH:mm' }}", "tpl_hours_frame": "from {{ begin | date:'HH:mm:ss' }} to {{ end | date:'HH:mm:ss' }}",
"tries": "Tries", "tries": "Tries",
"tries_length": "Tries length", "tries_length": "Tries length",
"tries_mean_length": "Tries mean length", "tries_mean_length": "Tries mean length",
......
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
"totals": "Totales", "totals": "Totales",
"to_add": "Para añadir", "to_add": "Para añadir",
"tpl_day": "{{ day | date:'dd-MM-yyyy' }}", "tpl_day": "{{ day | date:'dd-MM-yyyy' }}",
"tpl_hours_frame": "de {{ begin | date:'HH:mm' }} a {{ end | date:'HH:mm' }}", "tpl_hours_frame": "de {{ begin | date:'HH:mm:ss' }} a {{ end | date:'HH:mm:ss' }}",
"tries": "Ensayos", "tries": "Ensayos",
"tries_length": "Duración ensayos", "tries_length": "Duración ensayos",
"tries_mean_length": "Duración media ensayos", "tries_mean_length": "Duración media ensayos",
......
...@@ -125,20 +125,18 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr ...@@ -125,20 +125,18 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
$http $http
.put(config.backend+'/try/' + t.id, update_data) .put(config.backend+'/try/' + t.id, update_data)
.success(function(data, status, headers, config) { .success(function(data, status, headers, config) {
}) })
.error(function(data, status, headers, config) { .error(function(data, status, headers, config) {
}); });
}; };
$scope.update_current_try = function(){ $scope.update_current_try = function(){
$http $http // actualizamos try actual
.put(config.backend+'/try/' + $scope.actual_try.id, { result: $scope.actual_try.result, end: new Date() }) .put(config.backend+'/try/' + $scope.actual_try.id, { result: $scope.actual_try.result, end: new Date().toISOString() })
.then( .then(
function(data, status, headers, config2) { function(data, status, headers, config2) {
$http $http // creamos un nuevo try
.post(config.backend+'/try/', {ws: $scope.ws, student: $scope.studentData.id, supervisor: $scope.user.id, begin:new Date() }) .post(config.backend+'/try/', {ws: $scope.ws, student: $scope.studentData.id, supervisor: $scope.user.id, begin:new Date().toISOString() })
.then( .then(
function(data, status, headers, config) { function(data, status, headers, config) {
$scope.load_tries($scope.selectedIns); $scope.load_tries($scope.selectedIns);
...@@ -170,7 +168,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr ...@@ -170,7 +168,7 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
.post(config.backend+ '/ws/'+$scope.wsessions[0].id+'/close') .post(config.backend+ '/ws/'+$scope.wsessions[0].id+'/close')
.then( .then(
function(data, status, headers, config) { function(data, status, headers, config) {
$scope.wsessions[0].end=data.data.end; $scope.wsessions[0].end = data.data.end;
$scope.ws_recover=false; $scope.ws_recover=false;
} }
,function(data, status, headers, config) { ,function(data, status, headers, config) {
...@@ -238,13 +236,13 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr ...@@ -238,13 +236,13 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
$scope.sessionRunning = false; $scope.sessionRunning = false;
if ($scope.wsessions.length>0) if ($scope.wsessions.length>0)
$scope.wsessions[$scope.wsessions.length-1].tries.pop(); $scope.wsessions[$scope.wsessions.length-1].tries.pop();
$scope.ws.end = new Date().toISOString(); $scope.ws.end = new Date();
$http $http
.post( .post(
config.backend+'/ws/' + $scope.ws.id + '/close', config.backend+'/ws/' + $scope.ws.id + '/close',
{ {
"end": $scope.ws.end, "end": $scope.ws.end.toISOString(),
"id_stu": $scope.studentData.id "id_stu": $scope.studentData.id
} }
) )
......
...@@ -136,9 +136,10 @@ ...@@ -136,9 +136,10 @@
{{ 'tries' | translate }} {{ 'tries' | translate }}
<span class="badge">{{ s.tries.length }}</span> <span class="badge">{{ s.tries.length }}</span>
</button> </button>
<span ng-show="!showLastTry" class="list-group-item-heading color_green">{{$index+1}}&nbsp;&nbsp;&nbsp;</span>
<!-- span ng-show="!showLastTry" class="list-group-item-heading color_green">{{$index+1}}&nbsp;&nbsp;&nbsp;</span -->
<p style="text-align: left ; margin-bottom: 5px" class="list-group-item-text color_green"> <p style="text-align: left ; margin-bottom: 5px" class="list-group-item-text color_green">
<b>{{ 'tpl_day' | translate:{'day':s.begin} }}</b> <span translate>session</span> <b>{{ 'tpl_day' | translate:{'day':s.begin} }}</b>
{{ 'tpl_hours_frame' | translate:{'begin':s.begin, 'end':s.end} }} {{ 'tpl_hours_frame' | translate:{'begin':s.begin, 'end':s.end} }}
</p> </p>
<textarea type="editable title" rows="2" id="ins_desc_ws" placeholder=" {{ 'session_notes' | translate }}" ng-model="s.description" <textarea type="editable title" rows="2" id="ins_desc_ws" placeholder=" {{ 'session_notes' | translate }}" ng-model="s.description"
......
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