Skip to content Skip to main navigation Skip to footer

BUG REPORT

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4575
    Stefania **Stefania **
    Participant

    QSM Horizontal Multiple Response

    I implemented horizontal multiple response and the limitation to a certain number of max answers is not working.
    With just multiple response, no horizontal, it works.

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

    Hi Stefania,

    Currently, this option works only for Multiple response question type and not with horizontal multiple response question type. I am making a bug report for this. Our development team will try to fix this in the future releases.

    Kind regards,
    Kriti

    #4597
    Stefania **Stefania **
    Participant

    Hello, i made it work, on line 934 of question-types.php
    function qmn_horizontal_multiple_response_display($id, $question, $answers)
    {
    $question_display = ”;
    global $mlwQuizMasterNext;
    $limit_mr_text = ‘onchange=”qsmCheckMR(this,’. $limit_multiple_response .’)”‘;
    $required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, ‘required’);
    $limit_multiple_response = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, ‘limit_multiple_response’);
    if($limit_multiple_response > 0)
    $limit_mr_text = ‘onchange=”qsmCheckMR(this,’. $limit_multiple_response .’)”‘;
    if ($required == 0) {$mlw_requireClass = “mlwRequiredCheck”;} else {$mlw_requireClass = “”;}
    //$question_title = apply_filters(‘the_content’, $question);
    $question_display .= qsm_question_title_func($question);
    $question_display .= “<div class=’qmn_check_answers $mlw_requireClass’>”;
    if (is_array($answers))
    {
    $mlw_answer_total = 0;
    foreach($answers as $answer)
    {
    $mlw_answer_total++;
    if ($answer[0] != “”)
    {
    $question_display .= “<input type=’hidden’ name=’question”.$id.”‘ value=’This value does not matter’ />”;
    $question_display .= “<span class=’mlw_horizontal_multiple’><input type=’checkbox’ ” . $limit_mr_text .” name=’question”.$id.”_”.$mlw_answer_total.”‘ id=’question”.$id.”_”.$mlw_answer_total.”‘ value='”.esc_attr($answer[0]).”‘ /> <label for=’question”.$id.”_”.$mlw_answer_total.”‘>”.htmlspecialchars_decode($answer[0], ENT_QUOTES).” </label></span>”;
    }
    }
    }
    $question_display .= “</div>”;
    return apply_filters(‘qmn_horizontal_multiple_response_display_front’,$question_display,$id, $question, $answers);
    }

    #4609
    Kriti SharmaKriti Sharma
    Keymaster

    That’s great Stefania. Can I mark this ticket as resolved now?

    Kind regards,
    Kriti

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