Challenge: Word Blanks should have tests to make sure campers use function parameters #7603
Hahaha, I love this. It's not something we could ever fully prevent, but we could make it more annoying by adding 2 or 3 more tests. However, I tend to be of the mind that it doesn't matter. If someone does this there's no way they can't realize they're circumventing the purpose of the challenge and since this challenge isn't required for a cert the only thing they're harming is their own learning potential.
Anyone else have thoughts on if this is worth fixing?
@sludge256 @ltegman Isn't this similar to #7600 of intentionally trying to pass the tests?
@raisedadead Yes, that's why I brought it up.
I also agree that it's not a big issue. I can go ahead and close this, and maybe 7600 if we don't plan on preventing such code any time soon.
I would like to know what I am supposed to learn from this. Could you help me understand why the above code was controversial. I also noticed there was no closing } at top of page it is a must in java script right. I get an error when I try to place the code. Can anyone help me understand.
@jowright This challenge is meant to be an exercise in string concatenation using variables. This concept was introduced in Constructing Strings with Variables.
The above code is controversial because it passes without following the instructions:
You will need to use string operators to build a new string,
result
, using the provided variables:myNoun
,myAdjective
,myVerb
, andmyAdverb
.
None of the provided variables were used.
The closing }
for the function is just below the return statement.
A low priority/bike shedding issue, but I figured it's worth mentioning anyways.
Supplied code passes, but defeats the purpose of the challenge. It's unlikely that someone would ever do this, but I do recall seeing similar code being posted in one of the Gitter rooms.
Challenge Word Blanks
The code I saw in chat looked something like this (from what I remember at least):