Commit Graph

277 Commits

Author SHA1 Message Date
rob orton c10ea6f852 explicitly scope teacher enrollments on course
test plan
 * existing specs should all pass
 * when including teacher enrollments from course conditions should keep enrollments.type

Change-Id: Ic99fc40069b4d5ab003ed43cd1b7c9f34454a43f
Reviewed-on: https://gerrit.instructure.com/15097
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-11-15 22:12:29 -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
Sterling Cobb 3f4fe6d295 Make course syllabus optional when copying courses
fixes #9185

This adds a new version of export files and ensures
older exports will work. We are now using a
canvas_export.txt resource to identify if this is a
canvas cartridge or a common cartridge.

Test Plan
1. Copy a course
2. When copying, unselect copy all and course syllabus
3. The syllabus shouldn't be copied over.

Change-Id: I37c9aa12aabe453ef4481c6f39b7b33c97b130bb
Reviewed-on: https://gerrit.instructure.com/14971
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-08 09:29:50 -07:00
Joel Hough 992df4a1f0 remove outcomes tab for non-users. fixes #11587
test plan:
- make a public course with a learning outcome
- view the course home page while not logged in as any user
- ensure outcomes tab is not present
- navigate to /courses/<course_id>/outcomes
- ensure the page does not load, while presenting a reasonable lack of permissions message
- log in as registered user that should be able to see outcomes
- ensure that the outcomes tab and page are still accessible

Change-Id: I17f974f6dc7c55332391cf6c87c4959d15a95273
Reviewed-on: https://gerrit.instructure.com/14962
Reviewed-by: Mark Ericksen <marke@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Marc LeGendre <marc@instructure.com>
2012-11-06 13:11:58 -07:00
Jeremy Stanley bbda06964d course filters in accounts api; fixes #11389
test plan:
 * See the API documentation for "List active courses in an account"
 * Exercise each of the parameters and verify the correct courses
   are returned

patch set 4: added new specs that test the scopes by themselves,
 and with other scopes layered on them; also, reorganized the
 api specs into separate tests

Change-Id: Ifef0018aad9fc03b44d7542a787ecefb3cf05c5e
Reviewed-on: https://gerrit.instructure.com/14924
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
2012-11-05 16:47:00 -07:00
Bracken Mosbacker 2780604b09 change concluding courses in ui/api to a soft conclusion
Instead of "hard concluding", or setting the workflow
state to 'concluded', courses will now set the end date
and be soft concluded.

This is to allow easier unconcluding in the future so that
all enrollments are still active.

Test Plan:
 * Publish a course
 * conclude the course
 * notice that the end_at date for the course is set to when you concluded it
 * notice that the "Users can only participate in the course between these dates" checkbox is checked

closes #11387 #11386

Change-Id: I568539723b7f0f4471761d742ff3a8bb821a7605
Reviewed-on: https://gerrit.instructure.com/14748
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
2012-11-05 08:45:08 -07:00
Jacob Fugal b68592b602 clarify/fix outcome API permissions
fixes #11504

Change-Id: If7c480bfac9b0339f9ce9f0ec6d5705dafbcb037
test-plan:
 - global outcomes should be visible to:
   - any logged in user
 - outcomes defined in an account should be visible to:
   - admins in subaccounts
   - enrollees in the account's courses
   - enrollees in the account's subaccounts' courses
 - outcomes defined in a course should be visible to:
   - any user that can view the course
 - global outcomes should not be visible without being logged in
 - managing outcomes should require the same permissions as before
Reviewed-on: https://gerrit.instructure.com/14910
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-11-01 11:44:59 -06:00
Zach Pendleton 94908ef8b8 don't display announcements tab on public courses.
fixes #11266

because a user can't see course announcements without being
logged in, don't display the announcements tab in the course
navigation unless there is a current user.

test plan:
  * create a public course with an announcement;
  * without being logged in, navigate to the course and verify
    that the announcements tab is missing from the course
    navigation;
  * verify that the course tab still appears for logged in
    users.

Change-Id: I319f1f022d7cdbf54772b0e99bcb59cae74d1a42
Reviewed-on: https://gerrit.instructure.com/14618
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
2012-10-26 09:09:10 -06:00
Jacob Fugal 52cd995f1b Merge branch 'dev/learning_outcome_refactor'
simple keep-both merge in config/routes.rb

Conflicts:
	config/routes.rb

