Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 460 | Rev 462 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 460 Rev 461
Línea 19... Línea 19...
19
 
19
 
20
    /**
20
    /**
21
     * Update question answer
21
     * Update question answer
22
     * @param {*} answer 
22
     * @param {*} answer 
23
     */
23
     */
24
    const handleAnswerMultiple = (value) => {
24
    const handleAnswerMultiple = (event, value) => {
25
        question.answer.includes(value) ?
25
        //question.answer.includes(value) ?
26
            question.answer = removeOptionMultiple(question.answer, value) :
26
            //question.answer = removeOptionMultiple(question.answer, value) :
27
            question.answer.push(value);
27
            //question.answer.push(value);
28
        setInput(question.answer);
28
        setInput(question.answer);
Línea 29... Línea 29...
29
    }
29
    }
30
 
30
 
Línea 56... Línea 56...
56
                            <input
56
                            <input
57
                                type="checkbox"
57
                                type="checkbox"
58
                                name={`${opt.slug_option}[]`}
58
                                name={`${opt.slug_option}[]`}
59
                                value={opt.slug_option}
59
                                value={opt.slug_option}
60
                                checked={question.answer.includes(opt.slug_option)}
60
                                checked={question.answer.includes(opt.slug_option)}
61
                                onChange={() => handleAnswerMultiple(opt.slug_option)}
61
                                onChange={() => handleAnswerMultiple(e.target.checked, opt.slug_option)}
62
                            />
62
                            />
63
                        }
63
                        }
64
                        {question.type != 'multiple' &&
64
                        {question.type != 'multiple' &&
65
                            <input
65
                            <input
66
                                type="radio"
66
                                type="radio"