30 June 2013

Are "abandoned" quizzes included in rankings analysis?

JasonC asks this question:

Occasionally, I'll start a quiz, and it's about a subject I have no knowledge of at all - I can't even make an educated guess.  So I just close the window and do something else.

So then I wondered if my non-start gets logged somewhere as null points, and a VERY long time ?

The reason for this is that I notice I nearly always complete the quiz quicker than the AVERAGE time, but slower than the MEAN time, which suggests to me that a few excessively long times are skewing the average - maybe these could be people failing to complete the quiz?  None of this really matters: I've no complaints about my scores (well, they're lower than I would like, but that's another story!) - I'm just curious.

Excellent question! I thought I knew the answer but decided to look at the code, anyway. The code always tells the truth. :-)

Here's what the code tells me:


   PROCEDURE submit_saved_answers (comp_event_id_in IN INTEGER)
   IS
      l_comp_event      qdb_comp_events%ROWTYPE
                           := one_comp_event (comp_event_id_in);
      l_competition     qdb_competitions%ROWTYPE;
      l_answer_closed   BOOLEAN DEFAULT FALSE;
   BEGIN
      /* Assign an end date to all answers for which there is at 
           least one saved answer. */
      FOR rec
         IN (SELECT DISTINCT eva.compev_answer_id, eva.user_id
               FROM qdb_compev_answers eva, qdb_quiz_results qr
              WHERE     eva.compev_answer_id =
                           qr.compev_answer_id
                    AND eva.comp_event_id = comp_event_id_in
                    AND eva.ended_on IS NULL)
      LOOP
         UPDATE qdb_compev_answers eva
            SET ended_on =
                   qdb_player_mgr.user_end_time (
                      comp_event_id_in,
                      rec.user_id)
          WHERE eva.compev_answer_id = rec.compev_answer_id;
      END LOOP;
   END submit_saved_answers;

Look, a comment! I proudly proclaim in my trainings that my code is self-documenting, requiring no comments. But I am glad I broke my pledge here.
 
Bottom line: in the current scheme of things at the PL/SQL Challenge, we will not automatically set an end time for your answer when the quiz consists of a single question. For multiple-question competitions like the playoff, we will automatically set an end time if you answered at least one of the questions.

There can still, however, be some very long answer times that will skew the average. I have tried to isolate those in at least some of our calculations, but may not have caught them all.