# Accelerated-course management

This document describes the administrator workflow for creating accelerated courses.

## Course duplication

An administrator can start duplication from the accelerated-course list or from
the course details page. The dedicated duplication action accepts only a
CSRF-protected `POST` request with the source course ID. After validation it
stores a one-time server-side source reference and uses a `303` redirect to open
the regular new-course form. That form copies only the source course name and
description. Refreshing it therefore does not repeat the duplication request.

The new course keeps the standard defaults for a newly created record. The
administrator must select the location and instructor and provide the dates,
start time, and price. Its duration defaults to 90 minutes. The source course
location, instructor, capacity, schedule, duration, price, active state,
participants, payments, attendance, messages, and generated course days are
not copied.

The duplication endpoint is separate from the edit endpoint. The edit route has
only its optional course ID and does not interpret positional URL segments as a
duplication mode. No new database record is created when the duplication form
is opened. The copied content is prepared from a one-time server-side session
reference to the source course, so long descriptions are
copied without truncation and the source ID is not encoded as a positional edit
URL parameter. The reference expires after ten minutes and is consumed by the
first new-course form request. A new course and its course days are created only
after a second, valid, CSRF-protected form submission.

## Verification

1. Open an existing accelerated course and choose `Duplikuj kurs`.
2. Confirm that the name and description match the source course.
3. Confirm that location, instructor, dates, start time, and price are empty and
   that capacity retains the normal new-course default and duration is 90 minutes.
4. Change the copied name or description, complete all required fields, and save.
5. Confirm that a separate course is created and that no participants, payments,
   attendance, messages, or existing course days from the source were copied.
