{"id":"code-work-teach-apps-script-lab-copies","audience":"teachers","category":"coding","track":"coding","technique":"constraints","title":"Make a copy of a lab template for every student","free":false,"task":"Write a Google Apps Script function named makeLabCopies that reads student names from the Roster tab, column A from row 2 down, skipping blank rows, and makes one copy of the template doc (file ID 1LabTemplate4xYz) per student in the folder with ID 1Period3Folder, named exactly Lab 4 - <student name>. Don't share the copies or email anyone yet; you'll share them after checking. One code block, at most 12 lines, then under 25 words outside the code.","materialLabel":"Roster and setup notes (attached to your prompt automatically)","material":"ROSTER tab - Biology Period 3 (row 1 is headers)\nA Student | B Email | C Lab group\nAmari Jones | ajones@stu.ridgeview.example | 1\nBen Lowe | blowe@stu.ridgeview.example | 1\nCarla Mendes | cmendes@stu.ridgeview.example | 2\n(blank row, Dev moved to Period 5)\nElla Reyes | ereyes@stu.ridgeview.example | 3\nFinn Soto | fsoto@stu.ridgeview.example | 3\n\nSetup:\n- Template: \"Lab 4 - Enzyme Activity (TEMPLATE)\"\n- Period 3 folder in the class Drive\n- 28 students in total\n\nNotes from Ms. Adeyemi:\n- Last year I made copies by hand and two students got each other's labs.\n- Lab groups share data but each student turns in their own doc.\n- Students sometimes get added mid-semester.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":12},{"type":"maxProseWords","max":25}],"mistakes":[{"title":"Not saying where the names are","why":"The AI reads the whole sheet, header and blank rows included, so you get a copy called Lab 4 - Student.","fix":"Add: \"Roster column A from row 2, skip blanks.\"","checks":["r0"]},{"title":"Leaving the name open","why":"The AI names copies its own way, like Copy of Lab 4.","fix":"Add: \"Name each copy exactly Lab 4 - <student name>, in folder 1Period3Folder.\"","checks":["r1"]},{"title":"Not saying it's too early to share","why":"The AI helpfully shares each doc with the student's email.","fix":"Add: \"Don't share or email anything yet.\"","checks":["r2"]},{"title":"Getting a menu of options","why":"The AI likes to offer two or three versions of the script, so you're left to pick and test them yourself.","fix":"Add: \"Give one script only, in one code block, no alternatives.\"","checks":["codeBlocks","maxCodeLines"]},{"title":"Getting a tutorial","why":"By default the AI explains every part of the code at length, which you then have to scroll past.","fix":"Add: \"After the code, one line under 12 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Says where the names are","patterns":["roster","column a","row 2"]},{"label":"Gives the copy name","patterns":["lab 4 - ","named exactly","name each"]},{"label":"Gives the IDs","patterns":["1labtemplate4xyz","1period3folder","file id|folder id"]},{"label":"Rules out sharing","patterns":["don'?t share","no (sharing|email)","not share"]},{"label":"Caps the code length","patterns":["\\d+\\s*lines","at most","under \\d+","short"]}],"hint":"Tell the AI exactly where the names are, what each copy is called and where it goes, and that it shouldn't share anything yet.","rubricLabels":["Is a function named makeLabCopies that reads names from the Roster tab's column A starting at row 2 and skips blank names","Copies the template with DriveApp.getFileById(\"1LabTemplate4xYz\").makeCopy(\"Lab 4 - \" + name, DriveApp.getFolderById(\"1Period3Folder\")), so each copy is named exactly Lab 4 - <student name> in that folder","Doesn't share or email anything: no addEditor, addViewer, setSharing, MailApp or GmailApp calls"]}