Skip to content

Commit

Permalink
Merge branch 'master' into sibinh/maintenance_mailer
Browse files Browse the repository at this point in the history
  • Loading branch information
huyuxin0429 authored Jan 13, 2024
2 parents 20f9fd1 + 0fb4da9 commit 3ff5fdf
Show file tree
Hide file tree
Showing 26 changed files with 543 additions and 452 deletions.
Binary file added app/assets/images/add-course-info.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/add-users.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/confirm-plagiarism-prompt.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/create-assignment.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/create-groupings.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/mark-as-suspicious-prompt.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/print-report-page.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/print-report-prompt.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/remove-plagiarism.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/remove-user.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/student-history-page.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/update-course-user.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/user-removal-confirmation.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/view-course-users.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/view-submissions-prompt.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/view-visuals.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/assets/stylesheets/site.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ h2, h3, h4, h5, h6 {
}
.accordion-button {
font: 600 18px/20px Inter, sans-serif;
min-width: unquote("min(600px, 80vw)");
min-width: 80vw;
background: white !important;
color: black !important;
}
Expand All @@ -173,7 +173,7 @@ h2, h3, h4, h5, h6 {

.accordion-body {
font: 400 16px/18px Inter, sans-serif;
width: unquote("min(600px, 80vw)");
width: 80vw;
line-height: 150%;
}

Expand Down
12 changes: 6 additions & 6 deletions app/controllers/api/v1/assignments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class AssignmentsController < ApplicationController
OCTET_STREAM_MIME_TYPE = 'application/octet-stream'
REQUIRED_PARAMS = %w[title language studentSubmissions].freeze
ALLOWED_PARAMS = %w[title language useFingerprints minimumMatchLength sizeOfNGram studentSubmissions
mappingFile].freeze
mappingFile references].freeze
ALLOWED_LANGUAGES = %w[java python3 c cpp javascript r ocaml matlab scala].freeze

def init_api_key_handler
Expand Down Expand Up @@ -113,15 +113,15 @@ def create
return render action: 'new' unless @assignment.save

is_map_enabled = !params['mappingFile'].nil?
used_fingerprints = params['useFingerprints'] == 'Yes'
used_fingerprints = (params['useFingerprints'] == 'Yes') && (!params['references']) # if references supplied, defaults to false

# No student submission file was uploaded
# Student submission file is a valid zip
if valid_zip?(params['studentSubmissions'].content_type, params['studentSubmissions'].path)
# Don't process the file and show error if the mapping was enabled but no mapping file was uploaded
if valid_map_or_no_map?(is_map_enabled, params['mappingFile'])
start_upload(@assignment, params['studentSubmissions'], is_map_enabled, params['mappingFile'],
used_fingerprints)
start_upload(@assignment, params['studentSubmissions'], params['references'], is_map_enabled, params['mappingFile'],
used_fingerprints)
# Don't process the file and show error if the mapping was enabled but no mapping file was uploaded
else
@assignment.errors.add :mapfile, 'containing mapped student names must be a valid csv file'
Expand All @@ -141,11 +141,11 @@ def create
end
end

def start_upload(assignment, submission_file, is_map_enabled, map_file, used_fingerprints)
def start_upload(assignment, submission_file, references, is_map_enabled, map_file, used_fingerprints)
require 'submissions_handler'

# Process upload file
submissions_path = SubmissionsHandler.process_upload(submission_file, is_map_enabled, map_file, assignment)
submissions_path = SubmissionsHandler.process_upload(submission_file, references, is_map_enabled, map_file, assignment)
if submissions_path
# Launch java program to process submissions
SubmissionsHandler.process_submissions(submissions_path, assignment, is_map_enabled, used_fingerprints)
Expand Down
Loading

0 comments on commit 3ff5fdf

Please sign in to comment.