Change-Id: If4180b9c360f32786acce2a8ad6251437318db21
2012-10-25 15:12:10 -06:00
Cody Cutrer b3dd53d72c cache site admin permission lookups if it's the only one being queried
it's a common query, so reduce db dependency if possible

test plan:
 * as a site admin, ensure you still have access to everything
 * as a non-site admin, ensure you don't have access to any courses
   or accounts that you shouldn't (even without links to them)

Change-Id: I56fb5063b16fe6a3ddc96bdf66586a9e48a79850
Reviewed-on: https://gerrit.instructure.com/13757
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-25 08:51:49 -06:00
Brian Palmer 005e42a757 cassandra store for page views
Adds a new back-end store for page_views, using a Cassandra cluster. All
the current page view queries are supported, many using denormalized
views on the data.

test plan:

first, canvas instances that are currently using AR page views
should function as before.

by Setting.set('enable_page_views', 'cassandra') and restarting, you will
switch to cassandra page views. a script to migrate the AR page views to
Cassandra is coming. all page view functionality should work as before.
note that the format of the pagination headers in the
/api/v1/users/X/page_views endpoint has changed.

Change-Id: I2d1feb4d83b06a0c852e49508e85e8dce87507b4
Reviewed-on: https://gerrit.instructure.com/14258
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-24 17:23:56 -06:00
Jacob Fugal 2fc15ae69c Merge branch 'master' into dev/learning_outcome_refactor
simple keep-both resolutions for app/models/submission.rb and
config/routes.rb. spec/integration/learning_outcome_group_spec.rb stays
removed.

fixed path->url in outcome group api pagination to match master's new
rules.

Conflicts:
	app/models/submission.rb
	config/routes.rb
	spec/integration/learning_outcome_group_spec.rb

Change-Id: I8dd31e1d3764970a8f683aef362f0cca06abe90e
2012-10-24 13:56:33 -06:00
Joel Hough 7b93ba46f0 add api for listing visible navigation tabs
test plan:
- fetch tab list using some command like:
curl -H 'Authorization: Bearer <token>' \
 https://<canvas>/api/v1/courses/<course_id>/tabs\?include\="external"
- ensure that the returned list corresponds to the left-hand tab list on the
  web interface

fixes #10891

Change-Id: If3371472b58f849a9736ab6747f69551178e99a4
Reviewed-on: https://gerrit.instructure.com/14615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-10-23 10:13:20 -06:00
Jacob Fugal de1676cd4b rename user_(is|has_been)_teacher to instructor
also, make the implementations of those and user_(is|has_been)_student
consistent, and fix a bad cache key.

test-plan:
 - everything but the cache key is just a refactor
 - create and then delete a student enrollment in a course so that
   user_is_student? and user_has_been_student? should be different
 - enable caching
 - call user_is_student?; should be false
 - call user_has_been_student?; should be true

Change-Id: Ia9458605273741ef3971d8701fe3cff56453f9b4
Reviewed-on: https://gerrit.instructure.com/14580
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-23 09:06:16 -06:00
Jacob Fugal 7aaf63db52 VDD: Assignment#overrides_visible_to(user)
scopes the assignment's overrides to just those that the user can see.
intended for use with admin users (e.g. teachers or tas) not students,
since a student technically can see other students and thus this scope
will let them see the other students' adhoc overrides, which is not
desired. but this should never need to be called in the context of a
student.

test-plan:
 - architectural, run specs

Change-Id: I4e1515c263870a13f073af1b39cb19d223b41ab9
Reviewed-on: https://gerrit.instructure.com/14486
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-22 09:32:58 -06:00
Simon Williams 5ce9fb146e unread badges in left nav
refs #10541

add counts of how many unread discussions and announcements a user has in
a course or group in the left hand nav bar of the course or group, next to the
appropriate navigation link.

these counts are cached in a context/user/content_type join table.
unfortunately, there are situations that can change whether or not a discussion
or announcement is visible to the user (and thus unread) without triggering any
backend action. for example, a post delayed announcement, a locked discussion
assignment, or a discussion with prereqs in a module. because of these types of
situations, the count has to be re-queried every so often, and the time chosen
for this is if it's been stale for 10 minutes.

