Error in U4L5, 6D

In lesson U4L5, level 6D, the directions on lines 17-35 of ImageScene.java do not make sense. I pasted them below. First of all, the —TO DO— is inside of the wrong method. That method, getImages(), is incomplete, but all the directions say to write the code for chooseRandomImage(). However, chooseRandomImage() is written correctly and doesn’t need any changes. Finally, getImages() is not necessary for the program to function, but it needs to correctly return a String array for the code to compile. Once I fix the return statement in that method, the code passes all the tests even though I only had to add a single word, the name of the instance variable (images), to the return statement on line 26. I don’t think code.org meant to write the level so that I only needed to add a single word to the wrong method to make the code work.

/*

  • Returns the 1D array of images
    /
    public String[] getImages() {
    /
    ----------------------------------- TO DO -----------------------------------
    • :white_check_mark: Return a random image from the images array.

    */
return "";

}

/*

  • Returns a random image from the 1D array of images
    */
    public String chooseRandomImage() {
    int randomIndex = (int)(Math.random() * images.length);
    return images[randomIndex];
    }
1 Like

Hi @matt_s_mclaughlin! Thank you for pointing this out for others to see if they get to this level! I will send an email to support@code.org with your notes. Sending a message to this email when there are clear errors in directions or technical difficulties generally gets the proper attention for issues like this. Feel free to use that email if you see other glaring problems like this in the future.

Best,
-Sam

I just wanted to follow up on this. I received a reply from support@code.org and this is what they said:

Andrew (Code.org Support)

Nov 28, 2023, 10:05 AM PST

Hello Samuel,

Thank you for contacting Code.org!

We appreciate you reporting this!

Our team is aware of this and they are actively working on a fix. We sincerely apologize for any inconvenience. You should see this level updated within the next few days.

These reports help us make our site and offerings better for everyone, so thanks again for taking the time to send us this information!

If you have any additional questions, please let us know.

Hi Sam-

Thanks for showing me the usefulness of the emails to support@code.org. The last time I tried that I didn’t get as prompt and helpful responses as I did on this forum, which is why I tried the forum for the first errors I found in U4.

One of my students found a new error today. I will use the email address to report it!

Sincerely,

Matt

1 Like