Commit Graph

303 Commits

Author SHA1 Message Date
Spencer Olson b219df063b set boolean values to false before saving if nil
closes CNVS-35932
closes CNVS-35931

test plan:

1. Create an announcement.
2. Go to the announcements index page at
   /courses/:course_id/announcements.
3. Click the settings cog and select 'Close for Comments'.
4. Verify there is no error.
5. Refresh the page and verify the announcement has been closed for
   comments (there should be a lock icon to the left of the settings
   cog).

Change-Id: Ide9559622460e59dc089291345b4c1da8f0e12d2
Reviewed-on: https://gerrit.instructure.com/106609
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Neil Gupta <ngupta@instructure.com>
2017-03-28 19:51:46 +00:00
Cody Cutrer ce21af8ecf rails 5: find and fix lots of deprecation warnings [ci verbose]
refs CNVS-34843

Change-Id: Idd523c2a7c37325381d590f1ee70c406ace2a459
Reviewed-on: https://gerrit.instructure.com/105033
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-03-16 16:03:51 +00:00
Cody Cutrer a18c89d17f ruby 2.4: fix another BigDecimal
Change-Id: I6feb98bb2d91d269d8b8611ce4be1554f4c7bff8
Reviewed-on: https://gerrit.instructure.com/105164
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-15 16:00:05 +00:00
Cody Cutrer 6751891617 rails 5: fix lots of deprecation warnings
mostly s/uniq/distinct/, and choosing a content type for render :text

Change-Id: I53a2e77d23ecc43162f70b4fd88303cc1539c20b
Reviewed-on: https://gerrit.instructure.com/104762
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-03-13 19:07:11 +00:00
Cody Cutrer d812a74977 rails 5: apis/v1 c-q
Change-Id: Ia1343f2590b87638264de5a1bf6e41eb78db4bd7
Reviewed-on: https://gerrit.instructure.com/104375
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-03-08 19:07:41 +00:00
Jeremy Stanley fe535f92c0 allow more fine-grained locking for blueprint assignments
extract :points, :due_dates, and :availability_dates
from :settings

also allow {:all => true} shorthand in restrictions

test plan: specs (fine-grained locking is not supported in the
user-interface yet)

closes MC-99

Change-Id: I885192e6828b6628e73fcf4a532dda19143dd20a
Reviewed-on: https://gerrit.instructure.com/104163
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2017-03-07 21:48:36 +00:00
Cody Cutrer 4ec005d7fc rails 5: controllers q-r
refs CNVS-34864

Change-Id: I14f590aa5b5b7e97bd240aad7feaa74298567817
Reviewed-on: https://gerrit.instructure.com/104169
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-03-07 04:08:40 +00:00
Cody Cutrer 4a6bf544f2 rails 5: fix quewstion reference data fixer
refs CNVS-34862

Change-Id: I35afac57c65947e11b0217ff5c3aca0ba17b9d14
Reviewed-on: https://gerrit.instructure.com/103677
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-02 19:59:58 +00:00
Spencer Olson fb9049324e set default values for booleans on various tables
This commit adds default values of false and not null constraints for
all boolean columns on the assignments, discussion_topics, and quizzes
tables. This commit also has a data fixup to backfill default values on
the boolean columns.

closes CNVS-34536

Test Plan:
* Do the following in a course with at least one closed grading period:
1. On the Assignments page, create an assignment with a due date in a
   closed grading period using the "+" button on an assignment group.
2. As a teacher, try to toggle the "Post to SIS" setting for the
   assignment from the Assignments page. Verify the setting changes.
3. Create a new assignment with a due date in a closed grading period
   using the "+Assignment" button.
4. As a teacher, try to toggle the post to SIS setting for the
   assignment from the Assignments page. Verify you can edit the
   setting as you toggle the button.

Change-Id: I7c799bb3b194363836d900287be90ca13805508e
Reviewed-on: https://gerrit.instructure.com/101315
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Tested-by: Jenkins
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-02-22 18:17:59 +00:00
Jon Jensen 9ac6aaaee4 spec: fix selinimum capture autoload issue, fixes SD-2103
fix a newly exposed autoloading edge case, that depends on spec run order.
given:

ConversationParticipant which autoloads:
  SimpleTags and
  Conversation (which would normally autoload SimpleTags),

