This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by Dania
about 9 years

6/6 Seems to have some sort of bug

Looking at all the questions, it’s pretty apparent that 6/6 is broken somehow. It’s looking for unreasonable parameters or something because I’ve looked through the questions and a lot of people have had the issue.

I’ve had similar issues with the JavaScript tutorial where proper code didn’t go through and I had to go to the forums for an exact copy and paste job to get to the next step. I think it has something to do with how the browser is handling the code as you type, because it’s happened where I refresh and paste whatever I just did and it works all of a sudden. I’ve also managed to have old code still run after I’ve deleted it.

Just something to look at. After browsing for an answer, this works:

$i=3 switch($i): case 1: case 2: case 3: echo "i is between 1 and 3"; break;break;break; default:break; endswitch;

I got it from this answer.

Answer 5531649076b8fe9bbc00013d

2 votes

Permalink

While I applaud codeacademy.com for providing such a great (and free) resource for learning programming, I will say that it is frustrating when you write perfectly valid code and the editor does not approve it and allow you to continue. I provided the following switch statement for this exercise which is 100% valid (and validates and functions in other PHP testing sites, like PHPTESTER.net) but does not here for whatever reason:

    <?php

    
    $dog = "doggie";
    
    switch($dog) {
        case "Woodle":
            echo "That's a woodle!";
            break;
             
        case "Lab":
            echo "That's a lab!";
            break;
            
        case "German Shepard":
            echo "That's a German Shepard!";
            break;
            
        default:
            echo "You need to give me a dog I know!";
            
    }

?>
points
Submitted by iboersma
about 9 years

4 comments

Zeke Y about 9 years

Refresh the page && try again :)

iboersma about 9 years

Thanks, Zeke. I tried that several times and it still didn’t work. What’s strange is that I am not getting an error, but the blue ‘submit’ button is just showing the white “gear” icon after clicking. The result pane on the right is actually showing the correct output of the script, so I’m really puzzled…

Zeke Y about 9 years

Are you getting any connection errors?

iboersma about 9 years

Well, I closed my browser and re-logged in and re-copied the same switch statement above and it worked this time. Go figure… Thanks for trying to help, Zeke.

Answer 5527ed4286f5526f01000255

1 vote

Permalink

Hi Dania,

It’s looking for unreasonable parameters

Not at all. The instructions for 6/6 are very clear and easy to follow if you’ve been paying attention.

it’s happened where I refresh and paste whatever I just did and it works all of a sudden.

You probably just needed to wait a few seconds for the code to update before refreshing, but yes, that’s a common procedure for debugging a problem.

After browsing for an answer, this works: $i=3 switch($i): case 1: case 2: case 3: echo "i is between 1 and 3"; break;break;break; default:break; endswitch;

That code is terrible. It doesn’t pass for me, and the only reason it passes for you is because it’s so terrible you broke the SCT (Submission Correctness Test; code checker). It’s pretty easy to write a valid switch statement that will pass you and not throw a PHP error. If you don’t remember how, look at step 2/6 :)

points
Submitted by Zeke Y
about 9 years

Answer 55196f5c9113cbca80006419

0 votes

Permalink

Hi Dania,

There are a lot of problems with this course and people have been raising them for a long time. For some reason it looks like the editor doesn’t always update its memory to the most recent code you’ve entered.

If you could post a copy of your code for it before you used the answer above someone might be able to see if it was an error with the code or the editor (probably the editor but you never know).

Tim

points
Submitted by Tim Fawkes
about 9 years

Answer 553ee6d8d3292fd48b000024

0 votes

Permalink

GO TSM! GO TSM!

points
Submitted by Tason Jran
almost 9 years

5 comments

Yiliang Peng almost 9 years

GO CLG! GO CLG!

Yiliang Peng almost 9 years

CLG > TSM

Tason Jran almost 9 years

TSM WildTurtle > CLG DoubleLift

Yiliang Peng almost 9 years

thats why im on 30 points

Tason Jran almost 9 years

Thats why CLG came 5th, and TSM cant 1st ;)

Answer 553ee97695e37848d6000005

0 votes

Permalink

GO CLG! GO CLG!

points
Submitted by Yiliang Peng
almost 9 years