Merge pull request #157 from openHPI/add-exercise-description-to-download

Add exercise description as txt file to downloaded zip
This commit is contained in:
rteusner
2018-03-07 16:52:10 +01:00
committed by GitHub

View File

@ -75,6 +75,11 @@ class SubmissionsController < ApplicationController
zio.write(file.content)
end
# zip exercise description
zio.put_next_entry(t('activerecord.models.exercise.one') + '.txt')
zio.write(@submission.exercise.title + "\r\n======================\r\n")
zio.write(@submission.exercise.description)
# zip .co file
zio.put_next_entry(".co")
zio.write(File.read id_file)