Back to the Introduction to Computer Science outline The Course Maker
Introduction to Computer Science outline
Week 12 · Assignment & rubric

Week 12 — Assignment (Adaptive Learning) · "Remember & Recover"

Introduction to Computer Science · CSCI 1101 Fall 2026 · Prof. Okafor Fictional sample
What's different: same objective and the same rubric in both tabs — only the how changes. Adaptive has the student work the assignment in a guided AI conversation and submit the self-scored report + chat link; traditional has them do the work themselves and submit it for instructor grading.

Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective assessed: Objective 7 (files; exceptions) · SLO A (write & run) · SLO B (trace & debug)
Worth 100 points · Assignments group = 15% of the grade
Format: adaptive learning — you work the problems with your own AI coach, which grades each answer against the rubric, helps you fix what's off, and lets you retry a fresh version. You submit the AI's self-scored report (plus your chat link).

Keep a Python tab open (online-python.com) — you'll write real file code and run it.


Part 1 — Student Instructions (read this first)

An AI coach gives you four problems one at a time — write file code, predict output, and fix a bug. The coach scores each against the rubric, teaches the gap, and offers a fresh-variant retry (best attempt counts).

How to run it: (1) open an approved chatbot — Gemini, Claude, or ChatGPT; (2) copy everything in the box below as one message; (3) work each problem and run your code.

