Commit Graph

540 Commits

Author SHA1 Message Date
James Williams 349e411315 allow teachers with concluded enrollments to view hidden tabs
test plan:
* create a course with a teacher
* set the enrollment term end date for teachers
 in the past
* teachers should still be able to all tabs on
 the left-hand side inside the course (including
 the files tab)

closes #CNVS-13353

Change-Id: I1ee41567edb1fad7620f18e7b822c47f09e2ab38
Reviewed-on: https://gerrit.instructure.com/49998
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-03-09 20:35:23 +00:00
Cameron Matheson 6036360b79 turnitin: use a unique identifier for courses
fixes CNVS-17473

Test plan:
  * create two new shards
  * create a course in each shard (the courses should both have id 1)
  * in the rails console, try course.turnitin_id for each shard.  they
  * should be different

Change-Id: I70892e35eb53b32ede26cd00505142962c9785be
Reviewed-on: https://gerrit.instructure.com/49196
Tested-by: Jenkins
Reviewed-by: Strand McCutchen <smccutchen@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2015-02-27 22:05:18 +00:00
Michael Nomitch a1315792db DA - public users scopes not filtered
fixes CNVS-18595

test plan:
  - make a course with DA on and some assignments
    only visible to certain sections
  - make it public to all
    - when logged out you can see all the
      assignments on the index page
    - when logged in as a user, DA filters assignments
      out of the index page by section (like normal)
  - make it public to authenticated users
    - when logged in as a user enrolled in the course,
      DA filters assignments out of the index page
    - when logged in as a user who is NOT enrolled,
      you see all the assignments on the index page
    - when logged out you cant access this page
  - make it a private course
    - when logged out or logged in as a student NOT in
      the course you cant see the assignment index
    - when logged in & enrolled DA filters like normal

Change-Id: Id9b19883baab20b4aa871d61ecf29620a5212d05
Reviewed-on: https://gerrit.instructure.com/49176
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-02-27 20:03:06 +00:00
James Williams 09b2d1a7f5 touch content after changing course public visibility settings
also fixes an issue with logging false setting changes

test plan:
* create a course with content (assignments, quizzes, etc)
* set the course as public
* in another browser/incognito window should be able to view the
 content
