Week 14 — Assignment (Adaptive Learning) · "Call Yourself"
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective assessed: Objective 8 (recursion, the call stack) · 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, helps you fix it, 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 code and run it.
Part 1 — Student Instructions (read this first)
An AI coach gives you four problems one at a time. It 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, Dec 6.
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 14 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) — Write a recursive factorial ────────────
SHOW ME: "Write a recursive function factorial(n) that returns n! (n factorial). Include a base case. Test it on factorial(5) and factorial(0)."
VETTED ANSWER: def factorial(n): if n == 0: return 1; return n * factorial(n - 1) — factorial(5) → 120, factorial(0) → 1 (both run-verified). Must have a base case (n==0 → 1) and a recursive case that shrinks n.
RUBRIC: 25 — correct base case + recursive case, both tests right (full). Partial: missing/wrong base case, or doesn't shrink, otherwise sound (10–18).
FRESH VARIANT: "Write a recursive power(base, exp) that returns base**exp using recursion (base case exp==0 returns 1). Test power(2, 4)." Answer: 16. Same rubric.
──────────── PROBLEM 2 (25 pts) — Write a countdown ────────────
SHOW ME: "Write a recursive function countdown(n) that prints n, n-1, ..., down to 1, then prints 'Go!'. Test it with countdown(3)."
VETTED ANSWER: def countdown(n): if n == 0: print('Go!'); return; print(n); countdown(n - 1) — countdown(3) prints 3, 2, 1, Go! on four lines (run-verified). Base case n==0 prints Go! and returns.
RUBRIC: 25 — prints n then recurses, base case prints 'Go!' last, correct order for countdown(3) (full). Partial: prints in wrong order or 'Go!' first, or off-by-one (10–18).
FRESH VARIANT: "Write countdown that prints from 5 down to 1 then 'Liftoff!'. Test countdown(5)." Same rubric.
──────────── PROBLEM 3 (25 pts) — Predict the output ────────────
SHOW ME: "Without running it first, predict what this prints, then run it:
def sum_to(n):
if n == 0:
return 0
return n + sum_to(n - 1)
print(sum_to(4))"
VETTED ANSWER: it prints 10 (4 + 3 + 2 + 1 + 0). WHY: each call adds n to the sum of everything below it; the base case sum_to(0) returns 0, then the values add up as the stack unwinds (run-verified: 10).
RUBRIC: 25 — correct output 10 + correct reasoning about the values adding as the stack unwinds (full). Partial: right number, weak reason (10–18).
FRESH VARIANT: "Predict sum_to(3)." Answer: 6 (3+2+1). Same rubric.
──────────── PROBLEM 4 (25 pts) — Find and fix the bug ────────────
SHOW ME: "This recursive function never stops and raises a RecursionError. (a) Explain why, and (b) fix it so it counts down from n to 1 and stops.
def count_down(n):
print(n)
count_down(n - 1)"
VETTED ANSWER: (a) there's no base case, so it calls itself forever (n keeps decreasing past 0 into negatives) until Python raises RecursionError: maximum recursion depth exceeded (run-verified). (b) add a base case before the recursive call, e.g. if n == 0: return (or if n < 1: return) — then print(n) and count_down(n - 1). Now it stops at 0.
RUBRIC: (a) 13 — identifies the missing base case as the cause. (b) 12 — adds a base case that returns without recursing. Partial for the right fix with a fuzzy reason.
FRESH VARIANT: "This factorial recurses forever: def fact(n): return n * fact(n - 1). Why, and what's the fix?" Answer: no base case; add if n == 0: return 1. 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 14 ASSIGNMENT — Call Yourself
Student: [name] | Date: ___
Problem 1 (Write factorial): a/25 — [one line]
Problem 2 (Trace the countdown): 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/100from line 1 into the Assignments group. - Spot-check chat links against scores; the embedded run-verified key 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 14 Assignment — Call Yourself (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"
Traditional variant — for comparison. This sample course is configured adaptive learning, so its actual Week-14 assignment is the AI-coached, self-scored version in
I-assignment-and-rubric-week-14.md. This file shows the same skills built the traditional way — the student writes the programs and submits them, and the instructor grades against the rubric. (Choosingassignment_type = traditionalat setup generates this style.)
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective assessed: Objective 8 (recursion, the call stack) · SLO A + SLO B
Worth 100 points · Assignments group = 15% of the grade
The Assignment
This week a function learns to call itself. In four parts you'll write a recursive factorial, write a countdown, predict a recursive sum, and fix a recursion that never stops. Write and run your code in a free online Python editor, then submit your code and its output (screenshot or pasted text) as a document upload or text entry in Canvas. Read the rubric first.
Part 1 — Write a recursive factorial (25 pts). Write factorial(n) that returns n! using recursion, with a base case. Test it on factorial(5) and factorial(0).
Part 2 — Write a countdown (25 pts). Write a recursive countdown(n) that prints n, n-1, ..., 1, then prints Go!. Test it with countdown(3).
Part 3 — Predict the output (25 pts). For the program below, (a) predict sum_to(4) before running, and (b) explain why:
def sum_to(n):
if n == 0:
return 0
return n + sum_to(n - 1)
Part 4 — Find and fix the bug (25 pts). This never stops and raises a RecursionError. (a) Explain why, and (b) fix it so it counts down from n to 1 and stops:
def count_down(n):
print(n)
count_down(n - 1)
Integrity & AI note. Your own work, submitted for grading. You may use an approved chatbot to help you think, but submitting AI-generated answers as your own isn't allowed; if AI helped, add a one-line note. Run your code before submitting. (Traditional format; the adaptive version has you work the problems with the chatbot — see I-assignment-and-rubric-week-14.md.)
Rubric — 100 points
| Criterion (part) | Full credit | Partial | Little/none |
|---|---|---|---|
| Part 1 — Recursive factorial (25) | Correct base + recursive case; 120 and 1 (25) | Missing/wrong base case (10–18) | Non-working (0–8) |
| Part 2 — Countdown (25) | Prints 3, 2, 1, Go! in order; base case last (25) | Wrong order or 'Go!' first (10–18) | Non-working (0–8) |
| Part 3 — Predict (25) | Output 10 + correct unwinding reasoning (25) | Right number, weak reason (10–18) | Wrong (0–8) |
| Part 4 — Find & fix (25) | Names missing base case + adds a base case (25) | Right fix, fuzzy reason (10–18) | Neither (0–8) |
(This same rubric is what the adaptive variant embeds for the AI to grade against.)
Instructor answer key — REMOVE BEFORE PUBLISHING TO STUDENTS
Execution gate: PASS — every program and output below was produced by running the code.
- Part 1:
def factorial(n): if n == 0: return 1; return n * factorial(n - 1)→ factorial(5)=120, factorial(0)=1 (run-verified). - Part 2:
def countdown(n): if n == 0: print('Go!'); return; print(n); countdown(n - 1)→ countdown(3) prints 3, 2, 1, Go! (run-verified). - Part 3: prints 10 (4+3+2+1+0). The base case returns 0; values add up as the stack unwinds (run-verified).
- Part 4: (a) no base case → recurses forever →
RecursionError(run-verified). (b) addif n == 0: returnbefore the recursive call so it stops at 0.
Canvas placement block
canvas_object = Assignment
title = "Week 14 Assignment — Call Yourself (traditional)"
assignment_group = "Assignments"
points_possible = 100
grading_type = points
assignment_type = traditional
submission_types = [online_upload, online_text_entry]
due_offset_days = 6
published = true
rubric_ref = "week-14-assignment-rubric"
provenance = "~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com"
~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com