# Check your understanding — Sessions 0–6

This is not an exam and there is no grade. Answer in your own words, then compare with the answers.

## Session 0: how an app works

1. Where do the frontend and backend of our app run?
2. If you save a photo in Drive and its reference in the spreadsheet, does the link grant access?
3. What do you check when AI proposes a solution that looks correct?
4. Does the AI that writes the code need to stay connected to save each record?

<details><summary>See the answers</summary>

1. The **frontend**, the dining room, runs in the browser. The **backend**, the kitchen, will run in Apps Script. Browsers also run logic; not all invisible work is backend work.
2. No. In this pattern, the file is in storage and the reference is in a table; file permissions determine who can open it. This is a common approach, not the only possible architecture.
3. What it reads, writes and requests permission to use; then a valid case, an invalid case and whether the result persists. A convincing explanation does not guarantee accuracy.
4. No. AI helps build the code; the practice log runs on that deployed code.
</details>

## Session 1: your first app

1. What do Codi.gs and Index.html do? How do they communicate?
2. Which three configuration details do you check before deploying?
3. Why does the deployed app open the spreadsheet by its ID?
4. What do you do about an unexpected permission or an account restriction?
5. Which tests do you run at /exec? How do you deploy a change while keeping the link?

<details><summary>See the answers</summary>

1. **Index.html** is the frontend, the dining room. **Codi.gs** is the backend, the kitchen. They communicate through `google.script.run`, with success and failure handlers.
2. The **spreadsheet document ID**, **Registres** tab and **row 1 headers** in the expected order. The HTML file name must match what `doGet` loads: Index in this course.
3. To avoid relying on the active spreadsheet or tab in an editor. The explicit connection is `SpreadsheetApp.openById(ID_DEL_FULL)`; the ID is not the project's ID or the /exec URL.
4. Stop and review the account, project, code and permissions. A verification warning is not an instruction to accept. Ask the administrator about organisational restrictions.
5. Valid input, invalid input with no write, persistence after reloading, restricted access and phone use. To update: **Manage deployments → edit the existing deployment → New version**. Test the same /exec and check the data.
</details>

## Session 2: improve and fix

1. Why might changed code work at /dev but not appear at /exec?
2. What do you give AI when an error occurs?
3. Must you complete all six improvements and share publicly?
4. Does searching the loaded list search the whole spreadsheet? Does a Drive URL guarantee image access?

<details><summary>Answers</summary>

1. /dev runs the latest saved code; /exec runs the deployed version. Test first, then update the existing deployment.
2. Expected and observed results, exact message, steps, environment and current code without private data. Ask for the cause, smallest fix and tests.
3. No. The minimum is diagnosis, one improvement, security review, functionality and access checks. Sharing and advanced challenges are optional.
4. No: some records may not be loaded. And no: the file has its own permissions; thumbnail retrieval must match the intended access.
</details>

## Session 3: GitHub and context

1. How do save, commit, push and pull differ?
2. What do you give a chat that cannot see the files?
3. Why use openById rather than “the active spreadsheet”?
4. Does push deploy the app? Does closing the tab stop Codespaces?

<details><summary>Answers</summary>

1. Save updates the file. Commit records selected changes in the working copy. Push sends them to GitHub. Pull incorporates remote changes and may cause conflicts. The working copy can be in the cloud.
2. Both context documents and the current code. Then review and test the change, as with an integrated agent.
3. A web app should not depend on an active spreadsheet. An explicit ID, tab and headers determine where it works. For practice, check the ID does not point to the original.
4. No. S3 tests and deploys manually in Apps Script. And no: use Stop codespace; the stopped environment still uses storage.
</details>

## Session 4 — A reviewed change

1. Does a branch create another copy of the spreadsheet and deployment?
2. What do you review before merging a PR?
3. Does AI review guarantee that the change is correct?

<details><summary>Answers</summary>

1. No. It separates commits. To test without affecting other data, prepare an Apps Script copy and a practice spreadsheet.
2. Correct repo, base and compare, latest diff, tests, warnings and reviewed commit. Then verify the merge in main and sync your copy.
3. No. Check findings against code and tests; the person decides. Review again if the diff changes.

</details>

## Session 5 — Repeatable publishing

1. Are push, version and deployment the same?
2. Does a green workflow remove the need to test /exec?
3. Must you always enable automatic publishing?
4. What if it fails after uploading code?

<details><summary>Answers</summary>

1. No. Push uploads code to the project; creating a version fixes a snapshot; updating the deployment changes the version served at the same URL.
2. No. Check the commit, version, URL, record, errors and access using the intended account.
3. No. Start manually and keep AUTO_DEPLOY empty until you decide. Private protections depend on the plan and exceptions.
4. Check the stage and remote state before retrying. With automation stopped, you can restore the previous version of the same deployment and fix the repo. Restoring code does not restore data.

</details>


## Session 6 — Check your decision

1. Must you leave Apps Script? **No.** Choose based on a need and a tested limit.
2. Does installation validate offline use? **No.** Test resources, data, reload and updates.
3. Does opening HTML execute google.script.run? **No**, adapt calls outside Apps Script.
4. Does a private repo make a website private? **Not necessarily.** Check deployment visibility and authorisation separately.
5. Does a budget alert always stop spending? **No.** Check effective controls.
6. Does the portfolio back up my app records? **No.** They need a separate backup and tested restore.
7. Does adding a title complete S6? **Not in the new route.** Check plan, test and recovery, then record completion. Earlier progress is preserved.