* in the course settings, turn off the public setting
* refresh the content pages in the other window
* should be unauthorized now (i.e. it didn't cache the setting)

(bonus test)
* enable "Disable comments on announcements" for the course
 (under the more options section)
* after refreshing, save another change to the course
* check the course activity logs in the account admin tools
* should not have logged a false change to the course settings

closes #CNVS-18580 #CNVS-18656

Change-Id: I65e4169ecb158207cd52126c31c52cf93a4a7cae
Reviewed-on: https://gerrit.instructure.com/49165
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2015-02-26 12:37:48 +00:00
Cameron Matheson b51cc5d09f add logging around grade recomputation
Change-Id: I8fda274034d0815a4ed0f90a79946beed13b1f9f
Reviewed-on: https://gerrit.instructure.com/48780
Tested-by: Jenkins
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-02-19 22:12:49 +00:00
Simon Williams d7d9d0baf9 properly hide discussions tab if unused
If there are no discussions and if student's cannot create discussions,
then gray out the discussions tab for teachers and hide it for students.

closes CNVS-6542

test plan:
- create a new course
- the discussions tab should not be hidden (where hidden means grayed
  out for teachers and invisible for students)
- in course settings, disallow students from creating discussions
- the discussions tab should now be hidden
- create an announcement as a teacher
- the discussions tab should still be hidden
- create a discussion as a teacher
- the discussions tab should no longer be hidden
- re-allow students to create discussions
- the discussions tab should still not be hidden

Change-Id: I5ef76eecb8eb16a2c1fddfdec9597422c1d7cf34
Reviewed-on: https://gerrit.instructure.com/48444
Tested-by: Jenkins
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2015-02-19 15:56:09 +00:00
Josh Simpson adb085672f add default to due_date for gb assignment sorting
fixes CNVS-18456
This commit addresses an issue if there are two assignments within
the same assignment group that have an identical position. The sort_by
in Course#gradebook_to_csv will then resort to comparing due_dates,
and if one of the assignments has a nil due_date, the sort_by will throw
an exception.

Test plan
- Create an assignment group on an existing course.
- Create two assignments within the assignment group, with due dates.
- Modify the two assignments (in the console):
  - Modify them so they both have the same position attribute.
  - Modify one of them so it has a nil due date.
- After modifications, the course should still generate a gradebook
CSV successfully.

Change-Id: I101e0566b15aa257740cd004293ab57b765e65ad
Reviewed-on: https://gerrit.instructure.com/48567
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2015-02-12 00:36:30 +00:00
Simon Williams e8b5f7d615 fix teacher interaction report to work with submission comments
The submission_comments table has a `recipient_id` column which the code
was assuming would be the user receiving the comment.  This is actual
a denomralized field, since the comment is also attached to a submission
object and the recipient of the comment would always be the same as the
owner of the submission.  Unfortunately, this field never got populated,
so code that assumed it exist failed.  Rather than fully populate it,
this commit changes the code to query against the submission owner
directly.

fixes CNVS-15315

test plan:
- as a teacher in a course with an assignment
- go to speedgrader and leave a comment for a student
- go to the course roster page and click on the teacher
- click to see "student interactions" in the right sidebar
- there should be a "last interaction time" that matches the time you
  left the comment in speedgrader

Change-Id: Ie786efc7ae073aafd96662f52d2dbd27c27332e2
Reviewed-on: https://gerrit.instructure.com/48207
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-02-06 18:54:59 +00:00
James Williams 192b78d0b4 don't set existing enrollments to invited state on re-enrollment
* invite a student
* as the student, accept the invitation
* use the people page to re-enroll the same student
* should not set the enrollment back to "pending"

closes #CNVS-18004

Change-Id: Icfcc6a12400d63d132d01ceb93ef98f1c3344355
Reviewed-on: https://gerrit.instructure.com/47954
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2015-02-02 17:35:21 +00:00
James Williams 74b74705b2 fix manage_user_notes permission checks
also remove some no-op code

test plan:
* create a new ta role
* disable their permission to "manage faculty journal entries"
* add them to a course
* they should not be able to see "faculty journal" buttons
 on student profiles and be able to access their journal pages

closes #CNVS-9000

Change-Id: I35b1cef5a458c6dec68209e4aa964a64a51edd65
Reviewed-on: https://gerrit.instructure.com/47818
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2015-01-28 20:11:35 +00:00
Cody Cutrer d909c6487b remove before/after callbacks pairs that simply check _changed?
you can check _changed? in after_save callbacks

Change-Id: I306b2dfcae00f2c435930a84814ca1a21425961e
Reviewed-on: https://gerrit.instructure.com/47044
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-15 19:53:40 +00:00
Jeremy Stanley dea1f8b11f touch the root folder when hiding or showing the Files tab
to ensure the permissions on it are updated in a timely fashion.

test plan:
 0. enable "better file browsing"
 1. have a student enrolled in a course
 2. view the student's files page, and note the course's files
    appearing in the list
 3. in a separate browser, as a teacher or admin, hide the
    files tab in the course
 4. refresh the student's browser and confirm that the course's
    files no longer appear
 5. in the teacher's browser, re-enable the files tab
 6. refresh the student's browser and confirm that the course's
    files appear again

fixes CNVS-17891

Change-Id: I43bb2d5606341e2ef7a337065d2e50e85bb1a40d
Reviewed-on: https://gerrit.instructure.com/47085
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2015-01-15 19:18:55 +00:00
Cameron Matheson 8442169d80 include current letter grade in gradebook.csv
Test plan:
  Download the gradebook csv for a course that has a grading standard.
  It should show both final and current letter grades.

Change-Id: I352354b5e6254325738b031d5e382d0a0c690102
Reviewed-on: https://gerrit.instructure.com/46861
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2015-01-13 22:25:29 +00:00
Michael Nomitch 89b36d052d include observers in assignment notifications
fixes CNVS-8728

test plan:
  - DA off
    - set up an observer following a student
    - set up an observer in course without a student
    - create an assignment in this course
    - both observers and the student should be
      notified of the assignments creation
    - remove an enrollment from an observer user
      - create another assignment and this user
        should not be notified
  - DA on
    - set up an observer following a student
      (we'll call him observer A)
    - set up an observer following a student
      in a different section (observer B)
    - set up an observer in course without a student
      (observer C)
    - create an assignment in this course for only
      the section that observer A's student is in
    - observer A and observer C should be notified of
      the assignment, observer B should not be

Change-Id: I5ff01cc9a6f19e8c7dca4f806fe48b9d6d8dbe36
Reviewed-on: https://gerrit.instructure.com/45853
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2015-01-13 21:20:06 +00:00
Cody Cutrer 856a56f152 skip sis uniqueness validation if nothing changed
refs CNVS-17778

we still have a unique constraint in the db that checks it
every time as well

Change-Id: Ie60798283a808bc8f3762b754d151d5c61f6afbc
Reviewed-on: https://gerrit.instructure.com/47020
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-01-13 18:46:29 +00:00
Cody Tanner 47889f7c65 Add settings to make course public to auth users
closes PFS-884, PFS-885, PFS-886, PFS-887, PFS-888, PFS-889, PFS-891, PFS-892

Test Plan: 
	1) View a course that is public (Possibly take a screenshot) 
	2) Go the settings for that course and check 'Make this course visible to authenticated users'
	3) Attempt to view that course without being logged in. You should not be able to. 
	4) Login but make sure you aren't enrolled in that course and you should see the identical page that was seen when the page was public
	5) Enroll in the course and it should appear normally. 