when we reset autoloads and then resolve Conversation, ensure it restore
SimpleTags

also remove a weird self-require_dependency ... it's not a problem for AS,
but it is for selinimum

[ci selinimum capture]

test plan:
n/a, specs

Change-Id: I6b0193c9162a70554c997f4ed0c76690c86bf0e0
Reviewed-on: https://gerrit.instructure.com/102628
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-02-17 23:41:22 +00:00
Cody Cutrer 3eb03930e1 ruby 2.4: various fixes
* BigDecimal now validates its input, so where we don't care about invalid
   input, catch the error and return 0.0 like it did before
 * iso8601 in UTC serializes differently, so fix a spec that doesn't care
   about the serialization to be tolerant of that
 * fix some rspec-mock weirdness for both ruby 2.3 and ruby 2.4

Change-Id: Icea56eae5949e795a0c1c29dc1f4833dd885f7f5
Reviewed-on: https://gerrit.instructure.com/101039
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-06 15:46:21 +00:00
Matthew Berns 413b1c594f prevent result creation for 0 point and non-assignment quizzes
fixes OUT-506

test plan for 0 point quizzes:
- create a quiz
- create a bank and align an outcome
- add questions from the bank, making some worth 0 points
- as a student, take the quiz
- go the the learning mastery gradebook
- the gradebook should load properly
- create another quiz and add questions aligned to the bank
  (ensure quiz is set up for multiple attempts - latest score)
- make all questions worth points
- take the quiz, check the score on the LMGB
- change all questions to be worth 0 points
- retake the quiz
- the score should no longer be seen in the gradebook

test plan for ungraded quizzes:
- create a quiz and make it an ungraded survey
- align questions worth points from a bank
- take the quiz
- no result should be generated
- repeat the above steps for graded surveys
- repeat the above steps for practice quizzes

Change-Id: I3ca77249e5a978ce301fc8c83ed6c88ff9cd871a
Reviewed-on: https://gerrit.instructure.com/98195
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Cemal Aktas <caktas@instructure.com>
Tested-by: Jenkins
Product-Review: McCall Smith <mcsmith@instructure.com>
2017-01-26 15:10:34 +00:00
Cody Cutrer 6beba043bc fix some ruby 2.4 deprecations
the thread_safe gem has deprecations too, but they'll require Rails 5.1
until they're fixed (when both activesupport and tzinfo no longer
depend on it)

Change-Id: Ic53839d911ba8ed4d463d17f9dd7207673510f3a
Reviewed-on: https://gerrit.instructure.com/100499
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-01-25 21:53:37 +00:00
James Williams 8e01d17e03 master courses: link graded discussions/quizzes with assignments
should use the same migration_id + master/child content tags
so they'll be restricted/unlinked together

closes #MC-63

Change-Id: I815c76d79b7407ecbcb2bff88dea9c90188800eb
Reviewed-on: https://gerrit.instructure.com/99887
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
2017-01-19 17:25:46 +00:00
James Williams 0517c58e71 master courses: do some locked restrictions+icons for quizzes
closes #MC-62

Change-Id: I39f72492d622749d44fc6c29e96768b25f5b1a7a
Reviewed-on: https://gerrit.instructure.com/99812
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-18 14:47:37 +00:00
James Williams 0126d90e8e set inverse_of for polymorphic associations, again
basically means we don't have to reload the contexts
all the time

also make sure that inverse associations are populated
when calling temp_record

Change-Id: I2a0baefeccc814746a241f506a8f2db02aa8eebf
Reviewed-on: https://gerrit.instructure.com/99642
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
2017-01-16 20:15:20 +00:00
Landon Wilkins 7bc6743b0b Revert "set inverse_of for polymorphic associations"
This reverts commit c20d270a4a.

Change-Id: I0227de546fc7ea22efd6b2acb6b77982f52bde52
Reviewed-on: https://gerrit.instructure.com/99570
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-13 18:50:07 +00:00
James Williams c20d270a4a set inverse_of for polymorphic associations
basically means we don't have to reload the contexts
all the time

also make sure that inverse associations are populated
when calling temp_record

