Skip to content

CP3108 Staff Dashboard - Backend Modifications for Assessment Uploader #586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
May 22, 2020

Conversation

Wong-ZZ
Copy link
Contributor

@Wong-ZZ Wong-ZZ commented Apr 20, 2020

Context

This PR is for modifying the backend API to support the Assessment Uploader component for the CP3018 Staff Dashboard project. The Assessment Uploader, also called the GroundControl, provides an interface for staff to manage assessments for the course. Staff can upload, delete, publish or update assessments through this interface.

Implementation

  • Added multiple routes to aid with the uploading, deleting, publishing and updating of assessments.
  • Modified and added various methods in xml_parserand in assessments to handle the additional routes. The 'parse_xml' method now returns the error message if there is any error in parsing.
  • Modified how the is_published field for assessments work. Unpublished assessments are now viewable by staff and admin.
  • Assessments have the 'is_published' field set to false by default when it is parsed.
  • Changed the all_published_assessments in cadet/assessments/assessments.ex to all_assessments. Returns all assessments/all published assessments depending on the role of the user.
  • Added a new field, isPublished, to the assessment overview.
  • XML files for assessments no longer require the 'startdate' and 'enddate' tags. The assessments will now have a default start and end date relative to the time it was uploaded at.
  • Existing tests have been modified to accommodate the modifications made.

Other Information

Corresponding PR to cadet-frontend: PR 1080
More info on the wiki: Assessment Uploader

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2904

  • 98 of 124 (79.03%) changed or added relevant lines in 5 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-1.6%) to 90.023%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/cadet_web/controllers/assessments_controller.ex 30 36 83.33%
lib/cadet/assessments/assessments.ex 45 65 69.23%
Files with Coverage Reduction New Missed Lines %
lib/cadet/jobs/xml_parser.ex 3 92.5%
Totals Coverage Status
Change from base Build 2901: -1.6%
Covered Lines: 1155
Relevant Lines: 1283

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants