Commit Graph

92 Commits

Author SHA1 Message Date
Cody Cutrer b77e9f969b remove OpenObject usage
it's really just OpenStruct, which needs to be removed because it has
abysmal performance, and is being removed from Ruby 3.4

Change-Id: I9b692bfefaee7649cf117d846047e531a7e09309
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/345718
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-04-23 17:47:19 +00:00
Sarah Gerard b595e71d85 Add assign to tray to quiz show page
closes LF-699
flag=differentiated_modules

test plan:
- have the flag on and a course with some quizzes in it
- go to one of the quizzes, the Assign To button should
  be there as per the design in the ticket
- click on the Assign To button. Expect the tray to open and
  close properly, and to have the same functionality as it
  does when opened from the modules page
- if the quiz has overrides, expect them to appear in
  the tray
- ensure button does not show in student view or if the flag
  is off

Change-Id: Iee1b33122f29ce7e067a97fb60a916e21b29b42d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/336340
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Sarah Gerard <sarah.gerard@instructure.com>
2024-01-04 18:17:53 +00:00
Cody Cutrer 8f8f6f7313 bump rubocop gems and apply changes
[skip-stages=Flakey]

Change-Id: I5f080be6efb64351b4a89e6bd6040bc6f0432e82
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/323854
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-07 20:13:35 +00:00
Jacob Burroughs 7dcc507d0a Rubocop for ruby 3.1
[skip-stages=Flakey]

Change-Id: I6abefdfa9fed6dd4525c8786e93efa548b3710f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-06-06 16:44:26 +00:00
Cody Cutrer 502aa068da rubocop: Layout/Multiline*LineBreaks
[skip-stages=Flakey]

Change-Id: I24912809267088bc19a4082c49bc5f78ca7b76bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317302
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-05-01 19:31:42 +00:00
Jacob Burroughs be5fed6c45 Fix a bunch of erb related specs on rails 7.0
[ignore-stage-results=Flakey Spec Catcher]

Change-Id: Iabf5cb78da428849f89e7e7d02c35d76afc7dafb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304423
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-11-01 15:13:13 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer e73cf9ddf4 RuboCop: Style/HashSyntax
[skip-stages=Flakey]

auto-corrected

Change-Id: I9371a61046aee6b148f89dd434114a8ba2b1188c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:02:35 +00:00
Cody Cutrer 9b5ab437d5 RuboCop: Performance/TimesMap
[skip-stages=Flakey]

manual (it says it's auto-correct, but it didn't. which is fine cause a few
I simplified in other ways than using Array.new)

Change-Id: I8a4d5cf61deac22ad24e012f5a6f3647c84d3d3c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278312
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 16:20:35 +00:00
Cody Cutrer 1ccd29b412 RuboCop: Style/PreferredHashMethods
[skip-stages=Flakey]

auto-corrected for the most part, but I went through specs and used
the have_key matcher when possible

Change-Id: I4a2df1cdd536a94f3b493668386883d1148660c9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278050
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-12 16:24:14 +00:00
Cody Cutrer 8125858d27 RuboCop: Style/RedundantInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: Id04fd07bb918f0f4dc376b5c3474653a8e767e95
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277870
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:06:11 +00:00
Cody Cutrer eefb34d6c2 RuboCop: RSpec/HookArgument
[skip-stages=Flakey]

auto-corrected

Change-Id: Ifb3f097064db0e00313a079a45da7e651b58d30b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277798
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-10 16:40:43 +00:00
Cody Cutrer 104f7642ff RuboCop: RSpec/EmptyLineAfterHook
[skip-stages=Flakey]

auto-corrected

Change-Id: I6663e9e197e5f6c06b574804e466c39519050ba3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277754
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-10 16:15:08 +00:00
Cody Cutrer 0a025efa2f spec: use require_relative instead of require File.expand_path
[skip-stages=Flakey]

Change-Id: I861a46acffa893b4ea6630039da66851c71b5a77
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276831
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-28 00:15:03 +00:00
Cody Cutrer 06a2c9df42 spec: remove manual requires of spec_helper
[skip-stages=Flakey]

Change-Id: Id65c835b72e1c0a4bb825b58490ce0ff7c8d9873
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276829
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-26 20:38:27 +00:00
Cody Cutrer dbd8c46655 RuboCop: Lint
[skip-stages=Flakey]

