{"schemaVersion":1,"contentVersion":"3.4.0","id":"foundation.13","languages":{"javascript":{"id":"foundation.13","title":"Checkpoint: move and edit in real files","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Make three or four changes in each of three real files, with the moves and edits of this module.</p><p><strong>Before this lesson:</strong> The other lessons of Editing foundations.</p><p>You choose the commands. Move a line or two at a time, or jump with a line number and G. Then pick the edit that fits: x or r for one character, cw for a word, dd or cc for a whole line, o or O for a new one, and yy with p for a copy. Try without hints first, and open help if you need it.</p><p>Compare your whole result with the target before you finish.</p>","teaches":["char-delete","door-o","linewise","operator-motion"],"introduces":[],"constraints":[],"drills":[{"task":"We've stopped shipping to the UK, so delete its rate. Free shipping starts at <code>6000</code> now, Belgium costs <code>595</code>, and the carrier is <code>carriers.dhl</code>. You can use any commands.","hint":"Move a line or two at a time, then pick the edit: x or r for one character, cw for a word, dd and cc for a line, o and O for a new one.","mode":"jsx","start":"import { carriers } from \"./carriers.js\";\n\n// Shipping rates in cents, by country. Free above the threshold.\nexport const FREE_SHIPPING_ABOVE = 5000;\nexport const RATES = {\n  nl: 495,\n  be: 695,\n  de: 795,\n  uk: 1495,\n};\nexport const CARRIER = carriers.postnl;","startCursor":{"line":0,"ch":0},"paths":[{"keys":["3","j","$","b","r","6","3","j","b","r","5","2","j","d","d","j","$","c","b","dhl","<Esc>"],"tier":"idiomatic","technique":"linewise","core":["linewise","operator-motion"],"note":"This is a clean route with what you've learned so far. Any other way that gets the same result is fine too."}],"target":"import { carriers } from \"./carriers.js\";\n\n// Shipping rates in cents, by country. Free above the threshold.\nexport const FREE_SHIPPING_ABOVE = 6000;\nexport const RATES = {\n  nl: 495,\n  be: 595,\n  de: 795,\n};\nexport const CARRIER = carriers.dhl;","language":"javascript","evidence":"checkpoint","canonicalKey":"foundation.13#0","canonicalFingerprint":"1ta37v8"},{"task":"Do the TODO: add a <code>Contact</code> link to <code>/contact</code> below Careers, like the others, then delete the TODO. The year is <code>2026</code> now. You can use any commands.","hint":"Move a line or two at a time, then pick the edit: x or r for one character, cw for a word, dd and cc for a line, o and O for a new one.","mode":"jsx","start":"// The footer on every page.\nexport function SiteFooter() {\n  return (\n    <footer className=\"site-footer\">\n      <a href=\"/help\">Help</a>\n      <a href=\"/returns\">Returns</a>\n      <a href=\"/careers\">Careers</a>\n      {/* TODO: link to the contact page, like the others */}\n      <p>Copyright 2025 Northwind</p>\n    </footer>\n  );\n}","startCursor":{"line":0,"ch":0},"paths":[{"keys":["6","j","y","y","p","4","w","c","w","contact","<Esc>","2","w","c","e","Contact","<Esc>","j","d","d","4","e","r","6"],"tier":"idiomatic","technique":"put","core":["put","linewise","operator-motion"],"note":"This is a clean route with what you've learned so far. Any other way that gets the same result is fine too."}],"target":"// The footer on every page.\nexport function SiteFooter() {\n  return (\n    <footer className=\"site-footer\">\n      <a href=\"/help\">Help</a>\n      <a href=\"/returns\">Returns</a>\n      <a href=\"/careers\">Careers</a>\n      <a href=\"/contact\">Contact</a>\n      <p>Copyright 2026 Northwind</p>\n    </footer>\n  );\n}","language":"javascript","evidence":"checkpoint","canonicalKey":"foundation.13#1","canonicalFingerprint":"b9d1km"},{"task":"The VAT helpers moved to <code>./tax.js</code>, so import from there. Add the comment <code>// Rates for 2026</code> above <code>describe</code>, and Belgium's test should expect <code>1210</code>, not <code>1211</code>. You can use any commands.","hint":"Move a line or two at a time, then pick the edit: x or r for one character, cw for a word, dd and cc for a line, o and O for a new one.","mode":"jsx","start":"import { describe, it, expect } from \"vitest\";\nimport { withVat } from \"./vat.js\";\n\ndescribe(\"withVat\", () => {\n  it(\"adds 21% in the Netherlands\", () => {\n    expect(withVat(1000, \"nl\")).toBe(1210);\n  });\n  it(\"adds 21% in Belgium\", () => {\n    expect(withVat(1000, \"be\")).toBe(1211);\n  });\n});","startCursor":{"line":0,"ch":0},"paths":[{"keys":["j","6","w","c","w","tax","<Esc>","7","j","4","e","r","0","4","G","O","// Rates for 2026","<Esc>"],"tier":"idiomatic","technique":"door-O","core":["door-O","operator-motion"],"note":"This is a clean route with what you've learned so far. Any other way that gets the same result is fine too."}],"target":"import { describe, it, expect } from \"vitest\";\nimport { withVat } from \"./tax.js\";\n\n// Rates for 2026\ndescribe(\"withVat\", () => {\n  it(\"adds 21% in the Netherlands\", () => {\n    expect(withVat(1000, \"nl\")).toBe(1210);\n  });\n  it(\"adds 21% in Belgium\", () => {\n    expect(withVat(1000, \"be\")).toBe(1210);\n  });\n});","language":"javascript","evidence":"checkpoint","canonicalKey":"foundation.13#2","canonicalFingerprint":"18qlbak"}]},"python":{"id":"foundation.13","title":"Checkpoint: move and edit in real files","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Make three or four changes in each of three real files, with the moves and edits of this module.</p><p><strong>Before this lesson:</strong> The other lessons of Editing foundations.</p><p>You choose the commands. Move a line or two at a time, or jump with a line number and G. Then pick the edit that fits: x or r for one character, cw for a word, dd or cc for a whole line, o or O for a new one, and yy with p for a copy. Try without hints first, and open help if you need it.</p><p>Compare your whole result with the target before you finish.</p>","teaches":["char-delete","door-o","linewise","operator-motion"],"introduces":[],"constraints":[],"drills":[{"task":"We've stopped shipping to the UK, so delete its rate. Belgium costs <code>595</code> now, free shipping starts at <code>6000</code>, and the carrier is <code>CARRIERS.dhl</code>. You can use any commands.","hint":"Move a line or two at a time, then pick the edit: x or r for one character, cw for a word, dd and cc for a line, o and O for a new one.","mode":"python","start":"\"\"\"Shipping rates in cents, by country. Free above the threshold.\"\"\"\nfrom shop.shipping.carriers import CARRIERS\n\nSHIPPING_RATES = {\n    \"nl\": 495,\n    \"be\": 695,\n    \"de\": 795,\n    \"uk\": 1495,\n}\nFREE_SHIPPING_ABOVE = 5000  # before VAT\nCARRIER = CARRIERS.postnl  # tracking links depend on it\nLABEL_FORMAT = \"A6\"","startCursor":{"line":0,"ch":0},"paths":[{"keys":["5","j","2","W","r","5","2","j","d","d","j","2","W","r","6","j","b","c","w","dhl","<Esc>"],"tier":"idiomatic","technique":"linewise","core":["linewise","operator-motion"],"note":"This is a clean route with what you've learned so far. Any other way that gets the same result is fine too."}],"target":"\"\"\"Shipping rates in cents, by country. Free above the threshold.\"\"\"\nfrom shop.shipping.carriers import CARRIERS\n\nSHIPPING_RATES = {\n    \"nl\": 495,\n    \"be\": 595,\n    \"de\": 795,\n}\nFREE_SHIPPING_ABOVE = 6000  # before VAT\nCARRIER = CARRIERS.dhl  # tracking links depend on it\nLABEL_FORMAT = \"A6\"","language":"python","evidence":"checkpoint","canonicalKey":"foundation.13#0","canonicalFingerprint":"1ta37v8"},{"task":"Do the TODO: add a <code>Contact</code> link to <code>/contact/</code> below Careers, like the others, then delete the TODO. The year is <code>2026</code> now. You can use any commands.","hint":"Move a line or two at a time, then pick the edit: x or r for one character, cw for a word, dd and cc for a line, o and O for a new one.","mode":"python","start":"\"\"\"The links in the footer on every page.\"\"\"\n# TODO: link to the contact page, like the others\nFOOTER_LINKS = [\n    (\"Help\", \"/help/\"),\n    (\"Returns\", \"/returns/\"),\n    (\"Careers\", \"/careers/\"),\n]\nCOPYRIGHT = \"Copyright 2025 Northwind\"","startCursor":{"line":0,"ch":0},"paths":[{"keys":["j","d","d","3","j","y","y","p","w","c","w","Contact","<Esc>","3","w","c","e","contact","<Esc>","G","5","e","r","6"],"tier":"idiomatic","technique":"put","core":["put","linewise","operator-motion"],"note":"This is a clean route with what you've learned so far. Any other way that gets the same result is fine too."}],"target":"\"\"\"The links in the footer on every page.\"\"\"\nFOOTER_LINKS = [\n    (\"Help\", \"/help/\"),\n    (\"Returns\", \"/returns/\"),\n    (\"Careers\", \"/careers/\"),\n    (\"Contact\", \"/contact/\"),\n]\nCOPYRIGHT = \"Copyright 2026 Northwind\"","language":"python","evidence":"checkpoint","canonicalKey":"foundation.13#1","canonicalFingerprint":"b9d1km"},{"task":"The VAT helpers moved to <code>shop.tax</code>, so import from there. Add the comment <code># Rates for 2026</code> above the first test, and Belgium's test should expect <code>1210</code>, not <code>1211</code>. You can use any commands.","hint":"Move a line or two at a time, then pick the edit: x or r for one character, cw for a word, dd and cc for a line, o and O for a new one.","mode":"python","start":"from shop.vat import with_vat\n\n\ndef test_dutch_rate():\n    assert with_vat(1000, \"nl\") == 1210\n\n\ndef test_belgian_rate():\n    assert with_vat(1000, \"be\") == 1211","startCursor":{"line":0,"ch":0},"paths":[{"keys":["3","w","c","w","tax","<Esc>","3","j","O","# Rates for 2026","<Esc>","G","$","r","0"],"tier":"idiomatic","technique":"door-O","core":["door-O","operator-motion"],"note":"This is a clean route with what you've learned so far. Any other way that gets the same result is fine too."}],"target":"from shop.tax import with_vat\n\n\n# Rates for 2026\ndef test_dutch_rate():\n    assert with_vat(1000, \"nl\") == 1210\n\n\ndef test_belgian_rate():\n    assert with_vat(1000, \"be\") == 1210","language":"python","evidence":"checkpoint","canonicalKey":"foundation.13#2","canonicalFingerprint":"18qlbak"}]},"text":{"id":"foundation.13","title":"Checkpoint: move and edit in real files","moduleName":"Editing foundations","tips":"","concept":"<p class=\"lead\">Make three or four changes in each of three real files, with the moves and edits of this module.</p><p><strong>Before this lesson:</strong> The other lessons of Editing foundations.</p><p>You choose the commands. Move a line or two at a time, or jump with a line number and G. Then pick the edit that fits: x or r for one character, cw for a word, dd or cc for a whole line, o or O for a new one, and yy with p for a copy. Try without hints first, and open help if you need it.</p><p>Compare your whole result with the target before you finish.</p>","teaches":["char-delete","door-o","linewise","operator-motion"],"introduces":[],"constraints":[],"drills":[{"task":"We've stopped shipping to the UK, so delete its row. Free shipping starts at <code>60</code> euros now, Belgium costs <code>5.95</code>, and we ship with <code>DHL</code>. You can use any commands.","hint":"Move a line or two at a time, then pick the edit: x or r for one character, cw for a word, dd and cc for a line, o and O for a new one.","mode":"text/plain","start":"# Shipping\n\nFree shipping on orders over 50 euros.\n\n| Country | Price |\n|---------|-------|\n| Netherlands | 4.95 |\n| Belgium | 6.95 |\n| Germany | 7.95 |\n| United Kingdom | 14.95 |\n\nWe ship with PostNL. You get a tracking link by email.","startCursor":{"line":0,"ch":0},"paths":[{"keys":["2","j","5","w","r","6","5","j","B","r","5","2","j","d","d","j","3","w","c","w","DHL","<Esc>"],"tier":"idiomatic","technique":"linewise","core":["linewise","operator-motion"],"note":"This is a clean route with what you've learned so far. Any other way that gets the same result is fine too."}],"target":"# Shipping\n\nFree shipping on orders over 60 euros.\n\n| Country | Price |\n|---------|-------|\n| Netherlands | 4.95 |\n| Belgium | 5.95 |\n| Germany | 7.95 |\n\nWe ship with DHL. You get a tracking link by email.","language":"text","evidence":"checkpoint","canonicalKey":"foundation.13#0","canonicalFingerprint":"1ta37v8"},{"task":"Do the TODO: add a <code>Contact</code> link to <code>/contact</code> below Careers, like the others, then delete the TODO. The year is <code>2026</code> now. You can use any commands.","hint":"Move a line or two at a time, then pick the edit: x or r for one character, cw for a word, dd and cc for a line, o and O for a new one.","mode":"text/plain","start":"# Footer links\n\nThese go at the bottom of every page, in this order.\nTODO: link to the contact page, like the others\n\n- Help: /help, in the Shop column\n- Returns: /returns, in the Shop column\n- Careers: /careers, in the Company column\n\nCopyright 2025 Northwind","startCursor":{"line":0,"ch":0},"paths":[{"keys":["3","j","d","d","3","j","y","y","p","w","c","w","Contact","<Esc>","3","w","c","e","contact","<Esc>","G","w","e","r","6"],"tier":"idiomatic","technique":"put","core":["put","linewise","operator-motion"],"note":"This is a clean route with what you've learned so far. Any other way that gets the same result is fine too."}],"target":"# Footer links\n\nThese go at the bottom of every page, in this order.\n\n- Help: /help, in the Shop column\n- Returns: /returns, in the Shop column\n- Careers: /careers, in the Company column\n- Contact: /contact, in the Company column\n\nCopyright 2026 Northwind","language":"text","evidence":"checkpoint","canonicalKey":"foundation.13#1","canonicalFingerprint":"b9d1km"},{"task":"Greet Dana with <code>Hi Dana,</code> on a line above the first sentence, make the total <code>125.00</code>, and end the total's line with <code> You can pay by bank transfer.</code> You can use any commands.","hint":"Move a line or two at a time, then pick the edit: x or r for one character, cw for a word, dd and cc for a line, o and O for a new one.","mode":"text/plain","start":"Subject: Your invoice for October\n\nYour invoice for October is attached.\nThe total is 120.00 euros, due on 15 November.\n\nNorthwind, accounts","startCursor":{"line":0,"ch":0},"paths":[{"keys":["4","G","4","e","r","5","A"," You can pay by bank transfer.","<Esc>","k","O","Hi Dana,","<Esc>"],"tier":"idiomatic","technique":"door-A","core":["door-A","door-O"],"note":"This is a clean route with what you've learned so far. Any other way that gets the same result is fine too."}],"target":"Subject: Your invoice for October\n\nHi Dana,\nYour invoice for October is attached.\nThe total is 125.00 euros, due on 15 November. You can pay by bank transfer.\n\nNorthwind, accounts","language":"text","evidence":"checkpoint","canonicalKey":"foundation.13#2","canonicalFingerprint":"18qlbak"}]}},"concepts":{"javascript":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> The other lessons of Editing foundations.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Make three or four changes in each of three real files, with the moves and edits of this module.</p><p>You choose the commands. Move a line or two at a time, or jump with a line number and G. Then pick the edit that fits: x or r for one character, cw for a word, dd or cc for a whole line, o or O for a new one, and yy with p for a copy. Try without hints first, and open help if you need it.</p><p>Compare your whole result with the target before you finish.</p></div></details>"},"python":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> The other lessons of Editing foundations.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Make three or four changes in each of three real files, with the moves and edits of this module.</p><p>You choose the commands. Move a line or two at a time, or jump with a line number and G. Then pick the edit that fits: x or r for one character, cw for a word, dd or cc for a whole line, o or O for a new one, and yy with p for a copy. Try without hints first, and open help if you need it.</p><p>Compare your whole result with the target before you finish.</p></div></details>"},"text":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> The other lessons of Editing foundations.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Make three or four changes in each of three real files, with the moves and edits of this module.</p><p>You choose the commands. Move a line or two at a time, or jump with a line number and G. Then pick the edit that fits: x or r for one character, cw for a word, dd or cc for a whole line, o or O for a new one, and yy with p for a copy. Try without hints first, and open help if you need it.</p><p>Compare your whole result with the target before you finish.</p></div></details>"}}}