canvas-lms/gems/canvas_quiz_statistics
Andrew Gardener 51a25db1b8 Add user_ids to quiz statistics endpoint
Fixes #1522
Closes #1534

Test plan:
- Create a quiz and have users take it.
- Generate quiz statistics.
- Fetch the statistics via the api:
  https://canvas.instructure.com/doc/api/quiz_statistics.html#
    method.quizzes/quiz_statistics.index
- They should include user_ids in addition to user_names

Change-Id: I9cec089790a2216d1b4ec3469c5557782f1cb74d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218189
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Bryan Petty <bpetty@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2019-12-04 19:24:27 +00:00
..
lib Add user_ids to quiz statistics endpoint 2019-12-04 19:24:27 +00:00
spec Add user_ids to quiz statistics endpoint 2019-12-04 19:24:27 +00:00
.rspec upgrade canvas_quiz_statistics to rspec 3 syntax 2016-12-27 18:44:20 +00:00
CHANGELOG.md Quiz Stats [Backend] - Gem & Essays 2014-05-12 15:02:45 +00:00
Gemfile bump simplecov, fixes SD-2056 2017-04-04 18:06:25 +00:00
Guardfile Quiz Stats [Backend] - Gem & Essays 2014-05-12 15:02:45 +00:00
LICENSE.txt da licença part 53 2017-05-01 21:06:11 +00:00
README.md Quiz Stats [Backend] - Gem & Essays 2014-05-12 15:02:45 +00:00
Rakefile Quiz Stats [Backend] - Gem & Essays 2014-05-12 15:02:45 +00:00
TODO.md Quiz Stats [Backend] - Gem & Essays 2014-05-12 15:02:45 +00:00
canvas_quiz_statistics.gemspec upgrade canvas_quiz_statistics to rspec 3 syntax 2016-12-27 18:44:20 +00:00
test.sh simplify gem test harnesses 2016-01-19 17:52:58 +00:00

README.md

CanvasQuizStatistics

A bunch of objects that can generate statistics from a set of responses to a quiz.

Work In Progress.

Extending

Adding support for a new question type

Implementing the analyzer

  • define an answer analyzer in answer_analyzers/question_type.rb
  • make sure your analyzer implements the common interface, which is defined by the AnswerAnalyzer::Base class
  • please document both output and input formats that you expect to generate the stats

Registering it

Edit lib/canvas_quiz_statistics/answer_analyzers.rb and:

  • require your analyzer
  • add it to the list of available analyzers in CanvasQuizStatistics::AnswerAnalyzers::AVAILABLE_ANALYZERS where the key should be the question type (with the _question suffix) and the value would be your analyzer

Covering it

You will probably need to simulate question data to cover your analyzer. Grab a JSON snapshot of the question_data construct for your question and save it in spec/support/fixtures/ and check out the fixture helpers in spec/support/question_helpers.rb for more information on how to use the fixture.