You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/challenges/edit.json.jbuilder

26 lines
919 B

6 years ago
json.partial! "challenges/top_common_data", shixun_identifier: @shixun.identifier
json.chooses do
json.array! @chooses do |choose|
json.choose_id choose.id
json.type choose.category
end
end
5 years ago
json.st @challenge.st
6 years ago
if @tab == 0
# 本关任务tab的编辑模式
5 years ago
json.(@challenge, :id, :subject, :task_pass, :difficulty, :score, :exec_time, :st)
6 years ago
json.tags @challenge.challenge_tags.map(&:name)
elsif @tab == 1
# 评测设置的编辑模式
json.(@challenge, :id, :path, :exec_path, :show_type, :original_picture_path, :expect_picture_path, :picture_path,
5 years ago
:web_route, :test_set_score, :test_set_average, :exec_time)
json.has_web_route @shixun.has_web_route?
6 years ago
json.test_sets @challenge.test_sets do |set|
json.hidden (set.is_public ? 0 : 1)
5 years ago
json.(set, :input, :output, :score, :match_rule)
6 years ago
end
elsif @tab == 2
# 参考答案
json.(@challenge, :answer)
end