web/assets/candidat-quiz/candidat-quiz-elearning-session.js
/*stop time + validate les reponse  */
stop time + validate les reponse
stop time + validate les reponse
function stopTime(idQuestion) {
    var typeInput = $('.answer' + idQuestion).prop('type');
    ArrayIdQ.push(idQuestion);
    isPaused = true;
    $('.choice' + idQuestion).addClass('styleAnswerverif');
    searchInputCheckedUser = $('input[name="answer' + idQuestion + '"]').each(function () {
        $('.newCheck').show();
        if ($(this).is(':checked')) {
            valInputChecked = $(this).val();
            idAnswer = $(this).data('id');
            if (valInputChecked == "1") {
                $('#labelReponse' + idAnswer).addClass('quesValid');
                $('.labelReponse' + idAnswer).addClass('quesValid');
                $('.checkrep' + idQuestion).hide();
                if (typeInput == 'radio') {
                    $('#divCheckvalid' + idAnswer).removeClass('radio clip-radio radio-danger radio-md').addClass('correct checked answerCheckValid' + idQuestion);
                } else {
                    $('#divCheckvalid' + idAnswer).removeClass('checkbox clip-check check-danger check-md').addClass('correct checked answerCheckValid' + idQuestion);
                }
                $('#checkVerif' + idAnswer).html('<i class="ti-check" ></i>');
            } else {
                if (typeInput == 'radio') {
                    $('#divCheckvalid' + idAnswer).removeClass('radio clip-radio radio-danger radio-md');
                } else {
                    $('#divCheckvalid' + idAnswer).removeClass('checkbox clip-check check-danger check-md');
                }
                $('#labelReponse' + idAnswer).addClass('quesError');
                $('.labelReponse' + idAnswer).addClass('quesError');
                $('.checkrep' + idQuestion).hide();
                $('#checkVerif' + idAnswer).html('<i class="ti-close" ></i>');
            }
        } else {
            var valInputNoChecked = $(this).val();
            var idAnswer2 = $(this).data('id');
            if (valInputNoChecked == "1") {
                if (typeInput == 'radio') {
                    $('#divCheckvalid' + idAnswer2).removeClass('radio clip-radio radio-danger radio-md');
                } else {
                    $('#divCheckvalid' + idAnswer2).removeClass('checkbox clip-check check-danger check-md');
                }
                $('#labelReponse' + idAnswer2).addClass('quesValidAuto');
                $('.labelReponse' + idAnswer2).addClass('quesValidAuto');
                $('.checkrep' + idQuestion).hide();
                $('#checkVerif' + idAnswer2).html('<i class="ti-check" ></i>');
            } else {
                $('#labelReponse' + idAnswer2).addClass('quesError');
                $('.labelReponse' + idAnswer2).addClass('quesError');
                if (typeInput == 'radio') {
                    $('#divCheckvalid' + idAnswer2).removeClass('radio clip-radio radio-danger radio-md');
                } else {
                    $('#divCheckvalid' + idAnswer2).removeClass('checkbox clip-check check-danger check-md');
                }
                $('.checkrep' + idQuestion).hide();
                $('#checkVerif' + idAnswer2).html('<i class="ti-close" ></i>');
            }
            return [valInputNoChecked, idAnswer2];
        }
        return [idQuestion, idAnswer2];
    });
    $('.btnValide').hide();
    $('.btnNextQues').show();
    var toQ = $('.CountQuestion').text();
    var questFinale = $('#tab' + idQuestion).data('index');
    if (questFinale == toQ) {
        $('#btnSaveQuiz').show();
    }
}
function stopTime ( idQuestion ) { var typeInput = $ ( '.answer' + idQuestion ) . prop ( 'type' ) ; ArrayIdQ . push ( idQuestion ) ; isPaused = true ; $ ( '.choice' + idQuestion ) . addClass ( 'styleAnswerverif' ) ; searchInputCheckedUser = $ ( 'input[name="answer' + idQuestion + '"]' ) . each ( function ( ) { $ ( '.newCheck' ) . show ( ) ; if ( $ ( this ) . is ( ':checked' ) ) { valInputChecked = $ ( this ) . val ( ) ; idAnswer = $ ( this ) . data ( 'id' ) ; if ( valInputChecked == "1" ) { $ ( '#labelReponse' + idAnswer ) . addClass ( 'quesValid' ) ; $ ( '.labelReponse' + idAnswer ) . addClass ( 'quesValid' ) ; $ ( '.checkrep' + idQuestion ) . hide ( ) ; if ( typeInput == 'radio' ) { $ ( '#divCheckvalid' + idAnswer ) . removeClass ( 'radio clip-radio radio-danger radio-md' ) . addClass ( 'correct checked answerCheckValid' + idQuestion ) ; } else { $ ( '#divCheckvalid' + idAnswer ) . removeClass ( 'checkbox clip-check check-danger check-md' ) . addClass ( 'correct checked answerCheckValid' + idQuestion ) ; } $ ( '#checkVerif' + idAnswer ) . html ( '<i class="ti-check" ></i>' ) ; } else { if ( typeInput == 'radio' ) { $ ( '#divCheckvalid' + idAnswer ) . removeClass ( 'radio clip-radio radio-danger radio-md' ) ; } else { $ ( '#divCheckvalid' + idAnswer ) . removeClass ( 'checkbox clip-check check-danger check-md' ) ; } $ ( '#labelReponse' + idAnswer ) . addClass ( 'quesError' ) ; $ ( '.labelReponse' + idAnswer ) . addClass ( 'quesError' ) ; $ ( '.checkrep' + idQuestion ) . hide ( ) ; $ ( '#checkVerif' + idAnswer ) . html ( '<i class="ti-close" ></i>' ) ; } } else { var valInputNoChecked = $ ( this ) . val ( ) ; var idAnswer2 = $ ( this ) . data ( 'id' ) ; if ( valInputNoChecked == "1" ) { if ( typeInput == 'radio' ) { $ ( '#divCheckvalid' + idAnswer2 ) . removeClass ( 'radio clip-radio radio-danger radio-md' ) ; } else { $ ( '#divCheckvalid' + idAnswer2 ) . removeClass ( 'checkbox clip-check check-danger check-md' ) ; } $ ( '#labelReponse' + idAnswer2 ) . addClass ( 'quesValidAuto' ) ; $ ( '.labelReponse' + idAnswer2 ) . addClass ( 'quesValidAuto' ) ; $ ( '.checkrep' + idQuestion ) . hide ( ) ; $ ( '#checkVerif' + idAnswer2 ) . html ( '<i class="ti-check" ></i>' ) ; } else { $ ( '#labelReponse' + idAnswer2 ) . addClass ( 'quesError' ) ; $ ( '.labelReponse' + idAnswer2 ) . addClass ( 'quesError' ) ; if ( typeInput == 'radio' ) { $ ( '#divCheckvalid' + idAnswer2 ) . removeClass ( 'radio clip-radio radio-danger radio-md' ) ; } else { $ ( '#divCheckvalid' + idAnswer2 ) . removeClass ( 'checkbox clip-check check-danger check-md' ) ; } $ ( '.checkrep' + idQuestion ) . hide ( ) ; $ ( '#checkVerif' + idAnswer2 ) . html ( '<i class="ti-close" ></i>' ) ; } return [ valInputNoChecked , idAnswer2 ] ; } return [ idQuestion , idAnswer2 ] ; } ) ; $ ( '.btnValide' ) . hide ( ) ; $ ( '.btnNextQues' ) . show ( ) ; var toQ = $ ( '.CountQuestion' ) . text ( ) ; var questFinale = $ ( '#tab' + idQuestion ) . data ( 'index' ) ; if ( questFinale == toQ ) { $ ( '#btnSaveQuiz' ) . show ( ) ; } }
stop time + validate les reponse
stop time + validate les reponse