Commit Graph

115 Commits

Author SHA1 Message Date
Davis McClellan 8b3d1abcdb Make "Discrimination Index" Button on stats page KB accessible
fixes CNVS-25739

test plan:
- Go to a quiz's stats page
- Try to access a question's "Learn More About Discrimination Index"
  via the keyboard
- Test on all supported browsers (initially failed on IE)

Change-Id: Id18207cb85272ed3df05662285f2804a8f451624
Reviewed-on: https://gerrit.instructure.com/69817
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Nathan Rogowski <nathan@instructure.com>
2016-01-14 21:17:48 +00:00
Ethan Vizitei 81561784e0 web pack port of quiz statistics
refs CNVS-25916

remove dynamic requirements for env configs,
use separate jsx loader for client apps,
update client app plugin to use old react version,
rewrite selenium spec to be an integration test
rather than executing arbitrary javascript,
and MAJORLY refactor loading patterns of client apps
to avoid sharing code with differences delineated
by opaque require re-writes.

Also moved some code that was in "common" client
app but only used by one actual client app down
into the app that uses it (simplifies dependency
tracing).

TEST PLAN:
 1) make sure quiz statistics still works ok under
    require js build, no behavior should have changed
 2) also make sure quiz log auding works under require-js

Change-Id: I0e5ee3eda9da16e0ad48cf858761735c71df801c
Reviewed-on: https://gerrit.instructure.com/69804
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2016-01-14 00:33:19 +00:00
Davis McClellan 800b871162 Ensure that anonymous surveys remain anonymous
fixes CNVS-24633

test plan:
1. Statistics
- answer an anonymous survey as a student
- as a teacher go to the quiz statistics page and expand the questions
- ensure that none of the questions have the student's name on them

2. Submissions
- answer an anonymous survey as a student
- as a teacher go to:
  /courses/:course_id/assignment/:assignment_id/submissions/:student_id
- should get "This student's responses are hidden because this
  assignment is anonymous." message

Change-Id: I94e08d0ad1293240ac9722a94d3365ed53ca5f7d
Reviewed-on: https://gerrit.instructure.com/67629
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-11-25 00:16:56 +00:00
Kacey Roberts 31f800269f Removed useless tabindex in quiz statistics as mentined
in gerrit 58962 also added minor ui tweeks

Fixes: PFS-2226

Change-Id: I665deca873c2d5f5975a59f5551c1a449d138d2d
Testcase: Verify that tab order is still correct with the change.
Reviewed-on: https://gerrit.instructure.com/63912
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Jenkins
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-10-20 16:27:40 +00:00
Pam Hiett 25b3a96194 address use of ic-brand-secondary within quiz attempt audit
Fixes: CNVS-23629

Test Plan:
- as an admin using the new or old UI
- ensure you have the "Quiz Log Auditing" feature allowed at the
  highest account level under >Settings >Feature Options
- also ensure you have "Quiz Log Auditing" turned on for the
  account the quiz will be conducted in
- navigate to a course with a quiz *or* create a short quiz
- once it has been taken/submitted/attempted you should see a
  # Attempt so far / View Previous Attempts on the right-hand
  area
