Skip to content
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

Add user interface to upload config files, revamp file input fields #1883

Merged
merged 13 commits into from
Apr 23, 2023

Conversation

damianhxy
Copy link
Member

@damianhxy damianhxy commented Apr 17, 2023

Description

New

  • Modify assessment#update to handle assessment config updates
  • Modify course#update to handle course config updates
  • Add upload button for assessment config
  • Add upload button for course config
  • Modify file_field method for FormBuilderWithDateTimeInput, update existing code that uses the FormBuilder's field

Deletions

  • Remove unnecessary margin at top of edit course page
  • Remove unused _upload_form.html.erb file
  • Remove link to non-existent bulkGrade.css
  • Remove commented out embedded form code on assessments/new.html.erb
  • Remove unused and hidden name field on edit course page (backend doesn't even permit modification)

Changes

  • Make assessment.rb#source_config_file_path public, since it's necessary for the controller
  • Make bulkGrade_initial use FormBuilder
  • Simplify embedded file upload
  • Update helptext for handin_filename
  • Update assessment reload page to be clearer and more helpful
  • Update assessment reload page to be clearer and more helpful
  • Update default course.rb file to reflect the ability to upload files now
  • Simplify attachment file upload
  • Simplify Autograder Tar and MakeFile upload
  • Touch-up styling of course edit page (add a title, reduce unnecessary padding)

Motivation and Context

Currently, instructors have to manually modify course and assessment config files locally before reloading the files via the web interface. This PR makes it possible to upload the files directly through a UI, which will be especially convenient when it comes to Autolab on AWS.

How Has This Been Tested?

Part 1: Assessment config upload functionality

Navigate to: Edit Assessment > Basic
Screenshot 2023-04-23 at 13 49 11

Upload a functional config file (i.e. the one that already exists in the Autolab directory)

  • Successfully save

Upload an incorrect config file (e.g. add a 1+1=2 inside assessmentInitialize)

  • Note the improved styling (headers)
  • Test the links under Options
    Screenshot 2023-04-19 at 23 55 28

Part 2: Course config upload functionality

Navigate to: Manage Course > Course settings
Screenshot 2023-04-23 at 17 31 52

Upload a functional config file (i.e. the one that already exists in the Autolab directory)

  • Successfully save

Upload an incorrect config file (e.g. add a 1+1=2 inside fooAverage)

  • Note the improved styling (headers)
  • Test the links under Options
    Screenshot 2023-04-19 at 23 57 34

Part 3: Improved file upload fields

Test functionality of all forms that used the FormBuilder AND file_field.

This is a list of occurrences of file_field, but note that not every form uses the FormBuilder.
Screenshot 2023-04-19 at 23 59 17

Embedded file upload
Before
Screenshot 2023-04-20 at 00 00 55
After
Screenshot 2023-04-23 at 13 49 49

Test that the upload still works

  • Upload embedded_form.txt
  • Enable embedded form
  • When you view the assessment, you should see the form

bulkgrade
Before
Screenshot 2023-04-20 at 00 03 12
After
Screenshot 2023-04-23 at 13 50 24

Test that the upload still works

  • For simplicity, upload a random file to trigger the error

Attachments
Before
Screenshot 2023-04-20 at 00 04 00
After
Screenshot 2023-04-23 at 13 50 45

Test that the upload still works

  • Create an attachment and download it

Autograder Tar and MakeFile
(Need to add an Autograder first, then go to its settings)
Before
Screenshot 2023-04-20 at 00 04 54
After
Screenshot 2023-04-23 at 13 51 16

Test that the upload still works

  • Upload random Autograder Tar / Makefile (e.g. from hello.tar), check that it appears in the Autolab directory

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run rubocop for style check. If you haven't, run overcommit --install && overcommit --sign to use pre-commit hook for linting
  • My change requires a change to the documentation, which is located at Autolab Docs
  • I have updated the documentation accordingly, included in this PR

@damianhxy damianhxy marked this pull request as ready for review April 20, 2023 04:05
@gitstream-cm gitstream-cm bot requested a review from 20wildmanj April 20, 2023 04:07
@damianhxy damianhxy changed the title Add UI to upload course and assessment rb files Add user interface to upload config files, revamp file input fields Apr 20, 2023
Copy link
Contributor

@20wildmanj 20wildmanj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Ran through testing strategy, checked that rb updating for course and assessments work
  • Checked that forms still work
  • Checked that deletions don't break anything

Overall, looks good, and lots of nice fixes. Just would like adding support for a label to the file_field before getting this merged.

app/views/autograders/_form.html.erb Outdated Show resolved Hide resolved
@damianhxy damianhxy requested a review from 20wildmanj April 23, 2023 17:53
Copy link
Contributor

@20wildmanj 20wildmanj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@damianhxy damianhxy added this pull request to the merge queue Apr 23, 2023
Merged via the queue into master with commit 18576de Apr 23, 2023
@damianhxy damianhxy deleted the update-config branch April 23, 2023 21:40
@damianhxy damianhxy mentioned this pull request May 17, 2023
6 tasks
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.

2 participants