Commit Graph

111 Commits

Author SHA1 Message Date
Jeremy Stanley 9f5997a77c don't break unicode sequenecs when truncating filenames
also, don't round-trip the display_name through the truncated
CGI-escaped filename, since UTF-8 chars become nine-character
sequences, limiting entirely non-Latin filenames to 28 chars
(255 / 9).

fixes CNVS-13426

test plan:
 - all files attached to the ticket should
   (1) upload to the files page without error
   (2) with the filename preserved and untruncated

Change-Id: I41322595e858892313276544607fd3ff2a0310ec
Reviewed-on: https://gerrit.instructure.com/36046
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-06-09 14:57:51 +00:00
Derek DeVries 0f341059f5 add page to preview submission results after previewing a quiz in ember
fixes CNVS-13439

test plan:
  - enable draft state and quiz stats
  - as a teacher
    - create a quiz
    - 'preview' the quiz
    - after you submit the preview of the quiz, it should redirect you to
      the results page.
    - this page should show a notice that this is a preview of the draft
      version of the quiz
    - this page should show the preview results in the submission results
      below.

Change-Id: Ia5e54873af49a943a3e00a99e7b326ec682614cc
Reviewed-on: https://gerrit.instructure.com/36018
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-06-06 21:26:18 +00:00
Ahmad Amireh cc1f4688fc Quiz Stats - Multiple Answers
Ports the generation of stats for that question type to the CQS gem.

Changes:

  - no longer exposing "user_ids"
  - can now identify students who skipped the question

Closes CNVS-13089

TEST PLAN
---- ----

  - create a quiz with multiple-answer question(s)
  - take it by a number of students and cover the following cases:
    - answer correctly by picking only the right choices
    - answer almost correctly by:
      1. picking only 1 right choice
      2. picking 1 right and 1 wrong choices
      3. picking everything
    - answer incorrectly by picking only the incorrect choice(s)
    - don't answer at all
  - get the stats from the API:
    - for "responses", "correct", and "partially_correct", verify they
      meet the specification in the docs
      - also for the "responses" field in each document in "answers"
    - verify that there is an answer document with "none" for an id with
      "responses" that reflect the number of students that skipped the
      question
  - visit ember quiz stats:
    - verify the "Attempts: X out of Y" should read the "responses"
      field out of the total quiz participant count
    - verify the donut chart reads the correct "correct" response ratio
    - verify there is a "No-Answer" bar
    - expand the question details:
      - verify that all the choices are displayed, and the correct
        choices are highlighted in GREEEN

Change-Id: Ibc08b6f521f9cae35dd16950c68c164d7e27d95d
Reviewed-on: https://gerrit.instructure.com/35736
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-06-05 09:12:19 +00:00
Ahmad Amireh 625f60ce97 Quiz Stats - Short Answer
Closes CNVS-13386

TEST PLAN
---- ----

  - similar to multiple-choice in https://gerrit.instructure.com/35734
    but with this question type with a few minor differences:
    - "correct" metric, see docs
    - "other"/"unknown" answer should be generated only if any student
      writes an answer that is not correct

Change-Id: I2d56afc0d9c1a3620d4de96059ebdadc56baecf9
Reviewed-on: https://gerrit.instructure.com/35735
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-06-05 09:12:07 +00:00
Ahmad Amireh 4503abaabf Quiz Stats - Multiple Choice & True/False
Changes:

  - no longer exposing user_ids
  - no longer exposing response_values
  - new metric: "responses" at the root-level

Closes CNVS-13385

TEST PLAN
---- ----

  - create a quiz with those question types
  - take the quiz by a number of students, choose different answers
  - get the stats from the API:
    [GET] /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
    - verify you get the documented metrics and they have the proper
      values
  - verify the relevant sections in ember quiz stats is still functional

Change-Id: I470912060042405629812585ef6667693b1302a1
Reviewed-on: https://gerrit.instructure.com/35734
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-06-05 00:10:40 +00:00
Derek DeVries a8ad819043 fix the quiz submission preview inception issue in ember quizzes
fixes CNVS-13390

- test plan
  - enable draft state and quiz stats features
  - as a teacher
    - create a quiz with multiple attempts

  - as a student
    - take the quiz

  - as a teacher
    - go to speedgrader for this student's submission and add a note in the
      sidebar

  - as a student
    - go to your dashboard, the teacher's note should be in the sidebar
      under "Recent Feedback"
    - click on the note
    - it should bring you to the submission details page.
    - the ember version of the page should display in the frame
    - clicking on 'take the quiz again' should not cause inception

