eacec0a606
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> |
||
---|---|---|
.. | ||
lib | ||
spec | ||
.rspec | ||
CHANGELOG.md | ||
Gemfile | ||
Gemfile.lock | ||
Guardfile | ||
LICENSE.txt | ||
README.md | ||
Rakefile | ||
TODO.md | ||
canvas_quiz_statistics.gemspec | ||
test.sh |
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.