- click the "View Previous Attempts" from this screen click the
  "View Log" inspect the number with the dark background following
  the Attempt label (it should now be filled with #333 vs the orig
  #34444f)

Change-Id: Ia1072af666f399f2cf8d0995231ca7206e9ae829
Reviewed-on: https://gerrit.instructure.com/64124
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
Tested-by: Jenkins
QA-Review: Myller de Araujo <myller@instructure.com>
2015-09-30 14:30:17 +00:00
Kacey Roberts ff10b28e43 Added User List to responses on all questions for quiz statistics.
test case:
1. Create a Quiz with a question for each type.
2. Add at a few users to the course.
3. Create student submissions for the quiz with varying responses
4. When you log in as a teacher navigate to that quizzes statistics,
  and click on the expansion button for a question.
5. Click on the response ratio for that question and a modal will show
displaying all the users that have responded to that question.

Change-Id: I5e23b42f6982683902124d734c36eedb9c5da7f7
Fixes: PFS-2227
Reviewed-on: https://gerrit.instructure.com/59720
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-09-24 20:56:42 +00:00
Cody Tanner afd4fce104 adds ability to filter quiz statistics by section
closes PFS-2226
Tests:
1. Create a course with two or more sections
2. Create a Quiz with submissions.
3. with student A submit a submission to the quiz in the first section
4. With Student B submit a submittion to the quiz in the second section
5. As a teacher navigate to the quiz statistics section and view the
results
6. By default all submission will show, once you select a section only
that sections results will show.
Change-Id: Ifd32bbfb67068008f008b8323a10b9ea18a67468
Reviewed-on: https://gerrit.instructure.com/58962
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-09-23 23:54:28 +00:00
Jacob Fugal 1991fba3e5 spec: fix fragile packaging for canvas_quizzes
added these files included by timezone_core recently; apparently they
need to be whitelisted

Change-Id: I529975dc7da25a9e2cb5c3a9d095796e30d0f6c7
test-plan: `grunt test` works for canvas_quizzes
Reviewed-on: https://gerrit.instructure.com/61094
Reviewed-by: Kacey Roberts <kroberts@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2015-08-17 23:11:20 +00:00
Ryan Taylor 8d8f26c42e Fixes event sorting issue in question inspection view of QLA
Closes CNVS-21946

Test plan:
  - Write a long essay into an essay quiz question.  Never delete
    anything, just keep writing and writing.
  - Confirm that the quiz log audit shows a growing and growing answer
    (when you've clicked on the "#1" question inspection button).

Change-Id: I3c3c854418921df61d7529d9c5b702eeda93ab56
Reviewed-on: https://gerrit.instructure.com/58732
Tested-by: Jenkins
Reviewed-by: Brian Finney <bfinney@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Nick Nelson <nick@instructure.com>
2015-07-27 16:17:56 +00:00
Michael Nomitch 16686a7a78 dont call position on null in quiz events
fixes CNVS-21052

test plan:
- the event log page for a quiz submission
  loads properly
- /courses/:c_id/quizzes/:q_id/submissions/:qs_id/log

Change-Id: I7605aaddcbe179841c44396f4839b901054fceb6
Reviewed-on: https://gerrit.instructure.com/56957
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Jenkins
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
2015-07-20 21:41:43 +00:00
Ryan Taylor 07b733262c Rereference client_app symlinks to be more specific
This helps with grep and some IDEs which can't handle infinite directory
structures.

Test Plan:
  - Confirm that the quiz statistics and quiz event logs still work as
    awesome as ever, nay awesomer.

Change-Id: Ibbcdafac17ffff3c06c82666b5edbc695760abca
Reviewed-on: https://gerrit.instructure.com/54385
Tested-by: Jenkins
Reviewed-by: Brian Finney <bfinney@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
2015-07-02 15:01:27 +00:00
Ryan Taylor a3f359a8a9 Fixes broken client_apps specs
Test Plan:
  - If it passed Jenkins, it is good.

Change-Id: I16d10300bf21a6d97f5520075230cdf66abcca4e
Reviewed-on: https://gerrit.instructure.com/57286
Tested-by: Jenkins
Product-Review: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
2015-06-29 22:15:22 +00:00
Ryan Taylor 405d6a8a66 Add default case to event log to prevent blank entries
Every time we add an event type, we get a blank bar on the event log.
This ticket defaults to ignoring events which we are explicitly
handling.

Closes CNVS-21195

Test Plan:
  - View the QLA log view for any recently completed quiz submission
    and see that there are no blanks anymore.

Change-Id: I11d3b2cb315fa6d884c12633ece10119802f3b83
Reviewed-on: https://gerrit.instructure.com/56833
Tested-by: Jenkins
Reviewed-by: Brian Finney <bfinney@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2015-06-26 15:36:33 +00:00
Ryan Taylor 22f6313d73 Fixes broken client_apps specs
Closes CNVS-21327

Test Plan:
 - Passes Jenkins.

Change-Id: I6321723220904a77aad14fe3460dce3a3c429daf
Reviewed-on: https://gerrit.instructure.com/56793
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Ryan Taylor <rtaylor@instructure.com>
2015-06-19 21:29:21 +00:00
Ryan Taylor 48ba8a5ffd Alters attempt indicators for a11y
When viewing QLA for multiple attempts, the current attempt is no
longer a link.

Closes CNVS-18363

Test Plan:
  - Confirm that screenreader now identifies the current attempt when
    viewing a QLA recorded set of quiz attempts.

Change-Id: I9d68b2354447ea453c1513b07f6c082d32cfef0b
Reviewed-on: https://gerrit.instructure.com/49784
Tested-by: Jenkins
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
2015-03-05 19:58:35 +00:00
Ryan Taylor 22d238b89d Fixes participant count bug in Quiz Statistics
MultipleAnswersQuestions were being interrogated for participant counts
which counted each student mutliple times.

Closes CNVS-18499

Test Plan:
  - Build a quiz with various question types
  - Take the quiz 5 times
  - Confirm that each question has 5 attempts.

Change-Id: I9c60d5c15f55b3519387e97a595ab659d2ac9d70
Reviewed-on: https://gerrit.instructure.com/49780
Tested-by: Jenkins
Reviewed-by: Brian Finney <bfinney@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
2015-03-04 18:20:06 +00:00
Ryan Taylor 25989dfae9 Fixes signage issue in discrimination index on Quiz Stats
Indicates both positive and negative with respect to the threshold and
now indicates + and - with respect to 0 (like numbers should)
independently.

Closes CNVS-18382

Test Plan:
  - Create student responses for a quiz to create a discrimination index
    of 0.25>x>0.0 and 0.0>x for two questions
  - See that discrimination index shows red and positive, and red and
    negative respectively, rather than being red and negative and red
    and negative as was reported.

Change-Id: Iebd1eae671d2c7738069728714e934aea10aa717
Reviewed-on: https://gerrit.instructure.com/49384
Tested-by: Jenkins
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
2015-02-27 14:58:05 +00:00
Colleen Palmer c968c8d926 Replace color palette variables canvas- with ic-brand-
fixes: CNVS-18615

This changes our $canvas- color variables to use the prefix $ic-brand
or $ic-color, based on whether it will be used in the theme editor
or not.

Variable Changes:
$canvas-primary --> $ic-brand-primary
$canvas-secondary --> $ic-brand-secondary

$canvas-success --> $ic-color-success
$canvas-neutral --> $ic-color-neutral
$canvas-action --> $ic-color-action
$canvas-danger --> $ic-color-danger
$canvas-alert --> $ic-color-alert
$canvas-light --> $ic-color-light
$canvas-dark --> $ic-color-dark

Test Plan:
- CSS should compile successfully
- on /styleguide under Styles > Colors, the first two colors in both
normal contrast and high contrast should now read, "Brand Primary"
and "Brand Secondary"

Change-Id: I3bce89f008db06232d9ff4bf49227aabf573b4a6
Reviewed-on: https://gerrit.instructure.com/48916
Reviewed-by: Chris Hart <chart@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
Tested-by: Jenkins
QA-Review: Nathan Rogowski <nathan@instructure.com>
2015-02-23 19:17:31 +00:00
Colleen Palmer f0e17e2454 Rework base- variables to use ic- prefix
fixes: CNVS-18517
refs: CNVS-17332

This creates consistency in our naming schema on variables.

- base- and can- variables now have the prefix ic-
- where these variables were being used in our stylesheets has been
updated with the new name
- note: content doesn't change with this. just variable names.

Test Plan:
- CSS should compile successfully
- Front-end facing content doesn't change

Change-Id: Ie3f169be27b9cd4c4158ec467de7bec0cb2de680
Reviewed-on: https://gerrit.instructure.com/48757
Reviewed-by: Chris Hart <chart@instructure.com>
Tested-by: Jenkins
Product-Review: Colleen Palmer <colleen@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2015-02-19 21:11:01 +00:00
Aaron Cannon fc87c09a62 QLA: Fixed scope on table headers
Fixes CNVS-18336

Test plan:
- Visit a quiz log page
- Navigate through the table via screen reader table navigation commands and
  verify that each non-header cell is read together with its proper header.

Change-Id: I802d3e370b933cae87107678f5c8295b703f2a45
Reviewed-on: https://gerrit.instructure.com/48656
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2015-02-18 21:38:02 +00:00
Ryan Taylor c1b82356ab Prevents null answers from being shown as answered
In QLA when a question has recorded a null answer, these events are
shown in the stream as if they were real answers.  This prevents those
from showing.

Closes CNVS-17862

Test Plan:
  - Attempt a quiz and leave many answers blank.
  - Confirm that the only answers which are shown have valid answers
  - Confirm that null answer events are still recorded in the individual
    question records.

Change-Id: I5efafa1e5b7c39dbe4cbc97ad5c6be6470f4efd1
Reviewed-on: https://gerrit.instructure.com/48610
Tested-by: Jenkins
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Brian Finney <bfinney@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
2015-02-18 01:50:32 +00:00
Ryan Taylor 3186552bb7 Accessibility fixes for QLA
Fixes header problems, and accessibility warnings for the inaccessible
table view.

Closes CNVS-18364, CNVS-18361

Test-Plan:
  - Check heading levels
  - Confirm the presence of a warning visible/audible next to the "View Table"
    button.

Change-Id: I7c9cada26a62648b2fca52240b19a66492ad737f
Reviewed-on: https://gerrit.instructure.com/48756
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Brian Finney <bfinney@instructure.com>
2015-02-18 01:46:37 +00:00
Colleen Palmer 5636e99383 QLA: Color Contrast - Attempt number that is not selected
fixes: CNVS-18337

This edits the colors on toggle for attempts on the Quiz Log.
It should now be passing contrast.

Test Plan:

- Make sure Quiz Log Auditing feature is turned on
- Go to a quiz that has been completed by a student
- Go to Moderate Quiz
- Choose a student and then go to View Log
- The Attempts toggle should now be passing contrast ratio
requirements

Change-Id: Id2b1a1a6d7c61ed827d4f4bb7e1f5cd9ebfe8e0f
Reviewed-on: https://gerrit.instructure.com/48658
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
Tested-by: Jenkins
QA-Review: Nathan Rogowski <nathan@instructure.com>
2015-02-12 19:14:05 +00:00
Ryan Taylor b3ba044e65 Modifying R-router in QLA for accessibility improvements
Specs are failing, based on config problems.

The screen-reader only jump to content is broken due to the way that
react-router modifies the URL.

Closes CNVS-18335

Test-plan:
  - Confirm that all QLA events pages/links are still functioning
    properly
  - Test screenreader "Skip to Content" button for proper functionality

Change-Id: I3f1c01297d4c960688be0ac3d803e437d10c838e
Reviewed-on: https://gerrit.instructure.com/48381
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Reviewed-by: Brian Finney <bfinney@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
2015-02-11 21:53:23 +00:00
Ryan Shaw 4d2fc99b66 upgrade bower react & react-router but change nothing existing
closes: CNVS-18177

this commit just changes our bower version of react
and react-router to the latest and copies the
current versions we are using to
old_unsupported_dot_use_react.js ant
old_unsupported_dot_use_react-router.js

...and then points everyone's existing code to those
old versions, so that nothing actually changes.

but if you require 'react' or 'react-router' you will
now get the new version.

each team can now take the time to update their own code
to the new versions and when no one is using either
of these 2 old libraries we can delete them.

test plan:
poke around in newfiles, the course wizard,
the external_apps app, quiz-statistics and make
sure they still work. nothing should actually change

Change-Id: I99a3526a740ac82f350bb6dd1fd4f25e4fd92483
Reviewed-on: https://gerrit.instructure.com/47625
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-02-11 19:42:38 +00:00
Ryan Taylor d836c6f08a A landing page for when Quiz Stats are just too big
Quiz Stats were silently failing. This catches the failed server request
and renders a clean error page which directs the user to download the
reports instead of using the statistics UI.

Closes CNVS-17285

Test Plan:
  - Access a quiz with more than 1000 submissions or more than 50
    questions.  See that the stats page is no longer rendered empty, but
    that an error page is shown.
  - Confirm that report buttons are operational
  - Confirm that report popup info boxes are looking good

Change-Id: I850406ed164a61e59d137dda3221746ee25a77cc
Reviewed-on: https://gerrit.instructure.com/46377
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Ryan Taylor <rtaylor@instructure.com>
2015-01-13 19:17:14 +00:00
Brian Finney b7f710b3f6 Add label for session started
Fixes CNVS-17760

Test plan
 - Enable QLA
 - Take a quiz
 - There should be a "Session started" event

Change-Id: I39240ce040f8253b1fc60d6f9be5fae5802f98f2
Reviewed-on: https://gerrit.instructure.com/46642
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Brian Finney <bfinney@instructure.com>
2015-01-09 20:56:45 +00:00
Brian Finney 92b754d2dd Fix test for flagged/unflagged event
Fixes CNVS-17760

Test plan
 - Enable QLA
 - Take a quiz
 - Flag a question
 - See "Flagged" event in the event log

Change-Id: I26c715d1532addcb9024904ab2a097210fd063fa
Reviewed-on: https://gerrit.instructure.com/46641
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Brian Finney <bfinney@instructure.com>
2015-01-09 20:56:26 +00:00
Ahmad Amireh 45260fa4b9 QLA - Table view / answer matrix
A table view that lists all the answers to all questions with lots of
options. The view is restricted to Support SiteAdmins only.

Closes CNVS-17165

Backend/API Changes:

  - QuizSubmissionEvents#index is now paginated

  - Added a new account-level permission :view_quiz_answer_audits to
    control the visiblity of the answer matrix. You can test this on the
    quiz using "quiz.grants_right?(user, :view_answer_audits)"

Client app changes:

  - Fixed a race issue when loading environment-specific config;
    sometimes would cause the tests to fail because the test suite would
    run before the test config was loaded

  - Moved the decoration of QUESTION_ANSWERED events to a separate
    module and now it is done only once at fetch-time, instead of once
    per render

  - Simplified a lot of book-keeping that was done in the Events store
    by using query & URL parameters

  - A global loading indicator prop "isLoading" which is managed by the
    root route in routes/app.jsx - if you want to create a nicer loading
    indicator, this would be the place to edit

  - Moved all "devDependencies" into "dependencies" in package.json so
    now we can just do "npm shrinkwrap" without any flags to generate
    the shrinkwrap.

  - grunt watch task is now smart enough to pick up the current app
    we're working on. Doing `grunt server:events` will watch all the
    files in /apps/events and run the test suite only for that app. :)

Doc changes:

  - Defined a new JSDuck tag @seed that allows us to inspect React
    components in real-time in the docs! Every @seed tag you define will
    accept a JSON construct (or a file that contains JSON) and will
    inject that into the rendered component, so you can show off
    different states and usages in the documentation itself.

TEST PLAN
---- ----

  - create a large quiz with a lot of questions and multiple attempts
  - take it a few times, do many things like answering questions,
    tabbing out and back in, flagging/unflagging questions, etc.
  - go to the log view
    + make sure you enable the new permission for your user from the
      "Manage Permissions" page in the SiteAdmin settings
    + verify you see the "View Table" button
    + click it, and verify the table works as expected
  - go back to the Stream View
  - click on a question link
    + in the question page, verify that the answers are rendered in a
      friendly version (e.g, MultipleChoice answers are shown as radio
      buttons, with the student's answer selected)
    + hop to other questions/types and verify the same thing

Change-Id: I0529b08becbf7dead86c959254faab55761db8df
Reviewed-on: https://gerrit.instructure.com/45883
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-12-19 22:11:56 +00:00
Ahmad Amireh 84a87f8513 QLA - use the submission's question set
Closes CNVS-17235

API/Backend Changes:

  - New helper in Filters::QuizSubmissions for retrieving a specific
    attempt model of a quiz submission, given the attempt number

  - QuizSubmission now provides an interface for looking up its model
    reflection in a certain attempt: QuizSubmission#model_for_attempt()

  - QuizQuestion API index endpoint now allows us to specify a
    submission and an attempt number for retrieving questions presented
    during that unique session

  - QuizSubmission API show endpoint now allows us to specify an attempt
    for retrieving the submission info at that attempt

  - QuizQuestion JSON renderer can now utilize quiz_data (if specified)
    to infer the position of the question in the output. This is
    necessary for submission questions since their position varies from
    a sub to another.

  - QuizSubmissionEvents #create endpoint has been moved to:
    [POST] /courses/:id/quizzes/:id/submissions/:id/events

  - New endpoint for retrieving a sub's attempt events at:
    [GET]  /courses/:id/quizzes/:id/submissions/:id/events

Client changes:

  - Client can now parse pagination using either the Link header when
    receiving regular JSON responses, or the JSON-API "pagination" set,
    whichever is available.

TEST PLAN
---- ----

  - create a quiz with 2 questions, make sure u allow multiple attempts
  - take the quiz as a student, no need to submit it
  - go to the submission log for that student:
    + verify the page loads and renders just fine
  - now edit the quiz, delete one of those questions, save the quiz
    + reload the submission log page:
      - it should still work
  - submit the quiz, take it again
    + go back the submission log page, and switch between attempts:
      - verify the switching works and data gets (re)loaded

Test with banks:

  - create a new quiz with questions pulled out of a bank, and let it
    allow multiple attempts
  - take the quiz a number of times so you get different questions from
    the bank across the attempts
  - in the QLA app, verify that you see the correct questions when you
    switch between attempts

Extra:

Generate the API docs (`bundle exec rake doc:api`) and visit the Quiz
Questions page; the "List questions in a quiz or submission" endpoint
docs should now list the 2 new parameters, "quiz_submission_attempt" and
"quiz_submission_id".

Change-Id: I4b1761b924fb6011b1df696b89fbf6a91bab43a6
Reviewed-on: https://gerrit.instructure.com/45262
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-12-18 23:39:54 +00:00
Ahmad Amireh 95120d3d49 Quiz stats - question banks support
We were using the total participant count for the quiz to calculate
certain response ratios for each question. This patch changes that
behavior to use the number of students who were actually presented with
each question.

There might still be issues with the DI chart [1] but I can not verify
that.

Closes CNVS-17148

TEST PLAN
---- ----

  - Create a quiz with:
    1) 2 normal questions
    2) a quiz group linked to a bank with 1 question pick
    3) let it allow multiple attempts
  - Take it by a number of students so that you get different questions
    pulled out of the bank.
    + After each attempt, refresh the stats page and verify that the
      question stats for the random question you just received is
      correct in that:
        1) The "Attempts: X out of Y" should read like this: X would be
           the number of students who took this question and left any
           NON-EMPTY response, where Y is the number of students who
           were presented with that question altogether, regardless of
           the type of response they left.
        2) The charts for that relevant question are correct[1].
  - If you re-take the quiz by a student who received a unique question
    (i.e, no one else has received it) and you do NOT get that question
    on the subsequent attempt, the stats page will no longer display
    that question since it has no data anymore

