--- id: "d4c35158-a869-4cbe-99e5-2612d61c03de" name: "canvas_mark_done()" micro_summary: "Call when you've completed an assignment and need to mark it done so canvas_next_item() skips it next time." status: "resolved" see_also: [] scope: "Mark a planner item as done by clicking its completion checkbox on the dashboard. Call after completing an assignment so canvas_next_item() skips it on the next invocation." --- ## canvas_mark_done(name) Mark a planner item as done by clicking its completion checkbox on the Canvas dashboard. Call after completing an assignment so `canvas_next_item()` skips it on the next invocation. ```bash browser-harness <<'PY' import json item = json.loads(canvas_next_item()) # ... complete the assignment ... result = json.loads(canvas_mark_done(item["name"])) print(result) # {"ok": true, "found": true, "clicked": true} PY ``` ### Flow (internal) 1. Navigates to Canvas dashboard (if not already there) 2. Searches planner items for link text matching `name` (fuzzy, case-insensitive) 3. Finds the `input[data-testid="planner-item-completed-checkbox"]` 4. Clicks the label (CSS modules) or checkbox directly 5. Returns result ### Return (parse with json.loads) **Success:** ```json {"ok": true, "found": true, "clicked": true, "name": "..."} ``` **Already done (no-op):** ```json {"ok": true, "found": true, "already_done": true, "name": "..."} ``` **Not found:** ```json {"ok": false, "found": false, "searchedFor": "...", "itemsChecked": 5} ``` ### Name matching - Uses the `a[data-cid="Link"]` span text, stripped of "Assignment " prefix - Case-insensitive substring match - Works with the `name` field from `canvas_next_item()` result directly