Change-Id: I1eb7d467ec08f8d3a1510602b4720483c1b1167c
Reviewed-on: https://gerrit.instructure.com/35871
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-06-04 17:56:00 +00:00
Cody Cutrer 92ea7c5be5 bundle check before bundle install for gem tests
they're likely already installed, and it will save a ton of trips
to rubygems.org

Change-Id: I9ccf2194619a6e8f97d7f21b4e232dac7ff20d3c
Reviewed-on: https://gerrit.instructure.com/35694
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 20:09:10 +00:00
Cody Cutrer 8a59a4289a fix duplicate dependency in event_stream spec
to avoid bundler warnings

Change-Id: Ie997a7bb06c6d3334ea8973a80902a5239f67eb5
Reviewed-on: https://gerrit.instructure.com/35516
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-03 18:06:49 +00:00
Shawn Meredith e6de56a029 spec: vendored_gems pin rspec versions
Change-Id: Ibad1c172e58a69eb3a5a9ff2c874e861086ae227
Reviewed-on: https://gerrit.instructure.com/35756
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 14:54:02 +00:00
Ahmad Amireh 741a6e0036 Ember Quiz Stats [+Backend] - Numerical
Adds numerical question support to CanvasQuizStatistics and the renderer
in the Ember quiz statistics (subclass of ShortAnswer question).

Closes CNVS-13087, CNVS-13086

TEST PLAN
---- ----

  - create a quiz with a numerical question:
    - mix and match between the answer types: exact, exact with margin,
      and range answers
  - take the quiz by a number of students, we need to score like this to
    cover the possible cases:
    - a correct answer
    - a missing answer
    - an incorrect/out-of-range answer
  - hitting the stats api should return the documented metrics in the
    output of "question_statistics":
    /api/v1/courses/:course_id/quizzes/:quiz_id/statistics [GET]
  - visiting ember quizzes should now render the numerical stats which
    is similar to short answer (fill in the blank) and multiple answers:
    - make sure the "Other" and "No Answer" answers and bars show up
  - verify the API docs are updated

Change-Id: I0c9ec0dbc7c729410241177b6ed43b0cd4dad143
Reviewed-on: https://gerrit.instructure.com/35431
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-27 22:16:58 +00:00
Ahmad Amireh 33e6711c9a Quiz Stats - Matching
Adds support for Matching question statistics. Similar to FIMB and
Mulitple Dropdowns in the output.

Closes CNVS-13088

TEST PLAN
---- ----

Similar to https://gerrit.instructure.com/#/c/35101/ but with Matching
questions instead of FIMB.

Change-Id: Iaa5da1631503a8750b9673d7cb6064a296a8aa55
Reviewed-on: https://gerrit.instructure.com/35331
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-27 16:39:05 +00:00
Brian Palmer 6f7e610124 support cassandra 1.2+ consistency level usage
This changed from a part of the query string in cassandra 1.1 to a
separate parameter passed to execute in cassandra 1.2 and above.
Unfortunately we need to jump through some hoops to support both, until
we've fully upgraded to 1.2.

This commit adds a placeholder to the query string %CONSISTENCY% that
will be replaced with the chosen level in 1.1, and replaced with the
empty string in 1.2. Once we've upgraded to 1.2, we can remove all this
as it'll just be another option to the method.

closes CNVS-9273

test plan:

Using each of cassandra 1.1, 1.2, and 2.0:

* Clear out the consistency level Settings
  * Setting.connection.delete("DELETE FROM settings WHERE name LIKE 'event_stream.%_consistency%'")
  * Verify that page views and audit logs can be fetched, verify in the
    rails logs that no consistency level is given in the CQL query
    lines
* Set the consistency level
  * Setting.set('event_stream.read_consistency', 'ONE')
  * Verify that page views and audit logs can be fetched, verify in the
    rails logs that consistency level "ONE" is given in the CQL query
    lines. In 1.1, this will be in the query string, in 1.2 and 2.0 it
    will follow the query in an options hash

Change-Id: I3d007376d096e6ed31a40e699e77dca4cdd065a2
Reviewed-on: https://gerrit.instructure.com/35171
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-05-23 18:53:25 +00:00
Ahmad Amireh 076e541cdb Ember Quiz Stats - File Upload & Formula
Render question statistics for those question types similar to Essay.
File Upload should include a link to download all submissions too.

