6 ms·
I really like the presentation of the problems. I hope this is developed much further. It could, however, benefit a lot by having separate quizzes at different
by just2n 13y ago
I really like the presentation of the problems. I hope this is developed much further. It could, however, benefit a lot by having separate quizzes at different levels, and moving the edge-cases and browser-specific questions into their own quizzes. I also question the value of questions that are intentionally meant to trick you.
Some of these questions, by their nature of being browser-specific, are time sensitive since no versions are specified. And I'd have to double-check all of these answers because I found at least one which is wrong:
window.onresize = function(){window.location.reload()}
Definitely reloads the page in Chrome 27 (and the current Canary, 29).
- jaffathecake 13y agoI can't recreate this. See http://jsbin.com/agitez/1/quiet http://jsbin.com/agitez/1/quiet, open dev tools, preserve the log, click the link, following page does not reload.
- just2n 13y agoResize the window.
- MindTwister 13y agoThe question was whether or not it refreshed the browser without user interaction. Resizing is an interaction
- jaffathecake 13y agoYep, what MindTwister says https://github.com/jakearchibald/request-quest/blob/master/www/questions/resize-reload/spec.json#L3 https://github.com/jakearchibald/request-quest/blob/master/w...
- just2n 13y agoThe question makes no sense, in that case. The verbatim question is: > Does the above trigger a request for the current page (a reload without user interaction) in any of the following: The "without user interaction" as presented describes the request for the current page, implying a programmatic reload, not "will this code run without user interaction." Of course it won't, nor will this: function foo(){ console.log('harharhar, I won\'t ever be printed, obviously!'); } At which point the question is really a basic/pointless JS question and has nothing to do with the concept the question is trying to address. Further, the part that manually dispatches the event doesn't quite match the spec: > If the currently executing task is the dispatch of a resize event in response to the user resizing the browsing context Emphasis mine. It's reasonable for an implementation to interpret this as a manually fired event does not meet the criteria and reload the page, while the same code called while actually resizing the browsing context would not.
- jaffathecake 13y agoWell, the question does make sense, and it sounds like you've understood it on 2nd reading. > Of course it won't Then your answer should have been "no". Remember, the very first example is a paragraph, and it asks you if it makes a request for an image, I don't see you getting into the same rage about that. The resize question comes later on in the quiz, where the user may have thought "of course it won't" a few times when a particular browser does actually make a request. If all "of course it won't" examples actually made a request, it'd be a pretty simple quiz, right? > It's reasonable for an implementation to interpret this as a manually fired event does not meet the criteria and reload the page Agreed, it's a grey area. But this quiz is about what browsers do, not what the spec says. It's a difficult quiz, no one's expected to get everything right. My expectations were blown apart when I tested a lot of this stuff. You got stuff wrong, that's ok, don't let it ruin your day.
- just2n 13y ago> Then your answer should have been "no". Remember, the very first example is a paragraph, and it asks you if it makes a request for an image, I don't see you getting into the same rage about that. There's a fairly huge difference between how browsers handle HTML and JS. After fully parsing HTML, the DOM tree is completely built and once resources are loaded, the page is completely rendered. It's declarative. Code is different. No JS interpreter runs a function you define until you call it. So code is parsed and then later on, independent of its parsing, can do things. When you're asking if code does something, especially in the context of an event listener, it's expected you're actually running the code, regardless of how you've presented it. The HTML equivalent would have been to have asked if opening index.html here would've caused an alert to be shown. <!-- index.html --> <a href="image.html">Click me to see a funny picture.</a> <!-- image.html --> <img src="catpic1029381859834.png"> <script> alert('I hope you like my cat!'); </script> A quiz should be testing actual understanding/knowledge, not intermixing over-literal interpretations and breaking reader expectations. And the wording on the question is still wrong, because as I pointed out, the sans-user-action point is emphasizing the page reload event, not the code itself, so the only logical interpretation is that the resize event happens. Technically, this could still very well happen without user interaction: consider gravity pulling out a display cable and causing the window to be relocated/resized by the OS. > It's a difficult quiz, no one's expected to get everything right. Incorrect. It's a deceitful quiz. The delivery is excellent sans a few load-time render issues, but the content needs work.