Change-Id: I22adf77d218f8084f76632d397161c05945cbae4
Reviewed-on: https://gerrit.instructure.com/98381
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-13 12:37:26 +00:00
James Williams 89370c5f11 remove protected_attributes
refs #CNVS-32574

Change-Id: I3ba018a7110a7530c9af4a59c97422f626a749b6
Reviewed-on: https://gerrit.instructure.com/99260
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-12 17:46:18 +00:00
James Williams 031242d031 strong params part Q
refs #CNVS-32574

Change-Id: Ifd139bf1e8296370d1d793ceed7c8e2e50440059
Reviewed-on: https://gerrit.instructure.com/94684
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-10 18:20:03 +00:00
James Williams 545057974b don't send quiz notifications to other section limited teachers
test plan:
* create two sections in a course
* have a teacher in one section with "limit privileges to course
 section" marked on
* have a student in another section
* submit to a quiz with an essay question (i.e. needs grading)
 as the student
* the other section teacher shouldn't get a notification to grade

closes #CNVS-30268

Change-Id: I4b990d46e17ca7b833b2200047589d4c4414a3fc
Reviewed-on: https://gerrit.instructure.com/96755
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-12-08 13:34:21 +00:00
Ben Rinaca 5075fc3a78 don't reject valid quiz responses
fixes CNVS-32890

an extreme edge case in quizzes that was preventing some quizzes from
recording responses for some questions.

test plan:
- in a shard that had no previous questions created in it, create a quiz
  with more than 11 questions that has OQAAT and Can't Go Back enabled;
  verify that all questions have their responses recorded and graded

Change-Id: Iff83deda18c62d6c2a9b1173fa08f908dbb56413
Reviewed-on: https://gerrit.instructure.com/93568
Reviewed-by: Hannah Bottalla <hannah@instructure.com>
Tested-by: Jenkins
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-10-28 19:58:19 +00:00
Cody Cutrer b00259b4a8 optimize and handle race conditions for generated quiz questions
fixes CNVS-32804

test plan:
 * general regression test of quiz creation and taking for quizzes
   with both inline groups, and groups pulling from question banks
 * be sure to test groups that specify more questions than are in
   the bank
 * especially more than double - it should continue duplicating questions
   when you take the quiz, to meet the number of questions allowed

Change-Id: If7f86b37928e9f83b34506b6e2ccf1772000c900
Reviewed-on: https://gerrit.instructure.com/93733
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-10-28 18:46:28 +00:00
Simon Williams 1ad2499ee9 remove confusing method User#admin_of_root_account?
the implementation was actually true if the user was an admin of any
account or sub-account in the given institution.

closes CNVS-32901

test plan:
- test multiple grading period restrictions for admins

Change-Id: Ib0a52da45d1bdf4b05dadd85003782db3bef9851
Reviewed-on: https://gerrit.instructure.com/93472
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2016-10-26 20:52:02 +00:00
James Williams f23f3b0ff2 remove rails 4.0 support
Change-Id: Id1900160375644ea33badaa9d9f9185fab6b81ac
Reviewed-on: https://gerrit.instructure.com/92726
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-10-25 17:17:22 +00:00
Jon Willesen c51b101e98 don't show module locked discussion on index page
fixes CNVS-31042

test plan:
- create and publish some discussion topics
- lock some of the discussion topics via a module various ways
- students should not see the topics that are locked for them on the
  discussions index page
- teachers should still see all the topic in the discussions index page

Change-Id: Ie6cc27c2539e5a915ce9243318f5505a04fb1e82
Reviewed-on: https://gerrit.instructure.com/91922
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2016-10-24 14:56:18 +00:00
Cody Cutrer b2e64d216a optimize speedgrader json for quizzes
fixes CNVS-32276

 * use a single query to check too many versions threshold
 * avoid instantiating AR objects for each of the quiz submission
   versions
 * avoid cloning the same quiz over and over again when we only
   need 1 field

Change-Id: I921e0bc7a2153a6eb7627a88bb8519beefeaa87e
Reviewed-on: https://gerrit.instructure.com/92123
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-10-06 21:49:42 +00:00
James Williams 8c978047f7 create assignments when importing graded quizzes
test plan:
* import the package referenced in the ticket
* it should create assignments for the graded quizzes instead
 of waiting until you publish them

