Rename files to include assignment name on download. Fixes
MODIFY
app/controllers/submissions_controller.rb
app/controllers/submissions_controller.rb
@@ -240,6 +240,7 @@ class SubmissionsController < ApplicationController
else
mime = params[:forceMime] || @submission.detected_mime_type
+
send_file @filename,
filename: @basename,
disposition: "inline"
@@ -383,6 +384,11 @@ private
@filename = @submission.handin_file_path
@basename = File.basename @filename
+ basename_parts = @basename.split("_")
+ basename_parts.insert(-3, @assessment.name)
+
+ @basename = basename_parts.join("_")
+
unless File.exist? @filename
flash[:error] = "Could not find submission file."
redirect_to [@course, @assessment] and return false

MODIFY
app/views/submissions/view.html.erb
app/views/submissions/view.html.erb
</div>
</div>
</div>
-
-

Rename files to include assignment name on download. Fixes #693. (#772)