test plan:
- as a teacher, create some announcements and discussions
- as a student, you should have unread counts in the left nav
- read the announcements and discussions
- the counts should update appropriately
- (see explanation above for the following)
- try post delayed announcements
- try locked discussion assignments
- try discussions locked in a module
- make sure the count badge looks good in all browsers

Change-Id: Ia6428717e91ed389c63ca97a065232dac7121b7e
Reviewed-on: https://gerrit.instructure.com/13926
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-08 11:38:01 -06:00
Cody Cutrer d70945c1bd remove unused twitter tables and no-op jobs
test plan:
 * edit course settings, there should not be an error
 * copy a course, there should not be an error

Change-Id: I733bef83b69d9c513be801d3e4b25422bcd10ebd
Reviewed-on: https://gerrit.instructure.com/13832
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-10-02 13:11:13 -06:00
Cody Cutrer a993ba3cbb remove default_wiki_wiki_pages relations fixes #10993
it was a has_many :through that is broken for auto-created wikis

existing specs cover all changes except /undelete page, which
is unsupported

test plan:
 * ensure user's rss feed can be opened correctly
 * ensure wiki sidebar loads and has wiki pages in it

Change-Id: I7c3f0f68641b67f602e6b412ab5a386140bb68b2
Reviewed-on: https://gerrit.instructure.com/14023
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-10-01 09:15:25 -06:00
Jake Sorce 91402aff10 add data validation to new course form, fixes #10779
test plan:
  1. log in as a teacher and click 'Create a New Course'
  2. try to enter a string longer than 255 characters into course name
  3. try to enter a string longer than 255 characters into short name
  4. validate inputs don't allow strings over 255 characters

Change-Id: I3bb4655cf351960bd7dafdf99a81eeee631f261d
Reviewed-on: https://gerrit.instructure.com/13836
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-09-20 11:19:54 -06:00
Jacob Fugal ac3cfe743f Merge branch 'master' into dev/learning_outcome_refactor
Change-Id: I48090d9965442b56eb4d73cbca91dfbf7c18517a
2012-09-17 10:23:26 -06:00
rob orton 41c3b5089d add hide_final_grades to course api closes #10575
test plan
 * hide final grades in a course
 * the should be shown in the get course api
 * create a course with hide final grades set to
   true through the api
 * update the hide final grades through the api
 * all api calls should reflect course UI setting

Change-Id: Iebd4c42ebb7c8f11285c5c85d1749348331fa8f8
Reviewed-on: https://gerrit.instructure.com/13685
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-09-16 19:24:56 -06:00
Bracken Mosbacker 9d5e9f4770 correctly replace modules and files on content migrations
Files weren't being replaced if they had a filename different
from their display_name.

The content_tags for modules are cleared before they are
imported so that only the items aren't duplicated.

Test Plan:
  * Import a package twice
	* The modules should be correct and not have 2 items for each item
	* The files should also not be duplicated

closes #10405

Change-Id: I3cb15c2530734185675a2b8bb9017bdf6ac35202
Reviewed-on: https://gerrit.instructure.com/13695
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-09-14 12:42:52 -06:00
Brian Palmer 79521d86f0 add Course#asset_user_accesses association
Change-Id: Ibfc70c3f56f632b684d642907d481bd9c5294134
Reviewed-on: https://gerrit.instructure.com/13584
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-09-12 12:44:31 -06:00
Simon Williams f898562246 api: fix bugs in group invite and membership api
fixes #10268

group invite wasn't searching in the correct account when trying to match user
emails passed in to users.  group membership creation was broken for
non-community account level groups to to a missing permission.

test plan:
- create an account level group
- invite someone who belongs to that account to the group with the api
- they should be added (it should not create a temporary user)
- now add someone else directly with the api be creating a membership for them
- it should work

Change-Id: I7bb7a22b83e13ed6e9575aa059e3e3463e0541f9
Reviewed-on: https://gerrit.instructure.com/13337
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-09-05 09:17:10 -06:00
Jon Jensen e466bf80d9 optionally return permissions in load_all_contexts, closes #9957
now that we also cache group permissions (in addition to course ones),
start grabbing the permissions in load_all_contexts. although we cache all
of them, only return ones that are requested (to keep js ENV etc. small)

slight refactor of conversations around permission stuff, and added the
ability to specify an :if check for a permission (i.e. the permission is
only on for a user if the policy says so *and* the :if method returns
true)

test plan:
n/a, see specs (new one, plus existing ones that exercise
load_all_contexts in its various capacities)

