TeachingKidsProgramming/TeachingKidsProgramming.Source.Java

Eliminate confusing warnings on TKP Quizzes

Closed this issue · 1 comments

Because of the way that the graders run the quizzes, Eclipse sometimes flags quiz methods as unused (by drawing yellow squiggles under them). Examples: HousesQuiz.small(), HousesQuiz.medium() and so on.

Ideally we should be able to teach students that this type of feedback from Eclipse is worth paying attention to, instead of telling them to ignore these warnings. So we can turn these warnings off on a class-by-class basis using the following attribute:

@SuppressWarnings("unused")
public class HousesQuiz extends HousesQuizAdapter 
{
   // ....
} 

We should find places where warnings would be a distraction, and eliminate them. Suppressing them is pretty easy. But, making the methods public would also work. So this:

public class HousesQuiz extends HousesQuizAdapter
{
  private void small()
  {
    //        'The current length is 7
  }

  // ...
}

Should become:

public class HousesQuiz extends HousesQuizAdapter
{
  public void small()
  {
    //        'The current length is 7
  }

  // ...
}

updated