Change-Id: I5303874c80db9d19c838ef44581102f4dfaf5f29
Reviewed-on: https://gerrit.instructure.com/46550
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Sean Mikkelsen <smikkelsen@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Cody Tanner <ctanner@instructure.com>
Product-Review: Cody Tanner <ctanner@instructure.com>
QA-Review: Cody Tanner <ctanner@instructure.com>
Tested-by: Cody Tanner <ctanner@instructure.com>
2015-01-12 18:25:04 +00:00
Simon Williams b10f626dde remove unused external feeds columns
external feeds have three columns that really aren't adding any value

* body_match: never used anywhere in the code, always nil in the
  database
* feed_type: always 'rss/atom' (built to handle ical, but never used)
* feed_purpose: always 'announcements' (build to handle calendar_events,
  but never used)

closes CNVS-17581

test plan:
- create an external feed on the announcements page
- wait for the rss feed to post a new story and the aggregator to run,
  OR, in a rails console:
  * set the created_at date on the external feed to before the last
    posted entry, something like
      ef = ExternalFeed.last
      ef.created_at = 5.days.ago
      ef.save!
  * run the external feed aggregator, like so:
      ExternalFeedAggregator.process
- it should create an announcement for the blog post from that feed

Change-Id: I74deffbdaaa1e217f8eefbdfd1000d50c2406cb1
Reviewed-on: https://gerrit.instructure.com/45990
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-01-07 23:36:18 +00:00
Bracken Mosbacker 5d67b73629 add used storage quota include to courses api
So that an api consumer doesn't have to make a call for each
individual course to find courses that are close to their
quota usage.

Test Plan:
 * do an include[]=storage_quota_used_mb for the courses api
 * it should return the property 'storage_quota_used_mb'

closes PLAT-812

Change-Id: Ia617ec825b685cbd682baffedee5afa7b19c5280
Reviewed-on: https://gerrit.instructure.com/46247
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2015-01-06 20:39:54 +00:00
James Williams 9987e6f2b7 fix course unpublishable status with deleted assignments
test plan:
* create an assignment
* enroll a student and submit to the assignment
* grade the submission
* note that it should not let you unpublish the
course on the course home page
* delete the assignment
* now you should be able to unpublish

closes #CNVS-17713

Change-Id: Ib76974c4d32efe7997caf32996b98e0446a8dd01
Reviewed-on: https://gerrit.instructure.com/46510
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2015-01-06 13:55:37 +00:00
Simon Williams 890abc9170 add documentation for grade export csv format
closes CNVS-17720
closes gh-159

test plan:
- go to /plugins -> "Grade Export", choose an account, and click enable
- you should see a description of the format and how the export works

