WordPress.org

Support

Support » Plugins and Hacks » WP Survey And Quiz Tool » [Plugin: WP Survey And Quiz Tool] Possible to submit empty quizzes

[Plugin: WP Survey And Quiz Tool] Possible to submit empty quizzes

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ollie Armstrong

    @olliea95

    Will take a look at this soon.

    if ( isset($_POST['answers']) ){

    Needs moving down from line 280 to 289 in:
    lib/Wpsqt/Shortcode.php

    Hi mystifier – nice one. Seems to have done the trick 🙂 Thanks a lot!

    hi,

    i have the same problem
    Can you explain me more, the solution

    I don’t understand well “Needs moving down from line 280 to 289

    thanks !!

    nono33z – you need to make sure you have the most up-to-date version of the plugin. At first, I didn’t – that’s why the line doesn’t show up where mystifier said it would.

    When you have updated the plugin, browse to the plugin directory using your FTP client, go to the directory mystifier says above and double-click the file Shortcode.php to open it. Scroll down to line 280 and just move the text from that line down to line 289. That’s all 🙂

    thanks you cagsmith,
    but i’m sorry
    I have to be a little beast! it does not work or I’m not good handling.
    can you copy the code snippet in your message?
    🙁

    EDIT : It’s work !! I had to work on the wrong version of the file :p

    Thanks a lot.

    In lib/Wpsqt/Shortcode.php around line 280:

    if ( isset($_POST['answers']) ){
      $_SESSION['wpsqt'][$quizName]['sections'][$pastSectionKey]['answers'] = array();
      $canAutoMark = true;
      foreach ($_SESSION["wpsqt"][$quizName]["sections"][$pastSectionKey]["questions"] as $questionData ){
        if ( isset($questionData['required']) && $questionData['required'] == "yes") {
          $requiredQuestions['exist']++;
        }
      }

    Needs to change to:

    $_SESSION['wpsqt'][$quizName]['sections'][$pastSectionKey]['answers'] = array();
      $canAutoMark = true;
      foreach ($_SESSION["wpsqt"][$quizName]["sections"][$pastSectionKey]["questions"] as $questionData ){
        if ( isset($questionData['required']) && $questionData['required'] == "yes") {
          $requiredQuestions['exist']++;
        }
      }
    if ( isset($_POST['answers']) ){

    Because the check for required answers is only done if answers exist.

    EDIT: crossed posts!!

    Plugin Author Ollie Armstrong

    @olliea95

    Thanks guys, implemented a fix.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: WP Survey And Quiz Tool] Possible to submit empty quizzes’ is closed to new replies.
Skip to toolbar