Proyectos de Subversion LeadersLinked - Backend

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 314... Línea 314...
314
                objFormGenerator.sections = response['data']['content'] || [];
314
                objFormGenerator.sections = response['data']['content'] || [];
315
                objFormGenerator.render();
315
                objFormGenerator.render();
316
                renderSectionData(objFormGenerator.sections);
316
                renderSectionData(objFormGenerator.sections);
317
                $('#row-forms').hide();
317
                $('#row-forms').hide();
318
                $('#row-edit').show();
318
                $('#row-edit').show();
319
                $('#form-main #form-name').focus();
-
 
320
            } else {
319
            } else {
321
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
320
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
322
            }
321
            }
323
        }).fail(function(jqXHR, textStatus, errorThrown) {
322
        }).fail(function(jqXHR, textStatus, errorThrown) {
324
            $.fn.showError(textStatus);
323
            $.fn.showError(textStatus);
Línea 521... Línea 520...
521
    const getAnswer = (type, options, answer) => {
520
    const getAnswer = (type, options, answer) => {
522
        if (type == 'open' || type == 'rating-range') {
521
        if (type == 'open' || type == 'rating-range') {
523
            return answer;
522
            return answer;
524
        }
523
        }
525
        if (type == 'multiple') {
524
        if (type == 'multiple') {
526
            var opt = '';
525
           let opt = '';
527
            opt += removeTags(options.filter((opt) => answer.includes(opt.slug_option))[0].text) + ' ';
526
            opt += removeTags(options.filter((opt) => answer.includes(opt.slug_option))[0].text) + ' ';
528
            return opt;
527
            return opt;
529
        }
528
        }
530
        return removeTags(options.filter((opt) => opt.slug_option == answer)[0].text);
529
        return removeTags(options.filter((opt) => opt.slug_option == answer)[0].text);
531
    }
530
    }
532
 
-
 
533
 
-
 
534
    /**
531
    /**
535
     * Get Status
532
     * Get Status
536
     */
533
     */
537
    const getStatus = (options, answer) => {
-
 
538
 
-
 
539
 
-
 
540
 
-
 
541
        return  options.filter((opt) => ( opt.slug_option == answer || answer.includes(opt.slug_option))  && 
534
    const getStatus = (options, answer) => options.filter((opt) => (opt.slug_option == answer || answer.includes(opt.slug_option)) &&
542
        
-
 
543
        
-
 
544
        opt.correct ==1) ?  'LABEL_CORRECT' : 'LABEL_FAIL'
535
            opt.correct == 1) ? 'LABEL_CORRECT' : 'LABEL_FAIL'
545
 
-
 
546
 
-
 
547
    }
-
 
548
 
-
 
549
 
-
 
550
 
-
 
551
 
-
 
552
    /**
536
    /**
553
     * Remove Html Tags
537
     * Remove Html Tags
554
     */
538
     */
555
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
539
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
556
    /**
540
    /**
Línea 693... Línea 677...
693
                                {{:~getStatus( options,answer)}}
677
                                {{:~getStatus( options,answer)}}
Línea 694... Línea 678...
694
 
678
 
Línea 695... Línea 679...
695
                                {{/if}}
679
                                {{/if}}
696
 
680
 
697
                                {{if type == 'open' || type == 'rating-open' || type=='rating-range' }}
681
                                {{if type == 'open' || type == 'rating-open' || type=='rating-range' }}
698
<select class="form-control">
682
<select class="form-control" onchange="myFunction()">
699
    <option value="true">LABEL_CORRECT </option>
683
    <option value="true">LABEL_CORRECT </option>
700
    <option value="false">LABEL_FAIL</option>
684
    <option value="false">LABEL_FAIL</option>