Change-Id: I54b829d624451e5ece49c2a4e48ebe7a96dcd14f
Reviewed-on: https://gerrit.instructure.com/46451
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2015-01-03 16:08:58 +00:00
Cameron Matheson 5cda45c40f add grade period support to grade calculator
closes CNVS-17105

Test plan:
  (This has to be done at the rails console)

  * enable multiple grading periods
  * set up assignments in all the grading periods
  * grade the assignments for a student
  * run the grade calculator for a grade period.  make sure the grade
    only considers assignments in the grading period:

    gc = GradeCalculator.new([student_id], course, grading_period)
    pp gc.compute_scores.first.first

Change-Id: I3b87eb7ec08fedebaab4f7a2fc83e68d4d4d5c7e
Reviewed-on: https://gerrit.instructure.com/45753
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-12-29 20:01:45 +00:00
James Williams 66f5425c25 add reset_content action to courses api
test plan:
* should be able to post to the
 "reset_content" action (see the Courses API
 documentation) to reset the course content
 (equivalent to the UI action)

closes #CNVS-17670

Change-Id: I6c8e96dcf6cc21ac06d599197338f6764c629c56
Reviewed-on: https://gerrit.instructure.com/46312
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-12-29 19:59:32 +00:00
Spencer Olson ec302728fa course grading periods should not return an error
add content and tests for API to ensure that the
course's grading period is RESTful.

test plan:

1. In a course, turn on the multiple grading periods feature flag
2. Using the api, create a few grading periods
3. do a GET on api/v1/courses/:course_id/grading_periods
4. verify that you don't get an error

fixes CNVS-17492

Change-Id: I36cdd1fea1bdd9b426d061e29abb75dd6a192a80
Reviewed-on: https://gerrit.instructure.com/45748
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2014-12-18 01:13:36 +00:00
Jayce Higgins 5e87afa22f Adds Sis Notification table to canvas
Fixes: SIS-628

Change-Id: I08eea4ad89135ccbfba0ce7059e4325b2971954e
Reviewed-on: https://gerrit.instructure.com/44858
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2014-12-15 17:25:21 +00:00
Michael Nomitch 35c7da6e43 api modifications for rollcall
refs CNVS-3451

test plan:
  - make api call to get users in a course
    "/api/v1/courses/#{course_id}/users"
    with enrollment_state[]=active&enrollment_state[]=invited&
    enrollment_state[]=completed
  - all users who were invited to the course
    are returned even if they arent in it anymore
  - make api call to get sections
    "/api/v1/courses/#{course_id}/sections"
    with "enrollments" in the included section
  - all user objects have an attached enrollment

Change-Id: I24d6ee31ca9a5c044efa526e762aa1d504045b99
Reviewed-on: https://gerrit.instructure.com/44717
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-12-11 17:28:45 +00:00
Jeremy Stanley 07bc07524a fix reset-course-content on canvas_net courses without profiles
default course profiles are invalid in canvas_net accounts
due to additional fields with presence validators, so they
can't be assigned via `Course#profile=`

test plan:
 - "reset course content" button in course settings should function
   on a course in a canvas_net account that does not have a profile

fixes CNVS-17153

Change-Id: Id20289aed76d5ec3effbad96110c974682376589
Reviewed-on: https://gerrit.instructure.com/45234
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-12-10 17:28:58 +00:00
Jacob Fugal 59d28b09bd dup the account chain before mucking with it
fixes CNVS-17308

some callers will want to add stuff to the account chain or otherwise
modify it. some do it in place, which is sad when we return a cached
Array. cache it, but return a copy of the cache, not the cache itself,
to prevent errors from this. Account#account_chain already did this.

