Menu

Removing functionality?

Help
2010-08-27
2013-05-28
  • Dennis Driscoll

    Dennis Driscoll - 2010-08-27

    I was wondering if it was possible to remove the check answer functionality, I have tried multiple things but cant seem to get it to go.  Please enlighten me, as my frustration is stopping me from thinking clearly.  I love this thing and I would love to use it!

     
  • Joe B.

    Joe B. - 2010-08-31

    I'm a little confused about what you mean? do you want it to ever check the answers?
    Do you mean to have it check your answers at the end of the quiz? Or to have it send the answers?

    It sounds like what you want to do would require a bit of code, but if you are talking about checking at the end of the quiz it's something I could implement relatively easily and it would be a useful feature.

     
  • Luka Lukas

    Luka Lukas - 2010-11-25

    Hi all!

    Quizzy is great!
    I just need to remove the check answer option.I do not want anyone to see an answer to a question during a quiz, just at the end to see the result.
    Thanks in advance…

     
  • Joe B.

    Joe B. - 2010-11-25

    ok
    I'll look into adding that for the next release.

     
  • Luka Lukas

    Luka Lukas - 2010-11-25

    Can you tell me what I need to delete, which line in the code, that instead of a button "Check answer" displays button "Next".
    Is it that simple or not? :\

    Thanks!

     
  • Joe B.

    Joe B. - 2010-11-26

    Hmm… If you don't care to let people see what they missed or the explanations, You can do the following:
    In quizzy.js:

    Line 177, Change

    $('#quizzy_q' + curQuestion + '_foot_chk')...
    

    to

    $('#quizzy_q' + curQuestion + '_foot_nxt')..."
    

    And Change line 163 from

    $('#quizzy_q' + curQuestion + '_foot_nxt').click(function (){
    

    to

      $('#quizzy_q' + curQuestion + '_foot_nxt').click(function (){
          //make sure the user selected one
          if( $('.quizzy_q_opt_b:checked').length == 0 )
            return;
          $.get('quizzy/serveExplanation.php',  {quizFile: quizFile, quizIndex: quizIndex, questNo: curQuestion, selOpt: selOpt}, function(data) {
            //have the data returned by that ajax query, set the proper div info
            $('#quizzy_q' + curQuestion + '_exp').html(data);
            //that should have set the correctOpt and addScore variables
            score += addScore;
          });
    

    I put a git diff of the changes here: https://gist.github.com/716453. If that's easier for you.

    This is a big hack to get you what you want. I'll add some more customization to the next version that'll let you do things this way without the big ugly hack.
    Also, I haven't tested this very much, so there may be some bugs lurking around in here. I dunno, let me know if you find any.

     
  • Luka Lukas

    Luka Lukas - 2010-11-26

    Thanks scallopedllama, everything works almost perfect :)

    Problem is that test don't count last question.

    Always have one point less then max even if I answered all question correctly!

    That's for now only bug I found. I understand that somewhere in the code must be "add last question in result" but can't find it.

    Thanks in advance!

     
  • Luka Lukas

    Luka Lukas - 2010-11-26

    To add something for you to better understand it, when I answered all questions wrong except last question, it said 0 points.
    So problem is only last question.

     
  • Joe B.

    Joe B. - 2010-11-26

    Oh, I figured it out.. Really a derp kind of situation.
    Change all off the next button's click handler function…

    $('#quizzy_q' + curQuestion + '_foot_nxt').click(function (){ ... });
    

    to the following

    $('#quizzy_q' + curQuestion + '_foot_nxt').click(function (){
      //make sure the user selected one
      if( $('.quizzy_q_opt_b:checked').length == 0 )
        return;
      $.get('quizzy/serveExplanation.php',  {quizFile: quizFile, quizIndex: quizIndex, questNo: curQuestion, selOpt: selOpt}, function(data) {
        //have the data returned by that ajax query, set the proper div info
        $('#quizzy_q' + curQuestion + '_exp').html(data);
        //that should have set the correctOpt and addScore variables
        score += addScore;
        $('#quizzy').loading(true);   
        $(this).unbind();
        requestNextQuestion();
      });
    });
    

    Basically, Moving the part where it requests the next question to occur only after the score has been added.
    The diff of this patch applied to a vanilla installation of quizzy is here

     
  • Luka Lukas

    Luka Lukas - 2010-11-26

    It WORKS!!!

    Thanks a lot!!

     
  • Joe B.

    Joe B. - 2010-11-27

    haha, No problem

     

Log in to post a comment.