auto corrections applied:
 * Lint/AmbiguousOperator
 * Lint/AmbiguousOperatorPrecedence
 * Lint/AmbiguousRegexpLiteral
 * Lint/DeprecatedClassMethods
 * Lint/DeprecatedOpenSSLConstant
 * Lint/NonDeterministicRequireOrder
 * Lint/ParenthesesAsGroupedExpression
 * Lint/RedundantRequireStatement
 * Lint/RedundantSafeNavigation
 * Lint/RedundantSplatExpansion
 * Lint/RedundantStringCoercion
 * Lint/RedundantWithIndex
 * Lint/SendWithMixinArgument
 * Lint/SymbolConversion

Change-Id: I222ec19978033544513bb99755994d109435abad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274551
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:38:23 +00:00
Cody Cutrer b6e406ddcf RuboCop: RSpec/ExampleWording
[skip-stages=Flakey]

Change-Id: I291432cd1f51fdaefb3cf6160d423879fb858c11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274253
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-24 02:15:35 +00:00
Cody Cutrer 6b0095610c RuboCop: Layout spec
[skip-stages=Flakey]

Change-Id: Id479617328562fd009f00db27f248c2ebafa4b7a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274151
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-09-22 22:40:24 +00:00
Jeremy Stanley 34e04307d6 remove direct_share feature flag
test plan:
 - direct share features appear if the user has permission
   to use them

closes LS-2046

Change-Id: I0a3d4614d572d3037d06494bbb05c5a8a1956125
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261055
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2021-03-29 16:25:30 +00:00
Cody Cutrer 160ff3c899 bump sanitize to latest
[fsc-max-nodes=12]
[fsc-timeout=60]

 * switch lots of parsing to Nokogumbo to keep things consistent
 * deep CSS sanitization is now built in, and with a proper parser (meaning
   we can drop our code to do it, and adjust some specs to account for things
   that _are_ valid)

lots of changes because gumbo parsing<->serialization cycle is slightly different:
 * better job preserving original whitespace
 * literal non-breaking space characters are converted to &nbsp; entities
 * <p> tags aren't inserted for the heck of it
 * several _other_ entities are unnecessary, and output as literal characters
 * some elements no longer have a closing tag

Change-Id: I7c5e36cbd04b8a05f64c9e0af00868dd6b00f4ce
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256444
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-02-17 18:17:57 +00:00
Cody Cutrer 81d0bbc465 add # frozen_string_literal: true for specs
Change-Id: Id508bec1817937b1c24c29f1db7221e09cb9c2ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251157
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:48:35 +00:00
Cody Cutrer 1c17f54a3f rails 6: view specs fixes
Change-Id: Ie5040fa5fbd0c360e214e5b9644d0c2d9061e1ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250572
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-21 02:07:54 +00:00
Jackson Howe ff92ddcdcd Allow direct share for teachers in concluded term
Previously, direct share options appeared for users with
manage_content rights in a course. This commit gives direct share
options to users with read_as_admin rights, so any teacher, TA, or
designer can direct share content, even if a course is concluded.

flag=none
Fixes LS-1409

Test plan:
 - Enable direct share on account
 - Create a term where "teachers can access from" is concluded
 - Add course to term
 - In the course as a teacher, verify that direct share functions from
   the following locations (also expect most other menu items to not
   appear):
   - Modules
   - Pages index and individual
   - Discussions index and individual
   - Assignments index and individual
   - Quizzes index and individual
 - Modify term settings to allow access for teachers always
 - Teachers should now see all menu items in above locations, including
   direct share
 - Students should never see any menu options in above locations
 - Disable direct share for account; verify that menus in above
   locations still function

Change-Id: I53b09ed0c535079ab4e811d58de18ab1ef7f6d3a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248214
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2020-09-29 15:21:21 +00:00
Mark Neuburger e7748d56e6 Update quiz taking view to support disabled timer autosubmission
Test plan:
1. As a quiz taker, verify that the quiz does not autosubmit after the
   time limit runs out when auto autosubmission is effectively disabled
(effectively = both the feature flag and the quiz attribute are true).
2. As a quiz taker, verify that the converse is true and timer
   autosubmission continues to work as expected when a time limit is
supplied and timer autosubmission is not effectively disabled.
3. As a quiz taker, verify that when timer autosubmission is effectively
   disabled, the late submission is still accepted.
