Commit Graph

6 Commits

Author SHA1 Message Date
Dave Donahue 8a42d8c035 make course progress API more resilient
fixes CAT-517

Issue: The information stored in ContextModuleProgression#requirements_met
is not always completely accurate due to edge cases that result from
moving module items between modules. This was leading to cases where
the value returned by the API for requirement_count was actually lower
than the requirement_completed_count. This fix makes it so that duplicate
requirements_met are filtered out.

Test plan:
 1. As a teacher, make a couple of Modules and add a couple Module Items
    to each. Set up completion requirements and require sequential progress.
 2. As a student, complete a couple of module items.
 3. Verify the info returned from the course progress API is as expected.
 4. As a teacher, shuffle module items around a bit (e.g. move items from
    Module 1 into Module 2).
 5. As a student, complete the same module items you completed before.
 6. Ensure the info returned from the course progress API still reflects
    actual student progress.

Issue #2: A module with no requirements should not cause an API error.
Issue #3: A module structured as follows:

 Module [published]
  Module Item 1 [unpublished]
  Module Item 2 [published]

Should return a next_requirement_url for Module Item 2, rather than nil.

Change-Id: I93ad9e3877ca56806f87c71207e156731510033b
Reviewed-on: https://gerrit.instructure.com/40942
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2014-09-23 17:39:22 +00:00
Michael Nomitch 506e786db4 DA - modules
fixes CNVS-14095
fixes CNVS-15157

test plan:
  - with DA on and off
    - go to modules page
      - only the right assignments show
      - completion requirements ignore
        assignments that cant be seen by a user
    - modules page works with changing sections
      - complete/incomplete updates properly
      - as does locked/unlocked
    - modules page shows correct content when
      a students grade is deleted and this makes
      them lose assignment visibility
    - modules api doesnt return any content that
      a student cannot see

Change-Id: Ia1acfd919214823cdfc3b45e974876b4529bb14d
Reviewed-on: https://gerrit.instructure.com/38970
Product-Review: Hilary Scharton <hilary@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
2014-09-22 21:23:44 +00:00
James Williams 81558f728c remove rails 2 support
closes #CNVS-14261

Change-Id: I1b0e8a4438ab659ecd1ac8462bc3559d810989b3
Reviewed-on: https://gerrit.instructure.com/38744
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-08-06 18:16:19 +00:00
Landon Wilkins 8f9d33a9ae ignore unpublished module items for course progress
fixes CAT-79

test plan:
1. Enable Draftstate on a course that has gallery set up
2. Set up a module with multiple module items
3. unpublish some of the module items ( individually)
* verify that the "requirement_count" adjusts to the
* unpublishing of items for the following endpoint:

/courses/:course_id?include[]=course_progress

Change-Id: I092b8c7a76a1abf4b05bd0a0ed654bee98de0217
Reviewed-on: https://gerrit.instructure.com/35654
Reviewed-by: Jeff Belser <jbelser@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-06-02 22:56:46 +00:00
Dave Donahue 19c973ef4c course progress API fix for deleted/unpublished module items
fixes CNVS-12769
fixes CAT-157

Test plan:
  1. Create a module with a few module items and set up
     completion requirements for them. Also be sure to require
     sequential progress.
  2. Hit the course progress API for that course and verify
     that the next_requirement_url points to the first module
     item.
  3. Delete the first module item.
  4. Hit the API again and verify that the next_requirement_url
     points to the next module item, not the one that was deleted.

Change-Id: If77ed034f897507f45b15e623fdbe2c1c8ab9208
Reviewed-on: https://gerrit.instructure.com/34082
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-05-03 04:39:44 +00:00
Landon Wilkins 4e08f0f7f3 adds completed_at to course_progress API
fixes CNVS-12257

test plan:
* set up a course with modules, module items
** and module completion requirements
* on each module, check the box that says:
** "students must move through requirements in
**  this module in sequential order"
* enroll a user in the course
* with that user's ACCESS-TOKEN, perform:

curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X GET -F 'include[]=course_progress' \
         <canvas>/api/v1/courses

* verify there is a completed_at field in the
** course_progress response
* verify that the completed_at field is nil unless
** the user has completed all the completion_requirements
** for all the modules
* if the user has completed all the completion_requirements
** for all the moduels, the completed_at date should be the
** date associated with the last thing the user did to complete
** the course.
* for example, if the last item is submitting an assignment,
** the completed_at date should be the submission date of that
** assignment
* verify that courses with 0 completion_requirements return
** nil for completed_at date

Change-Id: I6dfd6c7ec4168317cdcac0be13de52e9111f8c13
Reviewed-on: https://gerrit.instructure.com/32983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-14 15:17:15 +00:00