add more CO specific data to metadata
This commit is contained in:
@ -23,7 +23,6 @@ module ProformaService
|
|||||||
title: @exercise.title,
|
title: @exercise.title,
|
||||||
description: @exercise.description,
|
description: @exercise.description,
|
||||||
internal_description: nil,
|
internal_description: nil,
|
||||||
# ?: @exercise.instructions, store in meta-data
|
|
||||||
# proglang: proglang, where can we get this information?
|
# proglang: proglang, where can we get this information?
|
||||||
files: task_files,
|
files: task_files,
|
||||||
tests: tests,
|
tests: tests,
|
||||||
@ -32,7 +31,12 @@ module ProformaService
|
|||||||
model_solutions: model_solutions,
|
model_solutions: model_solutions,
|
||||||
meta_data: {
|
meta_data: {
|
||||||
CodeOcean: {
|
CodeOcean: {
|
||||||
instructions: @exercise.instructions,
|
public: @exercise.public,
|
||||||
|
hide_file_tree: @exercise.hide_file_tree,
|
||||||
|
allow_file_creation: @exercise.allow_file_creation,
|
||||||
|
allow_auto_completion: @exercise.allow_auto_completion,
|
||||||
|
expected_difficulty: @exercise.expected_difficulty,
|
||||||
|
execution_environment_id: @exercise.execution_environment_id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}.compact
|
}.compact
|
||||||
@ -78,8 +82,8 @@ module ProformaService
|
|||||||
def test_meta_data(file)
|
def test_meta_data(file)
|
||||||
{
|
{
|
||||||
CodeOcean: {
|
CodeOcean: {
|
||||||
'entry-point': file.filepath,
|
|
||||||
'feedback-message': file.feedback_message,
|
'feedback-message': file.feedback_message,
|
||||||
|
weight: file.weight,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -21,7 +21,13 @@ module ProformaService
|
|||||||
user: @user,
|
user: @user,
|
||||||
title: @task.title,
|
title: @task.title,
|
||||||
description: @task.description,
|
description: @task.description,
|
||||||
instructions: @task.meta_data&.dig(:CodeOcean)&.dig(:instructions),
|
public: @task.meta_data[:CodeOcean]&.dig(:public) == 'true',
|
||||||
|
hide_file_tree: @task.meta_data[:CodeOcean]&.dig(:hide_file_tree) == 'true',
|
||||||
|
allow_file_creation: @task.meta_data[:CodeOcean]&.dig(:allow_file_creation) == 'true',
|
||||||
|
allow_auto_completion: @task.meta_data[:CodeOcean]&.dig(:allow_auto_completion) == 'true',
|
||||||
|
expected_difficulty: @task.meta_data[:CodeOcean]&.dig(:expected_difficulty),
|
||||||
|
execution_environment_id: @task.meta_data[:CodeOcean]&.dig(:execution_environment_id),
|
||||||
|
|
||||||
files: files
|
files: files
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@ -33,7 +39,7 @@ module ProformaService
|
|||||||
def test_files
|
def test_files
|
||||||
@task.tests.map do |test_object|
|
@task.tests.map do |test_object|
|
||||||
task_files.delete(test_object.files.first.id).tap do |file|
|
task_files.delete(test_object.files.first.id).tap do |file|
|
||||||
file.weight = 1.0
|
file.weight = test_object.meta_data[:CodeOcean]&.dig(:weight) || 1.0
|
||||||
file.feedback_message = test_object.meta_data[:CodeOcean]&.dig(:'feedback-message').presence || 'Feedback'
|
file.feedback_message = test_object.meta_data[:CodeOcean]&.dig(:'feedback-message').presence || 'Feedback'
|
||||||
file.role = 'teacher_defined_test'
|
file.role = 'teacher_defined_test'
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user