Commit Graph

44 Commits

Author SHA1 Message Date
James Williams c23210564c use rails 4.2 preloader format
closes #CNVS-26031

Change-Id: I2e0351fb62e5a06b47fe8c6c3dd503318d29a7ad
Reviewed-on: https://gerrit.instructure.com/69228
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-12-30 14:58:10 +00:00
James Williams 1c549bfc82 fix incorrect override caching through upcoming_events
test plan:
* make sure the dashboard sidebar has correct due dates
 for overridden assignments

closes #CNVS-23993

Change-Id: I09ab704768b51aebe294515aad1791340b51f67f
Reviewed-on: https://gerrit.instructure.com/66467
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Jason Carter <jcarter@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-11-09 20:47:47 +00:00
James Williams 5ea6881b47 performance improvements for dashboard sidebar
and some other things too

test plan:
* regression test around the dashboard sidebar

closes #CNVS-22776

Change-Id: I46f1bd4476ca9aba27d41a4ce725c7dc2ee00dc5
Reviewed-on: https://gerrit.instructure.com/66056
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Ryan Allen <rallen@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-10-30 13:08:21 +00:00
James Williams 2dad511048 preload attachments in calendar events public feed
test plan:
* basic regression test the calendar events public feed api

closes #CNVS-22774

Change-Id: I0a21788d25c63b404a4c6410f5d01e785bed1ed8
Reviewed-on: https://gerrit.instructure.com/62941
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Charles Kimball <ckimball@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
2015-09-21 14:22:26 +00:00
James Williams df8399a834 performance improvements for assignment overrides, etc
- preload context module data for student assignments
 in calendar_events_api (improves locked_json)
- preload adhoc assignment overrides
 (i.e. assignment_student_overrides) instead of doing
 N+1 queries
- search the preloaded assignment_overrides when possible
 instead of calling yet another query

test plan:
* regression test assignments api index, assignment groups
 api index, calendar events api index, in particular
 with regards to assignment overrides

refs #CNVS-22774

Change-Id: I5c027e346c733ce0dac2fcd702c5272ff861d1b3
Reviewed-on: https://gerrit.instructure.com/62892
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Charles Kimball <ckimball@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
2015-09-21 14:22:16 +00:00
James Williams d0689a15a2 improve performance in assignments/assignment groups api index
test plan:
* assignments and assignment groups api index should
 work as before

closes #CNVS-22864

Change-Id: I4b72f0fd5d5a8dc40a7669ee3929c60ddc401114
Reviewed-on: https://gerrit.instructure.com/62851
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Charles Kimball <ckimball@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
2015-09-21 14:22:05 +00:00
James Williams 6278d9e17a consolidate usages of TempCache into RequestCache
refs #CNVS-21317

Change-Id: I60016fd04109605d4324d5b184d5c0f7afa2515e
Reviewed-on: https://gerrit.instructure.com/60583
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-08-13 19:33:15 +00:00
James Williams eab9eea95f misc improvements for assignments, calendar events and modules
test plan:
* syllabus should work as before
* modules loading of assignment due dates should work
 as before
* assignments api should work as before

refs #CNVS-21476 #CNVS-21317

Change-Id: Iba183d6fda604acb29e9685f0f32be74ad27b898
Reviewed-on: https://gerrit.instructure.com/57215
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-06-29 15:45:27 +00:00
Michael Nomitch 85a8669a56 speed up assignment index loading
fixes CNVS-16556

test plan:
  - assignment index loads fine as teacher & student
  - as does the gradebook
  - as do calls to the assignment group api

Change-Id: Iff2fe084c15500f1dd232606f9182df328c76988
Reviewed-on: https://gerrit.instructure.com/43511
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Reviewed-by: Matt Berns <mberns@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-11-04 16:18:28 +00:00
James Williams b5db0a7368 fix assignment overrides double caching on update
test plan:
* due dates should not intermittently fail to update
when updating

fixes #CNVS-13067

Change-Id: Ie4faf3112c847c4e969ae59e4c782466b94a2f84
Reviewed-on: https://gerrit.instructure.com/39535
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-08-20 18:27:07 +00:00
Nick Cloward e9595976c1 clean up permission calls for grants_rights?
refs: CNVS-11425