QuizSerializer was updated to include the submission ZIP download URL.

Closes CNVS-12988

TEST PLAN
---- ----

  - using your data set from https://gerrit.instructure.com/#/c/35112/
    - verify that the score chart renders with the student scores
    - verify that you get a link to Download All Files for FUpload
      questions
    - verify that the "Attempts: x out of Y" reads correctly based on
      the "responses" field and the total participant count,
      respectively
    - tooltips and chart interactivity like that for Essay

Change-Id: I4a77631491b169106e2eb677b21c1f30f3ca9440
Reviewed-on: https://gerrit.instructure.com/35113
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-22 15:56:45 +00:00
Ahmad Amireh ddcffe00ef Quiz Stats - File Upload & Formula
Add support for generating stats for File Upload and Formula questions.
Similar to Essay metrics but adjusted to calculate properly.

Closes CNVS-13169

TEST PLAN
---- ----

  - create a quiz with those question types
  - take the quiz:
    - answer both question types by at least one student, but leave it
      unanswered by another so we can test the "responses" metric
  - test the stats:
    GET /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
    - the "responses" metric should count the number of students who
      provided an answer
    - the "graded" metric should read the number of students whose
      answers you've graded so far
    - the "full_credit" one should read 0 until you grade it and give
      them a score higher than, or equal to, the maximum points possible
    - "point_distribution" is similar to that of Essays; it is an array
      of objects that track every score you gave the students and the
      number of students who received those scores
  - grade the scores and re-test to verify the metrics update correctly
  - verify that the API documentation is updated to include those
    question types

PS: the "responses" field will read "the number of students who uploaded
a file" for File Upload, and "the number of students who wrote any
answer" for Formula.

Change-Id: I890eafe018e000eef88de782bd7e86b5259df5d5
Reviewed-on: https://gerrit.instructure.com/35112
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-22 15:56:29 +00:00
Cody Cutrer 8178266194 split yaml file loading out of Setting
refs CNVS-13024

Setting wasn't properly being initialized as unsharded because
it was loading before Switchman. The reason we need Setting before
switchman is just for yaml loading, so split that into its own
class.

Change-Id: I5456e103cb216dba2d5af4e9c20a697b468c923b
Reviewed-on: https://gerrit.instructure.com/35043
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-05-21 18:27:06 +00:00
Ahmad Amireh 32801bd45d Quiz Stats - Multiple Dropdowns
Closes CNVS-13161

TEST PLAN
---- ----
  - create a quiz with multiple-dropdown questions
  - take the quiz by a number of students and type in different answers
  - make an API request to stats:
    GET /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
    - verify you get the documented metrics and they have the proper
      values
  - visit the ember quizzes page and verify that:
    - the charts are still working

Change-Id: I37ef48f22c3c16170034b6dd887b40ff20da4af5
Reviewed-on: https://gerrit.instructure.com/35104
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-21 16:37:11 +00:00
Ahmad Amireh 2e00d94732 Quiz Stats - FIMB
Support for FIMB question statistics in the CanvasQuizStatistics gem.

Closes CNVS-13160

TEST PLAN
---- ----

  - create a quiz with FIMB questions
  - take the quiz by a number of students and type in different answers
  - make an API request to stats:
    GET /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
    - verify you get the documented metrics and they have the proper
      values
  - visit the ember quizzes page and verify that:
    - the charts are still working

Change-Id: I2d82c708614c41e222aa24d65de64555d8056a9a
Reviewed-on: https://gerrit.instructure.com/35101
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-21 16:36:58 +00:00
Ahmad Amireh 4b552c0022 Quiz Stats - Convert Essay to new DSL
Closes CNVS-13159

TEST PLAN
---- ----

Only code changes. Test plan would be the same as
https://gerrit.instructure.com/#/c/35096/

Change-Id: I0f26a3df1278d555237c803cebbe80cde1559065
Reviewed-on: https://gerrit.instructure.com/35097
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-21 16:36:45 +00:00
Nathan Mills 5010cdef69 refactor variable substitution out of the models
also adds some new substitutions

fixes PLAT-497 PLAT-496

test-plan:
all current variable substitutions should work
new substitition: '$Canvas.account.name'  should work as well