closes #CNVS-32049

Change-Id: I02b5156fb617cc178c6a5b53ce98e640c1ea67da
Reviewed-on: https://gerrit.instructure.com/91033
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-10-03 16:14:05 +00:00
Gerrit Code Review 4ed051a252 Merge "Merge branch 'dev/mgp-v2'" 2016-09-29 19:23:29 +00:00
Jeremy Stanley 60213b772e include ungraded quizzes in TODO items
test plan:
 - ensure ungraded quizzes (survey or practice quizzes)
   due in the near future appear alongside graded quizzes
   and assignments in the To Do list on the dashboard
   - ensure they appear in the correct chronological
     position
   - ensure they link to the quiz properly
   - ensure the X button to remove the notification
     works properly
 - ensure ungraded quizzes are returned by the API
   "TODO items" endpoints for users and courses
   when `include[]=ungraded_quizzes` is supplied
   and that they appear in the correct chronological
   position

closes CNVS-32164

Change-Id: I216140ff9a3cada662c9fc8357de2e0ab0a8fa45
Reviewed-on: https://gerrit.instructure.com/91346
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2016-09-29 19:04:55 +00:00
Jeremy Neander c2f7d49105 Merge branch 'master' into dev/mgp-v2
Change-Id: I4b542d08b49a491db3f061f4c804aa3d6c99cebe
2016-09-26 13:25:02 -05:00
Jeremy Neander d07cb23490 prevent assignment & group deletion in closed periods
Assignments which have been assigned for at least one student in
a closed grading period must not be deletable, except by admins.
The same applies to assignment groups and quizzes.

closes CNVS-30897

test plan:
  A. create or select:
    a. an account
    b. an enrollment term for the account
    c. a grading period set for that term with:
      * a closed grading period
      * an open grading period
    d. a course with that enrollment term
    e. two students (1 & 2) for the course
    f. three assignment groups (1, 2, 3)
    g. an assignment (A) in group 1
      * due for everyone in the closed grading period
    h. an assignment (B) in group 1
      * due for student 1 in the open grading period
      * due for student 2 after the open grading period
    i. an assignment (C) in group 2
      * due for student 1 in the closed grading period
      * due for student 2 in the open grading period
    j. an assignment (D) in group 2
      * due for student 1 after the open grading period
      * for student 2 without a due date
    k. an assignment (E) in group 3
      * due for everyone in the open grading period
  B. as a Teacher in the course
    1. visit the course assignments page
      a. verify assignment A cannot be deleted
      b. verify assignment B can be deleted
      c. verify assignment C cannot be deleted
      d. verify assignment D can be deleted
      e. verify assignment E can be deleted
      f. verify assignment group 1 cannot be deleted
      g. verify assignment group 2 cannot be deleted
      h. verify assignment group 3 can be deleted
    2. visit the edit assignment page for each assignment
      a. verify assignment A cannot be deleted
      b. verify assignment B can be deleted
      c. verify assignment C cannot be deleted
      d. verify assignment D can be deleted
      e. verify assignment E can be deleted
  C. as an Admin
    1. visit the course assignments page
      a. verify assignment A can be deleted
      b. verify assignment B can be deleted
      c. verify assignment C can be deleted
      d. verify assignment D can be deleted
      e. verify assignment E can be deleted
      f. verify assignment group 1 can be deleted
      g. verify assignment group 2 can be deleted
      h. verify assignment group 3 can be deleted
    2. visit the edit assignment page for each assignment
      a. verify assignment A can be deleted
      b. verify assignment B can be deleted
      c. verify assignment C can be deleted
      d. verify assignment D can be deleted
      e. verify assignment E can be deleted
  D. create or select:
    a. an account
    b. an enrollment term for the account
    c. a grading period set for that term with:
      * a closed grading period
      * an open grading period
    d. a course with that enrollment term
    e. two students (1 & 2) for the course
    f. three assignment groups (1, 2, 3)
    g. a quiz (A) in group 1
      * due for everyone in the closed grading period
    h. a quiz (B) in group 1
      * due for student 1 in the open grading period
      * due for student 2 after the open grading period
    i. a quiz (C) in group 2
      * due for student 1 in the closed grading period
      * due for student 2 in the open grading period
    j. a quiz (D) in group 2
      * due for student 1 after the open grading period
      * for student 2 without a due date
    k. a quiz (E) in group 3
      * due for everyone in the open grading period
  B. as a Teacher in the course
    1. visit the course quizzes page
      a. verify quiz A cannot be deleted
      b. verify quiz B can be deleted
      c. verify quiz C cannot be deleted
      d. verify quiz D can be deleted
      e. verify quiz E can be deleted
      f. verify assignment group 1 cannot be deleted
      g. verify assignment group 2 cannot be deleted
      h. verify assignment group 3 can be deleted
    2. visit the show quiz page for each quiz
      a. verify quiz A cannot be deleted
      b. verify quiz B can be deleted
      c. verify quiz C cannot be deleted
      d. verify quiz D can be deleted
      e. verify quiz E can be deleted
    3. visit the edit quiz page for each quiz
      a. verify quiz A cannot be deleted
      b. verify quiz B can be deleted
      c. verify quiz C cannot be deleted
      d. verify quiz D can be deleted
      e. verify quiz E can be deleted
  C. as an Admin
    1. visit the course quizzes page
      a. verify quiz A can be deleted
      b. verify quiz B can be deleted
      c. verify quiz C can be deleted
      d. verify quiz D can be deleted
      e. verify quiz E can be deleted
      f. verify assignment group 1 can be deleted
      g. verify assignment group 2 can be deleted
      h. verify assignment group 3 can be deleted
    2. visit the show quiz page for each quiz
      a. verify quiz A can be deleted
      b. verify quiz B can be deleted
      c. verify quiz C can be deleted
      d. verify quiz D can be deleted
      e. verify quiz E can be deleted
    3. visit the edit quiz page for each quiz
      a. verify quiz A can be deleted
      b. verify quiz B can be deleted
      c. verify quiz C can be deleted
      d. verify quiz D can be deleted
      e. verify quiz E can be deleted