Change-Id: Ia0145e4b4d1da9e0f83a1845647ce203b3586057
Reviewed-on: https://gerrit.instructure.com/34280
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-19 18:10:30 +00:00
Cody Cutrer 7e5bc3ea24 remove unused switch_role functionality
this was replaced a long time ago by test student

Change-Id: I20981ada3e72df82da89d5bae1b81a3b31cfac66
Reviewed-on: https://gerrit.instructure.com/36309
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-12 22:03:07 +00:00
Jacob Fugal 2120e218f4 pass all overrides to current_override_version
when the assignment (or quiz) is a past version, it may have been
overridden by an override that was active then, but deleted now. don't
filter it out (based on deleted now) before letting
current_override_version look at it.

Change-Id: I072d24773a43f0ebfac6c463b5a820b553f056a3
Reviewed-on: https://gerrit.instructure.com/35116
Reviewed-by: Liz Abinante <labinante@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-06-10 16:04:52 +00:00
Michael Nomitch afd21dedea designers and TAs can see same overrides as teachers
fixes CNVS-7852

test plan:
  - as teacher create an assignment with different due dates for
    a couple sections
  - as a TA that is limited to one section
  - in the assignment index you can see all due dates
  - in the assignment show page you can see all due dates
  - in assignment edit page you have same access as a teacher
    - changing dates works as expected

Change-Id: I3616751d7158fa3252852fc78be40cb660fe9cf4
Reviewed-on: https://gerrit.instructure.com/35190
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Coraline Ehmke <coraline@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-23 18:22:12 +00:00
Liz Abinante e04a49235e AssignmentOverrides refactor
fixes CNVS-10793
fixes CNVS-12360

test plan
=========
- assignment overrides should still work
- general regression of assignment#new, #edit, quizzes#new, #edit, discussions#new, #edit
- check API end points for above overrides

Change-Id: I211ad888ac14d7e863ab67bfcb27d56a85e62aac
Reviewed-on: https://gerrit.instructure.com/29980
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
2014-05-16 21:12:45 +00:00
Cameron Matheson 8a1aea0c39 rails3: fix override timestamps
Change-Id: I5647ecdad8023dad1d5e463c6dbb8e2e1b927d33
Reviewed-on: https://gerrit.instructure.com/30856
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2014-02-26 00:18:58 +00:00
Joshua Simpson 1e81ea7caa move quiz into quizzes namespace as a precursor to enginifying
fixes CNVS-10679
this commit refactors quiz into a quizzes namespace. it contains various
shims to facilitate the data migration of polymorphic relationships
('Quiz' -> 'Quizzes::Quiz').  JIRA contains several tickets linked to
the above tickets in regards to removing these shims after the data
migration, as well as the strategies on reverting the shims once the
data migration is complete.
Change-Id: I30c566d60a87af6ee83e9d0041fdcb909ead6a89
Reviewed-on: https://gerrit.instructure.com/28573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-01-24 00:08:46 +00:00
Cody Cutrer 169d6e2ae6 copy preloaded associations for overrides in rails version agnostic way
Change-Id: I690956a1cc56d94af71ff68512894e48bbe28cab
Reviewed-on: https://gerrit.instructure.com/28723
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-20 17:22:11 +00:00
Cameron Matheson 20e43be542 kill another version_number in cache key
refs CNVS-6763

Test plan:
  assignment due dates should display properly after updating an
  assignment's overridden due dates

Change-Id: I3f066444dc969b4ee0cd30fe823278852216ae1e
Reviewed-on: https://gerrit.instructure.com/28798
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2014-01-17 21:24:18 +00:00
Cameron Matheson b4f7bb0daa don't include assignment version_number in cache key
fixes CNVS-9776

The version number isn't necessary since we still have updated_at
(having the version number requires a query for every assignment).

Test plan:
  * make sure assignment overrides still work (sorry)

Change-Id: I909494d1b7bde237a3b66db8ae987f61cdd6c024
Reviewed-on: https://gerrit.instructure.com/26793
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-12-03 00:53:37 +00:00
Cameron Matheson 8ee71f6077 cheap hack to skip overriding assignments
refs CNVS-6747

