Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 340 Rev 341
Línea 527... Línea 527...
527
            opt += removeTags(options.filter((opt) => answer.includes(opt.slug_option))[0].text) + ' ';
527
            opt += removeTags(options.filter((opt) => answer.includes(opt.slug_option))[0].text) + ' ';
528
            return opt;
528
            return opt;
529
        }
529
        }
530
        return removeTags(options.filter((opt) => opt.slug_option == answer)[0].text);
530
        return removeTags(options.filter((opt) => opt.slug_option == answer)[0].text);
531
    }
531
    }
-
 
532
 
-
 
533
 
-
 
534
    /**
-
 
535
     * Get Status
-
 
536
     */
-
 
537
    const getStatus = (options, answer) => {
-
 
538
 
-
 
539
 
-
 
540
 
-
 
541
        return options.filter((opt) => ( opt.slug_option == answer || answer.includes(opt.slug_option))  && 
-
 
542
        
-
 
543
        
-
 
544
        opt.correct ==1)
-
 
545
 
-
 
546
 
-
 
547
    }
-
 
548
 
-
 
549
 
-
 
550
 
-
 
551
 
532
    /**
552
    /**
533
     * Remove Html Tags
553
     * Remove Html Tags
534
     */
554
     */
535
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
555
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
536
    /**
556
    /**
537
     * Render Sections data
557
     * Render Sections data
538
     */
558
     */
539
    const renderSectionData = (data) => $("#rows").html($("#sectionTemplate").render(data, {
559
    const renderSectionData = (data) => $("#rows").html($("#sectionTemplate").render(data, {
540
        removeTags: removeTags,
560
        removeTags: removeTags,
541
        getAnswer: getAnswer
561
        getAnswer: getAnswer,
-
 
562
        getStatus: getStatus
542
    }));
563
    }));
543
    /**
564
    /**
544
     * Clear Div Section data 
565
     * Clear Div Section data 
545
     */
566
     */
546
    const clearSectionData = () => $("#rows").html('');
567
    const clearSectionData = () => $("#rows").html('');
Línea 666... Línea 687...
666
                            <tr class="tr-question">
687
                            <tr class="tr-question">
667
                                <td class="text-left">{{:~removeTags(text)}} </td>
688
                                <td class="text-left">{{:~removeTags(text)}} </td>
668
                                <td>
689
                                <td>
Línea 669... Línea 690...
669
 
690
 
-
 
691
                                {{if type == 'simple'  || type=='multiple' }}
-
 
692
 
-
 
693
                                {{:~getStatus( options,answer)}}
670
                                {{if type == 'simple'  || type=='multiple' }}
694
 
Línea 671... Línea 695...
671
                                {{/if}}
695
                                {{/if}}
672
 
696
 
673
                                {{if type == 'open' || type == 'rating-open' || type=='rating-range' }}
697
                                {{if type == 'open' || type == 'rating-open' || type=='rating-range' }}