@@ -57,24 +57,6 @@ unless @minimal
5757
5858 outputs = plan . research_outputs . any? ? plan . research_outputs : [ plan ]
5959
60- if @question_and_answer
61- json . questions_and_answers do
62- outputs . each do |output |
63- presenter = Api ::V2 ::ResearchOutputPresenter . new ( output : output )
64- q_and_a = presenter . send ( :fetch_all_q_and_a , plan : plan )
65- next if q_and_a . blank?
66-
67- json . set! output . id . to_s do
68- json . array! q_and_a do |item |
69- json . title item [ :title ]
70- json . question item [ :question ]
71- json . answer item [ :answer ]
72- end
73- end
74- end
75- end
76- end
77-
7860 json . dataset outputs do |output |
7961 json . partial! "api/v2/datasets/show" , output : output
8062 end
@@ -86,5 +68,22 @@ unless @minimal
8668 json . title template . title
8769 end
8870 end
71+
72+ if @question_and_answer
73+ json . questions_and_answers do
74+ outputs . each do |output |
75+ q_and_a = presenter . send ( :fetch_all_q_and_a , plan : plan )
76+ next if q_and_a . blank?
77+
78+ json . set! output . id . to_s do
79+ json . array! q_and_a do |item |
80+ json . title item [ :title ]
81+ json . question item [ :question ]
82+ json . answer item [ :answer ]
83+ end
84+ end
85+ end
86+ end
87+ end
8988 end
9089end
0 commit comments