Test plan:
  * Make sure the new assignments index page still shows correct dates
    (test in a course that has assignments with and without overrides)
  * Test the assignments index api action and make sure it returns the
    right dates too

Change-Id: Ibb6baaa5009fe95b68e160af2fb4e91d5ac8ef37
Reviewed-on: https://gerrit.instructure.com/22612
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-07-26 21:43:01 +00:00
Cameron Matheson 28e9eea66b stop needlessly re-querying CourseSection overrides
refs CNVS-6747

Test plan:
  make sure teachers still get the correct due date when an assignment
  has course section overrides and a default due date

Change-Id: I6ad9f99bc4558c7f1d6a48c93fbd13426d2fe409
Reviewed-on: https://gerrit.instructure.com/22531
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-07-23 17:54:46 +00:00
Cameron Matheson b6f62cf0bf copy pre-loaded associations to overridden clones
We would lose any included assocations on an assignment after
overriding due to ActiveRecord::Base#clone.  This just copies all the
loaded assocations back over.

refs CNVS-6747

Change-Id: I6496ad1eee257a6745edc6d8f69f9627993e9983
Reviewed-on: https://gerrit.instructure.com/22497
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-07-23 17:54:28 +00:00
Cody Cutrer 5d16bd674b minor optimizations around simply_versioned
refs CNVS-5805

first, don't do a count if we're just going to load the whole association anyway

second, don't use empty? on an association - that does a count. instead you
should use exists?, but the next branch does another query anyway that
would tell us the same information, and still only query one row

test plan:
 * basic regression testing around versioned models (assignments, overrides,
   wiki pages, etc.)

Change-Id: I9d29eacbaa67dbc267ee09400d62651ef6ccdc0a
Reviewed-on: https://gerrit.instructure.com/20901
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-18 21:05:27 +00:00
Brian Palmer 02e8efdcd7 skip checking override versions when not needed
if we're dealing with the actual assignment/quiz instead of the model
from one of its versions, we don't need to align the history of the
overrides with the history of the assignment/quiz. we can just use the
most recent version of each override.

refs CNVS-5805

test plan: existing specs cover that this optimization doesn't break
reading overrides of older versions

Change-Id: I52d55da0619688744d63d6523e1bc055ecdaa667
Reviewed-on: https://gerrit.instructure.com/20813
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-05-23 20:46:49 +00:00
Simon Williams c94efe04f2 fix override applicator if students don't have :read_roster
fixes CNVS-5650

test plan:
- go to the root account permission page and turn off "see the list of users"
  for students
- then create an assignment with only overrides (no default)
- the students should see the due date

Change-Id: I518f651db96b14509c997628575834943042117f
Reviewed-on: https://gerrit.instructure.com/20395
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-05-08 03:20:27 +00:00
Duane Johnson 9c54523309 make assignment_override_applicator cacheable
Currently, when an Assignment is replaced by a cloned version via
AssignmentOverrideApplicator, the new object is a singleton and there-
fore cannot be serialized / cached.

This patch removes the creation of the singleton and uses instance
variable @new_record to get the same effect.

Refs CNVS-5253

Change-Id: Id26377b6f9c4cd226d0144ccaf33452de1148050
Reviewed-on: https://gerrit.instructure.com/20158
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
2013-04-30 15:42:12 +00:00
Cody Cutrer 5ffbcbeb05 arel-ify lib
excluding api_find, which needs more work

refs CNVS-4706

Change-Id: I013d0660ff2b8dbe2abf6a5c973bd1203f432f99
Reviewed-on: https://gerrit.instructure.com/18921
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 19:12:22 +00:00
Cameron Matheson fb6fd951f9 set correct due_date for teachers on vdd assignments
closes CNVS-3756

Test plan:
  make sure assignment show up in the correct section of the page in
  /assignments for the following configurations:
    * no overrides
    * has a section override due date before the assignment due date
    * has a section override due date after the assignment due date

