Respuesta: Añadir y Quitar text inputs dinamicamente Y guardar su valor en unda base Esta son las tablas que les comente
CREATE TABLE IF NOT EXISTS `answers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`questions_id` int(11) NOT NULL,
`answer_text` varchar(800) CHARACTER SET utf8 DEFAULT NULL,
`correct_answer` int(11) NOT NULL,
`correct_answer_text` varchar(800) CHARACTER SET utf8 DEFAULT NULL,
`control_type` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `group_id` (`questions_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=125 ;
--
-- Volcar la base de datos para la tabla `answers`
--
INSERT INTO `answers` (`id`, `questions_id`, `answer_text`, `correct_answer`, `correct_answer_text`, `control_type`) VALUES
(85, 27, 'chkMulti1', 0, NULL, 0),
(86, 27, 'chkMulti2', 1, NULL, 0),
(87, 27, 'chkMulti3', 0, NULL, 0),
(88, 27, 'chkMulti4', 1, NULL, 0),
(89, 28, 'chkMulti5', 0, NULL, 0),
(90, 28, 'chkMulti6', 1, NULL, 0),
(91, 28, 'chkMulti7', 0, NULL, 0),
(92, 29, 'Respuesta Unica 1', 0, NULL, 1),
(93, 29, 'Respuesta Unica 2', 0, NULL, 1),
(94, 29, 'Respuesta Unica 3', 1, NULL, 1),
(95, 30, 'Respuesta Unica 4', 0, NULL, 1),
(96, 30, 'Respuesta Unica 5', 1, NULL, 1),
(97, 30, 'Respuesta Unica 6', 0, NULL, 1),
(98, 31, 'Respuesta Unica 7', 1, NULL, 1),
(99, 31, 'Respuesta Unica 8', 0, NULL, 1),
(100, 31, 'Respuesta Unica 9', 0, NULL, 1),
(101, 32, 'Respuesta de Checbox 1', 0, NULL, 0),
(102, 32, 'Respuesta de Checbox 2', 1, NULL, 0),
(103, 32, 'Respuesta de Checbox 3', 0, NULL, 0),
(104, 33, 'Respuesta de Checbox 4', 0, NULL, 0),
(105, 33, 'Respuesta de Checbox 5', 1, NULL, 0),
(106, 33, 'Respuesta de Checbox 6', 0, NULL, 0),
(107, 34, NULL, 0, 'LIbre', 3),
(108, 35, NULL, 0, 'Libre 2', 3),
(109, 36, 'Respuesta Multiples 1', 0, '1', 4),
(110, 36, 'Respuesta Multiples 2', 0, '2', 4),
(111, 36, 'Respuesta Multiples 3', 0, '3', 4),
(112, 37, 'Respuesta Multiples 4', 0, '4', 4),
(113, 37, 'Respuesta Multiples 5', 0, '5', 4),
(114, 37, 'Respuesta Multiples 6', 0, '6', 4),
(115, 38, 'txtOne1', 0, NULL, 1),
(116, 38, 'txtOne2', 1, NULL, 1),
(117, 38, 'txtOne3', 0, NULL, 1),
(118, 39, 'chkMulti1', 0, NULL, 0),
(119, 39, 'chkMulti2', 1, NULL, 0),
(120, 39, 'chkMulti3', 0, NULL, 0),
(121, 40, NULL, 0, 'libre', 3),
(122, 41, 'multi 1', 0, '1', 4),
(123, 41, 'multi 2', 0, '2', 4),
(124, 41, 'multi 3', 0, '3', 4);
CREATE TABLE IF NOT EXISTS `answers_users_detalles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`questions_id` int(11) NOT NULL,
`correct_answer_users` int(11) NOT NULL,
`correct_answer_text_users` varchar(800) CHARACTER SET utf8 DEFAULT NULL,
`detallles_answer` int(100) NOT NULL,
PRIMARY KEY (`id`),
KEY `group_id` (`questions_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=52 ;
--
-- Volcar la base de datos para la tabla `answers_users_detalles`
--
INSERT INTO `answers_users_detalles` (`id`, `questions_id`, `correct_answer_users`, `correct_answer_text_users`, `detallles_answer`) VALUES
(43, 29, 1, NULL, 120),
(44, 29, 0, NULL, 120),
(45, 29, 0, NULL, 120),
(46, 30, 1, NULL, 120),
(47, 30, 0, NULL, 120),
(48, 30, 0, NULL, 120),
(49, 31, 0, NULL, 120),
(50, 31, 1, NULL, 120),
(51, 31, 0, NULL, 120); |