Managing Videos, Homework & Tests
Each episode can contain three types of content: a video stream, homework assignments, and tests with auto-graded questions. This page covers how to create and manage all three.
Content Creation Workflow
Figure 5: Content Creation Workflow -- Video to Publish
Setting Up Video Streams
Each episode can have one video asset. The video is set up on the Video tab of the episode detail page.
-
Navigate to the Episode Detail
Go to /episodes/{episode_id} and ensure the Video tab is selected.
-
Enter the Stream URL
Provide the HLS (.m3u8), MP4, or DASH manifest URL. This URL should point to your CDN-hosted video file.
-
Configure Format and Quality
- Stream Format: HLS, MP4, or DASH
- Resolution: 480p, 720p, 1080p, or 4K
- Duration: Total duration in seconds
- Content Rating: TV-G, TV-PG, TV-14, or TV-MA
-
Add Metadata
Set a short description (max 200 chars) and thumbnail URL. These appear in the Roku feed and student interface.
-
Save
Click Save Video. The video asset is created or updated (upsert behavior).
curl -X POST http://localhost:8065/api/episodes/{episode_id}/video \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"collection_item_id": "{episode_id}",
"stream_url": "https://cdn.bunny.net/library/12345/video.m3u8",
"stream_format": "HLS",
"duration_seconds": 1800,
"resolution": "1080p",
"content_rating": "TV-G",
"short_description": "Introduction to Physics",
"thumbnail_url": "https://cdn.bunny.net/library/12345/thumb.jpg"
}'
Creating Homework Assignments
Homework assignments are attached to episodes. Students must complete them after watching the associated video.
-
Open the Homework Tab
On the episode detail page, switch to the Homework tab.
-
Click "Add Homework"
The homework modal opens with the following fields:
- Title (required): Assignment name
- Description: Brief overview
- Instructions: Detailed instructions for students
- Max Score: Maximum points (default: 100)
- Due Days After Watch: Deadline in days after video completion (default: 7)
- Required: Whether this homework counts toward the grade
-
Save the Homework
Click Save. The assignment appears in the homework list.
Students submit homework through the student companion app. Submissions include text and optional attachment URLs. Admins then grade submissions manually.
# Create homework for an episode
curl -X POST http://localhost:8065/api/episodes/{episode_id}/homework \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Physics Lab Report",
"description": "Write a lab report on the demonstrated experiment",
"instructions": "1. Describe the hypothesis\n2. Document observations\n3. State conclusions",
"max_score": 100,
"due_days_after_watch": 7,
"is_required": true
}'
# Grade a submission
curl -X PUT http://localhost:8065/api/episodes/homework/submissions/{id}/grade \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"score": 85, "feedback": "Excellent work on the hypothesis section."}'
Building Tests
Tests assess student understanding with auto-graded questions. The test system supports three question types.
Creating a Test
-
Open the Test Tab
On the episode detail page, switch to the Test tab.
-
Click "Create Test"
Configure the test settings:
- Title (required): Test name
- Time Limit: Minutes allowed (0 = unlimited)
- Passing Score: Minimum percentage to pass (default: 70%)
- Max Attempts: Number of retakes allowed (default: 3, 0 = unlimited)
- Shuffle Questions: Randomize question order
- Show Correct Answers: Reveal answers after attempt
-
Save and Add Questions
After saving the test, click the Questions button to open the question builder.
Question Types
| Type | Auto-Graded | How to Set Up |
|---|---|---|
| Multiple Choice | Yes | Enter options one per line. Prefix the correct answer with * (e.g., *Correct Answer) |
| True / False | Yes | Options auto-fill as True/False. Mark the correct one with * |
| Short Answer | Partial | Enter the expected correct answer. Exact match comparison is case-insensitive |
Question Builder Walkthrough
-
Select Question Type
Choose from the dropdown: Multiple Choice, True/False, or Short Answer.
-
Enter Question Text
Type the question in the text area.
-
Set Answer Options
For MC/TF: enter options one per line. Prefix correct answers with *. For Short Answer: enter the expected answer in the dedicated field.
-
Configure Points and Explanation
Set the point value (default: 1) and an optional explanation that can be shown after the attempt.
-
Add the Question
Click Add Question. It appears in the questions list with type badge and point value. Repeat for all questions.
# Create a test
curl -X POST http://localhost:8065/api/episodes/{episode_id}/tests \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Physics Chapter 1 Quiz",
"time_limit_minutes": 30,
"passing_score": 70,
"max_attempts": 3,
"shuffle_questions": true
}'
# Add a multiple choice question
curl -X POST http://localhost:8065/api/episodes/tests/{test_id}/questions \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"question_text": "What is the SI unit of force?",
"question_type": "multiple_choice",
"options": [
{"text": "Newton", "is_correct": true},
{"text": "Joule", "is_correct": false},
{"text": "Watt", "is_correct": false},
{"text": "Pascal", "is_correct": false}
],
"points": 2,
"explanation": "Newton (N) is the SI unit of force."
}'