Change-Id: I7681416a102c9d8078f433fb03f8667cf2647e98
Reviewed-on: https://gerrit.instructure.com/17968
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-03-01 13:33:49 -07:00
Stanley Stuart bb3b65395a add varied due date editor to quiz edit page
test plan:
  - new specs should pass
  - go through and make sure assignment overrides work
    for quizzes by using the editor on the quiz
    edit page.

fixes CNVS-469

Change-Id: I6b647575bb7db34235b2a1742558f6274b2605fc
Reviewed-on: https://gerrit.instructure.com/17437
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-02-28 10:26:06 -07:00
Stanley Stuart fe4cbf8ee9 add varied due date functionality to the assignments edit page
closes CNVS-747

test plan:
  - go to the assignments edit page
  - you should be able to create new assignment overrides as a teacher
  - you should be able to update existing assignment overrides as a
    teacher
  - make sure you are able to delete assignment overrides
  - make sure that using the "add due date" button, you cannot add more
    overrides than the number of the sections of the course + 1 (the +1
    is for the due date representing everyone else.
  - make sure that you can not remove the last override when hitting the
    remove buttons to the right of overrides when you have more than one
    override.
  - make sure the remove button disappears when you only have one
    override, and reappears when you add an override.
  - ensure the dates you enter on this page propogate to the assignments
    show page and other areas of Canvas.

Change-Id: I974924797d9d4783c7f6ae93a25c356112fc0f54
Reviewed-on: https://gerrit.instructure.com/17342
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-02-12 13:23:22 -07:00
Joel Hough f15fd0bb2a make observers viewing discussions vdd lock date aware
fixes CNVS-518

also included:
- observers now get visible students' section overrides in their
  AssignmentOverride.visible_to scope
- fixed a bug where calling some DatesOverridable methods would
  use an overridden date where you wouldn't expect (see the specs)
- added a method to get the original object from an overridden one
- made DiscussionTopicPresenter handle due dates overridden to nil

test plan notes
- keep an eye out for regressions in displayed due dates
- discussion locking behavior should be as follows
-- viewing the discussion page before the earliest applicable
   unlock date should show a locked discussion page that lists
   the earliest unlock date
-- viewing the discussion after the earliest unlock date should
   show the discussion
-- the discussion page should show the due date when only one
   due date applies
-- the discussion page should show a "multiple due dates" ui when
   more than one due date applies
-- the "multiple due dates" ui should only display entries for
   sections that the observer's linked students are in
-- the "multiple due dates" ui should display lock dates from the
   associated section override or from the original assignment
   if the section override does not override lock dates

test plan
- check an observer not observing student
-- ensure that the discussion locking behavior behaves according
   to the observer's section's override
- check an observer observing one student
-- ensure that the discussion locking behaves according to the
   student's section's override
- check an observer observing multiple student's in more than one
  section
-- make overrides for each student's section that differ in due
   dates and lock dates
-- ensure that the discussion locking behaves according to the
   students' sections' combined lock dates
-- ensure that the discussion page shows a "multiple due dates"
   ui when the discussion is unlocked

Change-Id: I8f2970f0962cdc60cf9a423f01a876bf0ae909d4
Reviewed-on: https://gerrit.instructure.com/17452
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2013-02-08 16:30:20 -07:00
Dave Donahue 8e039da53f vdd: fix override behavior for guests
Fixes #CNVS-2017

Notes:
* Previously, code assumed a user would always be present,
  but this is not so for public courses with anonymous users
* Handles nil user cases in DatesOverridable and
  AssignmentOverrideApplicator

Test plan:
1. Create a public course.
2. Create an assignment with a default due date
   and one or more overrides.
3. View the assignment as a guest. The default due
   date should be displayed.

Change-Id: I5e4907dd52636816c6dccabc3acdbb138c638f27
Reviewed-on: https://gerrit.instructure.com/16817
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-01-16 14:19:00 -07:00
James Williams 0213df2487 use assignment overrides for all sections on student view student
test plan:
 * create section overrides for an assignment
 * enter student view
 * the latest override across all sections should be
reflected in views where vdd has been implemented

closes #CNVS-388

Change-Id: I22d02e228c596d431835117383d12c7311f13a7a
Reviewed-on: https://gerrit.instructure.com/16529
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-01-11 15:13:07 -07:00
Dave Donahue 6ab15d087b bug: if override due date is before default due date on an assignment, it is not applied
fixes #CNVS-2309

Problem:
Overriding a due date to be earlier than the default was having no
effect because the default date was getting lumped in with the overrides
and treated the same way when deciding which to use.

Solution:
If there are applicable overrides, don't take the default into account.

Notes:
The issue was happening as a result of the way the VariedDueDate class
indiscriminately lumped due dates together and returned the last one.
Part of the solution was removing the VariedDueDate class and instead
relying on the override methods on an Assignment. This was done not
only to fix the bug at hand but also to move toward a more consistent
interface for handling varied due dates.

Change-Id: If9d24725a19b134d5d92d3a5c08d6794f466fa9c
Reviewed-on: https://gerrit.instructure.com/16406
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2013-01-09 09:37:00 -07:00
James Williams e41401f45c use overridden due dates on modules page
indicates multiple overridden due dates on multiple sections if
they are visible to a teacher/ta/designer

if there are different dates, it sends all the information back
this json info can be used in the future for a detailed popup

but for now, simply indicate with text that there are
multiple due dates for the assignment

if they are a student, then only show them the latest override
that applies to them

test plan:
* create an assignment
* create a module, add the assignment as an item
* create another course section
* override the assignment date for one section,
then override it to another date for the other section
* go to modules page, should see "Multiple Due Dates"

* create a ta/teacher/designer/student, restrict them to one section
* login as the ta/teacher/designer/student, should see one due date

closes #CNVS-2010 #CNVS-2011

Change-Id: Ieab089a27e4e4e7bea26b1c597859bf8b77dc802
Reviewed-on: https://gerrit.instructure.com/16401
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-01-04 15:34:43 -07:00
Joel Hough a9626310f8 make [quiz|assignment].locked_for? vdd aware
fixes #CNVS-517
fixes #CNVS-761

test plan
- start with a course with students in different sections
- create a quiz with a lock date that locks the quiz currently
- create a lock date override that unlocks the quiz for one section
- ensure that a student from a section that the override does not apply to
  does see a lock icon on the course's quizzes list for the quiz
- ensure that a student from the section that the override does apply to
  does not see a lock icon on the course's quizzes list for the quiz

Change-Id: Ic1f553818ff106e1d29a8f1b66d8445b99aecffc
Reviewed-on: https://gerrit.instructure.com/16228
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-12-21 10:38:06 -07:00
Dave Donahue 3b3b746cca vdd backend for quizzes
[Fixes #CNVS-1145]

* Adds support for attaching AssignmentOverrides to quizzes
* Links common overrides for Assignments that belong to Quizzes
  so quiz.due_dates_for(user) == quiz.assignment.due_dates_for(user)
* Moves common functionality for VDD out of the Assignment model
  and into the DatesOverridable module, which is now included on
  Quiz for a consistent interface

Test plan:
* Run through a few of the old VDD scenarios and verify things
  still work as expected since a lot of code has shifted around
* No interface changes have been made to quizzes yet, so nothing
  to check there

  https://gist.github.com/f12b3694016f3dcc979e

Change-Id: I32b4a54273f90fac689e05174039b8efc952dd39
Reviewed-on: https://gerrit.instructure.com/16028
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2012-12-18 14:28:34 -07:00
Dave Donahue cf16537d09 optimize varied due dates for when there are no overrides
[Fixes CNVS-1945]

Previously, we were executing a lot of unnecessary queries
in AssignmentOverrideApplicator#overrides_for_assignment_and_user
when the end result was coming up as an empty array in the case
of no overrides. We can predict this outcome by simply checking
if an assignment has overrides before trying to determine if a user
has matching enrollments.

With caching disabled for this method, hitting the assignments
listing as a student with 5 assignments and no overrides ran 46
queries. With this change, only 27 queries are made (41% fewer).

Change-Id: I42d6c81fe1a271e5fdea89e148417833312c83c3
Reviewed-on: https://gerrit.instructure.com/15838
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2012-12-06 12:48:35 -07:00
Zach Pendleton 1679ef30da include assignment override information in calendar api.
fixes #11752, #11753, #11758

this commit creates calendar events for every assignment
due date visible to the current user. this means that
students now see the due date that applies to them.

this commit also paves the way for proper override display
for teachers/admins/tas/observers.

test plan:
  * create an assignment with an overridden due date that
    applies to a student;
  * as the student, navigate to calendar and verify that
    the assignment is only displayed w/ its override date;
  * as the student's teacher, navigate to your calendar,
    view the API response, and verify that the overridden
    assignment displays once for each due date. also verify
    that the overridden assignment response has an
    "assignment_override" key.

Change-Id: I9d9ebd036425c155cb4ad7bf24f11f788b4f59f0
Reviewed-on: https://gerrit.instructure.com/15314
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2012-11-27 09:51:35 -07:00
Stanley Stuart 1a2779eb12 add varied due date functionality to the main assignments page
test plan:
  REFERENCE:
    * "Main Assignments Page": "localhost:3000/assignments", or click on
    "Assignments" in the menu bar near the top of the page.
    * "Right Side Bar": Go to the Main Assignments Page, it's on your
    right.
    * "Course Assignments Page": Hover over "Courses" in the menu bar
    * near the top of the page, click on the course you set up. Once
    that page loads, click on "Assignments" tab on the left hand side.
  STEPS:
    * https://gist.github.com/f12b3694016f3dcc979e

Change-Id: I9a5884ec1057f196ba5b731a2978c874141bec5b
Reviewed-on: https://gerrit.instructure.com/15006
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-11-09 23:21:44 -07:00
Jacob Fugal a75f34148e VDD: use most lenient due_at/lock_at/unlock_at
instead of "most specific"

Change-Id: I0b585de78dfb8ed7597e326610856aec331ed9f6
test-plan:
 - create an assignment with a section override and an adhoc override,
   and a student to which both overrides apply
 - set the assignment's due_at and the section override's due_at, then
   set the adhoc override's due_at to be later than both the section
   override's and the assignment's; the value of
   assignment.overridden_for(student).due_at should be that of the adhoc
   override
 - set the section override's due_at later than the adhoc override's;
   the overridden due_at should be that of the section override
 - set the adhoc override's due_at to be nil (but still overridden); the
   overridden due_at should be nil
 - set the adhoc override's due_at back later than the section
   override's and set the assignment's due_at to nil; the overridden
   due_at should be the adhoc override's
 - overridden all_day and overridden all_day_date should track with the
   overridden due_at
 - repeat for unlock_at and lock_at, but expect the *earliest* date for
   unlock_at, rather than the latest
Reviewed-on: https://gerrit.instructure.com/14853
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
2012-10-31 15:16:49 -06:00
Jacob Fugal be6093f9cd VDD: Assignment#due_dates_for(user), et al.
a convenience method to get all due dates applicable to and/or visible
to a specific user for an assignment. new named scopes on
AssignmentOverride to facilitate it, and minor bug fixes

Change-Id: I7f400fd13b7903b362e9ca0e6991f1d287f5f783
Reviewed-on: https://gerrit.instructure.com/14581
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-23 09:06:30 -06:00
Jacob Fugal 9441925122 VDD: efficient application of assignment overrides
refs #10831

test-plan:
 - create a course, student, and assignment
 - create an assignment override that applies to the student
 - the return value of assignment.overridden_for(student) should act
   just like assignment, but with the overridden values in place
 - the overridden assignment should not be able to be saved
 - create multiple assignment overrides that apply to the student
   (adhoc, group, sections, etc.)
 - the overrides should be applied in the correct order
 - overrides that don't affect a field should let lower priority
   overrides affect it
 - create an override and then delete it (without changing the
   assignment version in between)
 - the override should not apply
 - create an override, then bump the assignment version, then delete the
   override
 - the override should apply to the old version of the assignment but
   not the new one
 - bump the assignment version, then create an override
 - the override should apply to the new version of the assignment but
   not the old one

Change-Id: Ib632903640cb8aeae5bbc8959c244f6923690f29
Reviewed-on: https://gerrit.instructure.com/14135
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-17 12:47:50 -06:00