Change-Id: I2176904e9de96b61f31c9972c4c35b2b72367c54
Reviewed-on: https://gerrit.instructure.com/88608
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
2016-09-23 17:51:43 +00:00
James Williams 1be3e21887 show quiz descriptions to observers
test plan:
* be an observer
* should be able to see quiz descriptions (if published)

closes #CNVS-31029

Change-Id: I5f77d379c9540698fc8ee4d3f6066c846aaacccc
Reviewed-on: https://gerrit.instructure.com/90985
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-09-23 16:59:21 +00:00
Bryan Petty 5b2c7c2765 fix Download All Files for Quiz
fixes CNVS-27532

In cases where a teacher or admin has uploaded files during a Quiz
preview, their files are included in the QuizSubmission records,
but don't have an associated Submission or User.

This change excludes preview QuizSubmissions from being included
in the ZIP export.

Test Plan:
1. Create a quiz with a file upload question.
2. As a student, take the Quiz, upload a file, and submit.
3. As a teacher, preview the quiz, and upload a file.
4. As a teacher, click Download All Files on the Quiz page.
5. Verify download works as expected.

Change-Id: I1b7ff9042c4f25337b42c7a7e9d4d84a8fe2575c
Reviewed-on: https://gerrit.instructure.com/90358
Tested-by: Jenkins
Reviewed-by: Davis Lynn McClellan <dmcclellan@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-09-15 20:57:57 +00:00
Matthew Berns d745c6a73d do not generate outcome results for ungraded essay questions
fixes OUT-357

test plan:
- create two new outcomes
- create a question bank only consisting of essay questions
- create another bank consisting of a mix of essay questions
- align banks to the outcomes
- attach the banks to two separate quizzes
- as a student, take both quizzes
- as a teacher, go to the learning mastery gradebook
- there should be no outcome score for either quiz
- grade some, but not all of the essay questions
- there should still not be any outcome scores
- finish grading the essay questions
- outcome scores should now be generated
- remove a grade from one of the essay questions
- outcome score should not change

Change-Id: Ibf50842cf9a5e2e9f52214e6928e47b34323a001
Reviewed-on: https://gerrit.instructure.com/87098
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Product-Review: McCall Smith <mcsmith@instructure.com>
Tested-by: Jenkins
2016-08-26 18:20:22 +00:00
Davis McClellan 8723d04646 add error constant for answer serializers
fixes CNVS-30419

