diff --git a/app/models/searchable/shixun.rb b/app/models/searchable/shixun.rb index c574ecb1d..359b8b4dc 100644 --- a/app/models/searchable/shixun.rb +++ b/app/models/searchable/shixun.rb @@ -52,7 +52,8 @@ module Searchable::Shixun challenges_count: challenges_count, study_count: myshixuns_count, star: averge_star, - level: shixun_level + level: shixun_level, + is_jupyter: is_jupyter } end diff --git a/app/views/challenges/index.json.jbuilder b/app/views/challenges/index.json.jbuilder index 37ce94305..0b935cead 100644 --- a/app/views/challenges/index.json.jbuilder +++ b/app/views/challenges/index.json.jbuilder @@ -4,6 +4,7 @@ json.description @shixun.description json.power @editable json.shixun_identifier @shixun.identifier json.shixun_status @shixun.status +json.is_jupyter @shixun.is_jupyter? json.allow_skip @shixun.task_pass # 列表 diff --git a/app/views/shixuns/_shixun.json.jbuilder b/app/views/shixuns/_shixun.json.jbuilder index e6dbd3115..89e8d3c62 100644 --- a/app/views/shixuns/_shixun.json.jbuilder +++ b/app/views/shixuns/_shixun.json.jbuilder @@ -13,6 +13,7 @@ json.array! shixuns do |shixun| json.identifier shixun.identifier json.name shixun.name json.status shixun.status + json.is_jupyter shixun.is_jupyter? json.power (current_user.shixun_permission(shixun)) # 现在首页只显示已发布的实训 # REDO: 局部缓存 json.tag_name @tag_name_map&.fetch(shixun.id, nil) || shixun.tag_repertoires.first.try(:name) diff --git a/app/views/users/shixuns/shared/_shixun.json.jbuilder b/app/views/users/shixuns/shared/_shixun.json.jbuilder index 8427ead58..663522e53 100644 --- a/app/views/users/shixuns/shared/_shixun.json.jbuilder +++ b/app/views/users/shixuns/shared/_shixun.json.jbuilder @@ -6,4 +6,5 @@ json.name shixun.name json.status shixun.status json.human_status shixun.human_status json.challenges_count shixun.challenges_count -json.finished_challenges_count @finished_challenges_count_map&.fetch(shixun.id, 0) || shixun.finished_challenges_count(user) \ No newline at end of file +json.finished_challenges_count @finished_challenges_count_map&.fetch(shixun.id, 0) || shixun.finished_challenges_count(user) +json.is_jupyter shixun.is_jupyter \ No newline at end of file