Change-Id: I9b4e71f816d777e17d3369bb907c7b72209da770
Reviewed-on: https://gerrit.instructure.com/34546
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2014-05-21 14:58:01 +00:00
Ahmad Amireh d7a23ea23d Quiz Stats - Normalize input
Ensure all input hashes are using symbol keys.

Closes CNVS-13158

TEST PLAN
---- ----

Code changes. Test plan is similar to
https://gerrit.instructure.com/#/c/35096/

Change-Id: Ie1db45e2a5875e410a758c0b2f14594345212b5d
Reviewed-on: https://gerrit.instructure.com/35098
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-21 13:03:55 +00:00
Ahmad Amireh 457e55d6a2 Quiz Stats - Refactor/get rid of QuestionAnalyzer
- removed the question analyzer
  - each answer analyzer is now expected to calculate its own
    "responses" field as opposed to doing it in a generic manner
  - made the Essay analyzer generate its "responses" field
  - a self-documenting DSL for defining analyzer output metrics

Closes CNVS-13157

TEST PLAN
---- ----

It's all code movement/refactor so nothing new to test. The plan is to
verify the Essay question stats are unaffected (which is basically all
the gem supports at this point:)

  - create a quiz with an essay question
  - take the quiz by a few students
  - grade a submission
  - retrieve the stats via the API:
    GET /api/v1/courses/:course_id/quizzes/:quiz_id/statistics
    - verify the essay stats in the API are still functional, the
      "responses" field in particular

Change-Id: I42b9552c60ccb56f7c6912fed7cc1173da71852d
Reviewed-on: https://gerrit.instructure.com/35096
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-21 13:03:40 +00:00
Anthus Williams 62ec134c92 active_polymorph
fixes CNVS-12143

allow polymorphic names in ActiveRecord has_many
associations; when retrieving association, use these
names to retrieve records with different (but synonymous)
foreign_types

currently this gem only addresses has_many relationships
to achieve feature-parity with the existing Quizzes
monkeypatching. A future commit will address adding
similar functionality to other types of associations

test plan:
1) Create a quiz with id Q
2) Attempt the quiz twice, so you can see
both attempts on submission_history/ gradebook
3) In the rails console, get the set of attempts:

versions = Quizzes::QuizSubmission.where(quiz_id: Q).first.versions

4) Change the versionable_type of one of the attempts, but not the other:  

versions.where(id: versions.first.id).update_all(versionable_type: 
"Quiz")

5) Check the submission_history/gradebook to verify
that you still see both attempts

Change-Id: Ia9611a35705ba2929a92757f586a916dce90a4ee
Reviewed-on: https://gerrit.instructure.com/33505
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
2014-05-19 22:05:09 +00:00
Cody Cutrer 5d4d842ef2 send delayed jobs stats to statsd
closes CNVS-12739

log timing for pops, time spent in queue, time to perform job,
sliced by tag (where applicable), shard, and job shard.

test plan:
 * configure statsd.yml to go to 127.0.0.1 port 7856
 * nc -lu 127.0.0.1 7856
 * run jobs
 * you should see lots of job timings sent to netcat

Change-Id: I60a4b6b10d30edd96011e8e8bc8aa6104dfc6daa
Reviewed-on: https://gerrit.instructure.com/34724
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-05-15 21:16:14 +00:00
Ahmad Amireh 58eb918f97 Ember Quiz Stats - Essay Questions
Essay stats include a donut chart of the ratio of students who received
full-credit, as well as an area graph showing the score distribution.

Also, the serializer now prepares the data in a way for ED to properly
populate the questionStatistics association with quizStatistics, so we
got rid of the hack in the route's #afterModel hook, and exterminated
the bug that caused the question stats not to be updated when the quiz
changes (e.g, via the URL).

Closes CNVS-12466, CNVS-13009, CNVS-13021

TEST PLAN
---- ----

  - create a quiz with essay questions
  - take the quiz by a number of students
  - before grading, take a look at the stats page, make sure nothing
    funny happens
  - grade the responses with different scores
  - revisit the page, make sure the graphs are rendered appropriately
  - clicking the View in SpeedGrader link should open a new tab with the
    SpeedGrader for the quiz
  - hover over the circles and verify that you get tooltips similar to
    those for MChoice and T/F questions
  - verify that sorting by DI/Position is again functioning correctly