particularly, in this ticket, code in RoleOverride.permission_for pushed
siteadmin into the return value from Course#account_chain. this meant
that site admin was already in course.account_chain on the second time
through this code, but the code didn't handle the sharding implications
of that (and shouldn't need to)

test-plan:
  - have multiple shards
  - create a course in an account on a shard that's *not* the same as
    site admin's shard
  - create an AccountMembership role in site admin with permission to
    manage courses
  - create a site admin user with just that role and log in as that user
  - should be able to manage the course in the other shard

Change-Id: Iaf3a19dc2a2c0c7372c82d2af197d9f936792625
Reviewed-on: https://gerrit.instructure.com/45463
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-12-09 20:42:22 +00:00
Mark Severson 1a245e6bdd remove non-draft state wiki pages
test plan:
* regression test wiki pages

closes CNVS-16203

Change-Id: Ic37c69c8696151dc99f1df6f3cc9b013835b12a4
Reviewed-on: https://gerrit.instructure.com/42552
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-12-09 20:12:24 +00:00
James Williams c8a02df706 fix sections_visible_to for observer enrollments
test plan:
* create a course with multiple sections
* create a calendar event with "Use a different
 date for each section" checked, and a different
 data assigned for each section

* enroll a student in a course in one of the sections
* add an observer for the student

* view the course syllabus as an observer
* should see the specific section's event date (just
 like the student)

closes #CNVS-15485

Change-Id: I6ed751d27506cf9548f56cbdfc17506b080c398b
Reviewed-on: https://gerrit.instructure.com/44817
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2014-11-25 20:36:39 +00:00
James Williams 75c7b96718 fix sections_visible_to for array arguments
test plan:
* create a course with at least 2 sections
* enroll a teacher or ta both sections,
 checking "Can grade students in their section only"

* as the teacher/ta, visit the inbox
and start composing a message
* select the course
* use the address book button, click on "Course Sections",
 and then a specific section
* should not recieve a 500 network error

fixes #CNVS-16585

Change-Id: I99511bc46a67fd425c3eefde8cec2d9e275454d4
Reviewed-on: https://gerrit.instructure.com/44737
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2014-11-25 01:31:32 +00:00
Jeremy Stanley 96362fd69a data model and API for file usage rights
test plan:
 1. consult the files API documentation and note the additions:
   A. usage_rights include parameter on 'List files'
   B. usage_rights include parameter on 'Get file'
   C. 'List licenses' endpoint
   D. 'Set usage rights' endpoint (PUT)
   E. 'Remove usage rights' endpoint (DELETE)
 2. exercise these new API features

closes CNVS-16826
closes CNVS-16841

Change-Id: I6c01128423adc24a5b70f71bb109d5a005379c37
Reviewed-on: https://gerrit.instructure.com/44403
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-11-19 16:14:00 +00:00
James Williams 1de91edaa2 show custom role names in courses drop-down
test plan:
* create a custom course-level role for an account
* enroll a user into an active course with the custom role
* as that user, the "Courses" dropdown menu on the navigation header
 should read "Enrolled as: [Custom Role]" instead of
 the base type for the role

refs #CNVS-5349

Change-Id: Ife07a10852de3d5376a945c9f35d3ef56cb4ca58
Reviewed-on: https://gerrit.instructure.com/44507
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2014-11-18 16:21:51 +00:00
Spencer Olson 9cde815d68 add grading period group model
add GradingPeriodGroup, and change associations between GradingPeriods,
GradingPeriodGroups, Courses, and Accounts. also adjust the grading
periods controller to account for addition of grading period groups

closes CNVS-16538

test plan:
-run bundle exec rake db:migrate, and bundle exec rake db:migrate RAILS_ENV=test
-verify the migrations successfully run
-open the rails console in sandbox: bundle exec rails c -s
-create a course, a few grading periods, and a grading period group. Add the grading periods to the group. Assign
  the grading period group to the course.
  $ course = Course.create
  $ grading_period1 = GradingPeriod.create(weight: 25.0, start_date: Time.zone.now, end_date: 2.days.from_now)
  $ grading_period2 = GradingPeriod.create(weight: 30.0, start_date: Time.zone.now, end_date: 2.days.from_now)
  $ grading_period_group = GradingPeriodGroup.create()
  $ grading_period_group.grading_periods << grading_period1
  $ grading_period_group.grading_periods << grading_period2
  $ grading_period_group.course = course
-verify the associations are working as expected, i.e. a GradingPeriodGroup has GradingPeriods, a GradingPeriod
  belongs to a GradingPeriodGroup, and a GradingPeriodGroup belongs to a course or account.
  $ grading_period_group.grading_periods #should return an array containing grading_period1 and grading_period2
  $ grading_period1.grading_period_group #should return grading_period_group
  $ grading_period2.grading_period_group #should return grading_period_group
  $ grading_period_group.course #should return course
  $ grading_period_group.account #should return nil (should not throw error)

