Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 440 Rev 441
Línea 461... Línea 461...
461
        status = type == 'multiple' ?
461
        status = type == 'multiple' ?
462
            options.filter((opt) => answer.includes(opt.slug_option) && opt.correct == '1') :
462
            options.filter((opt) => answer.includes(opt.slug_option) && opt.correct == '1') :
463
            options.filter((opt) => opt.slug_option == answer && opt.correct == '1');
463
            options.filter((opt) => opt.slug_option == answer && opt.correct == '1');
464
        return status.length != 0 ? '<font color="green">LABEL_CORRECT</font>' : '<font color="red">LABEL_FAIL</red>';
464
        return status.length != 0 ? '<font color="green">LABEL_CORRECT</font>' : '<font color="red">LABEL_FAIL</red>';
465
    }
465
    }
466
    const getPtos = (options, answer, type, value, question_ptos) => {
466
    const getPtos = (options, answer, type, value, question_value) => {
467
        let ptos = 0;
467
        let ptos = 0;
468
        if (type == "open" || type == "rating-open" || type == "rating-range") {
468
        if (type == "open" || type == "rating-open" || type == "rating-range") {
469
            ptos = question_ptos ? question_ptos : 0;
469
            ptos = question_value ? question_value : 0;
470
        } else {
470
        } else {
471
            if (type == 'multiple') {
471
            if (type == 'multiple') {
472
                options.map((opt) => {
472
                options.map((opt) => {
473
                    if (answer.includes(opt.slug_option)) {
473
                    if (answer.includes(opt.slug_option)) {
474
                        ptos += parseInt(opt.value);
474
                        ptos += parseInt(opt.value);
Línea 682... Línea 682...
682
 
682
 
Línea 683... Línea 683...
683
                        {{/if}}
683
                        {{/if}}
684
                        
684
                        
685
                     </td>
685
                     </td>
686
                     <td>
686
                     <td>
687
                     {{:~getPtos(options,answer,type, value, question_ptos)}}
687
                     {{:~getPtos(options,answer,type, value, question_value)}}
688
               </td>
688
               </td>