Change-Id: I3ab6818d86632720c6da2c37b2126b4abe63cefa
Reviewed-on: https://gerrit.instructure.com/33991
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-15 18:58:19 +00:00
Nick Cloward 96d14b8717 event stream is requiring a cassandra database to be configured.
fixes: CNVS-13056

Test Case:

  Make sure cassandra is not configured in cassandra.yml.
  Event stream should not complain about it not being configured.

Change-Id: If6a6583be355672f9a24769caf5e2da663a336a8
Reviewed-on: https://gerrit.instructure.com/34926
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-05-15 15:04:44 +00:00
Nick Cloward 19ea2789dd canvas event stream
fixes: CNVS-10477

Test Plan:

Make sure auditing still works.

Change-Id: I021c0772ad0cf337d452b55bf690d15ce1a61a09
Reviewed-on: https://gerrit.instructure.com/31494
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-05-14 19:09:24 +00:00
Ahmad Amireh 555e7b0e18 Quiz Stats [Backend] - Gem & Essays
Refactoring the generation of quiz question statistics into its own gem.
This patch adds support for Essay question statistics.

Closes CNVS-12725

TEST PLAN
---- ----

  - create a quiz with an essay question
  - perform an API request to retrieve the quiz statistics
  - ensure that the following metrics are generated and correct:
    - "graded": number of students whose answers have been graded by the
      teacher
    - "full_credit": number of students who received a full score
    - "point_distribution": a list of scores and the number of students
      who received them (so if 2 students got graded for 3 points, it
      should have a key of 2 and a value of 3), un-graded submissions
      should be keyed under null
    - "responses": number of students who answered the question
      (wrote anything)
    - "user_ids": IDs of those students
  - documentation for QuizStatistics -> Essay should be updated with the
    new stats

> Other things to test

  - verify that the old statistics page still renders:
    /courses/:course_id/quizzes/:quiz_id/statistics
  - verify that you can still generate both student and item analysis
    CSV reports

API endpoint for quiz stats:

  /api/v1/courses/:courseid/quizzes/:quiz_id/statistics [GET]

Change-Id: Ib15434ff4cef89ac211c1f4602d1ee609ef48ec4
Reviewed-on: https://gerrit.instructure.com/33990
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-05-12 15:02:45 +00:00
Braden Anderson b735558ff8 discussion topics: fix sorting nil positions
fixes CNVS-12774

test plan:
  * if you don't have legacy discussions with nil positions, run this:

Course.find(1).discussion_topics.where(pinned: true).update_all(position: nil)

  * open the discussions index page
  * move a discussion using the "Move To" gear menu option
  * verify that the discussion is moved
  * reload the page
  * verify that the change persists

Change-Id: Ibb3afc6a876f359cecba360792009b3db1793785
Reviewed-on: https://gerrit.instructure.com/34230
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-05-08 21:17:21 +00:00
Joseph Rodriguez 7722732692 fix indentation and remove commented out code
fixes: CNVS-12670, CNVS-12677

test plan:
- formatting only, no qa needed

Change-Id: I2fa467873daf62182587f00f71a47b19dc073232
Reviewed-on: https://gerrit.instructure.com/33867
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-05-07 18:33:06 +00:00
Brian Palmer d9535621b2 don't require execjs until needed inside the task
test plan: rake canvas:compile_assets should still succeed

Change-Id: Id90e7cdc9e9989bc975a09fb34c944a611074aa0
Reviewed-on: https://gerrit.instructure.com/34309
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-05-06 15:41:43 +00:00
Joseph Rodriguez 860f39d7b8 fixed indentation
fixes: CNVS-12681

test plan:
- code formatting only, no qa needed

Change-Id: Ia209fb7d8012aa56f0904a1c9c30b129c8643a74
Reviewed-on: https://gerrit.instructure.com/33868
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-05-05 22:32:26 +00:00
Joseph Rodriguez 2d9cfc5ac4 moved Facebook code into gem
fixes: CNVS-12120

test plan:
- regression test facebook functionality

Change-Id: I041e726ee12f9eca8fc27ccdd049422073d1af15
Reviewed-on: https://gerrit.instructure.com/33595
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 22:32:15 +00:00
Joseph Rodriguez 302f2bd6b4 fixed code indentation
fixes: CNVS-12683

test plan:
- code formatting only, no qa needed

