Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 406 Rev 407
Línea 419... Línea 419...
419
    /**
419
    /**
420
     * Get Status
420
     * Get Status
421
     */
421
     */
422
    const getStatus = (options, answer, type) => {
422
    const getStatus = (options, answer, type) => {
Línea 423... Línea 423...
423
 
423
 
424
        console.log(type);
-
 
425
        console.log(answer);
-
 
426
 
-
 
427
        if(type=='multiple'){
-
 
428
            return options.filter((opt) => answer.includes(opt.slug_option) &&
-
 
429
        opt.correct == '1') ? '<font color="green">LABEL_CORRECT</font>' : '<font color="red">LABEL_FAIL</red>'
-
 
430
        }
-
 
431
 
-
 
432
        console.log(options.filter((opt) => opt.slug_option == answer &&
-
 
433
        opt.correct == '1'));
-
 
434
 
-
 
435
        return options.filter((opt) => opt.slug_option == answer &&
-
 
Línea -... Línea 424...
-
 
424
        let status;
-
 
425
 
-
 
426
     status = type=='multiple' ?
-
 
427
           status = options.filter((opt) => answer.includes(opt.slug_option) && opt.correct == '1')
-
 
428
     :
Línea -... Línea 429...
-
 
429
            status options.filter((opt) => opt.slug_option == answer && opt.correct == '1')
436
        opt.correct == '1') ? '<font color="green">LABEL_CORRECT</font>' : '<font color="red">LABEL_FAIL</red>'
430
        
437
 
431
 
438
 
432
        return  status.length != 0 ? '<font color="green">LABEL_CORRECT</font>' : '<font color="red">LABEL_FAIL</red>';
439
    }
433
    }
440
    /**
434
    /**