Skip to content

Commit

Permalink
Merge pull request #5530 from dodona-edu/fix/export-name
Browse files Browse the repository at this point in the history
Use exercise name for dolos report
  • Loading branch information
jorg-vr authored May 16, 2024
2 parents 297f6c8 + 6c64aa3 commit 0889c45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/dolos_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create
body: {
dataset: {
zipfile: file,
name: export.archive.filename
name: export.archive.filename.base
}
}
)
Expand Down
4 changes: 3 additions & 1 deletion app/helpers/export_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def all?
end

def zip_filename
@item.is_a?(User) ? "#{@item.full_name.parameterize}.zip" : "#{@item.name.parameterize}.zip"
name_source = @list.present? && @list.one? ? @list.first : @item
base_name = name_source.is_a?(User) ? name_source.full_name : name_source.name
"#{base_name.parameterize}.zip"
end

def ex_fn(ex)
Expand Down
2 changes: 1 addition & 1 deletion config/locales/js/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,5 +333,5 @@ nl:
draft: Concept
popularity: Populariteit
dolos:
view_report: Plagiaat bekijken
view_report: Rapport bekijken

0 comments on commit 0889c45

Please sign in to comment.