Change-Id: I82f4f71edf221c6c859a15156224d8e5b719edc5
Reviewed-on: https://gerrit.instructure.com/12983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-09-04 16:07:58 -06:00
Jon Jensen 4b59fa0466 paginate prior enrollments
added uber_scope fu to override association :select/:order. slight
refactor of order_by_sortable_name (which incidentally makes it so custom
:select's get respected rather than getting all columns)

test plan:
1. go to a course with more than 20 concluded enrollments
2. go the prior enrollments page
3. it should be paginated
4. spot check other places that order_by_sortable_name (e.g. user_notes)
5. they should work

Change-Id: I3176876383a03d38950b2159cbb73931017d1cc1
Reviewed-on: https://gerrit.instructure.com/13167
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-27 14:27:02 -06:00
Jacob Fugal 8fa01db612 Merge branch 'master' into dev/learning_outcome_refactor
Conflicts:
	public/javascripts/aligned_outcomes.js
	spec/apis/v1/collections_spec.rb
	vendor/plugins/moodle2cc/Gemfile

Change-Id: I2ea31263e4367dd456d12d2d53a297f3c25c9a5b
2012-08-22 10:42:21 -06:00
Bracken Mosbacker 82d4003320 learning outcomes refactor
This list is *NOT* complete, some items may have snuck in that I forgot
to note, and/or some of the noted items may not be completely functional
yet.

Specs need to be written around a lot of this, other specs will no doubt
need to be fixed.

Some things, particularly around LearningOutcomeGroups will need data
migrations that aren't there yet.

 * remove LearningOutcome.non_rubric_outcomes? and replace with false
   where invoked
 * remove LearningOutcome.enabled? and replace with true where invoked
 * remove never-taken branches
 * remove the shared/aligned_outcomes partial and it's supporting
   javascript, since it's now empty
 * remove js handler for add_outcome_alignment_link and supporting
   method since it only occurred in never-taken branches
 * mix LearningOutcomeContext into Course and Account
 * replace LearningOutcomeGroup.default_for(context) with
   LearningOutcomeContext#root_outcome_group
 * rename LearningOutcome#content_tags to LearningOutcome#alignments
 * rename LearningOutcomeGroup#content_tags to
   LearningOutcomeGroup#child_links, and properly restrict
 * remove ContentTag[Alignment]#rubric_association_id, add
   ContentTag[Alignment]#has_rubric_association? that looks at the
   presence of the content's rubric_association_id
 * condition off the assignment having a rubric_association rather than
   filtering tags by has_rubric_association (which just looks back at
   the assignment). all or none of the assignment's alignments are
   forced to have the association (via the assignment). this was true in
   practice before, is now codified (and more efficient)
 * rename AssessmentQuestionBank#learning_outcome_tags to
   AssessmentQuestionBank#learning_outcome_alignments
 * rename Assignment#learning_outcome_tags to
   Assignment#learning_outcome_alignments
 * rename Rubric#learning_outcome_tags to
   Rubric#learning_outcome_alignments
 * move/rename (Course|Account)#learning_outcome_tags to
   LearningOutcomeContext#learning_outcome_links
 * move/rename Account#learning_outcomes (corrected) and
   Course#learning_outcomes to
   LearningOutcomeContext#linked_learning_outcomes
 * move/rename Account#created_learning_outcomes and
   Course#created_learning_outcomes to
   LearningOutcomeContext#created_learning_outcomes
 * clarify and correct usage of linked_learning_outcomes vs.
   created_learning_outcomes
 * move/rename (Account|Account)#learning_outcome_groups to
   LearningOutcomeContext#learning_outcome_groups
 * remove unused Account#associated_learning_outcomes
 * just remove one link to a learning outcome when deleting
 * merge Account#has_outcomes?, Course#has_outcomes? and
   Course#has_outcomes into LearningOutcomeContext#has_outcomes?, add a
   use in Context#active_record_types
 * kill LearningOutcomeGroup#root_learning_outcome_group (unused)
 * rename LearningOutcomeResult#content_tag to
   LearningOutcomeResult#alignment
 * kill unused (and broken) OutcomesController#add_outcome_group
 * kill unused OutcomesController#update_outcomes_for_asset
 * kill unused OutcomesController#outcomes_for_asset
 * remove unused (outside specs, correct specs)
   AssessmentQuestionBank#outcomes=
 * remove unused ContentTag#learning_outcome_content
 * replace ContentTag.learning_outcome_tags_for(asset) (only ever called
   with asset=an assignment) with call to
   Assignment#learning_outcome_alignments
 * remove unused ContentTag.not_rubric
 * remove (now) unused ContentTag.include_outcome
 * remove unused LearningOutcome#learning_outcome_group_associations
 * avoid explicit use of ContentTag in outcome-related specs
 * replace LearningOutcomeGroup#learning_outcome_tags with
   LearningOutcomeGroup#child_outcome_links (and only use for outcome
   links; not tags for child groups)
 * split ContentTag#create_outcome_result into
   Submission#create_outcome_result,
   QuizSubmission#create_outcome_result, and
   RubricAssessment#create_outcome_result. fix some bugs along the way
 * refactor ContentTag.outcome_tags_for_banks and some code from
   QuizSubmission#(track_outcomes|update_outcomes_for_assessment_questions)
   into QuizSubmission#questions_and_alignments
 * refactor RubricAssociation#update_outcome_relations and
   Rubric#update_alignments into LearningOutcome.update_alignments
 * don't use ContentTag#rubric_association with outcome alignments; use
   the tag's content's rubric_association in its place (they should have
   been equal anyways)
 * refactor LearningOutcome.available_in_context and
   @context.root_outcome_group.sorted_all_outcomes (only time
   sorted_all_outcomes is used) into
   LearningOutcomeContext#available_outcomes and
   LearningOutcomeContext#available_outcome
 * overhaul LearningOutcomeGroup#sorted_content and rename to
   LearningOutcomeGroup#sorted_children. it not returns ContentTags
   (outcome links) and LearningOutcomeGroups, vs. LearningOutcomes and
   LearningOutcomeGroups; fix usages appropriately
 * fix UI for arranging/deleting outcome links and groups within a group
   to refer to the outcome link rather than the outcome