4. As a course instructor or similar, verify that late submissions are
   still available in the same way that non-late submissions are.

Refs PFS-15518
flag=timer_without_autosubmission

Change-Id: I0262234331d42bd1ff1ec5f22cf790917514f58b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234337
Tested-by: Chad McGuire <cmcguire@instructure.com>
QA-Review: Chad McGuire <cmcguire@instructure.com>
Product-Review: Chad McGuire <cmcguire@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
2020-05-06 17:53:27 +00:00
Jeremy Neander 2cf0c733d6 spec: remove post policy enable_feature! calls
Change-Id: I7becb72121d2dd66cfb8c65e273bb87379b25a1c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229748
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
2020-03-12 16:37:48 +00:00
Jeremy Neander f3d8f81b57 spec: update quizzes show view for post policies
Change-Id: I176fb0f1c13ed9fc938655cf75579a2442e8d627
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229200
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
2020-03-06 22:25:32 +00:00
Jeremy Neander f872089ee8 remove new_gradebook flag
closes TALLY-563
flag = none
...obviously

test plan:
 * Smoke test New Gradebook
 * Smoke test Grade Summary

Change-Id: I0bf7f962f5e910002b69d727666464356a1e3ccf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/225876
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2020-02-18 20:50:34 +00:00
Jeremy Stanley fa10ea0ec7 use CanvasSanitize for quiz question comments
this change was done for answer comments in g/164809
but was not done for correct/incorrect/neutral comments
on the question as a whole

test plan:
 - insert an equation in correct/incorrect/neutral
   comments at the end of a quiz question
 - in the HTML editor, note the presence of
   data-equation-content
 - update the question, save the quiz, re-edit it,
   and ensure the data-equation-content part was
   preserved

flag=none
fixes LA-416

Change-Id: I7e85d3da5c929b9f661ff18305092da15d994189
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/225364
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2020-02-06 22:01:06 +00:00
Jon Willesen 8fcad84dcd Add direct share feature to quizzes show page
closes LA-300
flag=direct_share

test plan:
- When FF is enabled, on the quizzes show page, the direct share options
  should be available in the kabob menu.
- The direct share features should work.
- The kabob menu should receive focus when the direct share modal/tray
  is closed.
- When the feature flag is disabled, the direct share options are not
  displayed.

Change-Id: Idece77707e87ec4c13b8f4d0d8868e76ab6a2d39
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219856
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-12-17 21:47:39 +00:00
Adrian Packel 4513a1a5dd Have old quizzes check posted not muted
fixes GRADE-2300

Test plan:
- Have new gradebook with post policies enabled
- Create two old quiz assignments
  - Set one to be auto-post and the other manual-post
- Take the quizzes
- For the auto-post quiz you should see the results
- For the manual-post quiz you should see "Your quiz has been muted"

Change-Id: Icb67cac0599c95c82a8cc11f2f5a6da09b011ab9
Reviewed-on: https://gerrit.instructure.com/201391
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-07-17 13:50:34 +00:00
Adrian Packel 9d89795983 Replace old anonymous-grading course flag checks
Remove the old Anonymous Grading course flag; update checks for it to
instead look at whether a given assignment (or quiz) is anonymous.

closes GRADE-957

Test plan:

Course flag:
- Check that the relevant course flags are now 'Anonymous Grading (OLD)'
  (which should not be able to be enabled) and 'Anonymous Grading' (the
  "new" setting previously called Anonymous Marking)
- The old flag should be hidden for any course or account that does not
  have a value in the database for it already

Assignments:
- Create an anonymous assignment and a non-anonymous assignment
- Test the assignments:
  - SpeedGrader: student names should be visible for the non-anonymous
    assignment only
  - Log in as a student and upload submissions for the assignments
    created above; as a teacher, download them and make sure that the
    anonymous assignment does not include the students' names in
    its filenames

Anonymous surveys:
- Create two quizzes with a type of Graded (or Ungraded) Survey, and
  enable anonymous submissions for one of them but not the other
- Log in as one or more students and answer both surveys
- As a teacher, open the "Moderate This Survey" link for each survey:
  - Student names should be shown for the non-anonymous survey but
    replaced by "Student 1" and so forth for the anonymous survey
  - The history page (accessible by clicking the name of a student who
    has filled out the survey) should show the student's name for the
    non-anonymous survey but only "Student" for the anonymous survey