Change-Id: I9d7465431dabd2afa18e7a8a33706b9a78a94cd1
Reviewed-on: https://gerrit.instructure.com/43512
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2014-11-14 22:07:00 +00:00
Braden Anderson 2f9171080d course catalog
test plan:
  * open a course's settings page
  * enable listing the course in the public index but not
      making the course content public
  * open the course home page as an unregistered user
  * verify that only the course's title and description are accessible

  * open root account feature flags page
  * enable Course Catalog

  * open your "My Courses" page
  * verify that the right pane includes a "Browse more courses" link
  * click the link
  * verify that you can browse courses allowed in the public index

  * log out
  * verify that the homepage includes a "Browse courses" link

Change-Id: I44f96396859283d76bfe527672612ff71ca4ae67
Reviewed-on: https://gerrit.instructure.com/24682
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Braden Anderson <braden@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2014-11-07 17:15:10 +00:00
Michael Nomitch 386a8d15e8 DA - split large hashes
fixes CNVS-16452

test plan:
  - regression test of the following
    - GB csv download/upload
    - assignments index
    - assignments api index
    - submissions api call to for_students
      - as teacher/observer/student
    - score calculation in GB
    - score calculation on individual grades page

Change-Id: Ifaa0c7580535c2c5d4e218508ef00c1b6007770b
Reviewed-on: https://gerrit.instructure.com/43361
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-11-03 19:35:09 +00:00
James Williams 81d4adc319 new roles
refactor everything that used to use strings for roles
to use actual role_ids

the apis should be backwards compatible so we don't need
to update (most of) the UI's right away in this commit

test plan:
* regression tests for permissions, role overrides,
 alerts (for account roles), enrolling users,
 adding account admins, etc.

refs #CNVS-15481

Change-Id: Id57fd3104c5c518b6fbf180609950dcddcdd474d
Reviewed-on: https://gerrit.instructure.com/41208
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-10-31 19:44:14 +00:00
Nathan Mills 5b44b2a83f lti2 course and account nav placements
fixes PLAT-658 PLAT-660 PLAT-661

test plan:
setup:
fixes PLAT-658 PLAT-660 PLAT-661

test plan:
*setup:
register an lti tool using the following url template
/accounts/#{account_id}/lti/tool_proxy_registration?
tool_consumer_url=http://lti-tool-provider-example.herokuapp.com/tool_proxy

ignore the canvaception during the registration

*testing:
there should be course and account nav placements for the tool

Change-Id: Ie02fffdc3a1ede70216db2b21d9f4bd17f53f36d
Reviewed-on: https://gerrit.instructure.com/42094
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-10-24 17:01:19 +00:00
Ben Young 6d5e5b1ee5 Only change the course code using the course name if the code is nil or empty
Fixes CNVS-6235

Test plan:
- Create a course, giving a value to both the name and code.
- Update the name of the course.  The code should not change.
- Set the code to nil or empty.
- Upon saving, the code should be regenerated based on the course name.

Change-Id: Ib3c2f355c9f9cd512c54c111ee958569370d51c1
Reviewed-on: https://gerrit.instructure.com/43060
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-10-23 15:50:59 +00:00
Josh Simpson c18c1ab385 add grading periods api
closes CNVS-15907,CNVS-15908
This commit adds a RESTful, JSONAPI standardized api for grading
periods, along with a serializer and some naive permissions on the
GradingPeriod object.

Test plan
- Note that you'll need to enable the 'multiple_grading_periods' feature
  on the root account.

- Test each of the following endpoints, according to the newly generated
  grading period documentation:

  - GET index
    - /api/v1/accounts/:account_id/grading_periods
    - /api/v1/courses/:course_id/grading_periods

  - GET show
    - /api/v1//accounts/:account_id/grading_periods/:id
    - /api/v1/courses/:course_id/grading_periods/:id

  - POST create
    - /api/v1/accounts/:account_id/grading_periods
    - /api/v1/courses/:course_id/grading_periods

  - PUT update
    - /api/v1/accounts/:account_id/grading_periods/:id
    - /api/v1/courses/:course_id/grading_periods/:id

  - DELETE destroy
    - /api/v1/accounts/:account_id/grading_periods/:id
    - /api/v1/courses/:course_id/grading_periods/:id

