Skip to content Skip to main navigation Skip to footer

Extra Radio Button

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2536
    Ricky FourieRicky Fourie
    Participant

    Hi,

    I’m getting an extra blank checkbox option at the end of my quiz answers and I can’t get rid of it.

    When I inspect the element it says:

    <div class=”stm_input_wrapper stm_input_wrapper_radio”>
    <input type=”radio” style=”display: none;” name=”question37″ id=”question37_none” checked=”checked” value=”No Answer Provided”></div>

    See attached for screenshots.

    Thanks in advance.

    Attachments:
    You must be logged in to view attached files.
    #2547
    Kriti SharmaKriti Sharma
    Keymaster

    Hi Ricky,

    Welcome to Qsm Pro Support Forum. Please check that you have not put empty answer field in the question.

    Regards,
    Kriti

    #2548
    Ricky FourieRicky Fourie
    Participant

    Hello Kriti,

    I have not put an empty answer field. In the example in the attached screenshot, I only put the four answers that are listed. There is no fifth answer.

    Thanks,
    Ricky

    #2552
    Ricky FourieRicky Fourie
    Participant

    Hi,

    The extra button seems to be added by an event:

    function(e) {
    if (qmn_ajax_object.enable_quick_result_mc == 1) {
    var question_id = jQuery(this).attr(‘name’).split(‘question’)[1],
    value = jQuery(this).val(),
    $this = jQuery(this).parents(‘.quiz_section’);
    jQuery.ajax({
    type: ‘POST’,
    url: qmn_ajax_object.ajaxurl,
    data: {
    action: “qsm_get_question_quick_result”,
    question_id: question_id,
    answer: value,
    },
    success: function(response) {
    $this.find(‘.quick-question-res-p’).remove();
    if (response == ‘correct’) {
    $this.append(‘<p style=”color: green” class=”quick-question-res-p”><b>Correct!</b> You have selected correct answer.</p>’)
    } else if (response == ‘incorrect’) {
    $this.append(‘<p style=”color: red” class=”quick-question-res-p”><b>Wrong!</b> You have selected wrong answer.</p>’)
    }
    },
    error: function(errorThrown) {
    alert(errorThrown);
    }
    });
    }
    }

    #2555
    Ricky FourieRicky Fourie
    Participant

    I hid the extra button by adding CSS:

    div.stm_input_wrapper:nth-child(5)
    {
    display:none;
    }

    #2562
    Kriti SharmaKriti Sharma
    Keymaster

    Glad to know that you were able to find out the cause.

    All the best
    Kriti

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.