JSFiddle - React, Tailwind, and code Playground

by rigid

JavaScript

jQuery('input[name=choice]').on('change', function () {
        var now = jQuery(this);
        var numItems = jQuery(this).parents('.item').find('.ca').length;
        jQuery('.container1.qstn_slct').removeClass('check');
        now.parent('label').addClass('check');
        now.parents('.item').find('input[name=choice]').attr('disabled', true);
        setTimeout(function () {
            if (now.parent('label').hasClass('ca')) {
                if (numItems == 1) {
                    now.parents('.item').find('.que').hide();
                    now.parents('.item').find('.ca_div').show();
                    now.parents('.item').find('#audio_core')[0].play();
                    jQuery('#audio_core').autoplay = true;
                    jQuery('#audio_core').load();
                    now.parents('.item').find('.question_show').show();
                } else if (numItems > 1) {
                    now.parents('.item').find('input[name=choice]').attr('disabled', false);
                    now.parents('.item').find('input[name=choice]').attr('type', 'checkbox')

                    jQuery(".wa input[name=choice]").click(function () {
                        now.parents('.item').find('.ca input[name=choice]').prop("checked", false);
                        jQuery('.container1.qstn_slct.ca').css("border-color", "#ccc ");
                    });
                    jQuery(".ca input[name=choice]").click(function () {
                        now.parents('.item').find('.wa input[name=choice]').prop("checked", false);
                    });

                    var countCheckedCheckboxes = 0;
                    jQuery('.ca input[type="checkbox"]').on('change', function () {
                        var countCheckedCheckboxes = jQuery('.ca input[type="checkbox"]').filter(':checked').length;
                        alert(countCheckedCheckboxes);
                        alert(numItems);
                        var countCheckedCheckboxess =...