Because we got the question last year, I am going to post my answer to that question here in advance. I hope this helps if you are confused why /file1 and file1 are correct, but the query is only correct without the ?
I understand why the grading can be confusing. Let's talk about the facts first and then about the reasoning for the grading.
According to RFC 1738 a HTTP URL has the format:
http://<host>:<port>/<path>?<searchpart>
Here you see how the : is not part of the port, / is not part of the path, and the ? is not part of the searchpath. According to this, only the file1 solution would be correct (and it even explicitly says that the leading / is not part of the path).
But that RFC has been obsoleted by RFC 3986, which provides us with this fantastic ASCII art:
foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
Again, you can see that ? is not part of the query (which is now actually defined as such, same goes for the fragment), in Section 3.2.3 it is stated that “an optional port number in decimal following the host and delimited from it by a single colon (":") character”, so the : is not part of the port element but its delimiter. What about the path? In Section 3.3 we learn that “path [...] begins with "/" or is empty” (as part of the grammar) so the / is part of the path element.
Now it's pretty confusing that the official definitions differ for some elements (but not for all), so the version presented in the lecture is how you think of the elements intuitively : before the port, / to start the path, and ? before the query (the actual format of the query is not standardized, but the whole internet uses the & symbol as a delimiter between values).
Now about the grading:
- If you solved it according to the slides you got full marks.
- If you solved it according to the either of the standards you got full marks.
We would rather not assume that y'all are reading standards, though that will definitely help you in the long run in this course. Not everything will be presented in the lecture that is needed for the exercises, you'll need to research yourselves sometimes.
I hope that resolves all confusion :)