test plan:
- Try to use the error

Change-Id: Ib35904e870d3dc8456bbcac0559422d110dae05b
Reviewed-on: https://gerrit.instructure.com/88176
Tested-by: Jenkins
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Davis Lynn McClellan <dmcclellan@instructure.com>
2016-08-19 22:14:16 +00:00
Cody Cutrer b77446f732 wrap partition management in a transaction
fixes CNVS-30984

so that databases automatically unshackle

Change-Id: I0c435c10c46e046f54f7c3139f45cba758ef4a8f
Reviewed-on: https://gerrit.instructure.com/87800
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-08-16 15:00:27 +00:00
Jacob Fugal 9a077a7873 AddressBook facade
fixes CNVS-29824
refs CNVS-29862, CNVS-29867

test-plan:
  check for regressions around:

  * accessing profile#show endpoint, with profiles enabled, is
    authorized if and only if current user knows profile owner.

  * eportfolios#show, with profiles enabled, includes link to owner's
    profile if and only if current user knows owner.

  * conversations:
    - filtering of individual recipients when creating a conversation
    - expansion of context recipients when creating a conversation
    - restriction of individual recipients to those known via course
      when creating a conversation in a course
      - including as an admin over that course
    - filtering of individual recipients when adding a message to an
      existing conversation allows existing recipients

  * searching/browsing address book (conversation creation, link
    observer to students, due date overrides, etc.):
    - when loading info about single user (user_id parameter), including
      combinations of conversation_id and context parameters, returns
      user data if and only if the target is known to current user under
      those parameters
    - users matched:
      - excludes already listed users
      - restricts to users known via specified context, if any
        - including as an admin over that context
      - finds users with weak associations (e.g. invited student that
        hasn't logged in for first time yet) when linking observers
      - doesn't find users with weak associations otherwise
    - contexts matched:
      - limited to those known to current user
      - have count of known users
      - have counts of known users in synthetic contexts

  * data returned for known users in various API calls include common
    course and groups between current user and returned user

Change-Id: I66bca0921b298be8d529a713fa982a6dfdcbcc8e
Reviewed-on: https://gerrit.instructure.com/84045
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2016-08-15 15:03:56 +00:00
James Williams ac73f764d4 fix errors with quiz#root_entries_max_position when loaded
refs #CNVS-29640 #CNVS-30748

Change-Id: I78d6a0feeadd0187506ec9fc8bca13102b6d1d8b
Reviewed-on: https://gerrit.instructure.com/87136
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-08-09 12:35:16 +00:00
James Williams a814712b34 add more preloads for enrollment state
should improve state_based_on_date performance

refs #CNVS-29460

Change-Id: Iaffdefd5280b3d3c360cd96b99e171b9c2b3f63e
Reviewed-on: https://gerrit.instructure.com/86977
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-08-05 19:36:46 +00:00
James Williams 8539a6b44b allow course admins without manage rights to preview quizzes
test plan:
* create a custom teacher role with "Manage assignments/quizzes"
 disabled
* a teacher with that role should be able to see and preview
 a quiz

closes #CNVS-30574

Change-Id: Ib036b2f352c63c63fc4454e08d80d21f34415ce0
Reviewed-on: https://gerrit.instructure.com/86119
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-08-02 12:47:16 +00:00
James Williams 89ef99767a round whole integers when displaying values for formula questions
refs #CNVS-29480

Change-Id: Iacf70d606ceb2d1e768c8491f1e30f3fee1c6c2c
Reviewed-on: https://gerrit.instructure.com/84653
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-07-08 16:39:14 +00:00
Ryan Taylor f65790aa9d Respect scale settings for formula answers visualization
Previously, formula questions generated answer variable values were
always shown with at least one decimal value.  Now, they always display
with respect to the scale value used to configure the variable itself.

Closes CNVS-29480

Test Plan:
 - Set up a formula question with a 0 scale answer and see that it
   shows up without a trailing .0 in the preview or taking views

Caveat: Will not fix existing data, but only new content or updated
content.

Change-Id: I671ad8a393bc1bea24fa0addd164f0fe4558253a
Reviewed-on: https://gerrit.instructure.com/82911
Reviewed-by: Sterling Cobb <sterling@instructure.com>
Tested-by: Jenkins
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-06-24 19:16:40 +00:00
Ryan Taylor 63f4b13bec Guard against malformed formula questions in Quiz stats
Closes CNVS-29923

Test Plan:
 - Build out a graded survey with an essay question.
 - Take the quiz
 - Change the question to a formula question with an answer
 - Take the quiz
 - Try to download stats and have :success: instead of :fail:

Change-Id: Ia9ce4b00d24136b876193e345a6a72e7b70e3b7a
Reviewed-on: https://gerrit.instructure.com/82738
Reviewed-by: Bryan Petty <bpetty@instructure.com>
Tested-by: Jenkins
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-06-20 20:19:04 +00:00
Ben Rinaca def5317ece allow students in extended sections to see quiz results
if a student is in a section that ends after the
course and they are able to take a quiz, then
they should be able to see their quiz results as
well.

fixes CNVS-28696

test plan:
- other configuration options for responses and
  correct answer visibility should still be
  respected

Change-Id: Ie4fedba3a8a70665353535822a2cdbbedc1de2fc
Reviewed-on: https://gerrit.instructure.com/80227
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
Tested-by: Jenkins
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-06-17 21:41:36 +00:00
Ben Rinaca 9d8df61450 prevent non-students from taking quizzes
admins shouldn't be able to take quizzes unless
they're students or the course is public.

fixes CNVS-28380

test plan:
- check that the api for retrieving quizzes
  returns locked_for_user = true and lock_info
  when fetching quizzes as a teacher admin, but
  returns locked_for_user = false when fetching
  quizzes as a student
- check that the api for creating a quiz
  submission doesn't allow you to as a teacher
  or admin, but does allow you to as a student
- make sure that students can still take quizzes
- make sure that teachers and admins can still
  preview quizzes
- make sure that teachers and admins cannot take
  quizzes unless they are also students
- make sure teachers and admins can take quizzes
  in public courses
- students should still be able to take a quiz in
  any cases where they could take a quiz in a
  concluded course or with a completed enrollment
  (that is one where their section has ended)

Change-Id: Ia52ef6d4efd192e8ebd6ae91acb7a6308c08bd9b
Reviewed-on: https://gerrit.instructure.com/79418
Reviewed-by: Davis McClellan <dmcclellan@instructure.com>
Tested-by: Jenkins
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
2016-06-17 21:40:28 +00:00
James Williams d5305936f5 allow admins without manage rights to read unpublished quizzes
test plan:
* create an account admin role with the ability to
 "read course content"
* create a course with an unpublished quiz
* as the admin, should be able to view the quiz

closes #CNVS-29772

Change-Id: I24335946d510eaa2aa3eb0c0ae4a3bf942b522b0
Reviewed-on: https://gerrit.instructure.com/81595
QA-Review: Heath Hales <hhales@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-06-10 17:33:36 +00:00
Simon Williams e7f3ba4e62 don't explode backing up a quiz with an unknown question type
it looks like occasionally we have quiz questions with type "Error" due
to failed QTI imports.  The UI treats these as text only questions, but
a backup fails for these types of questions.

fixes CNVS-28729

test plan:
- create a quiz with an invalid quesiton type (I'm not sure exactly how
to do this. You could munge the db, or try importing a QTI quiz with an
unsupported question type and see if it just happens)
- take it as a student.
- backups should work, and shouldn't throw errors

Change-Id: Ib8ec5839ddc9a178fc5a0753b9588f083b61de47
Reviewed-on: https://gerrit.instructure.com/77080
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Tested-by: Jenkins
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2016-06-08 20:01:09 +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
Cody Cutrer f71a829b47 partition versions
closes CNVS-29133

test plan:
 * run the migrations
 * inspect your database; there should be versions_0, versions_1,
   versions_2 tables.
 * drop versions_2 manually
 * run Versions::Partitioner.process
 * versions_2 should be created again, and have the proper indexes
 * use pieces of canvas that rely on versions; nothing should be broken

Change-Id: I3211fdd3fd1716b8a7e6c6f7553a6e49cc6e39bb
Reviewed-on: https://gerrit.instructure.com/80214
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-05-27 17:22:10 +00:00