So when doing the curriculum I have noticed if I get text wrong it won’t accept the answer but there are times when I get the actually syntax wrong and it will accept it and change it to be correct. I feel that is a little backwards. The text shouldn’t matter as much compared to the syntax of the code that should always be correct. Just wanted to bring that to your attention.
Please show examples
We do need an example.
But I wouldn’t say syntax is necessarily more important than text.
If I was a client and I asked you to put my name in a heading element and you got my name wrong, the code being correct wouldn’t matter much to me.
If you are asked to create an element with some specific text both the syntax for the element and the text should be correct and you can almost be sure that both will be tested.
So if the syntax is wrong the code still works? Because I feel that the code working is a little more important then spelling that can be easily fixed!
The tbody is missing the ‘t’ but it still accepted the answer. There are other times it has done the same thing. but say if I miss spell Assets it will say it is wrong.
Welcome there,
This is not the curriculum, but how browsers interpret HTML. That is, if a browser comes across malformed HTML, instead of giving up and throwing errors, it does its best to correct the input - assume what the HTML was meant to be.
You can test this for yourself by locally creating an index.html
file, add some malformed HTML (same as the code you shared), then open that file in your browser, and have a look at the HTML in the browser dev tools - it will not be the same.
As for the curriculum. Many of the tests check the outcome - not the input. So, if the code results in the correct output, the code passes.
Hope this clarifies
Yes that does a lot. Thank you. I was always told if the syntax is wrong the code will not work. But I’m now guessing that doesn’t apply to all program languages. I appreciate the feedback.
A post was split to a new topic: Cash Register help
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.