[{"id":"htmlintermediate-001","courseId":"html-intermediate","domain":"document-structure","topic":"Implicit end tags","prompt":"Put these parts of an HTML end tag, such as </p>, in the order the syntax requires.","hint":"Think about which pieces every end tag fixes in place, and which piece changes from tag to tag.","explain":"An end tag is built from a few required pieces. Its punctuation is fixed, and only the element's name changes from tag to tag.","source":"https://html.spec.whatwg.org/multipage/syntax.html#optional-tags","interaction":{"type":"sort","items":[{"text":"A less-than sign, < (U+003C)","why":"Every start and end tag begins with a less-than sign, so this opens the end tag."},{"text":"A slash, / (U+002F)","why":"The slash right after the opening bracket marks the tag as an end tag rather than a start tag."},{"text":"The element's tag name, such as p","why":"The name says which element is being closed; tag names are case-insensitive."},{"text":"A greater-than sign, > (U+003E)","why":"The greater-than sign closes the end tag, after any optional whitespace that follows the name."}]},"options":[],"answer":"o:abcd","explanation":"An end tag is </ followed by the element's name, optional ASCII whitespace, and a closing >. It cannot carry attributes.","concept":"An end tag is </ followed by the element's name, optional ASCII whitespace, and a closing >. It cannot carry attributes.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["End tags are </name> plus optional whitespace; attributes belong to start tags."]},{"id":"htmlintermediate-002","courseId":"html-intermediate","domain":"document-structure","topic":"Character references","prompt":"A paragraph must show the code point 60, written in base ten, as a character reference. Which reference does that?","hint":"Think about the number system the reference uses and what must close it.","explain":"A character reference writes a character by name or code point and always starts with an ampersand. Numeric forms come in decimal and hexadecimal, each with its own required punctuation.","source":"https://html.spec.whatwg.org/multipage/syntax.html#character-references","interaction":{"type":"single"},"options":[{"id":"a","text":"&#60;","why":"A decimal reference: an ampersand, a hash, the base-ten digits 60, then a semicolon."},{"id":"b","text":"&#60","whyNot":"The digits must be followed by a semicolon. Without it the text is not a valid numeric reference."},{"id":"c","text":"&#x60;","whyNot":"The x makes this a hexadecimal reference, so the digits are read in base sixteen, not base ten."},{"id":"d","text":"#60;","whyNot":"A character reference must start with an ampersand; without one, the text is plain characters."}],"answer":"a","explanation":"A decimal numeric reference is &# plus digits plus a semicolon. The hex form uses &#x with hex digits and also needs the semicolon.","concept":"A decimal numeric reference is &# plus digits plus a semicolon. The hex form uses &#x with hex digits and also needs the semicolon.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Numeric character references need the ampersand, the digits, and a closing semicolon."]},{"id":"htmlintermediate-003","courseId":"html-intermediate","domain":"document-structure","topic":"Dir attribute","prompt":"You mark up a page of mixed English and Arabic text, and some blocks have no known direction. Which TWO statements about the dir attribute are correct?","hint":"Consider what a missing attribute does, and what the auto value makes the browser examine.","explain":"The dir attribute sets a base text direction, which the bidi algorithm uses to order mixed-script runs. Its values are ltr, rtl and auto, and what the browser does depends on how it is set.","source":"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/dir","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"An element with no dir attribute generally inherits the direction of its parent.","why":"When dir is missing or invalid, the base direction comes from the parent. With no ancestor setting one, it is left-to-right."},{"id":"b","text":"dir='auto' takes the base direction from the first character with strong directionality.","why":"The browser scans the text for the first strongly typed character, skipping some elements, to pick the direction."},{"id":"c","text":"Leaving out dir turns on automatic direction detection for the element.","whyNot":"Omitting dir does not enable detection. Only dir='auto' asks the browser to detect the direction."},{"id":"d","text":"Setting lang='ar' also sets the base direction to right-to-left.","whyNot":"The lang attribute declares the language but does not imply a base direction; dir is still needed."},{"id":"e","text":"dir='auto' is the default value, so it applies whenever dir is missing.","whyNot":"When dir is absent the element inherits from its parent. Auto is not the default."},{"id":"f","text":"A bdi element always takes its direction from its parent element.","whyNot":"bdi decides its direction from its own content, as if dir='auto' were set."}],"answer":"ab","explanation":"dir sets the base direction: ltr, rtl, or auto for detection from the text. With no dir, an element inherits from its parent, and omitting dir never enables detection.","concept":"dir sets the base direction: ltr, rtl, or auto for detection from the text. With no dir, an element inherits from its parent, and omitting dir never enables detection.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Use dir='auto' for text of unknown direction; a missing dir means inheritance, not detection."]},{"id":"htmlintermediate-004","courseId":"html-intermediate","domain":"document-structure","topic":"Preconnect hints","prompt":"Your page calls its own /api endpoint and also loads one critical font from a third-party host. Where does a rel='preconnect' hint help?","hint":"Think about which origins benefit from a connection that is opened early.","explain":"Before a request is sent, the browser may need a DNS lookup, a TCP connection and a TLS handshake. Some hints let a page start that setup early, so think about which origins still need it.","source":"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preconnect","interaction":{"type":"single"},"options":[{"id":"a","text":"For the third-party font host, by doing the DNS and TLS setup early.","why":"Preconnect performs part or all of the handshake for a cross-origin host ahead of time, so later requests there start sooner."},{"id":"b","text":"For the same-origin /api, by opening a second connection in parallel.","whyNot":"Same-origin requests already use an open connection, so preconnect gives them no benefit."},{"id":"c","text":"For the font file, by downloading it before the stylesheet asks for it.","whyNot":"Preconnect only sets up the connection. It does not fetch the file itself."},{"id":"d","text":"For every third-party host, since more early connections always load faster.","whyNot":"Preconnecting many domains can be counterproductive, so keep it for the most critical connections."}],"answer":"a","explanation":"rel='preconnect' starts DNS, TCP and TLS for a cross-origin host early. It gives no benefit to same-origin requests and should be limited to the most critical hosts.","concept":"rel='preconnect' starts DNS, TCP and TLS for a cross-origin host early. It gives no benefit to same-origin requests and should be limited to the most critical hosts.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Preconnect only your few most critical third-party origins; same-origin needs no hint."]},{"id":"htmlintermediate-005","courseId":"html-intermediate","domain":"document-structure","topic":"Meta refresh redirects","prompt":"A page contains <meta http-equiv='refresh'>. Which TWO statements about how this instruction behaves are correct?","hint":"Think about the unit the content number uses and when the timer begins.","explain":"A meta element with http-equiv='refresh' asks the browser to reload or redirect after a delay, as if an HTTP header said so. Its content value holds the delay and may add a URL, so the format matters.","source":"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/http-equiv","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"content='300' reloads the page after 300 seconds.","why":"A non-negative integer in content counts seconds, so 300 means five minutes."},{"id":"b","text":"The countdown starts only after the load and pageshow events have both fired.","why":"The timer begins once the page has completely loaded, not when the tag is read."},{"id":"c","text":"The countdown starts as soon as the parser reaches the meta element.","whyNot":"The timer waits until the page is fully loaded, so parsing the tag does not start it."},{"id":"d","text":"content='300' waits 300 milliseconds before reloading.","whyNot":"The number is in seconds, not milliseconds."},{"id":"e","text":"A very short interval is recommended, since it moves users along quickly.","whyNot":"Short intervals can stop people from reading the page, so they are an accessibility concern."},{"id":"f","text":"content='3;url=https://www.mozilla.org' reloads the current page after 3 seconds, without changing the address.","whyNot":"With ;url= and a valid URL, the page redirects to that URL. Only a plain number reloads the current page."}],"answer":"ab","explanation":"Meta refresh content is a whole number of seconds, optionally followed by ;url= and a URL. The countdown starts after the page has fully loaded.","concept":"Meta refresh content is a whole number of seconds, optionally followed by ;url= and a URL. The countdown starts after the page has fully loaded.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Meta refresh counts seconds, not milliseconds, and a short delay can hurt readers."]}]