10 August 2010

Questions about the 9 August 2010 Quiz(1326)

The quiz on 9 August asked the following question: "Which of the following functions can you use to change the case of a string?" We then listed UPPER, LOWER, INITCAP, NLS_INITCAP and REVERSE_CASE. We scored the first four as correct, the last as incorrect. We received emails raising the following concerns: 1. "The wording for the today's quiz should be slightly different (bold word added): 'which of the following builtin functions...". Since anyone could write a function with the name reverse_case and use that to change the case of a string." 2. "For today's quiz question, regarding functions you can use to change the case of a string, I think I answered correctly based on my perception of your intent of the question, however, I wanted to point out that technically NONE of the functions listed CHANGE any supplied string, but instead return a new string, actually leaving the supplied string itself unchanged." 3. "Depends what case the string was to start with e.g. lower('asdfg') will not change case but UPPER('asdfg') will, similarly UPPER('ASDFG') won't." Regarding (1), I will change the text of the question to explicitly reference "built-in functions," but I do not think it was necessary, given the assumptions that we state for the quizzes. Anyone could write a function, but unless that function is defined as part of the question, you must assume that such a function does not exist. Regarding (2), yes, it is true that these functions do not actually change the case of a string passed to them. Instead, they return a string with a possibly changed case. I believe, however, that the meaning of this question was clear and will not be adjusting any scores or ranks. I will, though, change the text to make that explicit. Regarding (3), the player is correct that there are circumstances under which none of these functions would return a string any different from that passed into it, but that wasn't the question. The fact is, you can use those first four functions to return a string with changed case. I look forward to your thoughts on this. Regards, Steven

08 August 2010

Proposal for Forgiveness Policy

Several players have requested a way to avoid being penalized heavily for missing quizzes or for making a silly mistake or for Internet failures that result in long delays is submitting responses. This issue has come up quite a bit lately, given the summer months and the tendency of normal human beings in the northern hemisphere to take holidays during this time.

In addition, I now manually make adjustments to scores when players report a problem. This is very time consuming and simply not sustainable or scalable (as we add more players).

I therefore plan to implement a forgiveness policy starting with Q3 2010. We will "forgive" a certain number of missed days or low scores per month/quarter. Once this is in place, we will also no longer make adjustments to scores, such as when your quiz submission is interrupted and you have to go back and "take the quiz" a second time.

I share with you below my ideas on how to implement/apply this policy. I would love to hear what you think. It may take a little while to sort it all out, but of this you can be certain:

The forgiveness policy will be applied at the end of Q3 (and every quarter thereafter). The determination of participation in the championship playoff will be made after I apply the forgiveness algorithm. So if you miss a few days of quizzes, do not panic!