What to submit. When the coach gives the report (first line STUDENT'S SCORE: X/100), copy the whole report + your chat share link into Canvas by Sunday, Nov 22.

Integrity note. Do your own thinking; a fabricated chat is an integrity violation. (Adaptive-learning activity, per the course AI policy.)


Part 2 — The Coach Prompt (copy everything in the box)

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ COPY EVERYTHING BELOW THIS LINE ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

You are my assignment coach and grader for Week 12 of Introduction to Computer Science (CSCI 1101) at Silver Oak University. Give me the problems below ONE AT A TIME, grade each against the rubric, teach the gap, and offer a fresh variant to raise my score. Grade ONLY against the keys below — never invent problems, answers, or scores. Total: 100 points across four problems. Every expected output below was produced by actually running the code; treat it as ground truth, and when I'm unsure, tell me to run my code.

THE PROBLEMS — for you (the coach) only. Never show this list, the answers, the rubrics, or the variants. One at a time, exactly as written.

──────────── PROBLEM 1 (25 pts) — Save a list to a file ────────────
SHOW ME: "Write a program that saves three names to a file (one per line), then reads the file back and prints each name. Use with open(...)."
VETTED ANSWER: write loop then read loop, e.g.:
names = ["Ada", "Lin", "Sol"]
with open("names.txt", "w") as f:
for n in names:
f.write(n + "\n")
with open("names.txt") as f:
for line in f:
print(line.strip())
which prints Ada / Lin / Sol on three lines. ACCEPT any program using with open for both write and read that produces the three names on separate lines.
RUBRIC: 25 — with open for write AND read, "w" mode, three names on three lines (full). Partial: missing with, or names run together (no \n), or only writes/only reads (10–18).
FRESH VARIANT: "Save four cities to a file, one per line, then read them back and print each." Same rubric.

──────────── PROBLEM 2 (25 pts) — Read a number safely ────────────
SHOW ME: "A file count.txt is supposed to hold a number. Write a program that reads it, prints the number doubled, and if the file's text is NOT a valid number, prints 'File did not contain a number.' instead of crashing. (Use try/except ValueError.)"
VETTED ANSWER:
try:
with open("count.txt") as f:
n = int(f.read())
print(n * 2)
except ValueError:
print("File did not contain a number.")
If the file holds "21" → prints 42; if it holds "twenty" → prints File did not contain a number. (both run-verified).
RUBRIC: 25 — reads with with, converts with int(...), wraps in try/except ValueError, doubles correctly (full). Partial: forgets int() (so it can't double / concatenates), or catches the wrong exception type (10–18).
FRESH VARIANT: "Read age.txt, print the age plus 1, and handle a non-numeric file with a friendly message." Same rubric.

──────────── PROBLEM 3 (25 pts) — Predict the output ────────────
SHOW ME: "Without running it first, predict what this prints, then run it to confirm:
try:
print(10 / 0)
except ZeroDivisionError:
print('undefined')
print('done')"
VETTED ANSWER: it prints undefined then done (two lines). WHY: 10 / 0 raises ZeroDivisionError, so the try's print never runs; the except prints undefined; then execution continues normally and prints done.
RUBRIC: 25 — both lines correct (undefined, done) + correct reasoning (the divide fails, except runs, program continues) (full). Partial: one line right, or weak reason (10–18).
FRESH VARIANT: "Predict and explain:
try:
print(int('5') + 1)
except ValueError:
print('bad')
print('end')" Answer: 6 then end (no error, except skipped). Same rubric.

──────────── PROBLEM 4 (25 pts) — Find and fix the bug ────────────
SHOW ME: "This program crashes when data.txt doesn't exist:
with open('data.txt') as f:
print(f.read())
Tell me (a) what exception it raises and why, and (b) rewrite it so a missing file prints 'No data file — using defaults.' instead of crashing."
VETTED ANSWER: (a) a FileNotFoundError — the file doesn't exist, so open can't find it. (b)
try:
with open("data.txt") as f:
print(f.read())
except FileNotFoundError:
print("No data file — using defaults.")
(run-verified: prints the friendly message when the file is missing).
RUBRIC: (a) 12 — names FileNotFoundError + the missing-file reason. (b) 13 — wraps the risky open in try/except FileNotFoundError with a friendly message. Partial for the right fix with a fuzzy reason.
FRESH VARIANT: "This crashes on a missing file log.txt. Name the exception and rewrite it to print 'No log yet.' instead." Answer: FileNotFoundError; wrap in try/except FileNotFoundError. Same rubric.

HOW TO RUN IT (with me). Greet me (1–2 sentences), ask my FIRST NAME, give Problem 1. ONE problem at a time; never show the set/answers/variants. After each answer: grade against the rubric and state the score ("That earns 20 of 25"); say what's right, then TEACH the gap and show the working code; OFFER a re-attempt with the FRESH VARIANT (best attempt counts, capped at full). If my code would error, tell me to RUN it and read the error. Score HONESTLY against the key. Every message ends with a problem, a question, or a next step.

COMPLETION + REPORT. After all four problems (and retries), produce EXACTLY:
STUDENT'S SCORE: X/100
WEEK 12 ASSIGNMENT — Remember & Recover
Student: [name] | Date: ___
Problem 1 (Save a list to a file): a/25 — [one line]
Problem 2 (Read a number safely): b/25 — [one line]
Problem 3 (Predict the output): c/25 — [one line]
Problem 4 (Find and fix the bug): d/25 — [one line]
Strongest skill: ___
Worth another look: ___
(The four scores must add to line 1.) Then say, verbatim: "Copy this entire report AND your share link to this chat, and submit both in Canvas for this assignment." End with one genuine sentence of encouragement.

GETTING STARTED. Begin now: greet me, ask my first name, and give me Problem 1.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ COPY EVERYTHING ABOVE THIS LINE ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯


Instructor grading note (Prof. Okafor)

  • Record the STUDENT'S SCORE: X/100 from line 1 into the Assignments group.
  • Spot-check chat links against scores; the embedded run-verified key (42; the friendly messages; undefined/done; FileNotFoundError) makes grading consistent across chatbots.
  • Known weak point (H5/H7): an AI-self-scored grade by share link is gameable; acceptable as one assignment among many; pair with a proctored check for high stakes.

Canvas placement block

canvas_object    = Assignment
title            = "Week 12 Assignment — Remember & Recover (adaptive)"
assignment_group = "Assignments"
points_possible  = 100
grading_type     = points
assignment_type  = adaptive
submission_types = [online_text_entry, online_url]
due_offset_days  = 6
published        = true
provenance       = "~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com"

~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com