Change-Id: I9e52687c886c6ca3ff2e1f92ae3c9f0733375dd1
Reviewed-on: https://gerrit.instructure.com/33869
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:42 +00:00
Raphael Weiner a13f85e0ed move twitter to gem
fixes: CNVS-12492

test-plan:
* Test that all things Twitter related still work

Change-Id: Ib656c5bfcb2dc8490a6fa6f214b0f6dce25ad181
Reviewed-on: https://gerrit.instructure.com/33193
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:27 +00:00
James Williams 90afba09ae download formatted files from google doc when available
google docs allows you to specify the format in additional
parameters in the download url, so we can download .doc or
and .xlsx files instead of always plain 'text/html' content

test plan:
* enable the google docs and crocodoc plugins
* create a course with a file upload assignment
* as a student in the course, enable google docs
 integration in user settings
* submit a file to the assignment through the google
 docs tab
* the submitted file should open up in crocodoc

fixes #CNVS-1503

Change-Id: I00ad9ac25a0dd6c46e5b56d2e566ab88b6550054
Reviewed-on: https://gerrit.instructure.com/33994
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-05 19:21:51 +00:00
Derek DeVries 1168ed5ab4 make show/moderate/statistics actions redirect to fabulous quizzes when enabled
fixes CNVS-12752, CNVS-12753, CNVS-12754

test plan:
  - turn fabulous quizzes off
  - visit an individual quiz with fabulous quizzes turned off
  - switch fabulous quizzes on
  - refresh the page
  - it should redirect to the overview tab on fabulous quizzes
  - the url should be something like: /courses/1/quizzes/fabulous_quizzes#/437

  - turn fabulous quizzes off
  - visit the quiz moderate page for a quiz with fabulous quizzes turned off
  - switch fabulous quizzes on
  - refresh the page
  - it should redirect to the moderate tab on fabulous quizzes
  - the url should be something like: /courses/1/quizzes/fabulous_quizzes#/437/moderate

  - turn fabulous quizzes off
  - visit the quiz statistics page for a quiz with fabulous quizzes turned off
  - switch fabulous quizzes on
  - refresh the page
  - it should redirect to the statistics tab on fabulous quizzes (which is
    currently an empty page)
  - the url should be something like: /courses/1/quizzes/fabulous_quizzes#/437/statistics

  - turn fabulous quizzes on
  - edit a quiz
  - when you save the quiz, it should redirect to the overview tab

  - try other variations which should bring you back to the show/moderate/stats
    pages. They should all bring you to the correct tabs on fabulous now

Change-Id: I85e8b628c0562d72c72a30e4e8340dd2cc0adcac
Reviewed-on: https://gerrit.instructure.com/34112
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-03 18:18:56 +00:00
Nathan Mills 50aaedf38e make the resource_link_title for content_tag launched lti tools correct
fixes PLAT-324

test-plan:
  steps:
    *setup an lti tool as a module item changing the name to be different than the lti tools name
    *launch the lti tool
  result:
    *the resource_link_title value should match the name of the module item

Change-Id: Ifcfa695dd09f693cf4449869052349402168470b
Reviewed-on: https://gerrit.instructure.com/34030
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2014-05-01 21:29:42 +00:00
Ahmad Amireh e471722b26 Ember Quiz Statistics - Base/Skeleton
A starting point for the implementation of Ember quiz statistics that
includes a route with the required data properly loaded, the necessary
serializers and adapters, and base stylesheet/template to start from.

This patch also adds a new submission statistic called
"submission_scores" that's basically a map between a score percentile
and the count of students who received it.

Closes CNVS-12171

TEST PLAN
---- ----

  - with fabulous quizzes on, go to a quiz show page
  - click the Statistics tab
    - verify that you see the blank page, and the tab is activated
    - verify that no errors are thrown in the console

Testing the new metric:

  - create a quiz with a certain number of points possible
  - take it by a number of students and score diversely
    - also let more than one student have the same score
  - perform an API request to retrieve the statistics and:
    - verify you get the new score distribution statistic and that it is
      correct
    - the metric should contain an entry for each distinct percentile
    - the metric entry should really reflect how many students got that
      score
  - check out the Quiz Statistics API docs and:
    - verify the new "scores" statistic under SubmissionStatistics is
      documented
    - verify that the documentation is clear enough

