Skip to content

Commit

Permalink
create tags and add overall comment from autotester result
Browse files Browse the repository at this point in the history
  • Loading branch information
rickychen174 committed Jan 17, 2025
1 parent 1d5811f commit 2d7c4ec
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/models/test_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def update_results!(results)
)
marks_earned += test['marks_earned']
marks_total += test['marks_total']
create_tags(test['tags'])
add_overall_comment(test['overall_comment'])
rescue StandardError => e
extra_info = test_group_result.extra_info
test_name = test['name'].nil? ? '' : "#{test['name']} - "
Expand Down Expand Up @@ -141,6 +143,21 @@ def create_annotations(annotation_data)
end
end

def create_tags(tag_data)
tag_data.each do |data|
self.grouping.tags.create(
name: data['name'],
description: data['description'],
assessment_id: self.grouping.assessment_id,
role_id: self.role_id
)
end
end

def add_overall_comment(overall_comment_data)
self.submission.current_result.update(overall_comment: overall_comment_data)
end

def unzip_file_data(file_data)
file_data['content'] = Zlib.gunzip(file_data['content']) if file_data['compression'] == 'gzip'
if file_data['content'].size > self.course.max_file_size
Expand Down

0 comments on commit 2d7c4ec

Please sign in to comment.