canvas-lms/gems/canvas_quiz_statistics
Cody Cutrer eacec0a606 bundle update factory_bot
Change-Id: I3ab74c597004c220cc2d0515546f0f584579d433
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/337908
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2024-01-24 16:18:47 +00:00
..
lib bundle update rubocop 2023-12-06 14:25:02 +00:00
spec bundle update rubocop 2024-01-24 16:17:43 +00:00
.rspec raise bundler minimum requirement 2021-02-19 22:49:02 +00:00
CHANGELOG.md Quiz Stats [Backend] - Gem & Essays 2014-05-12 15:02:45 +00:00
Gemfile fix lockfile syncing from canvas lockfile to sub-gems 2023-05-09 22:57:42 +00:00
Gemfile.lock bundle update factory_bot 2024-01-24 16:18:47 +00:00
Guardfile RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +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 add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
TODO.md Quiz Stats [Backend] - Gem & Essays 2014-05-12 15:02:45 +00:00
canvas_quiz_statistics.gemspec switch from byebug to debug 2023-09-20 23:48:39 +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.