Punctuation with Quotation Marks Around Technical Terms
5 exercises — practise placing punctuation correctly with quoted error messages, code strings, and CLI flags.
0 / 5 completed
1 / 5
Which sentence correctly places the comma inside the closing quotation mark around a quoted error message, following standard American technical-writing convention?
"...shows \"connection refused,\" which usually points to a firewall rule" is correct under standard American convention: the comma goes inside the closing quotation mark. Option B places the comma outside, which is the British convention and inconsistent if the rest of the document follows American style. Option C adds an incorrect space before the comma. Option D misplaces the comma before the quotation and omits it after.
2 / 5
Choose the sentence that correctly keeps a literal error string unmodified, placing punctuation outside the quotation marks because moving it inside would corrupt the exact string being referenced.
"...the exact string \"user_not_found\"; no trailing period..." is correct: when quoting a precise code identifier or string literal, punctuation that is not part of the literal string stays outside the quotation marks, so the reader can trust the quoted content is exact. Option B incorrectly moves the semicolon inside, implying it's part of the string. Option C adds a fabricated period that was never in the original string. Option D adds an incorrect space before the semicolon.
3 / 5
Which sentence correctly punctuates a sentence that ends with a quoted CLI flag, following American convention for periods?
"Always pass the flag \"--dry-run.\"" is correct under American convention: the period goes inside the closing quotation mark, even though it's not literally part of the flag string. Option B places the period outside, following British style instead. Option C adds a stray space before the period. Option D omits the sentence-ending period entirely.
4 / 5
Select the sentence that correctly places a question mark outside the quotation marks because the question mark belongs to the whole sentence, not to the quoted term itself.
"...include the header \"X-Request-Id\"?" is correct: since the question mark applies to the entire sentence and "X-Request-Id" itself is not a question, the question mark goes outside the closing quotation mark, overriding the usual inside-placement rule for periods and commas. Option B incorrectly places it inside, implying the header name itself is a question. Option C adds an extra, unnecessary quotation mark. Option D adds a stray space before the question mark.
5 / 5
Which sentence correctly punctuates a colon that introduces a code block, keeping the colon outside the quoted term since it belongs to the introducing sentence?
"...variable \"NODE_ENV\": it controls which config file loads" is correct: colons and semicolons always go outside closing quotation marks in both American and British conventions, since they punctuate the surrounding sentence, not the quoted term. Option B incorrectly moves the colon inside the quotation marks, implying it's part of the variable name. Option C adds a stray space before the colon. Option D adds an unnecessary comma and a nonsensical trailing word.