WordPress.org

Ready to get started?Download WordPress

Forums

WP Survey And Quiz Tool
Multiple Answer Scoring (1 post)

  1. mystifier
    Member
    Posted 1 year ago #

    Just updated to get benefit of Answer explanation but got the usual responses that scoring had stopped working for multiple answer questions.

    It has been reported just about every update but to bump it here (so that I can also find it easier next update!):

    In Lib/Wpsqrt/Shortcode.php
    Around line 359

    Replace:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    // TODO Insert ability to set point per answer scores
    
    $incorrect += $questionData["points"];
    $answerMarked['mark'] = "incorrect";

    With:

    if ($questionData["type"] == 'Multiple' && $questionData["points"] > 1)
     {
     $partial = floor(($questionData['points']*$subCorrect/$subNumOfCorrect)-$subIncorrect);
     $correct += $partial;
     $incorrect += ($questionData['points']-$partial);
     $answerMarked['mark'] = ($partial > 0)?'correct':'incorrect';
    
    } else {
     // Incorrect single answer question or multiple worth 1 point
     $incorrect += $questionData['points'];
     $answerMarked['mark'] = "incorrect";
    }

    http://wordpress.org/extend/plugins/wp-survey-and-quiz-tool/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.