cancel
Showing results for 
Search instead for 
Did you mean: 
Surveyor

Quiz Grading via API

Jump to solution

Hi:

I'm trying to develop my own quiz speed grader using the API.

I'd like to pull down all of the answers to a particular open response (essay) quiz question and then grade them all on one page using a custom UI and send the scores back in for each student.

I'm having trouble finding the part of the API that let's me pull down a student's answer to a particular quiz question and then update the score for that question.  I saw one thread that suggested I needed to use some kind of report (with a download URL) but I'm really hoping that's not the case.  That also wouldn't help me change the score for a particular question.  I saw a place to change the fudge score but that's for the overall quiz (I think).

This seems so fundamental I can't believe it's not possible but I just can't figure it out.

Thanks,

Sam

Tags (1)
1 Solution

Accepted Solutions

OK!  Hi Deactivated user, rcarney@instructure.com and james@richland.edu:

Big thanks to wfrakes​ from Instructure for sending me a correct JSON string that works.  Here is the deal for other users who run into trouble here:

Here is the CORRECT FORMAT (the documentation is WRONG and/or misleading)

{

  "quiz_submissions": [{

    "attempt": 3,

    "fudge_points": 1,

    "questions": {

      "10959": {

        "score": 2.5,

        "comment": "test."

      },

      "10960": {

        "score": 1,

        "comment": "test."

      }

    }

  }]

}

Note , the red value is the id number of the quiz question.  I got confused because the API documentation is problematic.  Here are the examples from the docs:

Main example from the docs

{

  "quiz_submissions": [{

  "attempt": 1,

  "fudge_points": -2.4,

  "questions": {

  "1": {      <=========  These look like an array index of the questions in the quiz, not a six+ digit ID number

  "score": 2.5,

  "comment": "This can't be right, but I'll let it pass this one time."

  },

  "2": {      <========= see?

  "score": 0,

  "comment": "Good thinking. Almost!"

  }

  }

  }]

}

Three examples from the manual scoring appendix

The following come from the Appendix on manual scoring...

FIRST

{

  "quiz_submissions": [{

    "fudge_points": null, // null for no change, or a signed decimal

    "questions": {

      "QUESTION_ID": {   <============  This HAS the question ID but it fails because.... can you see it?... no attempt number

        "score": null, // null for no change, or an unsigned decimal

        "comment": null // null for no change, '' for no comment, or a string

      }

    }

  }]

}

SECOND

{

  "quiz_submissions": [{

    "attempt": 1,    <=========================  This HAS the attempt number but fails because no questions (it works WITH questions)

    "fudge_points": -2.4

  }]

}

THIRD

{

  "quiz_submissions": [{

    "attempt": 1,

    "questions": {

      "1": {     <============= We're back to single digit ID numbers

        "comment": ""

      }

    }

  }]

}

I hope Instructure fixes up the docs AND please note that the Live!  API tool is still broken for this call.

Regards,

Sam Dickerman

Brookline High School

View solution in original post

19 Replies
Surveyor

I found this after digging around a while but I can't get it to work:

Manual Grading

It says you can add this:

{

  "quiz_submissions": [{

    "fudge_points": null, // null for no change, or a signed decimal

    "questions": {

      "QUESTION_ID": {

        "score": null, // null for no change, or an unsigned decimal

        "comment": null // null for no change, '' for no comment, or a string

      }

    }

  }]

}

But I keep getting an error when using the REST LIVE! API too:

{ "status": "bad_request", "message": "missing required key :quiz_submissions", "error_report_id": 151189100 }

I can't figure out what the missing key is! 

Thanks for any help!!

Here's the three examples from from this area of the API docs:

Aren't these different?  Why does the top one NOT have "Attempt" in it but the other two do?

Parameter synopsis

{

  "quiz_submissions": [{

    "fudge_points": null, // null for no change, or a signed decimal

    "questions": {

      "QUESTION_ID": {

        "score": null, // null for no change, or an unsigned decimal

        "comment": null // null for no change, '' for no comment, or a string

      }

    }

  }]

}

More example requests

Fudging the score by a negative amount

{

  "quiz_submissions": [{

    "attempt": 1,

    "fudge_points": -2.4

  }]

}

Removing an earlier comment on a question

{

  "quiz_submissions": [{

    "attempt": 1,

    "questions": {

      "1": {

        "comment": ""

      }

    }

  }]

}

BUT then the live API tool has this (see screenshot below)

Which has "attempt" and "fudge_points" as separate form fields from "questions"...

So confused!

Screen Shot 2015-09-23 at 10.01.54 PM.png

OK - I just found this thread and I'm worried...

rcarney@instructure.com Aug 13, 2015 10:49 AM

Steven Williams

The Product Manager for Quizzes has confirmed that this API will not be completed and was pulled out of BETA some time ago (before he came on board).  The documentation will be updated to remove the mention of the API resource.

Our apologies that this caused confusion and frustration for you.  We do appreciate you bringing this to our attention and giving us an opportunity to spare others confusion and frustration.

Does this mean the ENTIRE quiz API will not be completed?  I'd love some clarification...

Thanks

Thank you for the question sam_dickerman@brookline.k12.ma.us

The comment was strictly around the request for ​ - not about the quiz API as a whole.

Hello sam_dickerman@brookline.k12.ma.usand rcarney@instructure.com

This is a very innovative use of the API.  The current API remains in a beta stage as we are actively considering some new development on the quizzes front. For now there will not be any further development of the current API. We will share more in the near future as things progress.

Kind regards,

Jason

Hi Jason - thanks for the reply. 

Could you please clarify if updating the score of a given student's answer through the API is supported?  I can't quite reconcile the docs and the live API tool.

A working curl example would be so helpful!

Thanks,

Sam

***Bump***

While Deactivated user did state the current status of the API, he didn't actually answer the question...

Is it possible to update a user's score on a particular quiz question using the current API?

rcarney@instructure.com - thanks for your work moderating the community.  Can you see if an engineer can take a look at this?

Thanks!

Sam

Hello Sam,

My apologies. Please try this API:

https://canvas.instructure.com/doc/api/quiz_submissions.html#method.quizzes/quiz_submissions_api.upd...

Kind regards,

Jason

On Mon, Sep 28, 2015 at 11:08 AM, sam_dickerman@brookline.k12.ma.us <

Hi Deactivated user​ and rcarney@instructure.com​:

Actually I think I was the one who was unclear...

What I meant to ask was if it was possible to get the answers a student has given for a set of questions, decide how to score them, and then add the scores back to Canvas - all through the API.

It now appears that one cannot get the answers the student has made on a quiz because the API is not working.  This thread by james@richland.edu seems to explain all this quite well. 

Can someone from Instructure confirm that it is not possible to get a student's answers, look at them, score them, and then put the scores back into Canvas via the API (not including the csv report method which does not look too fun).

Thanks,

Sam