-
Notifications
You must be signed in to change notification settings - Fork 118
[DRAFT] Add question and answer flag to V2 API #3590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
b3d9c2d
62c4498
8f3beaf
ccc7699
865d5de
1de5bfd
12e0a03
473a68e
547692d
0cee1ec
a248eb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,24 @@ unless @minimal | |
|
|
||
| outputs = plan.research_outputs.any? ? plan.research_outputs : [plan] | ||
|
|
||
| if @question_and_answer | ||
| json.questions_and_answers do | ||
| outputs.each do |output| | ||
| presenter = Api::V2::ResearchOutputPresenter.new(output: output) | ||
| q_and_a = presenter.send(:fetch_all_q_and_a, plan: plan) | ||
| next if q_and_a.blank? | ||
|
|
||
| json.set! output.id.to_s do | ||
| json.array! q_and_a do |item| | ||
| json.title item[:title] | ||
| json.question item[:question] | ||
| json.answer item[:answer] | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm looking at the comment at the top of this file: With the exception of
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll probably have to get Marcus to sign off on what the schema should look like in the end, but I agree additional data like this should be inside the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Marcus signed off on putting it into I added those changes to this PR. |
||
|
|
||
| json.dataset outputs do |output| | ||
| json.partial! "api/v2/datasets/show", output: output | ||
| end | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.