Change-Id: I85d99f2634f7206332cb1f5d5ea575b428988d4b
Reviewed-on: https://gerrit.instructure.com/12590
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
2012-08-22 09:51:39 -06:00
Brian Palmer 23710712fb avoid trying to change a user's locale while in a slave-query block
test plan: visit a canvas course as a new user who has their browser set
to a non-en locale. you shouldn't see a page error.

Change-Id: I5f0447faaec4971a08082de9819d9be79f19935f
Reviewed-on: https://gerrit.instructure.com/13062
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-21 14:53:18 -06:00
Cody Cutrer 02d50f181d ignore incoming messages for deleted accounts
test plan:
 * get some notifications for discussions, conversations, etc.
 * delete the root account
 * reply to the notifications via e-mail
 * undelete the root account
 * the replies should not show up

Change-Id: I2afe5de256cbd55ca360a4327150871ea40d7493
Reviewed-on: https://gerrit.instructure.com/12902
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-08-20 14:08:52 -06:00
Cody Cutrer c45ce31cc6 use a slave for Course#tabs_available
test plan:
 * visit several different courses

Change-Id: I19e8fbefba6164392269d6688df2c58d25e0f34b
Reviewed-on: https://gerrit.instructure.com/13027
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-08-20 11:34:40 -06:00
Zach Pendleton 8249329f9b don't display end course btn for courses in soft-concluded terms.
fixes #9872

on the course settings page, the 'end this course' button should not
display for courses whose terms have already ended.

test plan:
  * create a course inside of a term whose end_at date has already
    passed;
  * visit the course settings page and verify that the 'end this course'
    button is not visible in the sidebar.

Change-Id: I8f8ddc1cd495a3488fda6989de28d45abd67b6cd
Reviewed-on: https://gerrit.instructure.com/12893
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-08-16 17:05:56 -06:00
Zach Pendleton 3a373a83f2 don't return assignment group weights that aren't being used.
fixes #7435

previously the assignment_groups api was returning weights for
assignment groups, even when the parent context wasn't using
those weights.

now we return null for weights unless the context is currently
weighing the assignments by group.

test plan:
  * create a course with two assignment groups that have values
    for group_weight;
  * set the course's group_weighting_scheme to 'equal';
  * make an api call to AssignmentGroups#index and verify that
    group_weight returns as null;
  * set the course's group_weighting_scheme to 'percent';
  * make another api call and verify that group_weights are
    properly displayed.

