The user wants a "reproducible assignment template" that includes sections for code/data, grading, and feedback.
The goal is to create a structured document or set of files that an instructor or manager can use to create an assignment where the entire process (task, data, grading, feedback) is transparent and reproducible.
I should structure this as a comprehensive guide or a set of templates.
I'll likely use a Markdown format because it's clean and widely used for documentation.
Key Components needed:
Assignment Brief (The "What"): Context, learning objectives.
Data & Environment (The "Input"): Where to get data, software requirements (renv/requirements.txt).
Submission Instructions (The "Process"): Naming conventions, file structure.
Grading Rubric (The "Evaluation"): Clear criteria, points distribution.
Feedback Loop (The "Output"): How feedback is delivered.
Specific tools for "Reproducibility":
R: RMarkdown/Quarto, renv.
Python: Jupyter Notebooks, requirements.txt or environment.yml (conda).
General: Docker (maybe too advanced for a general template, but worth mentioning), Git.
Drafting the Template Structure:
Part 1: The Student/Instruction File (The Assignment) -> I should provide a template for a Quarto/RMarkdown or Jupyter Notebook file that includes the instructions within the code file. This ensures the code and the instructions never get separated.
Part 2: The Grading Specification -> A CSV or Markdown table.
Part 3: The Feedback Form -> A structured way to return results.
Let's refine the approach to be a "Starter Pack" containing:
README.md (Overview).
assignment_template.qmd or .ipynb (The actual assignment file).
rubric.csv (The grading key).
feedback_template.md (The return format).
Detailed Content for the Code/Data Template:
Header: Title, Due Date.
Setup: Libraries, Seed setting (crucial for reproducibility).
Data Loading: Relative paths only (no absolute paths like C:/Users/...).
Refining the Output:
I will create a complete, copy-pasteable "Project Structure" followed by the specific file contents. I'll provide an example using R (Quarto) and Python (Jupyter) because those are the most common data science teaching tools.
Step 1: The Directory Structure
Show the user what the folder should look like.
Step 2: The Assignment File (Quarto/RMarkdown example)
This is the most critical part for "reproducible code/data." It needs code chunks for setup and instructions for the student.
Step 3: The Grading Rubric (CSV/Table)
A tabular format that could theoretically be automated.
Step 4: The Feedback Template
A text file for the grader to fill out.
Self-Correction during drafting: I initially thought about just one generic text file, but "reproducible" implies code. I must include code-specific formatting (Markdown/Code chunks).
I will provide two versions:
The Framework (The conceptual template).
The Practical Example (The actual files).
Actually, let's stick to one cohesive "Template" that works for both R and Python logic, but I will write the specific code examples in one (likely Quarto as it handles R/Python/Julia) to keep it concise, or provide tabs/options. I'll stick to a Markdown/Quarto focus as it's the gold standard for reproducible research.
The Template Layout:
File 1: assignment_starter.qmd (Combines instructions, code setup, and data loading).
I will add a section on "Best Practices for Reproducibility" to ensure the user knows why the template is designed this way (e.g., relative paths, setting seeds).
Let's generate the response based on this plan.
Here is a comprehensive, reproducible assignment template designed for data science, programming, or technical courses.
This template follows the "Assign-Run-Grade" workflow, ensuring that the instructions, the code environment, and the grading criteria are standardized.
1. The Directory Structure
To ensure reproducibility, enforce a specific file structure. This allows you to use relative paths (e.g., data/raw_data.csv) instead of absolute paths, which ensures the code runs on any machine.
Instead of a PDF describing the code, provide a Runnable Script (Jupyter Notebook, R Markdown, or Quarto). This sets up the environment and defines the skeleton.
---
title: "Assignment 3: Data Cleaning & Visualization"
author: "[Student Name Here]"
date: "[Date]"
output: html_document
---
## Setup
**Instructions:** Do not modify this section. It loads the necessary libraries and sets the random seed for reproducibility.
```{r setup, include=FALSE}
# Python equivalent: import pandas as pd; import numpy as np; np.random.seed(123)
library(tidyverse)
set.seed(123)
Section 1: Data Import (10 Points)
Task: Load the dataset located at data/raw/dirty_sales.csv.
Hint: Watch out for missing values encoded as "NULL".
{r
# TODO: Write your code here
df <- NULL
# YOUR CODE HERE
Section 2: Analysis (20 Points)
Task: Calculate the mean sales grouped by region.
{r
# TODO: Write your code here
# YOUR CODE HERE
Section 3: Critical Thinking (Text Answer)
Question: Why did you choose specific handling methods for the missing values?
Write your answer here...
code
---
### 3. The Grading Rubric (The `rubric.csv`)
Store your rubric as a data file. This allows you to automate grading scripts later or easily import it into an LMS (Learning Management System).
**File:** `rubric.csv`
| Criteria_ID | Description | Points | Feedback_Template |
| :--- | :--- | :--- | :--- |
| `load_correct` | Data loads without error and handles NAs correctly. | 10 | "Data loaded, but NA handling missed." |
| `logic_group` | Grouping logic is statistically sound. | 20 | "Check your group_by syntax." |
| `plot_aesthetic` | Plot includes title, labels, and legible text. | 10 | "Missing axis labels." |
| `reproducibility` | Code runs top-to-bottom without intervention. | 10 | "Error: File not found (check paths)." |
| **Total** | | **50** | |
---
### 4. The Feedback Template (The "Return Slip")
When returning grades, provide a standardized markdown file. This separates the subjective feedback from the objective code execution results.
**File:** `feedback/feedback_student_001.md`
```markdown
# Grading Report: Assignment 3
**Student:** [Student Name]
**Grader:** [TA Name]
**Date:** 2023-10-27
---
### 🎯 Final Score: 42 / 50
### 📝 Detailed Breakdown
| Section | Score | Comments |
| :--- | :--- | :--- |
| **1. Data Import** | 8/10 | Code worked, but you hardcoded the full path (`C:/Users/...`). Use relative paths for reproducibility. |
| **2. Analysis** | 20/20 | Perfect use of `dplyr` chains. |
| **3. Visualization** | 10/10 | Great color palette choice. |
| **4. Reproducibility**| 4/10 | Script failed when run on a fresh machine due to missing library installation. |
### 💡 General Feedback
You demonstrated a strong understanding of the logic. However, remember the rule of **"Happy Paths"**: assume the next person running your code has none of your files installed. Add comments explaining *why* you chose specific parameters.
---
*If you believe there was an error in grading, please submit a regrade request via the Google Form.*
5. Workflow for the Instructor
To make this truly "reproducible" for you as the instructor, follow this checklist when creating a new assignment:
Create the Environment:
Python: Run pip freeze > requirements.txt
R: Run renv::snapshot() to create renv.lock.
Test the "Gold Master":
Create a separate folder.
Copy your starter code and solution.
Run it. If it breaks, your assignment is flawed.
Distribute:
Provide students with a Zip file of the folder structure (Section 1) or a GitHub Classroom invitation link (automates the folder creation for them).