Commit e345e84a by Pablo Molina

Fixed #409, pérdida de contraseña al actualizar estudiante

Se ha añadido una comprobación tanto en el cliente como en el servidor para comprobar si el valor introducido como contraseña tiene un valor verdadero (no vacío).

Además se han corregido los tests asociados a este error y se han actualizado los datos de ejemplo de la base de datos CAJA.
parent 25d6599b
......@@ -2,11 +2,11 @@
echo "-- Running pictogram server"
if [ -e "src/app.js" ]; then
cd src && forever start app.js
cd src && npm start
elif [ -e "/vagrant/src/app.js" ]; then
cd /vagrant/src && forever start app.js
cd /vagrant/src && npm start
elif [ -e "/home/vagrant/sync/src/app.js" ]; then
cd /home/vagrant/sync/src && forever start app.js
cd /home/vagrant/sync/src && npm start
else
echo "-- app.js not found, cannot run pictogram server"
exit
......
......@@ -388,7 +388,7 @@ CREATE TABLE IF NOT EXISTS `supervisor` (
`name` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`surname` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
`gender` char(1) COLLATE utf8_unicode_ci NOT NULL,
`pic` varchar(255) COLLATE utf8_unicode_ci DEFAULT '/upload/supervisorAvatar/defaultAvatar.jpg',
`pic` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'defaultAvatar.jpg',
`address` varchar(180) COLLATE utf8_unicode_ci DEFAULT NULL,
`country` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
......
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Datos de prueba `pictodb`
--
SET foreign_key_checks=0;
SET foreign_key_checks = 0;
--
-- Vaciado de tablas (opcional, se puede comentar)
-- Oficina
--
-- TRUNCATE supervisor;
-- TRUNCATE student;
-- TRUNCATE stu_sup;
-- TRUNCATE office;
-- TRUNCATE stu_picto;
--
-- Volcado de datos para la tabla `office`
--
INSERT INTO `office` (
`name`,
`address`,
`country`,
`contact_person`,
`email`,
`phone1`,
`lang`
) VALUES (
'Comunicación Aumentativa JAén (CAJA)',
'Paraje Las Lagunillas, Ed A3, primera plata, 23071. Jaén',
'ES',
'Fernando Martínez Santiago',
'dofer@ujaen.es',
'+34 953 21 28 88',
'es-es'
);
--
-- Alta de gabinete CAJA
-- Supervisores
--
INSERT INTO `office` (`name`, `address`, `country`, `contact_person`, `email`, `phone1`, `lang`) VALUES
('Comunicación Aumentativa JAén (CAJA)',
'Paraje Las Lagunillas, Ed A3, primera plata, 23071. Jaén',
'ES',
'Fernando Martínez Santiago',
'dofer@ujaen.es',
'+34 953 21 28 88',
'es-es')
;
INSERT INTO `supervisor` (
`name`,
`surname`,
`gender`,
`address`,
`email`,
`phone`,
`lang`,
`password`,
`active`,
`id_off`,
`pic`
) VALUES (
'Fernando',
'Martínez Santiago',
'M',
NULL,
'dofer@ujaen.es',
'+34953212888',
'es-es',
'$2a$10$Q4jHNlC58.ptfl/5wZeHfOIvpJslJHKOFNZO3bWs4it7TifQPQnEa',
true,
(SELECT id from office where email='dofer@ujaen.es'),
'test_caja_dofer.jpg'
), (
'Miguel Ángel',
'García Cumbreras',
'M',
NULL,
'magc@ujaen.es',
'+34953212420',
'es-es',
'$2a$04$XQvWUwGTvjR47ChPwd3f6ukx8Zg.7o1N4Kf6P.zqhVtQxVNArOsXi',
true,
(SELECT id from office where email='dofer@ujaen.es'),
'test_caja_miguel.jpg'
), (
'Arturo',
'Montejo Ráez',
'M',
NULL,
'amontejo@ujaen.es',
'+34953212882',
'es-es',
'$2a$04$yoBXAMSgCVGSIr2pnuIOw.J8UCm8f2XkATu5rqsMJiEmlxBHs5.cO',
true,
(SELECT id from office where email='dofer@ujaen.es'),
'test_caja_arturo.jpg'
), (
'Alfonso',
'Ureña López',
'M',
NULL,
'laurena@ujaen.es',
'+34953212895',
'es-es',
'$2a$04$zVGHJFafoZa60wo1yBqF/Oi3RXV/qS2cq0/j/W3Dkf4P1ad0e7.iS',
true,
(SELECT id from office where email='dofer@ujaen.es'),
'test_caja_alfonso.jpg'
), (
'Jesús',
'Navarro Moreno',
'M',
NULL,
'jnavarro@ujaen.es',
'+34953211912',
'es-es',
'$2a$04$8O3Jd5j9/nM/KC.b1a8qRevyUwWUx6XGU3Gm754Y/8PpLO2jv.i76',
true,
(SELECT id from office where email='dofer@ujaen.es'),
'defaultAvatar.jpg'
);
--
-- Alta de gabinete CAJA
-- Tutores
--
-- CAJA
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `email`, `phone`, `lang`, `password`, `active`, `id_off`)
(SELECT 'Fernando','Martínez Santiago', 'M', NULL, 'dofer@ujaen.es', '+34953212888', 'es-es', '$2a$10$Q4jHNlC58.ptfl/5wZeHfOIvpJslJHKOFNZO3bWs4it7TifQPQnEa', true, id from office where name='Comunicación Aumentativa JAén (CAJA)');
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `email`, `phone`, `lang`, `password`, `active`, `id_off`)
(SELECT 'Miguel Ángel','García Cumbreras', 'M', NULL, 'magc@ujaen.es', '+34953212420', 'es-es', '$2a$04$XQvWUwGTvjR47ChPwd3f6ukx8Zg.7o1N4Kf6P.zqhVtQxVNArOsXi', true, id from office where name='Comunicación Aumentativa JAén (CAJA)');
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `email`, `phone`, `lang`, `password`, `active`, `id_off`)
(SELECT 'Arturo','Montejo Ráez', 'M', NULL, 'amontejo@ujaen.es', '+34953212882', 'es-es', '$2a$04$yoBXAMSgCVGSIr2pnuIOw.J8UCm8f2XkATu5rqsMJiEmlxBHs5.cO', true, id from office where name='Comunicación Aumentativa JAén (CAJA)');
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `email`, `phone`, `lang`, `password`, `active`, `id_off`)
(SELECT 'Alfonso','Ureña López', 'M', NULL, 'laurena@ujaen.es', '+34953212895', 'es-es', '$2a$04$zVGHJFafoZa60wo1yBqF/Oi3RXV/qS2cq0/j/W3Dkf4P1ad0e7.iS', true, id from office where name='Comunicación Aumentativa JAén (CAJA)');
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `email`, `phone`, `lang`, `password`, `active`, `id_off`)
(SELECT 'Jesús','Navarro Moreno', 'M', NULL, 'jnavarro@ujaen.es', '+34953211912', 'es-es', '$2a$04$8O3Jd5j9/nM/KC.b1a8qRevyUwWUx6XGU3Gm754Y/8PpLO2jv.i76', true, id from office where name='Comunicación Aumentativa JAén (CAJA)');
--
-- Tutores CAJA
--
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `country`, `email`, `phone`, `lang`, `password`, `active`) VALUES
('Don Fernando', 'Padre Fernandito', 'M','C/ Mayor, 13. Jaén', 'ES', 'donfernando@gmail.com', '+34 232 232 232', 'es-es', '$2a$04$DMOX/cZ4h6cNJW9VlCou7O266q4YDYuS6p0QzP.gBHd08.QnFQWD.', true);
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `country`, `email`, `phone`, `lang`, `password`, `active`) VALUES
('Don Arturo', 'Padre Arturito', 'M','Avda. Andalucía 1. Jaén','ES', 'donarturo@gmail.com', NULL, 'es-es', '$2a$04$V2ods9MMmOFvdLTaHJqk3ejKEYdf28gvfDhaBkOSLCFJOC02TweFK', true);
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `country`, `email`, `phone`, `lang`, `password`, `active`) VALUES
('Don Miguel', 'Padre Miguelito', 'F', 'C/ Calatrava, 13. Córdoba', 'ES', 'donmiguel@gmail.com', NULL, 'es-es', '$2a$04$1UCak614LKz6WpDBtOblQeqFF41tOMy6ERMnP2OuGVZffe8Yi0mJq', true);
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `country`, `email`, `phone`, `lang`, `password`, `active`) VALUES
('Don Afonso', 'Padre Alfonsito', 'M','Avda. Andalucía 1. Jaén','ES', 'donalfonso@gmail.com', NULL, 'es-es', '$2a$04$$2a$04$KktXwe06AJg3vMUEX1E1/esbP.g8f79mtcNGjCsrEDWktmegcML4q', true);
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `country`, `email`, `phone`, `lang`, `password`, `active`) VALUES
('Doña Alfonsa', 'Madre Alfonsita', 'F', 'C/ Calatrava, 13. Córdoba', 'ES', 'doñaalfonsa@gmail.com', NULL, 'es-es', '$2a$04$ALDmQ1oRhRZKUEi1b0eK1ehQmSZiFkhzx48ZBwER0J4vakvlYc5VS', true);
INSERT INTO `supervisor` (`name`, `surname`, `gender`, `address`, `country`, `email`, `phone`, `lang`, `password`, `active`) VALUES
('Don Jesús', 'Padre Jesusito', 'M','Avda. Andalucía 1. Jaén','ES', 'donjesus@gmail.com', NULL, 'es-es', '$2a$04$Psuu6IMPUj1sbzR.uxq3EOgX1/4dFNmccjkv76LhKp35JzpiCE.fm', true);
--
-- Actualización de `office` con el id del supervisor admin
--
UPDATE office SET admin=(SELECT id FROM supervisor where name='Fernando' and surname='Martínez Santiago') WHERE name='Comunicación Aumentativa JAén (CAJA)';
INSERT INTO `supervisor` (
`name`,
`surname`,
`gender`,
`address`,
`country`,
`email`,
`phone`,
`lang`,
`password`,
`active`
) VALUES (
'Don Fernando',
'Padre Fernandito',
'M',
'C/ Mayor, 13. Jaén',
'ES',
'donfernando@gmail.com',
'+34 232 232 232',
'es-es',
'$2a$04$DMOX/cZ4h6cNJW9VlCou7O266q4YDYuS6p0QzP.gBHd08.QnFQWD.',
true
), (
'Don Arturo',
'Padre Arturito',
'M',
'Avda. Andalucía 1. Jaén',
'ES',
'donarturo@gmail.com',
NULL,
'es-es',
'$2a$04$V2ods9MMmOFvdLTaHJqk3ejKEYdf28gvfDhaBkOSLCFJOC02TweFK',
true
), (
'Don Miguel',
'Padre Miguelito',
'F',
'C/ Calatrava, 13. Córdoba',
'ES',
'donmiguel@gmail.com',
NULL,
'es-es',
'$2a$04$1UCak614LKz6WpDBtOblQeqFF41tOMy6ERMnP2OuGVZffe8Yi0mJq',
true
), (
'Don Afonso',
'Padre Alfonsito',
'M',
'Avda. Andalucía 1. Jaén',
'ES',
'donalfonso@gmail.com',
NULL,
'es-es',
'$2a$04$$2a$04$KktXwe06AJg3vMUEX1E1/esbP.g8f79mtcNGjCsrEDWktmegcML4q',
true
), (
'Doña Alfonsa',
'Madre Alfonsita',
'F',
'C/ Calatrava, 13. Córdoba',
'ES',
'doñaalfonsa@gmail.com',
NULL,
'es-es',
'$2a$04$ALDmQ1oRhRZKUEi1b0eK1ehQmSZiFkhzx48ZBwER0J4vakvlYc5VS',
true
), (
'Don Jesús',
'Padre Jesusito',
'M',
'Avda. Andalucía 1. Jaén',
'ES',
'donjesus@gmail.com',
NULL,
'es-es',
'$2a$04$Psuu6IMPUj1sbzR.uxq3EOgX1/4dFNmccjkv76LhKp35JzpiCE.fm',
true
);
--
-- Supervisores de CAJA
-- Actualización de `office` con el id del supervisor admin
--
UPDATE supervisor SET pic='/upload/supervisors/dofer.jpg' WHERE name='Fernando' and surname='Martínez Santiago';
UPDATE supervisor SET pic='http://wwwdi.ujaen.es/sites/default/files/foto1.jpg?1403259981' WHERE name='Arturo' and surname='Montejo Raéz';
UPDATE supervisor SET pic='http://wwwdi.ujaen.es/sites/default/files/magc_0.jpg?1244537764' WHERE name='Miguel Ángel' and surname='García Cumbreras';
UPDATE supervisor SET pic='http://wwwdi.ujaen.es/sites/default/files/foto_informal.jpg?1403609246' WHERE name='Alfonso' and surname='Ureña López';
UPDATE supervisor SET pic='http://wwwdi.ujaen.es/sites/default/files/magc_0.jpg?1244537764' WHERE name='Jesús' and surname='Navarro Moreno';
UPDATE office
SET admin=(SELECT id FROM supervisor where email='dofer@ujaen.es')
WHERE email='dofer@ujaen.es';
--
-- CAJA Students
--
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('faf0001', '$2a$10$oy98CXG9YWbjATOESXelDu8HVjDHFPVpX5kmfdQSbkNC965Z2zPkC', 'Fernandito', 'Alumno Fernando','2009-12-10','M','ES','/upload/students/juan.jpg',NULL,'es-es', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "es" }]}')
;
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('faf0002', '$2a$10$FOJ2fmJaHyI5sWe1tQojFuhoPpqHSTVPwvHPTpWEftFPI28VdyYNq', 'Fernandita', 'Alumna Fernando','2009-12-10','F','GB','/upload/students/kate.jpg',NULL,'en-gb', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}')
;
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('mam0001', '$2a$10$zygC/WviDviyZQsMsNqK8.tSUI4Qr/dLlLrw0i5kR1bbN4SeU5ACq', 'Miguelín', 'Alumno Miguel','2009-12-10','M','ES','/upload/students/carlos.jpg',NULL,'es-es', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "es" }]}')
;
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('mam0002', '$2a$10$xbyNUhf9rqhdXDBrvUSiOuJIzUVOyyz9ToQMCByFThiiiPwO0PWgK', 'Miguelita', 'Alumna Miguel','2009-12-10','F','ES','/upload/students/rocio.jpg',NULL,'es-es', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}')
;
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('aaa0001', '$2a$10$koWKIn42UNSi1N67akxjpOuJNwpXJ/vOe6biD2xkjrUz6dr3g.Wa.', 'Arturito', 'Alumno Arturo','2009-12-10','M','ES','/upload/students/samuel.jpg',NULL,'es-es', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "es" }]}')
;
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('aaa0002', '$2a$10$ffAjZjWN0UKja0JO7ko6qup4x2phbY3VpC66TmpMnGdWUutBFeWY2', 'Arturita', 'Alumna Arturo','2009-12-10','F','ES','/upload/students/adela.jpg',NULL,'es-es', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}')
;
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('aaa0003', '$2a$10$glc5A6vyPve5.4407Vdkau5CHF3GOpA0Uo6rxMDdIopIWTJK0nBse', 'Alfonsita', 'Alumna Alfonso','2009-12-10','F','ES','/upload/students/adela.jpg',NULL,'es-es', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}')
;
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('aaa0004', '$2a$10$tezK07jq5ZMdQbCboubEBeHiXWJisZPAbgN301n5kRLXkq8xOlb4O', 'Alfonsito', 'Alumno Alfonso','2009-12-10','M','ES','/upload/students/juan.jpg',NULL,'es-es', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}')
;
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('jaj0001', '$2a$10$UQYGXOOE8mxxOjvgo8cjwOpsv5jCtRXpMTLpbD3TzMBiUIv3hXlnO', 'Jesusita', 'Alumna Jesús','2009-12-10','F','ES','/upload/students/adela.jpg',NULL,'es-es', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}')
;
INSERT INTO `student` (`username`, `password`, `name`, `surname`, `birthdate`, `gender`, `country`, `pic`, `notes`, `lang`, `attributes`) VALUES
('jaj0002', '$2a$10$tVy3Wfu35l4B6bFpnjJCE.ckjncq6YCKMGW4B9abesbiFVeyGu2Dy', 'Jesusito', 'Alumno Jesús','2009-12-10','M','ES','/upload/students/samuel.jpg',NULL,'es-es', '{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}')
;
INSERT INTO `student` (
`username`,
`password`,
`name`,
`surname`,
`birthdate`,
`gender`,
`country`,
`pic`,
`notes`,
`lang`,
`attributes`
) VALUES (
'faf0001',
'$2a$10$oy98CXG9YWbjATOESXelDu8HVjDHFPVpX5kmfdQSbkNC965Z2zPkC',
'Fernandito',
'Alumno Fernando',
'2009-12-10',
'M',
'ES',
'test_caja_juan.jpg',
NULL,
'es-es',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "es" }]}'
), (
'faf0002',
'$2a$10$FOJ2fmJaHyI5sWe1tQojFuhoPpqHSTVPwvHPTpWEftFPI28VdyYNq',
'Fernandita',
'Alumna Fernando',
'2009-12-10',
'F',
'GB',
'test_caja_kate.jpg',
NULL,
'en-gb',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}'
), (
'mam0001',
'$2a$10$zygC/WviDviyZQsMsNqK8.tSUI4Qr/dLlLrw0i5kR1bbN4SeU5ACq',
'Miguelín',
'Alumno Miguel',
'2009-12-10',
'M',
'ES',
'test_caja_carlos.jpg',
NULL,
'es-es',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "es" }]}'
), (
'mam0002',
'$2a$10$xbyNUhf9rqhdXDBrvUSiOuJIzUVOyyz9ToQMCByFThiiiPwO0PWgK',
'Miguelita',
'Alumna Miguel',
'2009-12-10',
'F',
'ES',
'test_caja_rocio.jpg',
NULL,
'es-es',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}'
), (
'aaa0001',
'$2a$10$koWKIn42UNSi1N67akxjpOuJNwpXJ/vOe6biD2xkjrUz6dr3g.Wa.',
'Arturito',
'Alumno Arturo',
'2009-12-10',
'M',
'ES',
'test_caja_samuel.jpg',
NULL,
'es-es',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "es" }]}'
), (
'aaa0002',
'$2a$10$ffAjZjWN0UKja0JO7ko6qup4x2phbY3VpC66TmpMnGdWUutBFeWY2',
'Arturita',
'Alumna Arturo',
'2009-12-10',
'F',
'ES',
'test_caja_adela.jpg',
NULL,
'es-es',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}'
), (
'aaa0003',
'$2a$10$glc5A6vyPve5.4407Vdkau5CHF3GOpA0Uo6rxMDdIopIWTJK0nBse',
'Alfonsita',
'Alumna Alfonso',
'2009-12-10',
'F',
'ES',
'test_caja_adela.jpg',
NULL,
'es-es',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}'
), (
'aaa0004',
'$2a$10$tezK07jq5ZMdQbCboubEBeHiXWJisZPAbgN301n5kRLXkq8xOlb4O',
'Alfonsito',
'Alumno Alfonso',
'2009-12-10',
'M',
'ES',
'test_caja_juan.jpg',
NULL,
'es-es',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}'
), (
'jaj0001',
'$2a$10$UQYGXOOE8mxxOjvgo8cjwOpsv5jCtRXpMTLpbD3TzMBiUIv3hXlnO',
'Jesusita',
'Alumna Jesús',
'2009-12-10',
'F',
'ES',
'test_caja_adela.jpg',
NULL,
'es-es',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}'
), (
'jaj0002',
'$2a$10$tVy3Wfu35l4B6bFpnjJCE.ckjncq6YCKMGW4B9abesbiFVeyGu2Dy',
'Jesusito',
'Alumno Jesús',
'2009-12-10',
'M',
'ES',
'test_caja_samuel.jpg',
NULL,
'es-es',
'{"stu-att" : [{ "categories" : "on", "input feedback" : [ "vibration", "tts" ], "input selection" : "click", "pictogram size" : "medium", "tts engine" : "IVONA Text-to-Speech HQ", "tts voice": "en" }]}'
);
--
-- CAJA student-supervisor
--
INSERT INTO `stu_sup`(id_stu,id_sup) SELECT DISTINCT A.id, B.id FROM student A, supervisor B WHERE A.name='Fernandito' and B.name='Fernando';
INSERT INTO `stu_sup`(id_stu,id_sup) SELECT DISTINCT A.id, B.id FROM student A, supervisor B WHERE A.name='Fernandita' and B.name='Fernando';
INSERT INTO `stu_sup`(id_stu,id_sup) SELECT DISTINCT A.id, B.id FROM student A, supervisor B WHERE A.name='Arturito' and B.name='Fernando';
......@@ -140,10 +357,10 @@ INSERT INTO `stu_sup`(id_stu,id_sup) SELECT DISTINCT A.id, B.id FROM student A,
INSERT INTO `stu_sup`(id_stu,id_sup) SELECT DISTINCT A.id, B.id FROM student A, supervisor B WHERE A.name='Alfonsito' and B.name='Don Alfonso';
INSERT INTO `stu_sup`(id_stu,id_sup) SELECT DISTINCT A.id, B.id FROM student A, supervisor B WHERE A.name='Alfonsita' and B.name='Doña Alfonsa';
--
-- Student's CAJA offices
--
UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='Fernando') WHERE student.name='Fernandito';
UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='Miguel Ángel') WHERE student.name='Miguelín';
UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='Arturo') WHERE student.name='Arturito';
......@@ -155,22 +372,41 @@ UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='
UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='Jesús') WHERE student.name='Jesusito';
UPDATE student SET id_off=(SELECT id_off FROM supervisor WHERE supervisor.name='Jesús') WHERE student.name='Jesusita';
select a.name,b.attributes,text from student a, stu_picto b, picto c, picto_exp d where a.id=b.id_stu and b.id_pic=c.id and c.id=d.id_pic and a.id=23 and a.lang=d.lang;
--
-- CAJA Core vocabulary
--
INSERT INTO stu_picto(id_stu,id_pic,attributes)
INSERT INTO stu_picto(id_stu,id_pic,attributes)
SELECT S.id,P.id_pic, concat('{"id_cat":', if (id_cat_pic is null, 'null',id_cat_pic),
',"coord_x":',coord_x,
',"coord_y":',coord_y,
',"status":"invisible"',
',"highlight":false',
',"color":', if (color is null, 'null',concat('"',color,'"')),
'}') as attributes
FROM student S, picto_core_cat P
'}') as attributes
FROM student S, picto_core_cat P
WHERE S.id_off =(SELECT id from office where name='Comunicación Aumentativa JAén (CAJA)');
--
-- Test method
--
INSERT INTO meta_method(name) VALUES (
'Test MetaMethod'
);
INSERT INTO method(name, id_stu) VALUES (
'Test Method',
(SELECT id FROM student WHERE username='aaa0002')
);
INSERT INTO instruction(name, id_met) VALUES (
'Test Instruction',
(SELECT id FROM method WHERE name='Test Method')
);
INSERT INTO working_session (id_sup, id_ins) VALUES (
(SELECT id FROM supervisor WHERE email='dofer@ujaen.es'),
(SELECT id FROM instruction WHERE name='Test Instruction')
);
SET foreign_key_checks=1;
......@@ -255,6 +255,11 @@ module.exports = {
return res.json(500, {
error: "No student found"
});
if (!req.body.password) {
delete req.body.password;
}
// copy attributes
for (k in req.body) stu[k] = req.body[k];
stu.save(function (stuSaveError, saved) {
......
......@@ -16,7 +16,10 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
// For tab navigation (here too, if the user refresh the page...)
$scope.nav.tab = 'setup';
// When a picture is selected, launch the request
/**
* Updates the student picture
* @param {Angular file array} $files Image to be uploaded
*/
$scope.onFileSelect = function ($files) {
var i;
var file;
......@@ -57,46 +60,58 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
}
};
// Open calendar
$scope.open_calendar = function ($event) {
$event.preventDefault();
$event.stopPropagation();
/**
* Opens the calendar for selecting student's birthdate.
* Prevents the propagation of the click event.
* @param {event} Click event
*/
$scope.openCalendar = function (event) {
event.stopPropagation();
$scope.opened = true;
};
// Save personal info updated
$scope.update_student = function () {
// Validate password match
if ($scope.formUser.password_confirm &&
!$scope.formUser.password_confirm.length &&
$scope.formUser.password !== $scope.formUser.password_confirm) {
$translate('password_match').then(function (translation) {
ngToast.danger({ content: translation });
});
return;
}
/**
* Sends the student new information to the server.
* If any password has been entered in the form, both password and password_confirm must match,
* otherwise the password field is ignored.
*/
$scope.updateStudent = function () {
var password;
// password not changed (don't send it to DB)
if ($scope.formUser.password_confirm &&
!$scope.formUser.password_confirm.length) {
delete $scope.formUser.password;
delete $scope.formUser.password_confirm;
if ($scope.formUser.password_confirm || $scope.formUser.password) {
if ($scope.formUser.password_confirm === $scope.formUser.password) {
password = $scope.formUser.password;
} else {
$translate('password_match').then(function (translation) {
ngToast.danger({ content: translation });
});
return;
}
}
$http.put(config.backend + '/stu/' + $scope.studentData.id, $scope.formUser)
$http.put(config.backend + '/stu/' + $scope.studentData.id, {
birthdate: $scope.formUser.birthdate,
country: $scope.formUser.country,
gender: $scope.formUser.gender,
lang: $scope.formUser.lang,
name: $scope.formUser.name,
notes: $scope.formUser.notes,
surname: $scope.formUser.surname,
username: $scope.formUser.username,
password: password
})
.success(function (data) {
$translate('student_updated').then(function (translation) {
ngToast.success({ content: translation });
});
$scope.studentData.surname = data.surname;
$scope.studentData.birthdate = data.birthdate;
$scope.studentData.country = data.country;
$scope.studentData.pic = data.pic;
$scope.studentData.gender = data.gender;
$scope.studentData.lang = data.lang;
$scope.studentData.notes = data.notes;
$scope.formUser.birthdate = data.birthdate;
$scope.formUser.country = data.country;
$scope.formUser.gender = data.gender;
$scope.formUser.lang = data.lang;
$scope.formUser.name = data.name;
$scope.formUser.notes = data.notes;
$scope.formUser.surname = data.surname;
$scope.formUser.username = data.username;
})
.error(function () {
$translate.danger('student_not_updated', function (translation) {
......@@ -105,13 +120,16 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
});
};
// Search supervisor by email
$scope.search_sup = function () {
/**
* Get a supervisor by their email and updates the $scope.supToAdd element.
* The email used for search is fetched from $scope.email_sup.
*/
$scope.getSupervisorByEmail = function () {
// Find tutor by email
$http.get(config.backend + '/sup/email/' + $scope.email_sup)
.success(function (data) {
if (data.length > 0) {
$scope.supToAdd = data[0];
if (data) {
$scope.supToAdd = data;
$scope.showmessagesupfound = true;
$scope.showmessagesupnotfound = false;
} else {
......@@ -188,8 +206,8 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
$http.get(config.backend + '/sup/email/' + $scope.email_tutor)
.success(function (data) {
// If it found the length is > 0
if (data.length > 0) {
$scope.tutorToAdd = data[0];
if (data) {
$scope.tutorToAdd = data;
// Show message for validate
$scope.showmessagetutorfound = true;
$scope.showmessagetutornotfound = false;
......
<div class="panel panel-default student_tab_panel">
<div class="panel-body">
<div class="row">
<!-- Parte izquierda: Datos personales -->
<div class="col-md-6">
<div id="student_personal_edit">
<form role="form" ng-submit="update_student()">
<!-- Cambiar imagen de perfil -->
<div class="form-group">
<h4><span class="glyphicon glyphicon-picture" aria-hidden="true"></span> {{ 'change_picture' | translate }}: </h4>
<!-- Input oculto para cargar la redimensión de la imagen (awesome-cropper) -->
<input type="file" ng-file-select="onFileSelect($files)" ng-model="picFile" accept="image/*">
</div>
<!-- Preview -->
<img class="thumbnail preview" ng-src="{{studentData.pic}}" />
<!-- Fin Cambiar imagen de perfil -->
<!-- Datos personales del alumno -->
<fieldset>
<legend translate>account</legend>
<div class="form-group">
<input type="username" class="form-control" id="setup_username" placeholder="{{ 'username' | translate }}" required ng-model="formUser.username" readonly/>
</div>
<div class="form-group">
<input type="password" class="form-control" id="setup_password1" placeholder="{{ 'password_new_type' | translate }}" ng-model="formUser.password" />
</div>
<div class="form-group">
<input type="password" class="form-control" id="setup_password2" placeholder="{{ 'password_confirm' | translate }}" ng-model="formUser.password_confirm" />
</div>
<legend translate>personal_data</legend>
<div class="form-group">
<input type="text" class="form-control" id="student_personal_edit_name" placeholder="{{ 'name' | translate }}" ng-model="formUser.name" required />
</div>
<div class="form-group">
<input type="text" class="form-control" id="student_personal_edit_surname" placeholder="{{ 'surname' | translate }}" ng-model="formUser.surname" required />
</div>
<div class="form-group">
<p class="input-group">
<input type="text" class="form-control" datepicker-popup=" {{ 'day_format' | translate }}" ng-model="formUser.birthdate" placeholder="{{ 'birthdate' | translate }}" is-open="opened" close-text="{{'close' | translate}}" required />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open_calendar($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
<div class="form-group">
<select class="form-control" name="student_gender" id="student_gender" ng-model="formUser.gender" required>
<option value="F" selected translate>woman</option>
<option value="M" translate>man</option>
</select>
</div>
<div class="form-group">
<input type="text" class="form-control" id="student_country" placeholder="{{ 'country' | translate }}" ng-model="formUser.country" />
</div>
<!-- Fin de datos personales del alumno -->
<fieldset>
<legend translate>notes</legend>
<div class="form-group">
<textarea class="form-control" name="student_notes" id="student_notes" ng-model="formUser.notes" rows="5"></textarea>
</div>
</fieldset>
<fieldset>
<legend translate>language</legend>
<div class="form-group">
<select class="form-control" name="supervisor_language" id="supervisor_language" ng-model="formUser.lang">
<option value="es-es">Español</option>
<option value="en-gb">English</option>
</select>
</div>
</fieldset>
<div class="form-group text-center">
<button type="submit" class="btn btn-primary" translate>save</button>
</div>
</form>
<div class="panel panel-default student_tab_panel">
<div class="panel-body">
<div class="row">
<!-- Parte izquierda: Datos personales -->
<div class="col-md-6">
<div id="student_personal_edit">
<form role="form" ng-submit="updateStudent()">
<!-- Cambiar imagen de perfil -->
<div class="form-group">
<h4><span class="glyphicon glyphicon-picture" aria-hidden="true"></span> {{ 'change_picture' | translate }}: </h4>
<!-- Input oculto para cargar la redimensión de la imagen (awesome-cropper) -->
<input type="file" ng-file-select="onFileSelect($files)" ng-model="picFile" accept="image/*">
</div>
<!-- Fin de student_personal_edit -->
</div>
<!-- Parte derecha: Tutores y dispositivos -->
<div class="col-md-6">
<!-- Preview -->
<img class="thumbnail preview" ng-src="{{studentData.pic}}" />
<!-- Fin Cambiar imagen de perfil -->
<!-- Supervisores (terapeutas) del alumno -->
<div id="student_sups">
<h4 translate>supervisors</h4>
<!-- Buscador de supervisores -->
<p>
<form role="search" ng-submit="search_sup()">
<div class="input-group">
<input type="email" class="form-control" placeholder="{{ 'search_sup_email' | translate }}" name="email_sup" id="email_sup" ng-model="email_sup" required>
<div class="input-group-btn">
<button class="btn btn-default" type="submit">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
</form>
</p>
<fieldset>
<legend translate>account</legend>
<div class="form-group">
<input type="username" class="form-control" id="setup_username" placeholder="{{ 'username' | translate }}" required ng-model="formUser.username" readonly/>
</div>
<div class="form-group">
<input type="password" class="form-control" id="setup_password1" placeholder="{{ 'password_new_type' | translate }}" ng-model="formUser.password" />
</div>
<div class="form-group">
<input type="password" class="form-control" id="setup_password2" placeholder="{{ 'password_confirm' | translate }}" ng-model="formUser.password_confirm" />
</div>
<legend translate>personal_data</legend>
<div class="form-group">
<input type="text" class="form-control" id="student_personal_edit_name" placeholder="{{ 'name' | translate }}" ng-model="formUser.name" required />
</div>
<div class="form-group">
<input type="text" class="form-control" id="student_personal_edit_surname" placeholder="{{ 'surname' | translate }}" ng-model="formUser.surname" required />
</div>
<div class="form-group">
<p class="input-group">
<input type="text" class="form-control" datepicker-popup=" {{ 'day_format' | translate }}" ng-model="formUser.birthdate" placeholder="{{ 'birthdate' | translate }}" is-open="opened" close-text="{{'close' | translate}}" required />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openCalendar($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
<div class="form-group">
<select class="form-control" name="student_gender" id="student_gender" ng-model="formUser.gender" required>
<option value="F" selected translate>woman</option>
<option value="M" translate>man</option>
</select>
</div>
<div class="form-group">
<input type="text" class="form-control" id="student_country" placeholder="{{ 'country' | translate }}" ng-model="formUser.country" />
</div>
</fieldset>
<!-- Alert and success messages for supervisor found -->
<div ng-show="{{ 'showmessagesupfound' }}" class="alert alert-info">
<!-- Imagen de perfil del tutor -->
<img ng-src="{{supToAdd.pic}}" class="profile" alt="" title="" /> {{ supToAdd.name }} {{ supToAdd.surname }}
<a class="btn btn-default btn-lg pull-right" role="button" ng-click="add_sup()" translate>add</a>
<fieldset>
<legend translate>notes</legend>
<div class="form-group">
<textarea class="form-control" name="student_notes" id="student_notes" ng-model="formUser.notes" rows="5"></textarea>
</div>
</fieldset>
<fieldset>
<legend translate>language</legend>
<div class="form-group">
<select class="form-control" name="supervisor_language" id="supervisor_language" ng-model="formUser.lang">
<option value="es-es">Español</option>
<option value="en-gb">English</option>
</select>
</div>
<!-- Fin de buscador de supervisores -->
</fieldset>
<!-- Supervisores asignados -->
<ul class="list-group" id="user_sups">
<li class="list-group-item" ng-repeat="sup in studentSupervisors">
<!-- Imagen de perfil del supervisor -->
<img ng-src="{{sup.pic}}" class="profile" alt="" title="" />
{{sup.name}} {{sup.surname}}
<a ng-click="delete_sup(sup.id)" class="delete_sup" title="{{ 'unlink' | translate}}">
<span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
</a>
</li>
</ul>
<!-- Fin de Supervisores asignados -->
<div class="form-group text-center">
<button type="submit" class="btn btn-primary" translate>save</button>
</div>
<!-- Fin de id student-sups -->
<!-- Tutores (Padres) -->
<div id="student_tutors">
<h4>{{ 'tutors' | translate }}</h4>
<!-- Buscador de tutores -->
<p>
<form role="search" ng-submit="search_tutor()">
<div class="input-group">
<input type="email" class="form-control" placeholder="{{ 'search_tutor_email' | translate }}" name="email_tutor" id="email_tutor" ng-model="email_tutor" required>
<div class="input-group-btn">
<button class="btn btn-default" type="submit">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
</form>
</p>
</form>
</div>
<!-- Fin de student_personal_edit -->
</div>
<!-- Alert and success messages for tutor found -->
<div ng-show="{{ 'showmessagetutorfound' }}" class="alert alert-info">
<!-- Imagen de perfil del tutor -->
<img ng-src="{{tutorToAdd.pic}}" class="profile" alt="" title="" /> {{ tutorToAdd.name }} {{ tutorToAdd.surname }}
<a class="btn btn-default btn-sm pull-right" role="button" ng-click="add_tutor()" translate>add</a>
<!-- Parte derecha: Tutores y dispositivos -->
<div class="col-md-6">
<!-- Supervisores (terapeutas) del alumno -->
<div id="student_sups">
<h4 translate>supervisors</h4>
<!-- Buscador de supervisores -->
<p>
<form role="search" ng-submit="getSupervisorByEmail()">
<div class="input-group">
<input type="email" class="form-control" placeholder="{{ 'search_sup_email' | translate }}" name="email_sup" id="email_sup" ng-model="email_sup" required>
<div class="input-group-btn">
<button class="btn btn-default" type="submit">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
<!-- Fin de buscador de tutores -->
<!-- Tutores asignados -->
<ul class="list-group" id="user_tutors">
<li class="list-group-item" ng-repeat="tutor in studentTutors">
<!-- Imagen de perfil del tutor -->
<img ng-src="{{tutor.pic}}" class="profile" alt="" title="" />
{{tutor.name}} {{tutor.surname}}
<a ng-click="delete_tutor(tutor.id)" class="delete_tutor" title="{{ 'unlink' | translate}}">
<span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
</a>
</li>
</ul>
<!-- Fin de Tutores asignados -->
<!-- Info message -->
<div class="alert alert-info">{{ 'supervisor_note' | translate }}</div>
</div>
<!-- Fin de id student-tutors -->
</form>
</p>
<!-- Alert and success messages for supervisor found -->
<div ng-show="{{ 'showmessagesupfound' }}" class="alert alert-info">
<!-- Imagen de perfil del tutor -->
<img ng-src="{{supToAdd.pic}}" class="profile" alt="" title="" /> {{ supToAdd.name }} {{ supToAdd.surname }}
<a class="btn btn-default btn-lg pull-right" role="button" ng-click="add_sup()" translate>add</a>
</div>
<!-- Fin de buscador de supervisores -->
<!-- Supervisores asignados -->
<ul class="list-group" id="user_sups">
<li class="list-group-item" ng-repeat="sup in studentSupervisors">
<!-- Imagen de perfil del supervisor -->
<img ng-src="{{sup.pic}}" class="profile" alt="" title="" />
{{sup.name}} {{sup.surname}}
<a ng-click="delete_sup(sup.id)" class="delete_sup" title="{{ 'unlink' | translate}}">
<span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
</a>
</li>
</ul>
<!-- Fin de Supervisores asignados -->
</div>
<!-- Fin de row -->
<!-- Parte de abajo: Configuración de los dispositivos -->
<div>
<div class="page-header">
<h2 translate>device_setup</h2>
<!-- Fin de id student-sups -->
<!-- Tutores (Padres) -->
<div id="student_tutors">
<h4>{{ 'tutors' | translate }}</h4>
<!-- Buscador de tutores -->
<p>
<form role="search" ng-submit="search_tutor()">
<div class="input-group">
<input type="email" class="form-control" placeholder="{{ 'search_tutor_email' | translate }}" name="email_tutor" id="email_tutor" ng-model="email_tutor" required>
<div class="input-group-btn">
<button class="btn btn-default" type="submit">
<span class="glyphicon glyphicon-search"></span>
</button>
</div>
</div>
</form>
</p>
<!-- Alert and success messages for tutor found -->
<div ng-show="{{ 'showmessagetutorfound' }}" class="alert alert-info">
<!-- Imagen de perfil del tutor -->
<img ng-src="{{tutorToAdd.pic}}" class="profile" alt="" title="" />
{{ tutorToAdd.name }} {{ tutorToAdd.surname }}
<a class="btn btn-default btn-sm pull-right" role="button" ng-click="add_tutor()" translate>add</a>
</div>
<!-- Fin de buscador de tutores -->
<!-- Tutores asignados -->
<ul class="list-group" id="user_tutors">
<li class="list-group-item" ng-repeat="tutor in studentTutors">
<!-- Imagen de perfil del tutor -->
<img ng-src="{{tutor.pic}}" class="profile" alt="" title="" />
{{tutor.name}} {{tutor.surname}}
<a ng-click="delete_tutor(tutor.id)" class="delete_tutor" title="{{ 'unlink' | translate}}">
<span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
</a>
</li>
</ul>
<!-- Fin de Tutores asignados -->
<!-- Info message -->
<div class="alert alert-info">{{ 'supervisor_note' | translate }}</div>
</div>
<!-- Fin de id student-tutors -->
</div>
</div>
<!-- Fin de row -->
<!-- Alert and success messages -->
<div ng-show="{{ 'showmessageattributes' }}" class="alert" ng-class="alertattributes">{{ messageattributes | translate }}</div>
<form role="form">
<div class="row">
<!-- Pictogramas -->
<div class="col-md-6">
<fieldset>
<legend translate>pictograms</legend>
<div class="input-group">
<label>{{ 'background' | translate }}:
<input id="picto_background" type="color" ng-model="studentData.attributes.picto_background" ng-mouseleave="update_attributes()" />
</label>
</div>
<h4>{{ 'size' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-default" ng-model="studentData.attributes.pictogram_size" btn-radio="'normal'" ng-change="update_attributes()">{{ 'normal' | translate }}</label>
<label class="btn btn-default" ng-model="studentData.attributes.pictogram_size" btn-radio="'large'"ng-change="update_attributes()">{{ 'large' | translate }}</label>
<!--
<label class="btn btn-default" ng-model="studentData.attributes.pictogram_size" btn-radio="'enormous'" ng-change="update_attributes()">{{ 'enormous' | translate }}</label>
-->
</div>
<h4>{{ 'legend' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-default" ng-model="studentData.attributes.legend" btn-radio="'yes'" ng-change="update_attributes()">{{ 'show' | translate }}</label>
<label class="btn btn-default" ng-model="studentData.attributes.legend" btn-radio="'no'" ng-change="update_attributes()">{{ 'hide' | translate }}</label>
</div>
<div id="legend_size" ng-show="studentData.attributes.legend == 'yes'">
{{ 'legend_size' | translate }}: {{ studentData.attributes.legendsize }}%
<input type="range" min="10" max="90" step="10" ng-model="studentData.attributes.legendsize" ng-change="update_attributes()">
</div>
<!--
<h4>{{ 'animation' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-default" ng-model="studentData.attributes.animation" btn-radio="'yes'" ng-change="update_attributes()">{{ 'yes' | translate }}</label>
<label class="btn btn-default" ng-model="studentData.attributes.animation" btn-radio="'no'" ng-change="update_attributes()">{{ 'no' | translate }}</label>
</div>
<h4>{{ 'categories' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-default" ng-model="studentData.attributes.categories" btn-radio="'on'" ng-change="update_attributes()">{{ 'show' | translate }}</label>
<label class="btn btn-default" ng-model="studentData.attributes.categories" btn-radio="'off'" ng-change="update_attributes()">{{ 'hide' | translate }}</label>
</div>
<!-- Parte de abajo: Configuración de los dispositivos -->
<div>
<div class="page-header">
<h2 translate>device_setup</h2>
</div>
<h4>{{ 'picto_behavior' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-default" ng-model="studentData.attributes.picto_select" btn-radio="'enlarge'" ng-change="update_attributes()">{{ 'enlarge' | translate }}</label>
<label class="btn btn-default" ng-model="studentData.attributes.picto_select" btn-radio="'mark'" ng-change="update_attributes()">{{ 'mark' | translate }}</label>
</div>
-->
<!-- Alert and success messages -->
<div ng-show="{{ 'showmessageattributes' }}" class="alert" ng-class="alertattributes">{{ messageattributes | translate }}</div>
</fieldset>
<form role="form">
<div class="row">
<!-- Pictogramas -->
<div class="col-md-6">
<fieldset>
<legend translate>pictograms</legend>
<div class="input-group">
<label>{{ 'background' | translate }}:
<input id="picto_background" type="color" ng-model="studentData.attributes.picto_background" ng-mouseleave="update_attributes()" />
</label>
</div>
<div class="col-md-6">
<!-- Colocación en cinta de frase -->
<fieldset>
<legend translate>phrase_tape</legend>
<div class="input-group">
<label>{{ 'background' | translate }}:
<input id="phrase_background" type="color" ng-model="studentData.attributes.phrase_background" ng-mouseleave="update_attributes()" />
</label>
</div>
<h4>{{ 'place_pictos' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-success" ng-model="studentData.attributes.input_selection" btn-radio="'click'" ng-change="update_attributes()">{{ 'click' | translate }}</label>
<!--
<label class="btn btn-success" ng-model="studentData.attributes.input_selection" btn-radio="'double click'" ng-change="update_attributes()">{{ 'double_click' | translate }}</label>
<label class="btn btn-success" ng-model="studentData.attributes.input_selection" btn-radio="'press'" ng-change="update_attributes()">{{ 'press' | translate }}</label>
-->
<label class="btn btn-success" ng-model="studentData.attributes.input_selection" btn-radio="'drag'" ng-change="update_attributes()">{{ 'drag' | translate }}</label>
</div>
<h4>{{ 'feedback_picto' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-success" ng-model="studentData.attributes.input_feedback.vibration" btn-checkbox ng-change="update_attributes()">{{ 'vibration' | translate }}</label>
<label class="btn btn-success" ng-model="studentData.attributes.input_feedback.click" btn-checkbox ng-change="update_attributes()">{{ 'click' | translate }}</label>
<label class="btn btn-success" ng-model="studentData.attributes.input_feedback.read" btn-checkbox ng-change="update_attributes()">{{ 'read_picto' | translate }}</label>
<label class="btn btn-success" ng-model="studentData.attributes.input_feedback.highlight" btn-checkbox ng-change="update_attributes()">{{ 'highlight' | translate }}</label>
</div>
<h4>{{ 'size' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-default" ng-model="studentData.attributes.pictogram_size" btn-radio="'normal'" ng-change="update_attributes()">{{ 'normal' | translate }}</label>
<label class="btn btn-default" ng-model="studentData.attributes.pictogram_size" btn-radio="'large'"ng-change="update_attributes()">{{ 'large' | translate }}</label>
</div>
</fieldset>
<h4>{{ 'legend' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-default" ng-model="studentData.attributes.legend" btn-radio="'yes'" ng-change="update_attributes()">{{ 'show' | translate }}</label>
<label class="btn btn-default" ng-model="studentData.attributes.legend" btn-radio="'no'" ng-change="update_attributes()">{{ 'hide' | translate }}</label>
</div>
<!-- Ajustes de voz -->
<fieldset>
<legend translate>sound_setup</legend>
<div id="legend_size" ng-show="studentData.attributes.legend == 'yes'">
{{ 'legend_size' | translate }}: {{ studentData.attributes.legendsize }}%
<input type="range" min="10" max="90" step="10" ng-model="studentData.attributes.legendsize" ng-change="update_attributes()">
</div>
</fieldset>
</div>
<h4>{{ 'enable_sound_for' | translate }}:</h4>
<div class="btn-group">
<!--
<label class="btn btn-primary" ng-model="studentData.attributes.tts_options.picto" btn-checkbox ng-change="update_attributes()">{{ 'pictogram' | translate }}</label>
-->
<label class="btn btn-primary" ng-model="studentData.attributes.tts_options.phrase" btn-checkbox ng-change="update_attributes()">{{ 'phrase' | translate }}</label>
</div>
<!--
<h4>{{ 'voice' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-primary" ng-model="studentData.attributes.tts_voice" btn-radio="'child'" ng-change="update_attributes()">{{ 'child' | translate }}</label>
<label class="btn btn-primary" ng-model="studentData.attributes.tts_voice" btn-radio="'man'" ng-change="update_attributes()">{{ 'man' | translate }}</label>
<label class="btn btn-primary" ng-model="studentData.attributes.tts_voice" btn-radio="'woman'" ng-change="update_attributes()">{{ 'woman' | translate }}</label>
</div>
-->
</fieldset>
<div class="col-md-6">
<!-- Colocación en cinta de frase -->
<fieldset>
<legend translate>phrase_tape</legend>
<div class="input-group">
<label>{{ 'background' | translate }}:
<input id="phrase_background" type="color" ng-model="studentData.attributes.phrase_background" ng-mouseleave="update_attributes()" />
</label>
</div>
<!-- Fin de col -->
</div>
<!-- Fin de row -->
</form>
<h4>{{ 'place_pictos' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-success" ng-model="studentData.attributes.input_selection" btn-radio="'click'" ng-change="update_attributes()">{{ 'click' | translate }}</label>
<label class="btn btn-success" ng-model="studentData.attributes.input_selection" btn-radio="'drag'" ng-change="update_attributes()">{{ 'drag' | translate }}</label>
</div>
<h4>{{ 'feedback_picto' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-success" ng-model="studentData.attributes.input_feedback.vibration" btn-checkbox ng-change="update_attributes()">{{ 'vibration' | translate }}</label>
<label class="btn btn-success" ng-model="studentData.attributes.input_feedback.click" btn-checkbox ng-change="update_attributes()">{{ 'click' | translate }}</label>
<label class="btn btn-success" ng-model="studentData.attributes.input_feedback.read" btn-checkbox ng-change="update_attributes()">{{ 'read_picto' | translate }}</label>
<label class="btn btn-success" ng-model="studentData.attributes.input_feedback.highlight" btn-checkbox ng-change="update_attributes()">{{ 'highlight' | translate }}</label>
</div>
</fieldset>
<!-- Ajustes de voz -->
<fieldset>
<legend translate>sound_setup</legend>
<h4>{{ 'enable_sound_for' | translate }}:</h4>
<div class="btn-group">
<label class="btn btn-primary" ng-model="studentData.attributes.tts_options.phrase" btn-checkbox ng-change="update_attributes()">{{ 'phrase' | translate }}</label>
</div>
</fieldset>
</div>
<!-- Fin de col -->
</div>
<!-- Fin de Configuración de los dispositivos -->
</div>
<!-- Fin de panel body -->
<!-- Fin de row -->
</form>
</div>
<!-- Fin de panel -->
<!-- Fin de Configuración de los dispositivos -->
</div>
<!-- Fin de panel body -->
</div>
<!-- Fin de panel -->
......@@ -31,8 +31,7 @@
"winston": "~1.0.0"
},
"scripts": {
"start": "node app.js",
"debug": "node debug app.js",
"start": "forever start app.js",
"test": "mocha test/test-helper.js test/**/*-spec.js",
"test:watch": "npm run test -- --reporter min --watch"
},
......@@ -41,7 +40,7 @@
"type": "git",
"url": "http://scm.ujaen.es/softuno/pictogram.git"
},
"author": "emblanco, amontejo",
"author": "Yottacode",
"license": "",
"devDependencies": {
"chai": "^3.5.0",
......
describe('Action API', function () {
it('POST /action', function (done) {
studentAgent.post('/action').send({
student: studentAgent.data.id,
type: 'Add',
supervisor: supervisorAgent.data.id,
description: '{ json description }'
})
.expect(200)
.expect((response) => {
assert.isObject(response.body);
assert.isNumber(response.body.id);
delete response.body.id;
})
.expect({
student: studentAgent.data.id,
type: 'Add',
supervisor: supervisorAgent.data.id,
description: '{ json description }',
})
.end(done);
});
it('POST /action');
it('POST /actions');
});
......@@ -5,7 +5,7 @@ describe('Student API', function () {
delete studentAgentData.iat;
delete studentAgentData.isStudent;
delete studentAgentData.password;
studentAgentData.current_method = 'Test method';
studentAgentData.current_method = 'Test Method';
studentAgentData.current_instruction = 'Test Instruction';
supervisorAgent
......
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