Change-Id: Iaa0bc4e40b938056b8e9dfd6d13aff7e6b2ee7bd
Reviewed-on: https://gerrit.instructure.com/152985
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2018-06-18 16:16:33 +00:00
Omar Khan 87c5d43b83 Hide student name when anonymous grading enabled
Fixes QO-333

Test plan:

- Enable the "Anonymous Grading" setting in course settings
- Create a Quizzes 1 quiz
- Complete the quiz as student
- As teacher or admin, navigate to:
  /courses/<course_id>/quizzes/<quiz_id>/history?user_id=<user_id>
  where <user_id> is the id of the student that completed the quiz
- Verify that the student's name is not displayed

Change-Id: Iab15332d321046fc94b46d8c38e57221b99d5547
Reviewed-on: https://gerrit.instructure.com/146118
Reviewed-by: Jared Crystal <jcrystal@instructure.com>
Tested-by: Jenkins
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Omar Khan <okhan@instructure.com>
2018-04-19 16:21:39 +00:00
Omar Khan d127b13e56 Display quiz due date during take
Fixes QO-255

Test plan:

- Create an old quizzes quiz with a due date
- Set the quiz to be available until some date later than the due date
- Take the quiz as a student
- Check that the 'Assignment due' text on the right side shows the due
  date, not the 'available until' date

Change-Id: I12446578ea737752573e3c20d72fe80483fa8759
Reviewed-on: https://gerrit.instructure.com/135732
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Michael Hanks <mhanks-c@instructure.com>
Product-Review: Omar Khan <okhan@instructure.com>
2017-12-15 16:44:30 +00:00
Cody Cutrer 114a923c83 spec: mocha => rspec-stubs for views
whoa, a commit that I didn't have to manually fix anything after
running thorugh the automated fixer!

Change-Id: I6ff371a3d8fa775afdf224027dfb5162580506d5
Reviewed-on: https://gerrit.instructure.com/120565
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-07-26 19:26:49 +00:00
Landon Wilkins 05dec64bbd da licença part 50
add consistent license headers to all source files

Change-Id: Idbd54625443f6fed9057a21730b160765b8ba080
Reviewed-on: https://gerrit.instructure.com/110153
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-28 19:01:52 +00:00
Cody Cutrer e1d85fb9b7 rails 5: stop using assigns view specs shim
just do it the right way, since the shim doesn't seem to work in rails 5

this is just a massive find/replace (repeated, due to chained assignment)

refs CNVS-34867

Change-Id: I267a16bed05a116e463cf9301645270e79a2d80e
Reviewed-on: https://gerrit.instructure.com/104193
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-08 17:51:43 +00:00
Cody Cutrer 533b1868f8 rails 5: fix assigns in view specs
refs CNVS-34867

we need to get rid of our old monkey patch of assigns, but allowing
the default behavior of all ivars transfer over is a nightmare with
our factories. so block that behavior, and target to just view specs
a new shim to use the correct way to have explicit assigns

Change-Id: Ifa529f63405d278d3d0dfb09cc66febbeb5be5c3
Reviewed-on: https://gerrit.instructure.com/101562
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-02-10 19:17:28 +00:00
Neil Gupta 8edf09d694 add scores table
add scores table, which will hold the
computed_current_score and computed_final_score
which is currently stored on the enrollment
object. in addition, grading period scores will
be stored on the scores table.

closes CNVS-33573

Test plan:
* Create a course
* Make sure should total for all grading periods is enabled
* As a teacher, create an assignment that falls in a grading period
* As a student, submit something for that assignment
* As a teacher, grade that submission
* As a student, view your grades
* You should see the student's grade for both the grading period and
  all grading periods.
* Repeat this process for another assignment and make sure the total
  grades get updated for the student.

Basically, we want to smoke test test saving scores for an assignment
and re-calculating course grades with new scores. Everything should
behave the same as before.

Change-Id: Ib7241d55c0fa52e01441671f17f65675f8e10564
Reviewed-on: https://gerrit.instructure.com/96825
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Tested-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-12-28 20:11:54 +00:00
Shahbaz Javeed 95283746ea prevent grading if submission is due in closed grading period
closes CNVS-32229
closes CNVS-32232

