File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/services/course/assessment/question/programming_codaveri/java Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -106,9 +106,15 @@ def extract_supporting_tests_files
106
106
def extract_supporting_file ( filename , content )
107
107
supporting_solution_object = default_codaveri_data_file_template
108
108
109
- supporting_solution_object [ :type ] = 'internal'
109
+ supporting_solution_object [ :type ] = 'internal' # 'external' s3 upload not yet implemented by codaveri
110
110
supporting_solution_object [ :path ] = filename . to_s
111
- supporting_solution_object [ :content ] = content
111
+ if content . force_encoding ( 'UTF-8' ) . valid_encoding?
112
+ supporting_file_object [ :content ] = content
113
+ supporting_file_object [ :encoding ] = 'utf8'
114
+ else
115
+ supporting_file_object [ :content ] = Base64 . strict_encode64 ( content )
116
+ supporting_file_object [ :encoding ] = 'base64'
117
+ end
112
118
113
119
@data_files . append ( supporting_solution_object )
114
120
end
You can’t perform that action at this time.
0 commit comments