Change-Id: I27f86e6f7fff13fa4d1e8d9c985cd06371cf7bd9
Reviewed-on: https://gerrit.instructure.com/12523
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-07-31 12:36:52 -06:00
Cody Cutrer 29cf0db046 remove WikiNamespace fixes #9121
no user visible behavior change

test plan:
 * make sure existing wiki contents haven't disappeared
 * make sure a new course gets a wiki that functions correctly
 * make sure wiki rss feeds are still functional
 * try to access the wiki from a new course from multiple requests
   simultaneously; it should get a single wiki that's not conflated

Change-Id: I339b56c39d7868dbdec3df4007291a429272b1cf
Reviewed-on: https://gerrit.instructure.com/12432
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-07-30 09:15:04 -06:00
Bracken Mosbacker 261c37135f correctly find quiz file references in webct data
This fixes two cases that were missed before. Sometimes the
webct relative resource id starts with a '/' and sometimes
not, this accounts for that.

Also, finding a file by a relative path was trying to find it
by the URI escaped version instead of the unescaped one. And
sometimes webct data has differently-cased file paths in the
QTI, so this tries finding files in all lower case.

Test Plan:
 * Import a webct course that has files in quizzes
 * All the images should import correctly into canvas. (meaning the url should be like /courses/:id/files/:id/preview)

closes #9520

