• Programming 13.11.2008

    Lawyers famously say, “Never ask a question unless you already know the answer.”

    I’m supplementing a third-party application we recently installed that administers quizzes online.  It’s nothing revolutionary – students take a quiz, and it’s graded automatically.  I just need to generate a new report that includes the already-calculated quiz grades, so I’m studying the database.

    I started with the table results_answers which lists students’ individual answers, and includes a column called result_answer_iscorrect.  Excellent!  This must show a 1 if the answer is correct, or a 0 if it’s not.  Let’s just ask the database to make sure:

    [bobbojones@production xxx] > SELECT result_answer_iscorrect, COUNT(1)
    FROM results_answers
    GROUP BY result_answer_iscorrect;
    +————————-+———-+
    | result_answer_iscorrect | count(1) |
    +————————-+———-+
    |                       0 |      425 |
    |                       2 |    18986 |
    |                       3 |     5259 |
    +————————-+———-+
    3 rows in set (0.15 sec)

    Blërg!  (There aren’t any ones, but there are twos and threes.)

    I knew I shouldn’t have asked the question.

    Posted by Ben @ 8:37 am

  • One Response

    WP_Modern_Notepad
    • just pixels Says:

      I suppose you could infer the meaning of those values based on the quality of the students taking the quizzes.

      So maybe 2 means correct, 3 means incorrect, and zero means didn’t answer or something.

      Now if the students are particular dim bulbs,
      0 = correct
      2 = incorrect
      3 = all of the above

      And if they’re really wits of nit, you had it right from the start:
      0 = incorrect
      1 = correct
      2 = didn’t answer
      3 = what was the question?

    Leave a Comment

    Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

    Powered by WP Hashcash