Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 336 Rev 340
Línea 2... Línea 2...
2
import Option from "../option/Option";
2
import Option from "../option/Option";
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
const Question = (props) => {
4
const Question = (props) => {
5
 
5
 
Línea 6... Línea 6...
6
    // get props
6
    // get props
7
    const { question, backendVars } = props;
7
    const { question, backendVars, handleAnswer } = props;
8
 
8
 
9
    return (
9
    return (
Línea 21... Línea 21...
21
                        <textarea
21
                        <textarea
22
                            className="form-control"
22
                            className="form-control"
23
                            rows="5"
23
                            rows="5"
24
                            maxLength={question.maxlength}
24
                            maxLength={question.maxlength}
25
                            name={question.slug_question}
25
                            name={question.slug_question}
-
 
26
                            onChange={e => handleAnswer(
-
 
27
                                question.slug_section,
-
 
28
                                question.slug_question,
-
 
29
                                e.target.value)}
26
                        ></textarea>
30
                        ></textarea>
27
                    ) : (
31
                    ) : (
28
                        <input
32
                        <input
29
                            type="text"
33
                            type="text"
30
                            className="form-control"
34
                            className="form-control"
31
                            maxLength={question.maxlength}
35
                            maxLength={question.maxlength}
32
                            name={question.slug_question} />
36
                            name={question.slug_question}
-
 
37
                            onChange={e => handleAnswer(
-
 
38
                                question.slug_section,
-
 
39
                                question.slug_question,
-
 
40
                                e.target.value)} />
33
                    )}
41
                    )}
34
                </div>
42
                </div>
35
            }
43
            }
36
            {question.type == 'rating-range' &&
44
            {question.type == 'rating-range' &&
37
                <div className="form-group">
45
                <div className="form-group">
Línea 40... Línea 48...
40
                            <div className="checkbox"
48
                            <div className="checkbox"
41
                                key={i}>
49
                                key={i}>
42
                                <input
50
                                <input
43
                                    type="radio"
51
                                    type="radio"
44
                                    name={question.slug_question}
52
                                    name={question.slug_question}
-
 
53
                                    onChange={e => handleAnswer(
-
 
54
                                        question.slug_section,
-
 
55
                                        question.slug_question,
-
 
56
                                        e.target.value)}
45
                                    value={i + 1} />
57
                                    value={i + 1} />
46
                                <div className="option">
58
                                <div className="option">
47
                                    {i + 1}
59
                                    {i + 1}
48
                                </div>
60
                                </div>
49
                            </div>
61
                            </div>
Línea 52... Línea 64...
52
                </div>
64
                </div>
53
            }
65
            }
54
            {(question.type == 'simple' || question.type == 'rating-open' || question.type == 'multiple') &&
66
            {(question.type == 'simple' || question.type == 'rating-open' || question.type == 'multiple') &&
55
                <div className="form-group">
67
                <div className="form-group">
56
                    {question.options.length > 0 &&
68
                    {question.options.length > 0 &&
-
 
69
                        <Option
57
                        <Option question={question} />
70
                            question={question}
-
 
71
                            handleAnswer={handleAnswer} />
58
                    }
72
                    }
59
                </div>
73
                </div>
60
            }
74
            }
61
        </div>
75
        </div>
62
    )
76
    )