Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 343 Rev 344
Línea 3... Línea 3...
3
import Spinner from "../../../shared/loading-spinner/Spinner";
3
import Spinner from "../../../shared/loading-spinner/Spinner";
Línea 4... Línea 4...
4
 
4
 
Línea 5... Línea 5...
5
const Test = (props) => {
5
const Test = (props) => {
6
 
6
 
Línea 7... Línea 7...
7
    // get props
7
    // get props
8
    const { backendVars, test, loading, setTest, action  } = props;
8
    const { backendVars, test, loading, setTest, action } = props;
9
 
9
 
Línea 30... Línea 30...
30
    const handleAnswer = (slug_section, slug_question, answer) => {
30
    const handleAnswer = (slug_section, slug_question, answer) => {
31
        test.content.filter((section) => {
31
        test.content.filter((section) => {
32
            if (section.slug_section == slug_section) {
32
            if (section.slug_section == slug_section) {
33
                section.questions.map((question) => {
33
                section.questions.map((question) => {
34
                    if (question.slug_question == slug_question) {
34
                    if (question.slug_question == slug_question) {
-
 
35
                        if (question.type == 'multipe') {
-
 
36
                             !question.answer ? 
-
 
37
                                question.answer = array(answer) : 
-
 
38
                                question.answer = question.answer.push(answer)
-
 
39
                        } else {
35
                        question.answer = answer;
40
                            question.answer = answer;
-
 
41
                        }
36
                    }
42
                    }
37
                })
43
                })
38
            }
44
            }
39
        });
45
        });
40
        console.log(test);
46
        console.log(test);