Commit 7456cee4 by Arturo Montejo Ráez

Merge branch 'develop' of http://gitlab.ujaen.es/yotta/pictogram into develop

parents 9979181c daa52080
......@@ -11,6 +11,8 @@ mocha-report.xml
##########
sails/upload
sails/symbolstx*
sails/arasaac*
sails/arasaac
sails/src/assets/symbolstx*
sails/src/assets/upload
sails/upload.tgz
......
......@@ -286,10 +286,10 @@ public class Picto extends Img {
public String get_legend() {
String legend;
try {
legend=this.attributes.getString(JSON_ATTTRS.LEGEND);
legend=this.attributes.has(JSON_ATTTRS.LEGEND) ? this.attributes.getString(JSON_ATTTRS.LEGEND) : JSON_ATTTR_LEGEND_VALUES.NONE;
} catch (JSONException e) {
legend=JSON_ATTTR_LEGEND_VALUES.NONE; // By default
Log.e(LOG_TAG," Error getting legend:"+e.getMessage());
Log.e(LOG_TAG," Error getting legend:"+e.getMessage()+ "attributes: "+this.attributes.toString());
}
return legend.equalsIgnoreCase("null") ? JSON_ATTTR_LEGEND_VALUES.NONE : legend;
}
......
......@@ -269,7 +269,7 @@ public class User {
/**
*
* @return input feedback of the student configuration (default: "vibration")
* @return delivery method
*/
public JSON_STUDENT_ATTTRS.delivery delivery() {
JSON_STUDENT_ATTTRS.delivery delivery;
......
......@@ -55,8 +55,8 @@
<!--Upload local img -->
<string name="enterImgLabel">Introduzca etiqueta de la imagen</string>
<string name="notNewCats">No puede añadir nuevas categorias</string>
<string name="upload_error">No pudo subirse al servidor. Se intentará más adelante</string>
<string name="upload_ok">Se subió correctamente al servidor</string>
<string name="upload_error">No pudo subirse a Pictogram Web. Se intentará más adelante</string>
<string name="upload_ok">Se subió correctamente a Pictogram Web</string>
<string name="upload_duplicated">Pictograma ya presente en la colección. Utilice otra imagen</string>
......
......@@ -122,7 +122,27 @@ public class PictoAnimation {
}
});
moveAnim.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
if (up) activity.ttsButton.setImageAlpha(255);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
moveAnim.setDuration(500);
moveAnim.start();
}
......
......@@ -183,9 +183,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
}
});
if (this.vocabulary != null && this.vocabulary.size() > 0) {
Log.d(LOG_TAG, "Vocabulario correcto de tam:" + vocabulary.size());
}
this.tapeAdapter = new TapeAdapter();
this.tapeGridView = (GridView) this.findViewById(R.id.tape_grid_view);
......@@ -403,7 +401,9 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
@Override
protected void onStop() {
super.onStop();
tts.destroy();
Log.e(LOG_TAG, "Closing Pictogram Activity");
PCBcontext.getNetService().closeNotifyStatus();
}
......@@ -912,7 +912,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
@Override
public void onClick(View arg0) {
LinkedList<Picto> lp = tapeAdapter.getAll();
// This triggers the "Show" websocket action
// This triggers the "Show" websocket action SI hay algo en la cinta y esta no está vacia
if (lp.size()>0 && !PictogramActivity.this.tapeAdapter.play()) {
PCBcontext.getActionLog().log(new PictosAction(lp));
tapeAdapter.ttsAllNew(tts);
......@@ -926,11 +926,13 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
protected void showOnlyTape(boolean onlyTape) {
boolean tape_delivered_prev=this.tape_delivered;
Log.e(LOG_TAG,"ONLY TAPE->"+onlyTape+" "+ttsButton.isEnabled());
this.tape_delivered=onlyTape;
if (onlyTape) {
if (!tape_delivered_prev) {
if (PCBcontext.getPcbdb().getCurrentUser().delivery()== User.JSON_STUDENT_ATTTRS.delivery.one)
ttsButton.setEnabled(false);
Log.e(LOG_TAG,"ONLY TAPE0->"+onlyTape+" "+ttsButton.isEnabled());
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.showPictoCategoriesViewButton.setVisibility(View.INVISIBLE);
this.pictoCategoryGridView.setVisibility(View.INVISIBLE);
......@@ -946,8 +948,9 @@ protected void showOnlyTape(boolean onlyTape) {
}
}
else {
if (PCBcontext.getPcbdb().getCurrentUser().delivery()== User.JSON_STUDENT_ATTTRS.delivery.one)
ttsButton.setEnabled(true);
ttsButton.setEnabled(true);
ttsButton.refreshDrawableState();
Log.e(LOG_TAG,"ONLY TAPE1->"+onlyTape+" "+ttsButton.isEnabled());
new PictoAnimation().animateTapeViewVertical(this,true);
if (this.pictoMainGridView.getAnimation() != this.hidePictoMainViewAnimation) {
this.showPictoCategoriesViewButton.setVisibility(View.VISIBLE);
......
......@@ -11,7 +11,7 @@
<string name="session_header">Seleccion de método e instrucción</string>
<string name="session_error">Error de conexión</string>
<string name="session_noinstructions">Alumno sin ninguna instrucción asignada. Por favor, asigne al menos una instrucción al alumno desde Pictogram Web</string>
<string name="session_loading">Desargando instrucciones</string>
<string name="session_loading">Descargando instrucciones</string>
<string name="session_empty">Este alumno no tiene ningún método asignado. Por favor asigne un método a este alumno en</string>
<string name="session_notclosed">Este alumno tiene una sesión abierta. Por favor cierre la sesión desde Pictogram Web en</string>
<string name="session_closed_ok">Sesión grabada correctamente. Hora</string>
......
......@@ -11,7 +11,7 @@
<string name="session_header">Select method and instruction</string>
<string name="session_error">Server Error </string>
<string name="session_noinstructions">Student without any instrucction assigment</string>
<string name="session_loading">Desargando instrucciones</string>
<string name="session_loading">Descargando instrucciones</string>
<string name="session_empty">Este alumno no tiene ningún método asignado. Por favor asigne un método a este alumno en</string>
<string name="session_notclosed">Este alumno tiene una sesión abierta. Por favor cierre la sesión en el panel de control de Pictogram Web</string>
<string name="session_closed_ok">Sesión grabada correctamente</string>
......
......@@ -7,7 +7,7 @@ export LANG=en_US.UTF-8
echo "-- Installing build-essentials and g++"
sudo apt-get update
sudo apt-get install build-essential g++
sudo apt-get install -y build-essential g++
# installing ansible
echo "-- Installing ansible"
......
-- MySQL dump 10.13 Distrib 5.7.13, for Linux (x86_64)
--
-- Host: localhost Database: pictodbclean
-- ------------------------------------------------------
-- Server version 5.7.13
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `pictocat`
--
DROP TABLE IF EXISTS `pictocat`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pictocat` (
`id` int(11) NOT NULL,
`id_supercat` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Identifies a category, which, itself, may belong to another category';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `pictocat`
--
LOCK TABLES `pictocat` WRITE;
/*!40000 ALTER TABLE `pictocat` DISABLE KEYS */;
INSERT INTO `pictocat` VALUES (1,0),(2,1),(3,1),(4,0),(5,0),(6,1),(7,0),(8,1),(9,0),(10,0),(11,0),(12,0),(13,0),(14,0),(15,0),(16,0),(17,16),(18,16),(19,0),(20,0),(21,16),(22,0),(23,22),(24,16),(25,16),(26,0),(27,0),(28,0),(29,0),(30,29),(31,29),(32,29),(33,0),(34,0),(35,22),(36,0),(37,5),(38,0),(39,0),(40,12),(41,15),(42,0),(43,0),(44,0),(45,9),(46,0),(47,0),(48,0),(49,0),(50,0),(51,0),(52,0),(53,0),(54,53),(55,53),(56,53),(57,53),(58,53),(59,53),(60,53),(61,53),(62,53),(63,53),(64,53),(65,51),(66,20),(67,0),(68,0),(69,0),(70,0),(71,0),(72,20),(73,0),(74,0),(75,0),(76,71),(77,20),(78,51),(79,0),(80,0),(81,5),(82,22),(83,0),(84,0),(85,84),(86,84),(87,51),(88,0),(89,20),(90,0),(91,51),(92,80),(93,0),(94,0),(95,0),(96,0),(97,0),(98,97),(99,97),(100,80),(101,69),(102,51),(103,51),(104,0),(105,51),(106,69),(107,69),(108,0),(109,69),(110,69),(111,69),(112,69),(113,69),(114,0),(115,71),(116,0),(117,0),(118,0),(119,0),(120,0),(121,0),(122,0);
/*!40000 ALTER TABLE `pictocat` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-01-17 9:48:07
--
-- Creacion y volcado de datos para la tabla `pictocattree`
--
source /vagrant/roles/database/files/pictocat_tree_populate.sql
source /vagrant/roles/database/files/catexp.sql
......@@ -48,17 +48,14 @@ COMMENT="This table registers and action performed by a user at a given time, al
--
-- Estructura de tabla para la tabla `catexp`
--
CREATE TABLE IF NOT EXISTS `catexp`(
CREATE TABLE `catexp` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_cat` int(11) NOT NULL,
`lang` char(5),
`lang` char(5) DEFAULT NULL,
`exp` varchar(30) NOT NULL,
PRIMARY KEY(`id`),
UNIQUE(exp,lang),
CHECK (lang IN ('es-es','en-gb','en-us'))
)
COMMENT="Stores the expressions available in several languages for a given category (id_cat)";
PRIMARY KEY (`id`),
UNIQUE KEY `exp` (`exp`,`lang`)
) ENGINE=InnoDB AUTO_INCREMENT=27958 DEFAULT CHARSET=utf8 COMMENT='Stores the expressions available in several languages for a given category (id_cat)';
-- --------------------------------------------------------
--
......@@ -201,9 +198,9 @@ COMMENT="Stablish access rights to pictos";
CREATE TABLE IF NOT EXISTS `pictocat`(
`id` int(11) PRIMARY KEY,
`id_supercat` int(11)
`id_supercat` int(11) DEFAULT NULL
)
COMMENT="Identifies a category, which, itself, may belong to another category";
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT="Identifies a category, which, itself, may belong to another category";
-- --------------------------------------------------------
......
......@@ -24,14 +24,6 @@
state: import
target: "{{ server_path }}/{{ database_files_relative_path }}/symbolstix.sql"
- name: Imports symbolstix categories
mysql_db:
login_user: "{{ database_user }}"
login_password: "{{ database_user_passwd }}"
name: "{{ database_name }}"
state: import
target: "{{ server_path }}/{{ database_files_relative_path }}/pictocat.sql"
- name: Imports application essential data
mysql_db:
login_user: "{{ database_user }}"
......
......@@ -25,6 +25,7 @@
"admin_panel": "Admin panel",
"alert": "Alert",
"all": "All",
"all_methods": "All methods",
"animation": "Animation",
"apply":"Apply",
"annual": "Annual",
......@@ -75,6 +76,7 @@
"crop_image": "Crop image",
"data_no_saved": "Data can't be saved",
"data_saved": "Data saved",
"date_error": "Filter date to must be greater than since",
"day_format": "yyyy/MM/dd",
"days": "Days",
"days_from_first_session": "days from first session",
......@@ -254,6 +256,7 @@
"password_type": "Password",
"pause": "Pause",
"pause_session": "Pause session",
"percent": "Percent",
"personal_data": "Personal data",
"personal_data": "Personal data",
"phone": "Phone number",
......
......@@ -25,6 +25,7 @@
"admin_panel": "Panel de administración",
"alert": "Alerta",
"all": "Todos",
"all_methods": "Todos los métodos",
"animation": "Animación",
"apply":"Aplicar",
"annual": "Anual",
......@@ -75,6 +76,7 @@
"crop_image": "Recortar imagen",
"data_no_saved": "Los datos no se han podido guardar",
"data_saved": "Datos guardados",
"date_error": "La fecha 'desde' debe ser menor que la fecha 'hasta'",
"day_format": "dd/MM/yyyy",
"days": "Días",
"days_from_first_session": "días desde la primera sesión",
......@@ -253,6 +255,7 @@
"password_short": "La contraseña es muy corta, debe tener al menos una longitud de {{minlength}} caracteres",
"pause": "Pausar",
"pause_session": "Pausar sesión",
"percent": "Porcentaje",
"personal_data": "Datos personales",
"personal_data": "Datos personales",
"phone": "Teléfono",
......
......@@ -8,6 +8,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
$stateParams,
$http,
config,
ngToast,
$filter,
$translate) {
......@@ -63,6 +64,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
class:"instruction-opt", name: "- - "+$scope.fulldata.methods[i].instructions[j].name, id_method: $scope.fulldata.methods[i].id});
}
}
$scope.filter();
})
.error(function(data, status, headers, config) {
console.log("Error from API: " + data.error);
......@@ -86,14 +88,16 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
$scope.filter = function (){
if($scope.reportDateSince > $scope.reportDateTo){
//Mostrar error
$translate('date_error').then(function (translation) {
ngToast.danger({ content: translation });
});
return;
}
$scope.showPrint = true;
$scope.reportDateSinceFormat = moment($scope.reportDateSince).format("DD/MM/YYYY");
$scope.reportDateToFormat = moment($scope.reportDateTo).format("DD/MM/YYYY");
if($scope.selected_method == "-1"){
$scope.printName="All methods";
$scope.printName=$translate.instant('all_methods');
$scope.statistics({id: -1, class: "method-opt"});
}else{
$scope.printName=JSON.parse($scope.selected_method).name;
......@@ -201,8 +205,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
//CHART DATA
//*** Error rate chart***
$scope.labels1 = $scope.method_chart_dates[0];
$scope.series1 = ['Tasa de error'];
//$scope.dataChart1 = [error_rate];
$scope.series1 = [$translate.instant('error_rate')];
$scope.dataChart1 = $scope.error_rate_rate;
$scope.optionsChartDateRate = {
elements:{
......@@ -215,7 +218,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
scales: {
yAxes: [{
scaleLabel: {
labelString: "Porcentaje",
labelString: $translate.instant('percent'),
display: true
}
}],
......@@ -337,7 +340,7 @@ dashboardControllers.controller('StudentReportsCtrl', function StudentReportsCtr
//*** Vocabuary size chart***
$scope.labels4 = $scope.method_chart_dates[0];
$scope.series4 = [$translate.instant('Pictograms')];
$scope.series4 = [$translate.instant('pictograms')];
$scope.dataChart4 = $scope.vocab_size;
//*** Phrase size chart***
......
......@@ -965,19 +965,19 @@ input[type=range]:focus::-ms-fill-upper {
}
.numberCircle {
border-radius: 50%;
behavior: url(PIE.htc); /* remove if you don't care about IE8 */
border-radius: 50%;
behavior: url(PIE.htc); /* remove if you don't care about IE8 */
width: 36px;
height: 36px;
padding: 8px;
width: 36px;
height: 36px;
padding: 8px;
background: #fff;
border: 2px solid #3071a9;
color: #3071a9;
text-align: center;
background: #fff;
border: 2px solid #3071a9;
color: #3071a9;
text-align: center;
font: 32px Arial, sans-serif;
font: 32px Arial, sans-serif;
}
/*
......@@ -995,10 +995,10 @@ input[type=range]:focus::-ms-fill-upper {
ng-file-upload and ngImgCrop
*/
.cropArea {
background: #E4E4E4;
overflow: hidden;
width:500px;
height:350px;
background: #E4E4E4;
overflow: hidden;
width:500px;
height:350px;
}
form .progress {
line-height: 15px;
......@@ -1025,9 +1025,27 @@ form .progress {
}
.header-image {
width: 100%;
background-color: #f8f8f8;
padding-top: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #e7e7e7;
width: 100%;
background-color: #f8f8f8;
padding-top: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #e7e7e7;
}
@media print {
#reportsTitle{
display: inherit;
}
#filter{
display: none;
}
#filter-info{
display: none;
}
#inform-content-date{
display: none;
}
.languages{
display: none;
}
}
......@@ -499,8 +499,8 @@ function toSqlDate(date) {
('00' + date.getDate()).slice(-2) + ' ' +
('00' + date.getHours()).slice(-2) + ':' +
('00' + date.getMinutes()).slice(-2) + ':' +
('00' + date.getSeconds()).slice(-2) + '.' +
('00' + date.getMilliseconds()).slice(-3);
('00' + date.getSeconds()).slice(-2) + '.' +
('00' + date.getMilliseconds()).slice(-3);
return date;
}
......
......@@ -242,8 +242,8 @@ utils.toSqlDate = function toSqlDate(date) {
('00' + date.getDate()).slice(-2) + ' ' +
('00' + date.getHours()).slice(-2) + ':' +
('00' + date.getMinutes()).slice(-2) + ':' +
('00' + date.getSeconds()).slice(-2) + "." +
('00' + date.getMilliseconds()).slice(-3);
('00' + date.getSeconds()).slice(-2) + "." +
('00' + date.getMilliseconds()).slice(-3);
return date;
};
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