I have created a set of outcomes using the API (thus saving a lot of copy an paste into the user interface). Now I just want to have a rubric for an assignment use a specific outcome.
If I look at an assignment that has a rubric that is based on an outcome I see:
'rubric': [{'id': '_2958',<BR /> 'points': 5.0,<BR /> 'description': 'Pres1',<BR /> 'long_description': '<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>p</SPAN><SPAN class="punctuation token">></SPAN></SPAN><SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>strong</SPAN><SPAN class="punctuation token">></SPAN></SPAN><SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>em</SPAN><SPAN class="punctuation token">></SPAN></SPAN>Demonstrate the ability to, in English, clearly present and discuss his or her conclusions and the knowledge and arguments on which they are based in speech and writing to different audiences.<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>em</SPAN><SPAN class="punctuation token">></SPAN></SPAN><SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>strong</SPAN><SPAN class="punctuation token">></SPAN></SPAN><SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>p</SPAN><SPAN class="punctuation token">></SPAN></SPAN>',<BR /> 'ignore_for_scoring': False,<BR /> 'criterion_use_range': False,<BR /> 'ratings': [{'id': 'blank', 'points': 5.0,<BR /> 'description': 'Exceeds Expectations', 'long_description': ''},<BR /> {'id': '_3187', 'points': 3.0,<BR /> 'description': 'Meets Expectations', 'long_description': ''},<BR /> {'id': 'blank_2', 'points': 0.0,<BR /> 'description': 'Does Not Meet Expectations',<BR /> 'long_description': ''}<BR /> ],<BR /> 'outcome_id': 1081,<BR /> 'vendor_guid': None}],<BR />'rubric_settings': {'id': 932,<BR /> 'title': 'Presentation rubric',<BR /> 'points_possible': 5.0,<BR /> 'free_form_criterion_comments': False},<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
However, I do not understand how to pass the outcome_id into the rubric. For example, the following payload is used
payload<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="string token">'rubric'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="string token">'title'</SPAN><SPAN class="punctuation token">:</SPAN> name<SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">'description'</SPAN><SPAN class="punctuation token">:</SPAN> description<SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">'free_form_criterion_comments'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'false'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">'rubric_association_id'</SPAN><SPAN class="punctuation token">:</SPAN> outcome_id<SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">'rubric_association'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN><BR /> <SPAN class="string token">'association_type'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Assignment'</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">'association_id'</SPAN><SPAN class="punctuation token">:</SPAN> assignment_id<SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">'purpose'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'grading'</SPAN><SPAN class="punctuation token">}</SPAN><BR /> <SPAN class="punctuation token">}</SPAN><BR /><BR /> r <SPAN class="operator token">=</SPAN> requests<SPAN class="punctuation token">.</SPAN>post<SPAN class="punctuation token">(</SPAN>url<SPAN class="punctuation token">,</SPAN> headers <SPAN class="operator token">=</SPAN> header<SPAN class="punctuation token">,</SPAN> json<SPAN class="operator token">=</SPAN>payload<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>The result of creating the rubric is:
{"rubric":{"id":935,"user_id":29,"rubric_id":null,"context_id":12682,"context_type":"Course","data":[],"points_possible":null,"title":"Presentation outcome","description":null,"created_at":"2019-02-10T18:37:11Z","updated_at":"2019-02-10T18:37:11Z","reusable":false,"public":false,"read_only":false,"association_count":1,"free_form_criterion_comments":false,"context_code":"course_12682","migration_id":null,"hide_score_total":null,"workflow_state":"active","criteria":[],"permissions":{"read":true,"create":true,"delete_associations":true,"update":true,"delete":true}},"rubric_association":{"id":1618,"rubric_id":935,"association_id":85644,"association_type":"Assignment","use_for_grading":false,"created_at":"2019-02-10T18:37:11Z","updated_at":"2019-02-10T18:37:11Z","title":"Presentationsseminarium/Presentation seminar","summary_data":null,"purpose":"grading","url":null,"context_id":12682,"context_type":"Course","hide_score_total":null,"bookmarked":true,"context_code":"course_12682","hide_points":false,"hide_outcome_results":false,"assessment_requests":[],"permissions":{"update":true,"delete":true,"manage":true,"submit":false,"view_rubric_assessments":true},"skip_updating_points_possible":false}}
It makes an outcome, but there is no outcome_id. Thus it appears that my attempt to pass the outcome_id in via the rubric_association_id is not correct. The documentation is rather incomplete for this API, as it says "The id of the object with which this rubric is associated" for both the rubric_association_id and rubric_association[association_id].
So how does one pass in the outcome_id via an API?
I note that @James when he imports rubrics from a spreadsheet (Importing Rubrics from a Spreadsheet ) use TamperMokey to pass in the outcome_id via "learning_outcome_id" in the form and a similar approach is used spec/controllers/rubrics_controller_spec.rb.