Change-Id: I1f00bd4c18a0767d6a50767c5d8868f1d6e561ac
Reviewed-on: https://gerrit.instructure.com/32732
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-01 21:06:57 +00:00
Kenneth Romney 31361b5255 extract lib/text_helper to gems/canvas_text_helper
fixes: CNVS-12305

test plan:
summaries email should be formatted correctly with indentations.
twitter messages should not be longer than 140 characters.

Change-Id: I912a63b03c6c14de0c1d678063bb8fa33504d843
Reviewed-on: https://gerrit.instructure.com/33171
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-30 15:18:40 +00:00
Simon Williams dc3b16f9bf add gem names to gem script runners
Change-Id: I0dad5345aae75e552af97f5b54ded10bbfebbe37
Reviewed-on: https://gerrit.instructure.com/33925
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-28 15:51:28 +00:00
Raphael Weiner 5553f62357 extract incoming mail into gem
fixes CNVS-12182

test plan
- regression test on incoming mail
- use script/process_incoming_emails to manually trigger the processing
  of incoming mail

Change-Id: Iccd74d8fe2b5af3d5eefe25a2736273e3bf559b0
Reviewed-on: https://gerrit.instructure.com/32794
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:06:02 +00:00
Joel Hough b02a58e4ba remove rails dependency from html_text_helper
test plan
- ensure html text escaping still works

Change-Id: I2524f9df977a4139006030be33dc3be7db8d5f0f
Reviewed-on: https://gerrit.instructure.com/32973
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:03:47 +00:00
Raphael Weiner 8be0ae37d7 Move google_docs code into a gem
fixes: CNVS-12329

Change-Id: I044725c93582cbca39a61e036bb5f0385e069c1e
Reviewed-on: https://gerrit.instructure.com/32990
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:43 +00:00
Joseph Rodriguez baeeb6efc3 refactor and make gem rake task inclusion explicit
fixes: CNVS-12513

test plan:
- run rake tasks for i18n and jst

Change-Id: Ied2b1d67979e55356adfef1cc7aaed42aa0c4b5a
Reviewed-on: https://gerrit.instructure.com/33501
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2014-04-24 15:50:31 +00:00
Raphael Weiner 732d4991e5 extract linkedin into a gem and add tests
fixes: CNVS-12119

test plan:
regression test linkedin functionality

Change-Id: I9cec121d641db37d4c8f6a04966e766e9f8b293e
Reviewed-on: https://gerrit.instructure.com/33473
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 20:23:55 +00:00
Raphael Weiner 71d9f96279 extract canvas_ext gem
fixes: CNVS-11902

Test Plan:

Make sure Canvas is not broken.  This will break a lot of things if it
does not work correctly.

Change-Id: I8701ff8c271a162a712fe3be05a4fd361430b26e
Reviewed-on: https://gerrit.instructure.com/32113
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 17:39:32 +00:00
Jon Willesen 1f4737ed05 add migration_selection lti extension
this commit lets canvas remember that an LTI has this extension.
launching and using LTI for content migrations will happen
separately.

refs LOR-20

test plan:
 - configure an LTI tool with XML that includes the
   migration_selection extension
 - the tool should show up in the tool list with the "Migration
   Selection" tag.

Change-Id: I880125515a32af1b9a39fbd1787617bceae74f50
Reviewed-on: https://gerrit.instructure.com/21442
Reviewed-by: Jake Trent <jaketrent@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2014-04-23 17:05:41 +00:00
Joseph Rodriguez 3a8cdd8656 remove AR dependency from PaginatedCollection gem
fixes: CNVS-12271

test plan:
- no test needed, spec changes only

Change-Id: I54a814319e17f8ca05c5b8652fc13db70258ff5a
Reviewed-on: https://gerrit.instructure.com/33515
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2014-04-21 19:52:19 +00:00
Mark Severson a1dde79530 extract handlebars_tasks gem
fixes CNVS-11180

test plan:
 * ensure the jst rake commands operate correctly
	 * jst:compile
	 * jst:ember

Change-Id: Ibe3109cf2708abf08783e06b180eba9299472ccb
Reviewed-on: https://gerrit.instructure.com/29920
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-21 19:48:22 +00:00
Mark Severson a1fac754d2 extract i18n_tasks gem
fixes CNVS-11181

test plan:
 * i18n rake tasks still operate correctly

Change-Id: I261973a947ce28840d6817f5a931f5221192e8db
Reviewed-on: https://gerrit.instructure.com/31441
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-21 03:19:47 +00:00