Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Self-Destructing Message Android App Sending Messages Creating the Message

John Coffin
John Coffin
10,359 Points

Misleading Error Message "Oops! It looks like Task [#] is no longer passing."

I've noticed an odd behavior with the challenges. I believe that it occurs when the answer syntactically correct but just a little off of what was expected. Other people have reported similar occurrences when doing different code challenges (see Help with HTML Challenge Task 5 for an example). I am hoping that by posting this information here, other people will be able to get past similar occurrences.

In my case, I was finishing off task 3 of 3 for the "Creating Messages" code challenge (i.e. "Build a Self-Destructing Message Android App" in the section "Sending Messages"). My code looked like this (NOTE: I've changed the variable names and text for clarity and it hopes that it cuts down on the temptation to cheat):

Date date = new GregorianCalendar(2014, 0, 1).getTime();

// Add code here!
ParseObject object = new ParseObject("ObjectName");
object.put("fieldString", "Field String");
object.put("fieldDate", date.toString());

In this case, a Date object and not a String object was expected. When one clicks on the "Check Work" button one gets the error message "Oops! It looks like Task 2 is no longer passing." One is not given the option to "Preview" the code; instead one is given the options to "Recheck Work" or to "Go to Task 2."

If one moves the "fieldDate" string above the "fieldString" line, then the error is "Bummer! Make sure you use the 'put()' method to add the event date to your ParseObject." One now has the option to "Preview" as per normal, but the preview isn't very helpful (i.e. in this case, we see a link to "output.xml").

The correct answer is obtained by removing the "toString()" function, thus passing an object:

Date date = new GregorianCalendar(2014, 0, 1).getTime();

// Add code here!
ParseObject object = new ParseObject("ObjectName");
object.put("fieldString", "Field String");
object.put("fieldDate", date);

Neither of these error messages are helpful in determining why the code is not being accepted. In my case, the instructions did not specify which object needed to be passed, but once I understood why I was getting this error, I was able to adjust my code accordingly. Hopefully, this discussion will be enough information for people who encounter this error message to reread the instructions and (even if it ambiguous) tweak a part of this code which is (for all intents and purposes) syntactically correct but not what the challenge is expecting.

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Thanks for the feedback. This is really good to know. I've added this to my list of code challenges to review and update. We're also constantly improving the engine itself, and better hints and syntax error messages are high on our priority list.