Commit Graph

4 Commits

Author SHA1 Message Date
Jeremy Stanley c8666ec187 check for valid module_item_id
test plan:
 - add a discussion topic to a module
 - click on it
 - you should be looking at a URL like
   /courses/1/discussion_topics/123?module_item_id=456
 - change the module_item_id to something that isn't
   a valid id and reload the page
 - you should not get a page error

fixes CNVS-1870

Change-Id: I1a9d492131d8001e5a823c82a54febc6de6ea9ed
Reviewed-on: https://gerrit.instructure.com/29342
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-01-28 22:58:11 +00:00
Mark Severson df82a1efc4 change available_for? and locked_for? to be more consistent
test plan: no functional change

refs #CNVS-5837

Change-Id: I07d942840e30df15883d484fcc4c6d0f86ff477d
Reviewed-on: https://gerrit.instructure.com/21156
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-06-07 21:41:21 +00:00
Jeremy Stanley 909ef9ba75 don't preload all a module's progressions
because there could be lots of them in a mooc, and we're generally
not interested in any of them except those belonging to the
current user

also, tear out the expensive uncollapse! no-op

fixes CNVS-4312

test plan:
 - module progressions/collapsing/uncollapsing should work
 - modules page performance as a student (rendering time,
   completing requirements) should not collapse when lots
   of other students are enrolled

my own performance test results for modules page rendering
are as follows:

3 small modules, 10000 progressions each, total of
30000 progressions:
 before: 5.52 seconds
 after:  1.38 seconds

4 modules (the above, plus a 1000-item module; total of
40000 progressions:
 before: 8.55 seconds
 after:  4.35 seconds

(average of 5 page loads, timed by chrome's developer tools,
 clearing cache between sets, and discarding the initial
 page load after clearing the cache; mostly to discount
 the megabytes of javascript being downloaded)

Change-Id: Ic0f59e38928305ac7fd8c61943fa08cf92eae822
Reviewed-on: https://gerrit.instructure.com/18296
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-11 08:41:32 -06:00
Brian Palmer 73380d2bc8 allow using an item in modules more than once
closes #8769

An item can be added to multiple modules, or even the same module more
than once. This is especially useful for attachment items, but is also
useful for allowing multiple paths through a course, with say an
assignment in two different modules and the user only has to complete
one of the two modules.

test plan:

For an item in only one module, verify that the module navigation still
appears if you go straight to that item's page, without going through
the modules page.

Add an item to more than one module. If you visit that item from the
modules page, you'll see the right nav depending on which instance of
the item you clicked on. If you visit the item directly without going
through the modules page, you'll see no nav.

Lock one instance of the item by adding a prerequisite, but leave the
other unlocked. You can still see the item as a student.

Lock all instances of the item with prerequisites. The item will now be
locked and you can't see it as a student.

Add completion requirements to the item, such as a minimum score on a
quiz. Make the requirements different -- 3 points in one instance and 5
in the other, for instance. Verify that if you get 3 points on the quiz,
one item is marked as completed but the other isn't, as expected.

Rename the item. Verify that all instances of it in modules get renamed.

Change-Id: I4f1b2f6f033062ec47ac34fe5eb973a950c17b0c
Reviewed-on: https://gerrit.instructure.com/11671
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-06-21 10:12:22 -06:00