modified BDD schema and initial data for multilingual support in methods and instructions

parent af074ed3
...@@ -9,7 +9,7 @@ INSERT INTO `picto_core` (`id`, `id_pic`, `id_cat_pic`, `coord_x`, `coord_y`,`co ...@@ -9,7 +9,7 @@ INSERT INTO `picto_core` (`id`, `id_pic`, `id_cat_pic`, `coord_x`, `coord_y`,`co
(2, 4391, NULL, 1, 0, NULL), -- no (2, 4391, NULL, 1, 0, NULL), -- no
(4, 2237, NULL, 2, 0, NULL), -- i want (4, 2237, NULL, 2, 0, NULL), -- i want
(229, 2224, NULL, 3, 0, NULL), -- i have (229, 2224, NULL, 3, 0, NULL), -- i have
(131, 8148,NULL, 0, 1, '#FE9A2E'), -- Places and rooms (131, 8148, NULL, 0, 1, '#FE9A2E'), -- Places and rooms
(134, 7989, 8148, 0, 0, NULL), -- Places.Hospital (134, 7989, 8148, 0, 0, NULL), -- Places.Hospital
(135, 8155, 8148, 0, 1, NULL), -- Places.Playground (135, 8155, 8148, 0, 1, NULL), -- Places.Playground
(136, 8354, 8148, 0, 2, NULL), -- Places.Zoo (136, 8354, 8148, 0, 2, NULL), -- Places.Zoo
...@@ -229,6 +229,3 @@ INSERT INTO `picto_core` (`id`, `id_pic`, `id_cat_pic`, `coord_x`, `coord_y`,`co ...@@ -229,6 +229,3 @@ INSERT INTO `picto_core` (`id`, `id_pic`, `id_cat_pic`, `coord_x`, `coord_y`,`co
(5, 266, 1379, 3, 5, NULL), -- Adverbs and interjections.help (5, 266, 1379, 3, 5, NULL), -- Adverbs and interjections.help
(7, 2179, 1379, 3, 6, NULL), -- Adverbs and interjections.hello (7, 2179, 1379, 3, 6, NULL), -- Adverbs and interjections.hello
(124, 2169,1379, 3, 7, NULL); -- Adverbs and interjections.bye (124, 2169,1379, 3, 7, NULL); -- Adverbs and interjections.bye
...@@ -21,19 +21,33 @@ INSERT INTO `supervisor` (`id`, `name`, `surname`, `gender`, `pic`, `address`, ` ...@@ -21,19 +21,33 @@ INSERT INTO `supervisor` (`id`, `name`, `surname`, `gender`, `pic`, `address`, `
-- --
-- Meta-method -- Meta-method
-- --
INSERT INTO `meta_method` (`id`, `name`, `description`, `id_sup`) VALUES INSERT INTO `meta_method` (`id`, `name`, `description`, `id_sup`, `lang`) VALUES
(1, 'Comunicación Aumentativa y Adaptativa', NULL, NULL); (1, 'Comunicación Aumentativa y Alternativa', NULL, NULL, 'es-es'),
(2, 'Augmentative and Alternative Communication', NULL, NULL, 'en-us'),
(3, 'Augmentative and Alternative Communication', NULL, NULL, 'en-gb');
-- --
-- Meta-instruction -- Meta-instruction
-- --
INSERT INTO `meta_instruction` (`id` ,`name` ,`objective` ,`id_met`) VALUES INSERT INTO `meta_instruction` (`id` ,`name` ,`objective` ,`id_met`, `lang`) VALUES
(NULL , 'Fase 1 - El Intercambio físico', 'En cuanto vea un objeto altamente preferido, el estudiante tomará la imagen del objeto, se acercará hacia el terapeuta y dejará la imagen (fotografía) en la mano del terapeuta.', '1'), (NULL , 'Fase 1 - El Intercambio físico', 'En cuanto vea un objeto altamente preferido, el estudiante tomará la imagen del objeto, se acercará hacia el terapeuta y dejará la imagen (fotografía) en la mano del terapeuta.', '1', 'es-es'),
(NULL , 'Fase 2 - Desarrollando la espontaneidad', 'El estudiante irá a su tablero de comunicación, tomará una fotografía, irá a un adulto y la dejará en su mano.', '1'), (NULL , 'Fase 2 - Desarrollando la espontaneidad', 'El estudiante irá a su tablero de comunicación, tomará una fotografía, irá a un adulto y la dejará en su mano.', '1', 'es-es'),
(NULL , 'Fase 3 - Discriminación de fotografías', 'El estudiante solicitará los objetos deseados yendo al tablero de comunicación, seleccionando la fotografía apropiada y volviendo de nuevo hasta el interlocutor a darle la fotografía.', '1'), (NULL , 'Fase 3 - Discriminación de fotografías', 'El estudiante solicitará los objetos deseados yendo al tablero de comunicación, seleccionando la fotografía apropiada y volviendo de nuevo hasta el interlocutor a darle la fotografía.', '1', 'es-es'),
(NULL , 'Fase 4 - Estructura de la oración', 'El estudiante solicita artículos presentes y no presentes usando una frase de varias palabras yendo al libro.El estudiante toma una fotografía/símbolo de "Yo quiero" y la coloca en una línea de frase (tira de Velcro). Luego, el estudiante toma una imagen de lo que desea, la coloca en la línea de frase, quita toda la tira de Velcro, y la lleva a su interlocutor.', '1'), (NULL , 'Fase 4 - Estructura de la oración', 'El estudiante solicita artículos presentes y no presentes usando una frase de varias palabras yendo al libro.El estudiante toma una fotografía/símbolo de "Yo quiero" y la coloca en una línea de frase (tira de Velcro). Luego, el estudiante toma una imagen de lo que desea, la coloca en la línea de frase, y la lleva a su interlocutor.', '1', 'es-es'),
(NULL , 'Fase 5 - Respondiendo a "¿Qué quieres?"', 'El estudiante puede de manera espontánea solicitar una variedad de objetos y puede responder a la pregunta, "Que quieres?"', '1'), (NULL , 'Fase 5 - Respondiendo a "¿Qué quieres?"', 'El estudiante puede de manera espontánea solicitar una variedad de objetos y puede responder a la pregunta, "Que quieres?"', '1', 'es-es'),
(NULL , 'Fase 6 - Respuesta y comentario espontáneo', 'El estudiante responde apropiadamente a "Qué quieres?", "Qué ves?", "Qué tienes?" y a otras preguntas similares cuando éstas son hechas de manera aleatoria.', '1'); (NULL , 'Fase 6 - Respuesta y comentario espontáneo', 'El estudiante responde apropiadamente a "Qué quieres?", "Qué ves?", "Qué tienes?" y a otras preguntas similares cuando éstas son hechas de manera aleatoria.', '1', 'es-es'),
(NULL , 'Phase 1 - How to Communicate', 'Students learn to exchange single pictures for items or activities they really want. ', '2', 'en-us'),
(NULL , 'Phase 2 - Distance and Persistence', 'Still using single pictures, students learn to generalize this new skill by using it in different places, with different people and across distances. They are also taught to be more persistent communicators.', '2', 'en-us'),
(NULL , 'Phase 3 - Picture Discrimination', 'Students learn to select from two or more pictures to ask for their favorite things. These are placed in the phrase strip of the device where pictures are stored and easily removed for communication.', '2', 'en-us'),
(NULL , 'Phase 4 - Sentence Structure', 'Students learn to construct simple sentences on a detachable sentence strip using an "I want" picture followed by a picture of the item being requested.', '2', 'en-us'),
(NULL , 'Phase 5 - Answering Questions', 'Students learn to use Pictogram to answer the question, "What do you want?".', '2', 'en-us'),
(NULL , 'Phase 6 - Commenting', 'Now students are taught to comment in response to questions such as, "What do you see?", "What do you hear?" and "What is it?". They learn to make up sentences starting with "I see", "I hear", "I feel", "It is a", etc.', '2', 'en-us'),
(NULL , 'Phase 1 - How to Communicate', 'Students learn to exchange single pictures for items or activities they really want. ', '3', 'en-gb'),
(NULL , 'Phase 2 - Distance and Persistence', 'Still using single pictures, students learn to generalize this new skill by using it in different places, with different people and across distances. They are also taught to be more persistent communicators.', '3', 'en-gb'),
(NULL , 'Phase 3 - Picture Discrimination', 'Students learn to select from two or more pictures to ask for their favorite things. These are placed in the phrase strip of the device where pictures are stored and easily removed for communication.', '3', 'en-gb'),
(NULL , 'Phase 4 - Sentence Structure', 'Students learn to construct simple sentences on a detachable sentence strip using an "I want" picture followed by a picture of the item being requested.', '3', 'en-gb'),
(NULL , 'Phase 5 - Answering Questions', 'Students learn to use Pictogram to answer the question, "What do you want?".', '3', 'en-gb'),
(NULL , 'Phase 6 - Commenting', 'Now students are taught to comment in response to questions such as, "What do you see?", "What do you hear?" and "What is it?". They learn to make up sentences starting with "I see", "I hear", "I feel", "It is a", etc.', '3', 'en-gb');
-- --
-- Volcado de datos para la tabla `source` -- Volcado de datos para la tabla `source`
......
...@@ -94,6 +94,7 @@ CREATE TABLE IF NOT EXISTS `meta_instruction` ( ...@@ -94,6 +94,7 @@ CREATE TABLE IF NOT EXISTS `meta_instruction` (
`name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`objective` varchar(512) COLLATE utf8_unicode_ci DEFAULT NULL, `objective` varchar(512) COLLATE utf8_unicode_ci DEFAULT NULL,
`id_met` tinyint(4) NOT NULL, `id_met` tinyint(4) NOT NULL,
`lang` char(5) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
COMMENT="One in a set of instructions predefined or stored by users. They are related to a metamethod (id_met)"; COMMENT="One in a set of instructions predefined or stored by users. They are related to a metamethod (id_met)";
...@@ -108,6 +109,7 @@ CREATE TABLE IF NOT EXISTS `meta_method` ( ...@@ -108,6 +109,7 @@ CREATE TABLE IF NOT EXISTS `meta_method` (
`name` varchar(40) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(4096) COLLATE utf8_unicode_ci DEFAULT NULL, `description` varchar(4096) COLLATE utf8_unicode_ci DEFAULT NULL,
`id_sup` INT( 11 ) DEFAULT NULL, `id_sup` INT( 11 ) DEFAULT NULL,
`lang` char(5) COLLATE utf8_unicode_ci NOT NULL,
UNIQUE(name,id_sup), UNIQUE(name,id_sup),
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1
......
/**
* catexp.js
*
* @description :: TODO: Write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
tableName : 'catexp',
migrate : 'safe',
schema : true,
autoPK : false,
autoCreatedAt : false,
autoUpdatedAt : false,
attributes: {
id: {
type: "integer",
primaryKey: true,
unique: true
},
id_cat: {
type: "integer",
required: true,
model: 'PictoCat'
},
lang: {
required: true,
type: "string",
size: 5
},
exp: {
required: false,
type: "string",
size: 30
}
}
};
\ No newline at end of file
/**
* pictocat.js
*
* @description :: TODO: Write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
tableName : 'pictocat',
migrate : 'safe',
schema : true,
autoPK : false,
autoCreatedAt : false,
autoUpdatedAt : false,
attributes: {
id: {
type: "integer",
primaryKey: true,
unique: true
},
id_supercat: {
type: "integer",
required: false
},
exps: {
collection: "CatExp",
via: 'id_cat'
}
}
};
\ No newline at end of file
...@@ -57,7 +57,10 @@ ...@@ -57,7 +57,10 @@
<div class="form-group" ng-if="show_change_form"> <div class="form-group" ng-if="show_change_form">
<label>Captcha*</label> <label>Captcha*</label>
<div re-captcha ng-model="captcha_chgpass"></div> <div re-captcha
ng-model="captcha_chgpass"
size="compact"
lang="es"></div>
</div> </div>
<p class="text-center"> <p class="text-center">
......
...@@ -138,6 +138,45 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -138,6 +138,45 @@ dashboardControllers.controller('AddPictoCtrl', function (
}; };
/** /**
* It replaces the image associated to a picto (making a
* POST request to /picto/upload) but keeping the rest of attributes.
* @param {Array of Objects} $files Array of pictos to be uploaded the file
* itself (as binary data) will be sent.
*/
$scope.changePictoImg = function ($files, id_pic) {
$files.forEach(function (file) {
if (file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif') {
$upload.upload({
url: '/picto/update',
method: 'UPDATE',
fields: { owner: supervisor.id, id_pic: id_pic},
file: file
}).success(function (picto) {
$translate('picto_upload_success').then(function (translation) {
ngToast.success(translation);
});
picto.expressions = [];
$scope.pictos.push(picto);
$scope.open_exp(picto);
}).error(function (err) {
if (err.code == "E_EXCEEDS_UPLOAD_LIMIT")
$translate('picto_upload_limit').then(function (translation) {
ngToast.danger(translation);
});
else
$translate('picto_upload_error').then(function (translation) {
ngToast.danger(translation);
});
});
} else {
$translate('invalid_file_type').then(function (translation) {
ngToast.danger(translation);
});
}
});
};
/**
* When a image file is selected it tries to upload it as custom picto (making a * When a image file is selected it tries to upload it as custom picto (making a
* POST request to /picto/upload). * POST request to /picto/upload).
* @param {Array of Objects} $files Array of pictos to be uploaded the file * @param {Array of Objects} $files Array of pictos to be uploaded the file
......
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