Class CATMEController
java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.CATMEController
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object> auditCatmeCSV(Long courseId, org.springframework.web.multipart.MultipartFile file) Audit the roster for a course against a CATME TeamMaker CSV export, producing a list of students whose name and/or section should be updated in CATME, and a list of students who should be dropped from CATME because they are no longer enrolled (MANUAL or ROSTER status) in Frontiers, and enrolled students who need to be added to CATME.org.springframework.http.ResponseEntity<Object> createTeamsFromCatmeCSV(Long courseId, org.springframework.web.multipart.MultipartFile file) Audit a course's roster against an uploaded CATME TeamMaker CSV file, exactly asauditCatmeCSV(Long, MultipartFile); if the audit finds any issue, report it and stop.getCourseEmailsFromCatme(Long courseId, String payload)
-
Field Details
-
CATME_AUDIT_HEADER_LINE_1
- See Also:
-
CATME_AUDIT_HEADER_LINE_4
- See Also:
-
CATME_TEAM_HEADER_LINE_4
- See Also:
-
CATME_AUDIT_SCORES_LINE_PREFIX
- See Also:
-
CATME_AUDIT_FORMAT_ERROR_MESSAGE
- See Also:
-
CATME_TEAM_FORMAT_ERROR_MESSAGE
- See Also:
-
-
Constructor Details
-
CATMEController
public CATMEController()
-
-
Method Details
-
auditCatmeCSV
@PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @PostMapping(value="/audit", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<Object> auditCatmeCSV(@RequestParam Long courseId, @RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws IOException Audit the roster for a course against a CATME TeamMaker CSV export, producing a list of students whose name and/or section should be updated in CATME, and a list of students who should be dropped from CATME because they are no longer enrolled (MANUAL or ROSTER status) in Frontiers, and enrolled students who need to be added to CATME.- Parameters:
courseId- the id of the coursefile- the uploaded CATME TeamMaker CSV file- Returns:
- a
CATMEAuditResult, or a 422 error if the file is not in the expected format - Throws:
IOException- if the file cannot be read
-
createTeamsFromCatmeCSV
@PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @PostMapping(value="/createteams", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<Object> createTeamsFromCatmeCSV(@RequestParam Long courseId, @RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws IOException Audit a course's roster against an uploaded CATME TeamMaker CSV file, exactly asauditCatmeCSV(Long, MultipartFile); if the audit finds any issue, report it and stop. If the audit is clean, launch a job that creates the teams named in the file (in Frontiers only; nothing is pushed to GitHub) and adds each student to their team.- Parameters:
courseId- the id of the coursefile- the uploaded CATME TeamMaker CSV file- Returns:
- if the audit found issues, the
CATMEAuditResult; otherwise a message "Job Launched: N" where N is the id of the job; or a 422 error if the file is not in the expected format - Throws:
IOException- if the file cannot be read
-
getCourseEmailsFromCatme
-