Add exercise description as txt file to downloaded zip

This commit is contained in:
Maximilian Grundke
2018-03-07 11:07:45 +01:00
parent 20c59e3775
commit 83eba22e7b

View File

@ -75,6 +75,11 @@ class SubmissionsController < ApplicationController
zio.write(file.content) zio.write(file.content)
end 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 # zip .co file
zio.put_next_entry(".co") zio.put_next_entry(".co")
zio.write(File.read id_file) zio.write(File.read id_file)