ubc / canvas-rubric

Gets canvas rubric with grades using the CLI.
GNU General Public License v3.0
6 stars 0 forks source link

Program exits with exception error, no rubric data returned #5

Open paulrichards321 opened 4 years ago

paulrichards321 commented 4 years ago

Greetings, I'm trying to read peer review rubrics that students have answered - I think this project can do that???

I tried first with my own PHP code but did not get any rubric submitted selections/answers. I was able to get peer review related comments just not any selected rubric answers so the underlying reason I cannot get any data back might be because of the way the module is setup or the way the admins setup canvas at our school. I have also started a thread on community canvas forum with my own project. https://community.canvaslms.com/message/196673

So I tried your project!

I'm on ubuntu 18.04 LTS and using the node.js (version 8.10) supplied with the OS but getting an exception 'UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'rubricData' of undefined. Attached are two screenshots. I did input the course id and assignment id and then first tried the rubric id and then I used the associated rubric id. Both gave me unhandled exceptions.

canvasRubricErrorMsg canvasRubricErrorMsg2

justin0022 commented 4 years ago

So your course id is 137827 and your rubric id is 24977 or 38434.

Could you as a first step try navigating to this URL in your browser? {your_institution_url}/courses/137827/rubrics/24977? {your_institution_url}/courses/137827/rubrics/38434?

You should see a rubric displayed - if not, it likely means you're supplying the wrong rubric/course id.

paulrichards321 commented 4 years ago

Thanks for the response Justin!

I tried that and the correct rubric does show for 24977, however, 38434 gives me a canvas page not found error.

justin0022 commented 4 years ago

Okay interesting, I'm just thinking through why for 24977 rubricData is coming back as undefined...

justin0022 commented 4 years ago

My only other thought is that the assignment id and rubric id are not the correct "match". It can be tricky to figure out which rubric id is associated with which assignment id.

Are you confident that the associated IDs are correct? There's a way to double check that I can share with you, it requires a bit of digging around in Chrome Devtools - let me know if you want to check using devtools

paulrichards321 commented 4 years ago

Those are the correct association ids. I think I figured it out by PHP but would like to help you out as well. When I used php and via curl I was able to pull the following:

`` [rubric_association] => Array ( [id] => 38434 [rubric_id] => 24977 [association_id] => 919330 [association_type] => Assignment [use_for_grading] => [created_at] => Removed by Me [updated_at] => Removed by Me [title] => Title Removed By Me [summary_data] => [purpose] => Removed by Me [url] => [context_id] => 137827 [context_type] => Course [hide_score_total] => [bookmarked] => 1 [context_code] => course_137827 [hide_points] => 1 [hide_outcome_results] => [root_account_id] => )

justin0022 commented 4 years ago

Hmm okay. I'll keep thinking about this, will try to get back to you tomorrow.

justin0022 commented 4 years ago

I did just rerun this code with a previous set of course id, assignment id, and rubric id, as a sanity check, and it still does function for me. Just trying to think of a good way for us to debug.