Forgiveness Algorithm
  • Must be applied equally to everyone. That is, if I do not miss any quizzes, I should not be penalized, relatively speaking. Even I should see a benefit from the forgiveness policy.
  • Apply forgiveness to 10 days of quizzes in a quarter(out of about 60 days).
  • For each missed quiz (up to 10), give that person a score equal to average of all scores for that day. This way, you do not take the "full hit" of a 0 score, but you also will not "jump ahead" of those who rank lots higher than you (and remember: this only happens for a small number of days out of the total).
  • If you missed less than 10 quizzes in a quarter (let's call the balance N), then I will apply a different algorithm to the N lowest ranked days in that quarter. Suppose, for example, you usually rank in the top 100, but on 15 days during the quarter, your ranking was around 200. You also missed 3 quizzes. Then I would "forgive" 7 of the lowest ~200 ranked days.
  • Forgiveness for low ranking: change your score for those days to match the score of the ranking on that day that equals your average ranking throughout the quarter. In other words, if you average ranking is 125 then on a day in which you were ranked 250, I find the score of the person ranked 125, give you that score, and then re-rank.
What do you think? I need to find a way to give players some leeway/flexibility, but also not "punish," in effect, those who are diligent and most devoted to the quiz.

Thanks in advance for your thoughts.

SF

07 August 2010

1.5 Version of PL/SQL Challenge Now Available

We've upgraded the PL/SQL Challenge to 1.5, with the following new features and changes:

* New sponsors framework: we have upgraded support for sponsors so that we can have different kinds of sponsors. A part of this upgrade also implements a much more flexible foundation for defining competitions and awards for those competitions. This will mostly be transparent to players, but we thought you'd like to know.

* Add ability to let a user play for educational purposes only, and not participate in ranking-based competitions/prizes: If you do not want to compete for ranking-based prizes, check this box. You can still win a raffle prize just for playing the quiz, but you will not be ranked with other players. Choose this option if you want to play in a way that violates any of our rules (for example, you want your development team to play the quiz together) and you do not want to be penalized. You can switch back to competitive playing only within the first week of a quarter.

* Minor changes to Assumptions: please read this section in full before you take your next quiz, to make sure you are fully aware of all assumptions.

* Remove account: you can now remove your account from the PL/SQL Challenge from the Edit Profile page. This action will erase all results for your email address. This action cannot be reversed.

* Changes to Feedback form: you are now required to choose the type of Feedback. The more accurately you set this type, the more easily we can administer the PL/SQL Challenge.

* Changes to Rules and FAQ pages: please take a moment to read through these pages to ensure that you have a thorough understanding of how the PL/SQL Challenge works and how you can most effectively play and compete.

* Login and Forgot Password button locations changed: in response to player feedback, we have switched the locations of these buttons. So take a look at what you are pressing before you click!

1.5, by the way, marks the first version in which my son, Eli (brand-new to programming, Oracle, APEX, SQL, PL/SQL and HTML) participated in testing, enhancing and bug-fixing. A very exciting milestone for both of us.

06 August 2010

Only use code-based quizzes?

I received this email today from a player:

I think that the questions should be just only code based and should not haven anything that can be left to interpretation. For example, in yesterday's question (05-AUG-2010) I knew the correct answer, yet, I got two options wrong. Why? Because it was written in natural language instead of being just code based interpretation. In my point of view, the answers had one crucial difference, that could have confused the players (it confused me... :( ). When the VALUE_ERROR is raised on the block declaration, it could never be handled on the block level. Yet, the other two options are raised block level and, if left unhandled by the programmer, they are propagated to the outer block and so on. So they were all raised to the outer block, bu it is my belief that internally, the exception is always handled block level except when it is in the declaration... You may be thinking that the exception is certainly not handled inside the block, but I think that things are not so black and white in this subject. See this example:

DECLARE
   l   NUMBER;
BEGIN
   RAISE VALUE_ERROR;
EXCEPTION
   WHEN NO_DATA_FOUND
   THEN
      ROLLBACK;
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Mayday, mayday, I don''t know what to do...');
      RAISE;
END;

Was the exception VALUE_ERROR handled or not? Certainly it was caught... But then it was re-raised (or propagated??) tho the outer block... And nothing relevant was done... Probably I wouldn't remember this if there wasn't one option that was clearly different from the others in a feature relevant to the answer... If I didn't know that I couldn't handle an exception raised in the block declaration on that block, I would most probably have a higger score. If all the options were written in PL/SQL and the question was "Which of the options have the following output?" it would be easier to prove each one's knowledge in PL/SQL...

Here is my response:

I agree about offering lots of code-based quizzes, and that is certainly what you have seen in the PL/SQL Challenge. Having said that, I do think there is significant value in also tackling quizzes that ask you to understand concepts and rules in PL/SQL, and that pretty well means doing it in English, for the most part.

Regarding this player's specific objection, I don't really "get it." The choice to which I think he is referring as a source of ambiguity says:

"The exception section has only one WHEN clause (handler), and it is for NO_DATA_FOUND."

so the scenario in the code above does not apply. Certainly, if you have a WHEN OTHERS, you can trap and handle the exception, at which point you could choose to re-raise it. That is not, however, a choice I offered to you.

An update regarding very fast answers

I received this email today from a devoted player:

"I continue to wonder how fast some people manage to submit. Like "Neha Jain", only three seconds to check three questions before hitting the submit button. How's that possible even when realizing that of course no question text could possibly be read. I've used to period-type "Week" report to get to the conclusion above. The same holds for the next conclusion: Well, Neha just answered one question this week. But what about Alen Oblak, nr 23 Overall Rank. Just 37 seconds to answer all four questions (almost without error) this week? What can we learn from Alen ? I was getting curious because every day on 'Past Quizzes' the maximum score of the day is mentioned, which is always higher than reasonably possible for anyone not just hitting some buttons very quick at random."

At first, I hesitated to include the names this player mentions in his email, but that's the beauty of the way I am running the PL/SQL Challenge (not to sound boastful :-) ). We are open about this data so everyone can see - and wonder the same things.

When we upgraded to 1.4, I published a change in the rules that sent out a rather severe warning to people who submit very fast answers. I plan within the next week or so to apply these rules (and a modification of them, which will be published in the Rules section this weekend with the ugprade to 1.5).

Here's the bottom line: you are about to see significant changes in the rankings of players who seem to be able to consistently play the quiz dramatically faster than even I (a PL/SQL expert and author of the quizzes) am able to simply read my own questions.

As I have mentioned in earlier blog postings, I suppose it is theoretically possible for someone who is an incredible speed reader; amazing PL/SQL expert; and very lucky individual to answer much faster than I can manage, but that behavior cannot be distinguished from those who cheat. So all I can do, to preserve the credibility of the PL/SQL Challenge, is discourage players from following that pattern.

So, my friends, just a little bit more patience and then those rankings will start to make a bit more sense.

In fact, again for the sake of transparency, you will find below my plans for adjusting timings, scores and rankings for VFAs (very fast answerers). Feel free to let me know what you think.

Planned Algorithm

1. I record the time it takes me to quickly answer each quiz. I consider this a reasonable minimum (RM), since it is actually an aggressive score, as I know PL/SQL pretty well and I also wrote the quiz (making it hard to avoid rapidly identifying the correct and incorrect answers).

2. Every two weeks (10 quizzes), I identify all players whose total time is less than mine (call them TFP, too fast players). I choose every two weeks because (a) I don't want to compare and adjust/punish on a daily basis. I need to allow that some people will know a feature better than me and answer more quickly and (b) 10 quizzes should be enough to reveal a pattern. Over two weeks, I would expect my RM to be around 300 seconds or 30 seconds per quiz on average.

3. For each TFP, if the delta is within 10 seconds, I do nothing; that's close enough and nothing to worry about.

4. If TFP is more than 10 secs faster, then for every 10 seconds faster (or portion thereof), I add 60 seconds to the time for each quiz answered faster than I did on each day.

So if my RM is 300 seconds and a person answers in 280, and 5 of the scores are less than mine, then their overall time with increase by 5 minutes or so (5 x 1 x 60 = 300). This should be enough to cause a dramatic decrease in their ranking and be a substantial incentive to SLOOOOW down or stop cheating. If they only had a couple of too fast answers and the others are reasonable, then the impact on their is lessened.

Your thoughts?

SF

05 August 2010

Explicitly assign NULL to variable? Question on 4 August Quiz(1284)

A few players have written to me suggesting that one of the choices I scored as correct was incorrect because I never explicitly assigned a value of NULL to the l_value variable:
DECLARE
  l_value   NUMBER;
  l_count   PLS_INTEGER;
BEGIN
  EXECUTE IMMEDIATE 'update my_table set my_column = :value' USING l_value;

  SELECT COUNT (*)
    INTO l_count
    FROM my_table
   WHERE my_column IS NULL;

  DBMS_OUTPUT.put_line (l_count);

  ROLLBACK;
END;
In fact, the default behavior in PL/SQL is to automatically initialize the value of your variable (when appropriate, by datatype) to NULL. Therefore, I did not need to explicitly make this assignment.

03 August 2010

Double penalty for lack of syntax knowledge?

A player wrote the following message to me today:

"The answers for the 02 August quiz are not based on a real Oracle PL/SQL knowledge, but on visual memory abilities. I knew exactly that Sys_refcursor was a weak cursor, but I had rarely used it and I was not sure if the underscore character was supposed to be used there. Moreover, I am sure that if it is a mistake I should not have two mistakes 1) for choosing the option without underscore and 2) for NOT choosing the option with underscore. Assuming that I've made a mistake with underscore character, I don't want to lose 40% of my rate for 1 mistake. that should be 20%. Anyway, I don't think that such answer options really reflect the PL/SQL level of participant, because participant got the gist of question and replied correctly in general, except ""grammar" mistake. In this sense even this one mistake should not be counted as a mistake."

Here's my view on this: the PL/SQL Challenge is intended to test your knowledge and familiarity with the PL/SQL language, and to motivate you to deepen that knowledge and increase that familiarity. Sometimes the question will focus on the way a feature can be used. Somtimes the question will concentrate on "little more" than syntax.

I don't agree with this player, though, that choices that test your familiarity with syntax is not "real" PL/SQL knowledge or simply a matter of "visual memory abilities."

Knowing that the name of the pre-defined weak REF CURSOR type is SYS_REFCURSOR means that you don't have to look up the correct spelling. The more quickly and accurately you can recall syntax, therefore, the more productive you will be.

And, clearly, if you want to make sure not to lose points for a dull issue of correct syntax, take the time to verify the result in Oracle documentation or by writing a small block of code. That way, your weighted score will decrease due to the increase in time, but you will at least get the question completely correct, which is more important than a fast time.

Certainly, if every quiz simply tested your ability to memorize syntax, the PL/SQL Challenge would become rather dull. I believe that I offer a nice blend of different kinds of questions and choices, which must be part of the reason that over 1200 developers, and usually more like 1400 developers, play the quiz each day.

Your thoughts?

SF