test plan:
* Create a course with MGP enabled and two grading periods in
  the default term
* Create two assignments for this course, one in a closed GP and
  one in an open GP
* To test overrides, create the following as well:
  * For one of the students, make the open assignment due in the
    closed grading period
  * For another student, make the closed assignment due in the
    open grading period

* Ensure the following steps work for all assignment/student
  combos due in a closed grading period.

** CNVS-32229 **
* Login as a teacher
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is locked down
* Right click on the locked-down input and select 'Inspect'
* Remove the 'ui-state-disabled' class and remove
  readonly="readonly" from the input field's HTML
* Notice the input is no longer grayed out and you can enter
  a grade
* Enter a grade and tab out of the input
* You should see an error message that says something went wrong
  and notice in the Network tab of your dev tools that the AJAX
  post failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there.
* Verify it isn't there in Gradebook either

* Login as an admin
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is *not* locked down
* Enter a grade and tab out of the input
* You should *not* see an error message that says something went
  wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook

** CNVS-32232 **
* Login as a teacher
* Go into a gradebook that has an assignment that is
  locked down because it is in a closed grading period
* Notice that the grade cells for the assignment are locked
  down (because the submissions fall in a closed grading period)
* Right-click on one of the locked-down cells and select 'Inspect'
* Remove the 'grayed-out' and 'cannot_edit_in_closed_grading_period'
  classes
* Notice the cell is no longer grayed out and you can enter a grade.
* Enter a grade
* Click on another cell.
* You should see an error message that says something went wrong
  and in the Network tab of your dev tools verify the AJAX post
  failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there

* Login as an admin
* Login as a teacher
* Go into a gradebook that has an assignment that is
  in a closed grading period
* Enter a grade in a cell that should be due in a closed grading
  period
* Click on another cell
* You should *not* see an error message that says something went
  wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook

Change-Id: Ia80e4de626616309c5e9dffb78ed0f9671ad1076
Reviewed-on: https://gerrit.instructure.com/95687
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-12-08 21:01:07 +00:00
Jon Jensen f55776d146 spec: fix spec that fails the first run on most builds
also prevent session stubbing in before(:once) blocks and remove lots
of unnecessary stubbing

note that while session stubbing is also unnecessary in controller/api
specs (just need @user to be set), delaying removal of thay to another
commit (we might want tweak it to actually use session stubbing or
something otherwise explicit and less magical than @user)

Change-Id: Iea1792c960ad32090bc4644febc87e1d3651f550
Reviewed-on: https://gerrit.instructure.com/96791
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-12-06 00:07:13 +00:00
Chris Wang 191526ce16 add filter for users on quiz moderation
closes CNVS-3080

test plan:
- Course with at least two students and a quiz
- Go to moderation page
- input somthing into the filter
- ensure that filters correctly

Change-Id: Ia893d7b26c63e3596e9a1d42c33a75972574d467
Reviewed-on: https://gerrit.instructure.com/85870
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-08-12 22:27:11 +00:00
Davis McClellan 580e16f104 Revert "display quiz questions in grader's language in SpeedGrader"
This reverts commit 6533b360b1.

fixes CNVS-29795

Test plan:
Submission translation should match the user who took the quiz

Change-Id: Ib615a24b702cccbc5b9b01c5377bee265b6b99ee
Reviewed-on: https://gerrit.instructure.com/81603
Reviewed-by: Bryan Petty <bpetty@instructure.com>
Tested-by: Jenkins
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
Product-Review: Chris Wang <cwang@instructure.com>
2016-06-06 21:25:40 +00:00
Shahbaz Javeed 6533b360b1 display quiz questions in grader's language in SpeedGrader
closes CNVS-28197

* Added the Quizzes::QuizQuestionBuilder.translate_question_number_text
  method which is a subset of the decorate_question_for_submission
  method and is used in the latter as well.  This feels better.
* Made the quizzes_grading_teacher_specs.rb (selenium) less
  brittle by moving from a before(:once) setup method to a
  before(:each) so each spec essentially runs on its own.
* Updated quiz_question_builder_spec.rb to use something other
  than 1 as the position and also nil

test plan:
1. Create a course with a quiz containing at least one essay type
   question
2. Change the language of the teacher to Spanish
3. Enroll a student in the course and change their language to
   Korean