Change-Id: I586d6eaf565f35d5d4bd8e22aaa9fd72f0d07832
Reviewed-on: https://gerrit.instructure.com/42451
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-10-21 19:58:34 +00:00
Michael Nomitch 7ca8f592d2 DA - scope naming and filtering
fixes CNVS-15925

test plan:
  - quick regression test of DA
    - focus on assignments/quiz/discussion/modules index pages

Change-Id: I0c6fe67f14e0692d54727839ece993037fc4f6ca
Reviewed-on: https://gerrit.instructure.com/41958
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-10-10 18:27:31 +00:00
Michael Nomitch 4e791b941b DA - more refactoring
- cleans up assignment model
- eliminates unnecessary feature flag checks
- eliminates unnecessary teacher permission checks
- moves duplicated methods from assignment and quiz
  to new module

Change-Id: I8d1e8f99bf5c8f6a63bd670b432aeef7e8f0e86b
Reviewed-on: https://gerrit.instructure.com/41654
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-10-08 16:32:18 +00:00
Cody Cutrer 1d413521ec don't use write_attribute for primary_enrollment data
refs CNVS-15830

test plan:
 * the courses menu should not asplode

Change-Id: Ibec8f2496df476767472bf2245edde63909e7b16
Reviewed-on: https://gerrit.instructure.com/41980
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-10-03 15:54:13 +00:00
James Williams aedb75a7ec add course format setting
test plan:
* should be able to use the ui or the api to
 specify a "course_format" (i.e. whether a course
 is online or on-campus)

closes #CNVS-15470

Change-Id: I5772cfa416c066e94b24d45bd6ce7c1aa24d8c5f
Reviewed-on: https://gerrit.instructure.com/41994
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-10-01 15:06:59 +00:00
Cody Cutrer 1f8028f163 don't use preload_associations
it's a shim of the rails 2 variety, and breaks in rails 4 in the
common case because the options became a scope

Change-Id: I712a8fed35ee0a9747a13c1495f7d51b8dac6823
Reviewed-on: https://gerrit.instructure.com/41716
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-30 18:04:00 +00:00
Cody Cutrer 550a35ee5c don't use write_attribute for student count
refs CNVS-15830

test plan:
 * courses list for root account should still show student count and
  teacher names

Change-Id: Ib65af09e3e06f7a0176fcc517d579b3ae4204053
Reviewed-on: https://gerrit.instructure.com/41804
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-09-26 20:32:32 +00:00
Cody Cutrer 102fdfc849 no more dynamic finders (models)
refs CNVS-15126

Change-Id: I2996e0e262c41274c34d0ea3bfde757074416b8c
Reviewed-on: https://gerrit.instructure.com/40973
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-24 20:51:48 +00:00
Michael Nomitch ce3e0f287d DA - observer refactor
refs CNVS-15158

test plan:
  - general regression test as observers for selrel
  - things to look at: assignments, quizzes,
    discussions, & module index pages, quizzes api

Change-Id: I1211c58ebbd8bc0cd32610fafad215d11af58e16
Reviewed-on: https://gerrit.instructure.com/41039
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-09-24 19:56:23 +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
Cameron Sutter 0425b8652b DA - gradebook csv
fixes CNVS-14085

test plan:
 * enable DA
 - download gb csv
 > assignments without visibility should have "N/A" in the cell
 - upload gb csv
 > assignments without visibility should be ignored even if the "N/A"
   was replaced with a score in the cell
 > non-DA assignments can be changed like normal

 * without DA
 - download/upload csv
 > it should work like normal

Change-Id: I05984b4feb9046bc8de43bcf67aa46f2f751cafc
Reviewed-on: https://gerrit.instructure.com/40517
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2014-09-18 15:49:31 +00:00
Cody Cutrer d1bc9a700a use an inverse association instead of an include for Course#enrollments#course
Change-Id: Ief4e0423b3af846d235e35d566ea7cd6e32b0ab0
Reviewed-on: https://gerrit.instructure.com/40978
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-17 18:41:08 +00:00