[1] The discrimination index chart may not work as expected because of
the way it's calculated; it only looks at the data for the *first*
submitted attempt, and it requires a hefty number of responses. So,
you need to get really lucky that you receive a MC/TF question *on the
first attempt* by a number of students. I never got it to work, YMMV.

Change-Id: I5238b98cfb6ec92461bbcddbf67ef88fc9b37f1d
Reviewed-on: https://gerrit.instructure.com/46007
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
2014-12-18 21:10:14 +00:00
Ahmad Amireh aad33184d0 Remove .delete_me files for deprecated client apps
We had to manually add these two empty files to deprecated client app
folders in /client_apps/* as an indicator to a Rails initializer that
these client apps are now obsolete and need to removed BEFORE the JS
rake task runs. Otherwise, the rake task would fail trying to build
those client apps unless the initializer removed the folders.

Problem is, without this patch, anytime somebody runs `rake
canvas:compile_assets` or the JS rake tasks, their git HEAD will be
dirty with the now-removed .delete_me files. This patch removes the
files from the git history.

Closes CNVS-17516

TEST PLAN
---- ----

  - run `bundle exec rake canvas:compile_assets`
    + verify it works
  - run `git status` and make sure it does not list files in
    `/client_apps/canvas_quiz_*/.delete_me/`
  - browse the client_apps folder (`ls client_apps/*`) and verify
    neither canvas_quiz_statistics nor canvas_quiz_inspector exist

Change-Id: I0ab23ff6200e2425e0b3e104b2cdfd08e6a11629
Reviewed-on: https://gerrit.instructure.com/45813
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-12-15 23:36:23 +00:00
Ahmad Amireh 144d9316b9 UI for quiz submission logs
Closes CNVS-17020

Adds a small app for browsing quiz submission events for a student's
submission. Re-architectures the previous canvas_quiz_statistics client
app to now host more than 1 app. Common code between the two apps is
factored out into /apps/common/{css,js,test}.

Also:

  - a feature flag for quiz log auditing
  - renamed previous QuizSubmissionEventsController to an Api one
  - an API endpoint + controller action for retrieving/viewing events
  - "canvas_quiz_statistics" merged with the new client app
    "canvas_quizzes"

TEST PLAN
---- ----

Make sure you build the assets by running `bundle exec rake
canvas:compile_assets` before doing any of this.

Now:

  - take a quiz as a student
  - as a teacher, view the student's attempt
  - click on the big "View Log" link
    + verify the page loads and you can browse around in it

We also need to test stats, because the commit affects it:

  - turn on the new stats feature flag
  - go to stats:
    + verify the page loads and looks OK

Try both pages another time with the ?optimized_js=1 parameter added to
the URL to make sure nothing went wrong when they were optimized.

Change-Id: I5a30cb0db05e80084d1ddd595b53f9aa3cf336eb
Reviewed-on: https://gerrit.instructure.com/44576
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-12-15 19:51:52 +00:00
Ahmad Amireh 26d7cb06c3 Quiz Reports API - force regeneration
Extends the quiz reports API with the ability to re-trigger failed CSV
generation jobs, and to abort them completely. The UI is extended to
utilize those new APIs.

Closes CNVS-16525

TEST PLAN
---- ----

  - create a quiz with a file upload question
  - take the quiz by a student and upload a file, then submit
  - turn on new stats and go to new stats page
  - click the "Student Analysis" report generator button and verify that
    the CSV file is generated and you get prompted to save it

Now... we break the student's submission by removing the attachment and
then the student analysis will start failing to generate.

Launch a rails console and perform the following command:

[ 'Quizzes::QuizSubmission', 'Quizzes::QuizStatistics' ].each do |type|
  Attachment.where({ context_type: type }).last.destroy!
end

  - reload the stats page
    + the "Student Analysis" button should now read that it had never
      been generated, that's right because we just removed the CSV file
      attachment using the console
    + try generating the report again
      - verify that it blows up
    + you should now see a notification as in the screencast
      - clicking the "retry" link should retry generating the report
        (which will fail again)
      - clicking the "cancel" link should remove the notification
      - clicking "Dismiss" should dismiss the notification, but if you
        reload the page, it's still there

Change-Id: I467a9030c3ef94d685ec20b31dd533e530e24758
Reviewed-on: https://gerrit.instructure.com/43862
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-11-12 22:49:38 +00:00
Ahmad Amireh 1e0760b716 CQS - Loading states
While stats are being loaded:

  - Adds a spinner to the top of the page
  - Dims the summary table metrics and replaces them with "N/A"
  - Reads a "please wait while we're loading" sentence in the question
    breakdown section
  - Disables any buttons that are visible

Note: the summary percentile chart could use some work but it'll have to
be done in a different patch.

Closes CNVS-16597

TEST PLAN
---- ----

  - go to new quiz stats
  - try to get the page to load for a bit so you can see the effects,
    otherwise try reloading to test each item or get in touch and maybe
    we can figure something out
    + verify the items above are met while the stats are being loaded
    + verify everything goes back to normal when loading is complete

Change-Id: Ibd9049d3a81d85d376b79102c1567e470f06de9c
Reviewed-on: https://gerrit.instructure.com/43997
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-11-07 17:02:41 +00:00
Ahmad Amireh fbe72e558c CQS - ANIMATED percentile chart & brushing
This patch enhances the big chart in the Summary section (percentile
distribution) in a few ways:

  1. better positioning / anti-clipping when browser is resized
  2. bars are animated on the Y axis
  3. support for selecting a range of percentiles to interactively see
     how many students have scored within that range. This is refered to
     as "brushing" in the test plan
  4. code is optimized and no longer fully re-renders on updates

Closes CNVS-16595

TEST PLAN
---- ----

  - create a quiz with a large number of submissions so we get some
    healthy data for the chart
  - go to new quiz stats

Testing the animation:

  - just keep an eye on the chart as the page loads
  - verify that you see the animation of every bar growing up on Y axis

Testing positioning / scaling:

  - try resizing the browser a bit by bit (make it narrower) and make
    sure that to a certain extent, the chart stays visible and shrinks
    in size (x-axis ticks may get clipped, not much we can do about
    that)

Testing the brush:

  - verify that when you hover over the chart, you see a tip telling you
    you could use ur cursor to make a selection
  - try making a selection:
    + you should be able to "brush" the chart, and as you do, you read a
      sentence below with some information about the number of students
      who scored within the range of percentiles you selected
    + grab the selection around, and verify that the sentence updates
      with the correct information
  - single-click on any percentile:
    + you should see a similar, but some-what reworded, version of the
      sentence highlighting students who scored *exactly* that
    + also, the brush should automatically "clip" to cover the entire
      bar (e.g, it gets shaded without you having to manually make the
      selection)
    + try clicking the 0 and 100 percentile bars, make sure they're OK

Change-Id: Id0b5cfdc60e42214845c191f90ca42edd7d4b859
Reviewed-on: https://gerrit.instructure.com/43993
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-11-06 22:21:26 +00:00
Ahmad Amireh e00396cd2c CQS - ANIMATED correct answer ratio donut
Closes CNVS-16594

TEST PLAN
---- ----

  - go to new stats
  - watch the correct-answer donut charts spin up as data loads
  - watch the text inside of them (the %) spin up as data loads
  - go to a question with answer sets like FIMB or Matching
    + switch between answer sets
      - verify the arc in the donut as well as the text spin

Change-Id: If34e519bb72361a1e52ace3f0f5ae173aad84d60
Reviewed-on: https://gerrit.instructure.com/43625
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-11-06 22:17:44 +00:00
Ahmad Amireh 76f921ebc3 CQS - ANIMATED answer distribution
Closes CNVS-16593

TEST PLAN
---- ----

  - go to new stats
  - look at the answer distribution chart
    + the bars should smoothly transition up the Y axis as the data is
      loaded
  - find a FIMB or Matching question
    + switch between the answer sets
      - watch the bars change around smoothly

Change-Id: Id2548bd0cc59e64d778393d16770dd95c088df10
Reviewed-on: https://gerrit.instructure.com/43615
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-11-06 04:07:23 +00:00
Ahmad Amireh bacb70e3fc CQS - Answer distribution charts scaling
Also did some refactoring and added a number of comments in the chart
generator to ease future maintenance.

Removed "grunt-notify" module because it's too annoying and hardly
useful.

Closes CNVS-16518

TEST PLAN
---- ----

  - create a quiz with two FIMB questions
    + the first question should have over 10 possible answers (could be
      right or wrong, doesn't matter)
    + the other question could have like 3-4, like normal ones
  - take the quiz by quizard or manually; we'd like to have a number of
    responses to give the chart some shape
  - turn on new stats FFlag
  - go to stats page
    + verify the chart scales for the first question as described by the
      ticket and its AC
    + verify that the chart for the second question looks almost like
      the one on master/the normal one .. e.g, the bars are 30 pixels
      wide
    + make sure you can trigger the tooltips for every bar out there

Change-Id: Ifb1ee3e2359f0c3d77d733bba6262a46df8ced0b
Reviewed-on: https://gerrit.instructure.com/43404
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-11-06 04:07:11 +00:00
Ahmad Amireh 6610f08a49 CQS - roundhouse a11y powerups
Closes CNVS-16313, CNVS-16314, CNVS-16315

Here are the items covered by this patch:

- Discrimation Index help dialog will now auto-focus the close button
  instead of the first paragraph
- Toggle Question Details buttons are now hidden from the SR (both the
  individual question buttons, and the master one)
- Wording of the audible table summary for the answer distribution chart
  has been modified, see below for the new text.
- Bracket answer ratios in the DI table are now simplified; if we have
  60% correct answers in that bracket, it will no longer speak "and 40%
  got them wrong" as it was redundant
- Answer "drilldown" (aka question details) are now hidden from SR as
  that data was already covered by the tabular chart alternatives

TEST PLAN
---- ----

  - go to the new stats page and verify the items above are in place
  - (optional) take a look at the affected tickets, there's some
    discussion there that could give you some context

Change-Id: Ia34540f2b20c1387a83b5718e6884c9092e641f4
Reviewed-on: https://gerrit.instructure.com/43562
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Aaron Cannon <acannon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-11-02 17:32:40 +00:00
Ahmad Amireh 399272ec09 CQS: make the answer tears hollow and CSS updates
The little answer "tears" or bubbles in the answer details section are
now hollow except for the correct answer.

Also, some CSS refactoring, better use of variables and more consistent
naming.

Closes CNVS-16316

Change-Id: I99338d0b2dbafed2bc49f9841f04ae539f4fb61d
Reviewed-on: https://gerrit.instructure.com/42954
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-10-30 20:57:39 +00:00
Jon Jensen 2d37c16193 i18nliner-js (part II)
this swaps out (most of) our runtime i18n.js hacks with i18nliner-js

slightly tweak our js htmlEscape implementation (but not behavior) to play
nicely with i18nliner-js

remove auto-scoping abilities of I18n.lookup, but that's not a huge
deal as we didn't really need it

test plan:
1. verify english defaults:
   1. use canvas in english
   2. confirm everything looks correct
2. verify translation keys/scopes:
   1. run canvas w/ RAILS_LOAD_ALL_LOCALES=true and optimized js
   2. use canvas in spanish
   3. confirm that todo está bien
3. confirm you can now use i18nliner-y features:
   1. call `I18n.t` without a key

Change-Id: I93a2763f638f2807a7f804d320409fbdc80f0454
Reviewed-on: https://gerrit.instructure.com/42895
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-10-30 06:25:43 +00:00
Jon Jensen 8192132c3e i18nliner-js (part I)
this swaps out our "parsing" with i18nliner-js

also remove localization abilities of I18n.beforeLabel, since it's not
worth the trouble to support. it can still be called to format a string.

notable changes/fixes in generated yml:
1. client_apps are picked up by i18n:rake so they'll get translated...
   due to the old short-circuiting logic (`rc = rc && ...`), it would
   stop processing scripts within a particular file after the first one
   it found without an I18n.t
2. we no longer incorrectly double-escape special chars in our js strings
   (e.g. newlines are actually newlines, not a literal "\n")

test plan:
1. verify string extraction:
   1. `rake js:generate i18n:generate` before and after this commit
   2. confirm `config/locales/generated/en.yml` is identical, except the
      notable changes/fixes listed above
2. verify js translation file generation:
   1. `rake i18n:generate_js` before and after this commit
   2. confirm the files in public/javascripts/translations are identical
3. verify client_app checker still works:
   1. `cd client_apps/canvas_quiz_statistics/`
   2. `grunt check_i18n`

Change-Id: Ic8ad058bee1c9476f42916f10b612c1c08863fe3
Reviewed-on: https://gerrit.instructure.com/42809
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-10-30 06:25:36 +00:00
Ahmad Amireh e1f1d9e4b0 CQS: better page headings
- there's an H1 for the page that reads "Quiz Statistics" visible only
  to screen-reader
- rest of the headings are of levels H2 and H3

Closes CNVS-16312

Change-Id: I35c7d06f3ef9f9ffd59f7eaa1840173b1a1ee58a
Reviewed-on: https://gerrit.instructure.com/42953
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-10-20 17:29:55 +00:00
Ryan Florence 00f619716c get npm install to work in canvas_quiz_statistics
Change-Id: I75419d9078997507bad466f5fb76d1fd02fdb642
Reviewed-on: https://gerrit.instructure.com/42174
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2014-10-17 18:27:57 +00:00
Ahmad Amireh 73cf512ee9 CQS - lock down NPM dependencies
Closes CNVS-15990

Change-Id: I8a67acc5247b005fdd1841b5de607c8beff68762
Reviewed-on: https://gerrit.instructure.com/42154
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
Tested-by: Ryan Florence <ryanf@instructure.com>
2014-10-02 19:19:30 +00:00
Ahmad Amireh 858919c072 client_apps: use script/build
Each client_app is now expected to provide a runnable script at
/client_apps/app_name/script/build that builds its JS assets.

Also, `npm install` will only be run if an npm `package.json` file
exists, so the app is free not to use npm if it doesn't need to.

Closes CNVS-15445

TEST PLAN
---- ----

  - run `bundle exec rake canvas:compile_assets` and make sure it works

Change-Id: I635c79234dbb2c890e73cd9889fac86bd68fdf53
Reviewed-on: https://gerrit.instructure.com/41195
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
2014-10-01 16:26:26 +00:00
Ahmad Amireh bf8ce58549 CQS: accessible score percentile chart
Closes CNVS-15301

Three enhancements:

  - chart now has a title (and apparently a browser tooltip!)
  - the 0% ... 100% X-Axis ticks are now hidden to the screenreader
  - the chart is equipped with an audible description, something like:
    "10 of the students scored above, or at, the average, and 2 below."

TEST PLAN
---- ----

  - go to CQS page
  - verify you hear the chart's title, "Score percentiles chart",
    labeled as a "group"
  - verify you can enter the group
    + verify that once you enter the group, you can hear the audible
      description of the chart noted above
  - verify you can not reach the 0%...100% X Axis ticks using the
    screen-reader

NVDA NOTES
---- -----

To get to the summary sentence that is now a replacement of the chart,
you can keep pushing DOWNARROW until you pass by all the table cells,
and just before it reads the "Question Breakdown" heading, or
alternatively (faster):

  - press H two times until you get to "Question Breakdown" then UPARROW
  - press T to get to the summary table, press DOWNARROW like 12 times
    to pass by all the cells, then another time

Something else: if the app renders before the data is loaded, e.g, cells
in the first table are still at 0%, NVDA might have already cached the
page. Then, when you get to the table and the app has loaded, it reads
"0%" instead of the actual numbers... you can use INSERT+F5 to tell NVDA
to refresh the page and look for new changes.

This is obviously problematic, but solving it is outside the scope of
this patch. Maybe we should prevent the app from starting until we have
all the data ready? Donno

See "Refresh browse mode document" in this section of their User Guide:
http://community.nvda-project.org/documentation/userGuide.html?#toc40

Change-Id: Ia4912bfb5978bf9c2fc2ae26d9a2967a5392e2f3
Reviewed-on: https://gerrit.instructure.com/41329
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-09-24 23:10:56 +00:00
Ahmad Amireh 3b6f82d797 CQS: accessible discrimination index
Closes CNVS-15304

Enhancements:

  - "Discrimination Index" label that contains the number now reads as
    a full sentence
  - chart is now ignored by SR
  - chart is substituted by a table that provides a friendly sentence
    representing the DI for each bracket (more on this below)
  - the table is equipped with a nice description of what the table is
    about, and what the student brackets are

Other relevant enhancements:

  - in the summary table, when you go to the Average Time column, doing
    a read-sentence will no longer speak the "mm:ss" timestamp along
    with the friendly audible version, only the latter (tested on VO,
    needs checking on JAWS/NVDA)

Here's how the table should be read for DI data like this:

[ Top bracket | 100% correct ]
[ Mid bracket | 0%   correct ]
[ Bot bracket | 30%  correct ]

- "Top bracket: all students in this bracket have answered correctly."
- "Middle bracket: not a single student in this bracket has provided a
  correct answer."
- "Bottom bracket: 30% of students in this bracket have answered
  correctly, and 70% have not."

TEST PLAN
---- ----

  - go to CQS page, use a screen-reader
  - locate a multiple-choice or true/false question with some DI data
  - go to the DI chart
    + verify the enhancements above are in effect

Please test this under NVDA and JAWS as well as VO, Hopefully the
inconsistencies won't be that bad, but I have no idea.

CR NOTES
-- -----

I've come up with a decent hack for forcing VO to not read "sighted"
user content by exploiting the [hidden] attribute and some CSS. It
shouldn't have any regressions as it's an opt-in hack, and has a very
nice benefit for Say-All and Speak-Sentence modes.

Just so you know when you're looking at the CSS and SUC component
changes.

Change-Id: I986f1566f4b44b200b2bb89e0b9432190841d397
Reviewed-on: https://gerrit.instructure.com/41332
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-09-22 20:30:43 +00:00
Ahmad Amireh 5713c8ef67 CQS: accessible answer bars chart
Closes CNVS-15303

Enhancements:

  - chart is ignored by SR
  - a table is now provided for SR instead that reads the response
    counts in a in a friendly manner:
    * each answer text is prepended with the answer position
    * correct answers are read as such
    * the answer text itself acts like the row's header, so you hear a
       full sentence describing both the answer and its response count
    * hearing-friendly response counts

Here's an example of what you'll hear for a table with the following
data:

[ A               | 50 ]
[ B               | 0  ]
[ Something else  | 5 ]
[ No answer       | 3 ]

"Answer one: A. This is a correct answer. Fifty responses."
"Answer two: B. No response."
"Answer three: Something else. Five responses."
"Answer four: No answer. Three responses."

TEST PLAN
---- ----

  - go to CQS
  - using SR, visit question boxes that have the Answer Distribution bar
    chart
    + verify you do not gain focus to the chart, it should be totally
      ignored by the SR
    + verify you hear the answers laid out as described above (I've had
      to use the table mode in VoiceOver for this effect)

Change-Id: Iad32a3b5ed652ab531b9b1bc98a3a4dcf91d0dfd
Reviewed-on: https://gerrit.instructure.com/41331
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-09-19 21:13:24 +00:00
Ahmad Amireh 98daa66b62 CQS: correct-answer ratio donut chart a11y
Closes CNVS-15302

Enhancements:

  - the redundant "Correct answer" is no longer read by SR
  - the chart is ignored by the SR
  - the description is read by the SR: "XX% of your students correctly
    answered this question."

Enhancements to other parts:

  - question description is now read right after the question position
  - no longer using <aside /> for the control button container, so SR
    won't stop to say "Entering (exiting) complimentary landmark", it
    will just speak the button directly instead

TEST PLAN
---- ----

  - go to CQS
  - head over to a question that has the correct-answer donut chart
  - verify the enhancements written above are in effect

Change-Id: Ia689441901bd4d310c3b18c0aafb40f5333246aa
Reviewed-on: https://gerrit.instructure.com/41330
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-09-18 21:41:18 +00:00
Ahmad Amireh 1d1b12ef88 CQS: accessible report generation
This patch makes the report-generation functionality more accessible to
screen-reader and keyboard users. It also uses qTip instead of the old
jQueryUI.tooltip library we're using in Canvas for reliable keyboard
support and repositioning.

I'll highlight changes in the test plan.

Closes CNVS-15110

TEST PLAN
---- ----

Prepare for tests:

  - create a quiz with any number of questions
  - go to statistics cqs

We want to see if we can generate the reports using only the keyboard,
and another time without looking at the screen at all.

> Drive 1: generating the report using only the keyboard

  - use TAB to reach the "Student Analysis" generation button
    + verify the tooltip automatically opens as soon as you focus the
      button
    + press ENTER/RETURN
      - verify the report generation begins
      - verify the tooltip adjusts its position as the content changes
      - when it's complete:
        + press ESCAPE to close the dialog
        + verify that the focus is still locked to the button (which is
          now really a link)
        + click ENTER/RETURN
          - verify you get the Save-As file prompt
          - tooltip should now read "Report has been generated." or
            similar

> Drive two: generating the report with eyes shut

  - Turn on NVDA, JAWS, or VoiceOver
  - don't look at the browser! only these instructions
  - hit TAB until you hear "Generate item analysis report, button"
  - press ENTER/RETURN
    + you should soon hear "Report is being generated"
    + if you're lucky[1], you will hear the following updates:
      - "Less than half way to go" (when it's 50-75%)
      - "Almost done" 75-99%
      - "Report has been generated." at 100% and just before the button
        gets converted into a link
    + when it's done, you *should* hear "Download item analysis report,
link"
    + you should be prompted to save the file as usual
    + now when you close the dialog, if you TAB once, you should hear:
      - "Report has been generated."
  - reload the page
  - TAB a bit until you get to any of the (already generated) reports:
    + you should hear the "download..." message
    + if you TAB again, you should also hear *when* it was generated,
      something like: "Generated: Sunday ..."

[1] Even for quizzes with 400+ submissions, the report on my machine
would be generated in less than a second so I could not reliably get the
progress update messages to read all the time so it wasn't really
useful. YMMV. If you try this many times though, you'll at least hear
enough variations. Presumably, on production things take longer and
this will be more useful.

Change-Id: Ie879c20f5621e22b1b506f14e40877cf55eafb86
Reviewed-on: https://gerrit.instructure.com/40685
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-09-18 16:21:10 +00:00
Ahmad Amireh 288405f835 CQS: fix outdated specs
Closes CNVS-15444

TEST PLAN
---- ----

N/A

Change-Id: If82eabd396dd325cf2b2b876f9928fd6e5351b4f
Reviewed-on: https://gerrit.instructure.com/40939
Reviewed-by: Hannah Bottalla <hannah@instructure.com>
Product-Review: Hannah Bottalla <hannah@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Hannah Bottalla <hannah@instructure.com>
2014-09-11 19:04:28 +00:00
Ahmad Amireh 64f272123d CQS: gerrit integration
This is for Hannah to hook gerrit up with the test script for the client
app. Also, it scopes the selenium test in /spec/selenium/client_apps for
consistency.

  - canvas build task no longer installs production-only npm packages

Closes CNVS-15443

Change-Id: I0623b594782c55490e12dffdd379bf2baf5fb3a3
Reviewed-on: https://gerrit.instructure.com/40940
Reviewed-by: Hannah Bottalla <hannah@instructure.com>
Product-Review: Hannah Bottalla <hannah@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Hannah Bottalla <hannah@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-09-11 18:57:23 +00:00
Ahmad Amireh f3d3c5ec02 CQS: accessible summary stats table
Closes CNVS-15310

TEST PLAN
---- ----

  - go to statistics cqs page
  - turn on screen-reader
  - locate the table and verify that it reads in a sensible manner
  - verify you hear a short description of what the table is when you
    get to it
  - verify that no column header is abbreviated anymore, so "Std.
    Deviation" now reads "Standard Deviation" and "Avg. Time" now reads
    "Average Time"
  - verify the last column for the Average Time reads a
    human-understandable duration, like 10 seconds or 5 minutes and 30
    seconds instead of zero-zero-colon-one-zero (00:10)
  - sighted users should still see the duration in timestamp-form, e.g,
    00:10 and 05:30

Change-Id: Ia15877f654a4538e939758fcf89ad45f36e52df2
Reviewed-on: https://gerrit.instructure.com/40686
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-09-10 16:09:49 +00:00
Ahmad Amireh 7fd9d0fcf2 CQS: DI help dialog toggle button a11y
This patch makes the button that opens the discrimination index help
dialog more accessible.

Closes CNVS-15306

Enhancements:

  - the "?" little icon now acts (and reads) like a button
  - button is now reachable via TAB
  - button now reads a descriptive message when the user focuses it:
    "Learn more about the Discrimination Index"
  - pressing RETURN while focusing the button will open the dialog
  - the SR starts reading the content of the dialog as soon as it
    is opened, instead of focusing the Close button or the link inside
  - the link used to read "here", now it contains the full message:
    "More information is available here." which is better

TEST PLAN
---- ----

  - go to statistics cqs with at least 1 multiple choice question
  - keep pressing TAB and verify you can focus the "?" icon
  - verify that you hear "Learn more ..." when you focus it
  - press RETURN
    + verify the dialog opens
    + the thing should start reading the little article in there
    + verify you can TAB to the "More info..." link in the article
      - click it and verify it takes you to the instructure help article
      - close the tab
    + press ESCAPE and verify the dialog closes, and your focus is back
      to the toggle button

Change-Id: I1b840ed82b9d71262c92372aeb7182ef76707fc9
Reviewed-on: https://gerrit.instructure.com/40779
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-09-10 15:15:56 +00:00
Ahmad Amireh 93631a703c CQS: answer drilldown accessibility
This patch provides two a11y enhancements:

  - question statistics now have an invisible h4 that reads the question
    position, so the listening user can tell which question we're
    actually talking about
  - when you click the "Toggle Details" button, the new state of the
    button is read automatically by the SR

Closes CNVS-15305

TEST PLAN
---- ----

  - for a quiz with at least 1 question, go to statistics CQS page
  - search for headings using the screen reader and verify that each
    question box has a heading that reads "Question X" where X is the
    position of the question
  - tab through to the "Toggle Details" button for a question and press
    it
    + verify you hear "Hide answer details"
    + press it again
      - verify you hear "Show answer details" again

Change-Id: I85ddcc6219c0022e7979d06ba224de856575076f
Reviewed-on: https://gerrit.instructure.com/40777
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-09-10 14:56:46 +00:00
Ahmad Amireh 23d27fe365 CQS: Essay, File Upload, and Formula
This is the last part of Ember to CQS port. Adds question statistics
boxes for these question types.

Closes CNVS-15260

TEST PLAN
---- ----

  - create a quiz with those question types
  - take it by a number of students
  - visit the stats cqs page
  - verify the question stats render
  - verify the score distribution chart is functional
    + pls note that none of the scores will show until the teacher
      actually grades the responses
  - verify the correct answer donut chart is functional
  - verify the "Attempts: X out of Y" is functional:
    + when you write nothing in essay or formula, you don't count as an
      attempt
    + when you don't upload a file, you don't count as an attempt
  - verify the essay stats shows a link "View in SpeedGrader" that takes
    you to speedgrader
  - verify the file upload box shows a link "Download All Files" that
    opens a new tab, generates the zip file, and downloads it

Change-Id: Ibd72b32a21a508a78b1eb14a2b438f6fe4398451
Reviewed-on: https://gerrit.instructure.com/40544
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-09-09 17:00:10 +00:00
Ahmad Amireh fd4bbbf91c CQS: selenium spec for canvas integration
Added a selenium spec that visits the statistics_cqs page and verifies
that the client app has loaded and mounted successfully.

Closes CNVS-15363

Change-Id: I4a87b5af78343d51ef8e4c0b1e30065eff9e7d6b
Reviewed-on: https://gerrit.instructure.com/40775
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-09-09 15:52:36 +00:00
Ahmad Amireh d11ac9f82e CQS: FIMB and friends
This patch adds question statistics for Fill In Multiple Blanks,
Matching, and Multiple Dropdown question types to the CQS client app.

Closes CNVS-15215

TEST PLAN
---- ----

  - create a quiz with the question types above as well as the old ones
    (MC, T/F, FITB and friends)
  - take it by a number of students and generate stats
  - go to statistics cqs page
  - verify all those question types render
  - verify the new ones render with tabs for each "answer set" (e.g,
    blank)
  - click the tabs, verify that:
    + answer drilldown section updates with the answers for that set
    + correct answer donut chart and the message update
    + answer distribution bar chart updates

Change-Id: Ia554832a5825cdb4b883e3db6fd4b3c75dd2599e
Reviewed-on: https://gerrit.instructure.com/40543
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-09-05 20:50:59 +00:00
Ahmad Amireh 40f3695184 CQS: FITB and friends
Adds question statistics for Fill in The Blank, Multiple-Answers, and
Numerical questions.

Closes CNVS-15213

TEST PLAN
---- ----

  - create a quiz with the questions above
  - take the quiz by at least two students
  - visit statistics_cqs page
  - verify the question types above render and show the correct-answer
    donut chart, as well as the answer distribution chart (like
    MChoice)

Change-Id: I4d1b2653fe8806e51ec784a507fe6dc99d2cb51b
Reviewed-on: https://gerrit.instructure.com/40361
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-09-03 18:35:47 +00:00
Ahmad Amireh ba50a1c112 CQS - Expand/collapse question answers
Adds buttons to expand and collapse the question answer drilldown.

Closes CNVS-15054

TEST PLAN
---- ----

  - create a quiz with a bunch of MC/TF questions
  - take it
  - go to cqs page (/courses/:id/quizzes/:id/statistics_cqs)
  - under the Question Breakdown section:
    - verify each question box contains an "expand" button
    - click it
      + verify you see the answer drilldown below that matches the Ember
        one
      + click the button again (which should now show a Collapse icon)
        - verify the drilldown is now hidden
  - click the toggle button right next to the "Question Breakdown"
    heading
    + verify it expands/collapses all questions
      - play around by expanding/collapsing individual questions and
        then use the master one, it should always get them *all*
        expanded or *all* collapsed

Change-Id: Icf7fe571356c02c2d85b1dc2b6396c71f5281515
Reviewed-on: https://gerrit.instructure.com/39858
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-08-28 16:42:48 +00:00
Ahmad Amireh 772853e2f4 CQS: multiple-choice & true/false
Closes CNVS-15053, CNVS-13442

TEST PLAN
---- ----

  - create a quiz with multiple choice and T/F questions
    - take it by a number of students (tip: you can use Quizard to do
      this)
  - go to /courses/:id/quizzes/:id/statistics_cqs (CQS)
  - in another tab, open /courses/:id/quizzes#/:id/statistics (ember)
  - compare the functionality between the original Ember page and the
    new one regarding the question boxes for the questions, as described
    in the ticket
    + pay special attention to tooltips and dialog functionality
  - this patch also fixes the translation issue we had described here:
    https://instructure.atlassian.net/browse/CNVS-13442

what not to test:

  - toggling of answer drilldown/details, coming later in CNVS-15054

Change-Id: I468ed8f79354b58d79a12be221a6ab3bff51bd1f
Reviewed-on: https://gerrit.instructure.com/39856
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-08-28 16:42:30 +00:00
Ahmad Amireh 0f2d1ab0cf CQS - Quiz report generation & downloading
Features:

  - quiz report buttons are now functional
  - the report status is displayed in the tooltip
  - reports can be generated
  - their progress is tracked
  - when a report is generated, it is auto-downloaded
    - unless the user reloads the page before generation is complete
    - *NEW*: when reports r loaded, and we find out that some are being
      generated, the buttons actually show that just as if the teacher
      had just pushed the button in that page view
  - lots lots of tests, every single scenario is covered

Development updates:

  - helpers for testing stores and their actions
  - there is now a test environment initializer
  - grunt/connect server now supports downloading files from Canvas
    (e.g, proxies requests from /files/* with proper FRAMEORIGIN
    masquerading)
  - I18n.t() calls now provide (limited) support for Date parameters;
    the output is not quite the same as in Canvas yet
  - Backbone/JSON-API abstractions for parsing things without really
    caring
  - new, extended doc tags (JSDuck):
    - @needs_cfg: state the config parameter a method uses, or
      relies on, to function
    - @async: mark a method as asynchronous

Closes CNVS-14848

TEST PLAN
---- ----

  - go to CQS page
  - mouse over either the "Student Analysis" or "Item Analysis" buttons
    + verify you see a message saying they're not generated yet
    + click on one
      - verify you see a progress bar inside the tooltip, wait for it
        + verify the message changes, and you are prompted to save the
          CSV file

other things to try:

  - request a report generation
    + quizkly, before it finishes, reload the page
    + quickly, mouse over the button
      - verify that you see the progress bar just as if you had
        initiated the request on this page view
      - when it finishes, verify you do *not* get the Save prompt

  - try generating both reports at the same time:
    + verify you get a total of 2 Save prompts, one for each report

Change-Id: I1aec6c9e791de262ef87d028f2b432e921e6ea4a
Reviewed-on: https://gerrit.instructure.com/39855
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-08-27 22:09:42 +00:00
Ahmad Amireh 80d627eb7a client app: canvas_quiz_statistics
This commit brings in canvas_quiz_statistics, a client app that can be
embedded in Canvas.

Closes CNVS-14781, CNVS-14846, CNVS-14847, CNVS-14850

> What's done

  - full build integration, meaning the app runs with ?optimized_js=1:
    + JavaScript "built" source gets piped into the r.js build pipeline
      like any other Canvas JS source in public/javascripts/*
    + SCSS sources get picked up by the sass-compiler like Canvas style
      sources and they get compiled from the grounds-up
    + I18n: phrases are extracted properly, with default values and
      options, by our i18n rake tasks
    - new rake task js:build_client_apps that builds client apps and
      injects them as input to the rest of the JS build process
  - support for using Canvas JS packages, like d3, jQuery, and Backbone
  - support for using Canvas SASS variables & helpers
  - super i18n support: use raw I18n.t() calls like you are in Canvas,
    with development-time interpolation, as well as super new
    Handlebars-like block-style translations in React, perfect for very
    long phrases (mini-articles)

> Docs and References

The code was originally developed in its own github repository. While I
won't be pushing code to that repo anymore, the Wiki will still house
the docs until we find a better place.

  - Repo: https://github.com/amireh/canvas_quiz_statistics
  - Development guide: http://bit.ly/1sNOhER
  - Integration guide: http://bit.ly/1m9kA9V

> TESTING

  - login as a teacher
  - go to /courses/:course_id/quizzes/:quiz_id/statistics_cqs
    + make sure you see something that looks like the Ember stats
    + click one of those little "?" help icons, you get a dialog:
      - verify the contents within the dialog are actual English text,
        not code gibberish
      - there's also a link at the end of that dialog, click it and
        verify it takes you to an Instructure help article
  - build the assets: `bundle exec rake canvas:compile_assets` then:
    + add ?optimized_js=1 to the URL and reload the page:
      - verify the app still works

Change-Id: Ic474650dfb06a1c22869ed9680dd04d1ca0f651d
Reviewed-on: https://gerrit.instructure.com/39105
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Hannah Bottalla <hannah@instructure.com>
Reviewed-by: Adam Ard <aard@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-08-19 20:09:21 +00:00