4. As the student, take the quiz.  You should see your quiz in
   Korean.  At least "Question 1" etc will be in Korean.
5. As the teacher, attempt to grade the quiz in SpeedGrader
6. You should see an alert indicating pending questions to
   review in Spanish since that's the teacher's language.
7. You should see the quiz in Spanish.  At least things like
   "Question 1" will be in Spanish.

Change-Id: I7edbaccaf375d963df2f54c7a881f0e854ce599c
Reviewed-on: https://gerrit.instructure.com/76789
Reviewed-by: Davis McClellan <dmcclellan@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-04-29 19:25:04 +00:00
Bryan Petty ad1f643b17 fix heading levels on quiz show pages
closes CNVS-28771

While fixing levels, this downgrades the quiz preview warnings from
headers to standard alerts, which should also be more accessible.

Test Plan:
1. Create a quiz with a description included, and don't publish.
2. Preview quiz as teacher, verify "draft version" warning is present
   and accessible.
3. Publish quiz, and preview again. Verify warning now says
   "published version".
4. Pull up quiz show page as student, and verify heading levels
   use H1 for title, and H2 for "Instructions" heading.

Change-Id: I6c2512e576dcb2aedaa899e17080d9c106e159ca
Reviewed-on: https://gerrit.instructure.com/77805
Tested-by: Jenkins
Reviewed-by: Davis McClellan <dmcclellan@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-04-27 19:00:31 +00:00
James Williams eed3401759 remove a bunch of unused front-end files
not a comprehensive list by any means, but these were
the ones that stood out

refs #CNVS-27773

Change-Id: I209d983155e740fe1990b8fc4b1a10167eb149d6
Reviewed-on: https://gerrit.instructure.com/75134
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-04-21 20:36:15 +00:00
Michael Brewer-Davis c9cc99d240 add conditional release UI placeholder to quiz edit
refs: CYOE-107

Test plan:
1.  Enable Conditional Release
2.  View quizzes page, including Conditional Content tab.
    All quizzes functions should still work.
3.  Disable Conditional Release
4.  View quizzes page without Conditional Content tab.
    All quizzes functions should still work.

Change-Id: I8e1798fb223cbb049e99d851a099590e39641b24
Reviewed-on: https://gerrit.instructure.com/76200
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2016-04-19 15:06:42 +00:00
Davis McClellan 21d28e738c Fix resondus soft concluded course quiz submission issue
fixes CNVS-26860

test plan:
- Create a quiz with respondus lockdown browser and lock view
  submissions enabled
- As a student make a submission to the quiz
- Try to view the student submission as a teacher
- Ensure that they are able to view it in read only mode

Change-Id: Ie86e067ea158910a99777fd194f8587e0546db03
Reviewed-on: https://gerrit.instructure.com/71075
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Product-Review: Davis McClellan <dmcclellan@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
2016-03-24 04:00:12 +00:00
Spencer Olson a38da13955 don't show 'Correct Answer' tag for graded surveys
when a teacher is viewing submissions for a graded
survey in speedgrader, there should no longer be a
'Correct Answer' flag showing for multiple choice
questions.

closes CNVS-27084

test plan:
1) Create a new quiz with the type 'Graded Survey'
2) Add a multiple choice question to the survey
3) Take the survey as a student
4) As a teacher, view the student's submission in
   Speedgrader.
5) Verify there is no 'Correct Answer' flag next to
   any of the radio buttons on the multiple choice
   question
6) Repeat steps 1-4 but make the quiz with a type
   of 'Graded Quiz'. Verify there _is_ a 'Correct
   Answer' flag on multiple choice questions.

Change-Id: Id5fe779a476d6602d8dbade88e2167f1ab99f31d
Reviewed-on: https://gerrit.instructure.com/74406
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2016-03-21 15:18:54 +00:00
James Williams 84f0e8d9f7 remove old always-on features
closes #CNVS-27699

Change-Id: I5af3d9915fef4189204283ca87cafc540ed3eed4
Reviewed-on: https://gerrit.instructure.com/73566
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-03-03 16:50:13 +00:00
James Williams c06f95d270 rails 4.2: fix controller, integration and view specs
refs #CNVS-26056

Change-Id: I854a085afc6bff640c814098956344efff65f1a7
Reviewed-on: https://gerrit.instructure.com/70658
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-22 20:01:11 +00:00