Change-Id: I110c7f1968ae5a050fbd6b4e21332e8168481a15
Reviewed-on: https://gerrit.instructure.com/12474
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-07-25 16:40:30 -06:00
Jeremy Stanley 5b8524b14a Batch file notifications; closes #9012
Test plan:
(We need two users here because Canvas doesn't notify you about
files you upload yourself.  We'll call them Student and Teacher
here, but they don't actually have to be these things.)

 * As Student, enable notifications for new files in Profile.
 * As Teacher, upload a file.
 * Within an hour or so (everything about notifications occurs
   in low-priority background tasks), Student should receive
   a notification for the file.
 * As Teacher, upload multiple files.
 * Student should eventually receive a notification that
   X number of files were added.

Note that files are batched over a five-minute period; that is,
if a file is added to a course within five minutes of a previous
file, it will be counted in the same batch.

Change-Id: I09b5f497cae1d726b7aaf85824e98e69e45b0c1b
Reviewed-on: https://gerrit.instructure.com/12346
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-07-20 14:45:12 -06:00
Joe Tanner d16318c1e0 add multiple students to an observer in the UI, closes #7768
other changes:
- makes it possible to add a student to multiple sections in the course
- pagination of the user lists
- converted user tab js to coffee and backbone

test plan:
- as a teacher go to /courses/*/settings#tab-users
- verify that multiple students can be linked/unlinked to an observer
- verify that users can be added to and removed from multiple sections
- verify that 'Resend Invitation' and 'Remove from course' work

Change-Id: I0f64f72f1937348817990b6f13b6310185b68a73
Reviewed-on: https://gerrit.instructure.com/10865
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2012-07-16 15:48:27 -06:00
Brian Palmer a5c973b64f don't allow TAs to delete or reset courses
fixes #6227

test plan: Make a non-SIS course. Verify that teachers and designers can
still delete and reset the course, but TAs cannot.
They shouldn't see the buttons to do so, either.

Change-Id: I413a7646eaf7132b6b41d51bce4b05bb1b490b1c
Reviewed-on: https://gerrit.instructure.com/12151
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-07-16 10:50:10 -06:00
Sam Olds 9c09c52d41 doesn't show concluded users in collaborations and conferences
fixes #8845

originally, this issue was that if a student was concluded from a course
they would still show up in the list of students to be added to both
collaborations and conferences. this commit fixes that and also prevents
the student view student from showing up in the list of students when
creating a new conference.

test plan
  - be a teacher in a course with a few students and collaborations and
    conferences enabled
  - go to a collaboration and a conference and see the students listed
    there (when starting a new collaboration/conference)
  - conclude a student from the course
  - click student student view, then leave student view
  - back in the collaborations and conferences, the concluded student
    should no longer be listed, and test student should not be listed

Change-Id: I08da39a79ef1508e53064adf54bfacac0c527457
Reviewed-on: https://gerrit.instructure.com/12100
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Sam Olds <sam@instructure.com>
2012-07-12 15:49:23 -06:00
Cody Cutrer 9573ce76d6 search for xlisted sections when enrolling via CSV fixes #9175
test plan:
 * create two courses via SIS CSV
 * enroll a user in course 1 via SIS CSV by course_id only
 * xlist course 1's default section to course 2
 * enroll another user in course 1 via SIS CSV by course_id only again
 * the user should end up in the xlisted section in course 2

Change-Id: I3a114d70a109594a56915b705de77b87a177e966
Reviewed-on: https://gerrit.instructure.com/12122
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-07-11 08:59:07 -06:00
Simon Williams c69d723515 remove student view student from collaborations page
fixes #9159

the student view student was showing up as one of the users listed on the
collaborations page, but adding the student view student to a collaboration
resulted in an error. this simply removes the student view student as an option
on the page and disallows the student view student from using collaborations.

test plan:
- in a course with collaborations enabled
- enter student view
- go to the collaboration page, you should receive an unauthorized message
- leave student view
- go to the collaborations page
- the student view student should not be in the list
- select all and create
- the collaboration should work

Change-Id: I574f4f2caa6b0627dcd1a91acd4cb3699be4583a
Reviewed-on: https://gerrit.instructure.com/11927
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-07-09 14:19:13 -06:00
Simon Williams bae9ea36df recompute enrollment grades after transaction commits
fixes #8360

there was a race condition where the delayed job that was created after
a submission was graded or an assignment's points were changed could have run
before the original transaction finished, meaning it would have recomputed the
grades with an incorrect score.  this ensures that the delayed job is not
created until after the transaction commits.

test plan: this is difficult to test, and was confirmed using timing data from
logs, but you could try setting a breakpoint in the old code after the delayed
job was created in the callback and confirming that it ran with old data.

Change-Id: Iaff08f080702df6e0817a2075898428bfd19e67e
Reviewed-on: https://gerrit.instructure.com/11960
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-07-02 10:23:48 -06:00
Jeremy Stanley 452351b1cb make public syllabus page work without user; fixes #8499
test plan:
 - make a course publicly available
 - try to view its syllabus page without being logged in

Change-Id: I16c39a47006669c847ca57508fb4752769aa95f1
Reviewed-on: https://gerrit.instructure.com/11886
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-06-28 08:51:12 -06:00
Jon Jensen d45870956f Merge remote-tracking branch 'origin/master' into dev/fft 2012-06-27 16:40:07 -06:00
Jon Jensen 6fe330c534 allow resetting self enrollment courses, fixes #9122
test plan:
1. create a course
2. enable self enrollment
3. reset the course
4. it should work

Change-Id: Ib9c1f1b971538d0277e42a31d4b441b49be21146
Reviewed-on: https://gerrit.instructure.com/11810
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2012-06-26 16:37:24 -06:00
Ryan Shaw 77138c4d4a Merge remote-tracking branch 'origin/master' into dev/fft
Conflicts:
	app/controllers/collections_controller.rb
	app/views/layouts/application.html.erb
	config/build.js
	lib/tasks/parallel_exclude.rb

Change-Id: Ic9664c29d1469c13b514343915c5929dfb15c6ad
2012-06-26 10:14:46 -06:00
Cody Cutrer dea41f5213 limit enrollments api by section visibilities fixes #8819
test plan:
 * add two sections to a course
 * add a teacher or ta to a section, and limit them to that section
 * as that teacher, go to GB2
 * you should not be able to view any enrollments outside of that
   section

Change-Id: I3d7dd17828cb79aaf162b0947640e2fa7da7952d
Reviewed-on: https://gerrit.instructure.com/11705
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-06-25 11:03:01 -06:00
Jake Sorce 2879376c44 fix sorting on commit g/11544/
Change-Id: I1f64a096fec71fffce096a90a86a4ff0e7718724
Reviewed-on: https://gerrit.instructure.com/11682
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-06-20 16:10:54 -06:00
Cody Cutrer 2ced7d62f4 limit csv to section visibilities fixes #8405
test plan:
 * enroll a limited teacher, and a student in a different section
 * download the csv as that teacher; it should not include the
   student

Change-Id: I46af8f5d4bbf03e6c921bdd4269900d33e28b112
Reviewed-on: https://gerrit.instructure.com/11714
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-06-20 15:45:04 -06:00
Cameron Matheson 4efe9189d9 Merge remote-tracking branch 'origin/master' into dev/fft 2012-06-20 15:27:01 -06:00