Commit ac2bd08a by Fernando Martínez Santiago

Merge branch 'develop' of http://scm.ujaen.es/softuno/pictogram into develop

parents 17a905a7 db3c38c6
#!/bin/bash
#
# This script backups actual sails server (code and database), pulls new MASTER version and relaunches server
# by amontejo - 23.01.2017
#
TIMESTAMP=`date +"%Y%m%d"`
tar zcf /home/ubuntu/backup/${TIMESTAMP}-sails_src.tgz /home/ubuntu/pictogram/sails/src
mysqldump -u root -p'r00...Tt' pictodb |gzip > /ho:::me/ubuntu/backup/${TIMESTAMP}-mysql.sql.gz
git pull
sudo forever stopall
(cd src; sudo forever start app.js)
......@@ -95,6 +95,8 @@ CREATE TABLE IF NOT EXISTS `instruction` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="An instruction is a 'phase' in a method for learning AAC";
-- CREATE INDEX ix_instruction_begin ON instruction (`begin`);
-- --------------------------------------------------------
......@@ -396,6 +398,7 @@ CREATE TABLE IF NOT EXISTS `try` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="This table contains tries information (they belong to a working session)";
-- CREATE INDEX ix_try_begin ON try (`begin`);
-- --------------------------------------------------------
--
......@@ -427,6 +430,7 @@ CREATE TABLE IF NOT EXISTS `working_session` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="This table stores working session information. Every working session is related to one instruction and one supervisor (and the instruction is related to one method which is related to one student)";
-- CREATE INDEX ix_ws_begin ON working_session (`begin`);
--
-- Restricciones para tablas volcadas
--
......
......@@ -430,6 +430,7 @@ module.exports = {
function (instruction, next_ins) {
Instruction.findOne(instruction.id)
.sort('begin DESC')
.populate('workingSessions')
.then((populated_ins) => {
if (!populated_ins || !populated_ins.workingSessions || populated_ins.workingSessions.length == 0)
......@@ -441,6 +442,7 @@ module.exports = {
function(ws, next_ws) {
WorkingSession.findOne(ws.id)
.sort('begin DESC')
.populate('tries')
.then((populated_ws) => {
if (!populated_ws || !populated_ws.tries || populated_ws.tries.length == 0)
......@@ -452,6 +454,7 @@ module.exports = {
function(t, next_t) {
Try.findOne(t.id)
.sort('begin DESC')
.populate('actions')
.then((populated_try) => {
if (!populated_try || !populated_try.actions || populated_try.actions.length == 0)
......
......@@ -12,7 +12,7 @@ module.exports = {
autoPK : false,
autoCreatedAt : false,
autoUpdatedAt : false,
attributes: {
id: {
type: "integer",
......@@ -43,13 +43,13 @@ module.exports = {
size: 1024
}
},
afterUpdate: function (attrs, next) {
StuOpenTry.findOne({id_ws: attrs.workingSession}).exec(function(err, stuopentry) {
if (err)
throw new Error("Error at"+attrs.workingSession+"("+err+")");
if (stuopentry)
attrs.next_try_id=stuopentry.openTry;
next();
});
afterUpdate: function (attrs, next) {
StuOpenTry.findOne({id_ws: attrs.workingSession}).exec(function(err, stuopentry) {
if (err)
throw new Error("Error at"+attrs.workingSession+"("+err+")");
if (stuopentry)
attrs.next_try_id=stuopentry.openTry;
next();
});
}
}
\ No newline at end of file
}
......@@ -79,14 +79,16 @@ module.exports = {
next(err);
})
},
afterCreate: function (attrs, next) {
StuOpenTry.findOne({id_ws: attrs.id}).exec(function(err, stuopentry) {
afterCreate: function (attrs, next) {
// stu_opentry table is updated when a new try is inserted in try table
// (which is, itself, fired by a new session insertion)
// see triggers-sessions-integrity-constraints.sql
StuOpenTry.findOne({id_ws: attrs.id}).exec(function(err, stuopentry) {
if (err || !stuopentry)
throw new Error("No try found at"+attrs.id+"("+err+")");
throw new Error("No try found at"+attrs.id+"("+err+")");
attrs.first_try_id=stuopentry.openTry;
next();
});
});
},
//
......
......@@ -188,7 +188,7 @@
"no": "No",
"no_method": "Método sin definir",
"no_instruction": "Instrucción sin definir",
"no_students_for_user": "Su cuenta no está asociada a ningún estudiante. Por favor, contacto con su gabinete para enlazar su cuenta a un estudiante.",
"no_students_for_user": "Su cuenta no está asociada a ningún estudiante. Por favor, contacte con su gabinete para enlazar su cuenta a un estudiante.",
"no_space_in_category": "No queda espacio en la categoría",
"no_subscribed": "Sin conexión a la cuenta del estudiante",
"nobegin": "Sin iniciar",
......
......@@ -36,6 +36,9 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
//
$scope.methods = [];
// Visibility of the list of stored sessions
$scope.showSessions = false;
// Query to obtain an array of student methods
$http
.get(config.backend+'/stu/'+ $scope.studentData.id +'/methods')
......
......@@ -20,7 +20,7 @@
<div class="row" ng-hide="!selectedIns">
<p class="session_controls">
<div class="col-md-4">
<a ng-click="startTimer(); new_ws()" ng-disabled="!selectedIns " ng-hide="sessionRunning || studentData.num_peers<2" class="btn btn-success btn-sm" role="button" id="session_new" translate>new_session</a>
<a ng-click="startTimer(); new_ws()" ng-disabled="!selectedIns " ng-hide="sessionRunning || studentData.num_peers<2" class="btn btn-success btn-sm" role="button" id="session_new" translate>new_session</a>
<a class="text_large" ng-click="pause_ws(); pauseTimer();" ng-hide="!sessionRunning || paused" id="session_pause" popover="{{ 'pause_session' | translate}}" popover-trigger="mouseenter">
<span class="glyphicon glyphicon-pause" aria-hidden="true" title="{{ 'pause_session' | translate }}"></span>
</a>
......@@ -32,7 +32,7 @@
</a>
</div>
<div class="col-md-2" style="text-align: right">
<span class="label label-success" style="font-size: 10pt">{{ 'sessions' | translate}} <span class="badge" style="font-size: 10pt">{{wsessions.length}}</span></span>
<button ng-click="showSessions = !showSessions" class="btn btn-success btn-sm" style="font-size: 10pt">{{ 'sessions' | translate}} <span class="badge" style="font-size: 10pt">{{wsessions.length}}</span> <span class="glyphicon glyphicon-menu-down" ng-show="!showSessions"></span></button>
</div>
</p>
</div>
......@@ -127,7 +127,7 @@
<button class="btn btn-warning btn-sm" type="button" ng-click="close_ws()" translate>close_session</button>
</div>
<div class="list-group">
<div class="list-group" ng-show="showSessions">
<div class="list-group-item" ng-repeat="s in wsessions | orderBy: '-begin' | limitTo: numPerPage:(currentPage-1)*numPerPage">
<div ng-show="showLastTry && wsessions.length > 0">
<h4><strong>{{ 'last_session' | translate}}</strong>: {{ studentData.current_method }}, {{ studentData.current_instruction }}</h4>
......
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