Package edu.ucsb.cs.scaffold.jobs
Class CopyConceptGraphJob
java.lang.Object
edu.ucsb.cs.scaffold.jobs.CopyConceptGraphJob
- All Implemented Interfaces:
edu.ucsb.cs156.jobs.services.JobContextConsumer
public class CopyConceptGraphJob
extends Object
implements edu.ucsb.cs156.jobs.services.JobContextConsumer
Copies one course's entire concept-graph content (concepts, subconcepts, prerequisite edges, and
practice problems) into another course, replacing ALL of the destination course's content and
clearing every user's saved per-course scaffold state for that course.
Implemented as an in-memory YAML export of the "from" course immediately followed by a YAML
import into the "to" course (see docs/yaml-format.md), so this job cannot drift from the behavior
of the download/upload endpoints in ConceptsYamlController: the same code performs both, and any
future bug fix in ConceptYamlService applies to this job automatically.
Before copying anything, the job verifies that both courses exist and that the launching user has admin or instructor/staff level access to both; otherwise it logs an error and terminates without touching either course.
-
Constructor Details
-
CopyConceptGraphJob
public CopyConceptGraphJob()
-
-
Method Details
-
getScopeType
- Specified by:
getScopeTypein interfaceedu.ucsb.cs156.jobs.services.JobContextConsumer
-
getScopeId
- Specified by:
getScopeIdin interfaceedu.ucsb.cs156.jobs.services.JobContextConsumer
-
accept
- Specified by:
acceptin interfaceedu.ucsb.cs156.jobs.services.JobContextConsumer- Throws:
Exception
-