Commit Graph

5816 Commits

Author SHA1 Message Date
Duane Johnson 22e3992dd3 more detailed error logging for google docs linking issue
In some cases, google docs api is returning an xml document that our
api doesn't know how to handle. More info is needed in order to assess
and fix the issue.

Refs CNVS-3012

Change-Id: Ia78047872e054204cc32d2b5ae42adc830b80942
Reviewed-on: https://gerrit.instructure.com/16996
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-01-22 14:49:29 -07:00
Jon Jensen f519ae1fae show authentication errors on mobile login page, fixes #CNVS-2590
test plan:
1. go to the login page on a phone
2. enter invalid credentials
3. you should see an error

Change-Id: I92bdf581212608ed2414fac1b5f9356bf9fa2577
Reviewed-on: https://gerrit.instructure.com/16863
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: David Josse <david@instructure.com>
2013-01-22 14:17:06 -07:00
Bryan Madsen de5ea8e58f adding failing calendar spec to parallel_exclude
spec/apis/v1/calendar_events_api_spec.rb started failing intermittently
because of a spec ordering issue when we switched to running the tests in ruby 1.9.3.

Change-Id: I613c458879d4efe4bc5a57179b5255d3d22a8ef5
Reviewed-on: https://gerrit.instructure.com/17017
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
2013-01-22 13:58:31 -07:00
Zach Pendleton 5ccb69325f add destructive set_broadcast_policy! to BroadcastPolicy.
fixes #CNVS-2732

current implementation of set_broadcast_policy shares
notifications across parent and child classes; this method
provides a way for child classes to choose not to share
their notifications with the parent.

test plan:
  * create a user and set her notification policies for
    announcements and discussions to ASAP;
  * create a new discussion;
  * verify that the user receives a single message about
    the new discussion;
  * repeat the same process with an announcement.

Change-Id: Iaafa97f550f804d8bac4fb95552a6a4eeb2626dd
Reviewed-on: https://gerrit.instructure.com/16935
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-01-22 11:18:14 -07:00
Jacob Fugal fd305e90c4 bookmarked pagination, including multi-shard
introduces a new BookmarkedCollection module with behavior similar to
PaginatedCollection in the simple case.

the primary advantage is that assigning to current_page (e.g. from the
:page parameter to paginate) expects a bookmark token value and
automatically deserializes into current_bookmark. the library client can
then use current_bookmark to skip forward in the collection, rather than
using (current_page - 1) * per_page as the number of items to skip. the
client then calls set_next_bookmark on the pager if there's more
results, and it automatically derives the bookmark for the next page and
serializes it into next_page, for use by Api.paginate, etc.

in addition to the PaginatedCollection.build analog, you can simply wrap
an existing scope to change it from something that will paginate by page
number into something that will paginate by bookmark.

finally, the key reason to use bookmarked pagination is to enable
composition of collections. you can merge multiple collections into one
collection which when paginated will pull results from each
subcollection, in order, to produce the page of results. you can also
concatenate multiple collections into one collection which when
paginated will exhaust the collections in order with seamless transition
from one to the next when a page spans both.

with collection merging available, you can paginate an association where
you'd like to use with_each_shard. one collection is created per shard,
and then they are merged together. this process is automated for you in
the BookmarkedCollection.with_each_shard method.

fixes CNVS-1169

Change-Id: Ib998eee53c33604cb6f7e338153428a157928a6d
Reviewed-on: https://gerrit.instructure.com/16039
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-01-22 09:41:18 -07:00
Jeremy Stanley 81954472cd update rubyzip to 0.9.5 for non-ASCII filename support
test plan:
 - import a Canvas course containing attachments with non-ASCII
   filenames, on ruby 1.9 (there must be at least two attachments)

fixes #CNVS-3195

Change-Id: I0c7f19b6f7a477858bfba3cd2501bcbf16ba0567
Reviewed-on: https://gerrit.instructure.com/17006
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-01-22 09:29:05 -07:00
Mark Ericksen 8133710579 Force recalc of unread conversations. Fixes #CNVS-2142
When the Conversations/Inbox page is loaded, it will
recompute the actual unread message count for the user.

Testing Notes:
===============
When testing locally...
* Using the console, force the counts to be wrong: (First find the user by ID)
   u = User.find(id)
   u.update_attribute(:unread_conversations_count, 10)
* If off in positive direction, it will show the number of unread more clearly.
   You can verify it on the Dashboard or other pages. If testing negative,
   you need to have some conversations marked as unread and the
   count will not include them.
* Visit the "Inbox" page and verify that the count is corrected. Now on the
   Dashboard, it will be correct.

Change-Id: I0ccbb3489f4a296cc565fb453ae50c69637bfd60
Reviewed-on: https://gerrit.instructure.com/16770
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
2013-01-22 08:38:05 -07:00
Stanley Stuart bc3d4b7176 clean up tinyMCE after editing an outcome
Fixes a bug where descriptions would not be saved after editing one
outcome on the page. tinyMCE was not being removed from the
description's text field, so when the template was re-rendered, tinyMCE
was not able to attach itself to the newly rendered description textbox.
This commit ensures tinyMCE always gets cleaned up when hitting the
'Save' or 'Cancel' buttons when editing an outcome.

test plan:
  - As a user who can manage outcomes, go to the outcomes page and
    create a new outcome. Fill out the description and save it.
  - Edit the same outcome again, making sure to change the description.
    save it, then check to make sure that the description sticks.
  - Create a new outcome, or edit an already existing outcome, again
    changing the description and saving it. Make sure the description
    changes stick before you refresh.
  - Refresh the page. make sure all the changes you made in the above
    steps are still there.
  - Now, edit an outcome. Instead of making changes, hit the 'cancel'
    button. Now, try to edit the outcome again. You should see the
    tinyMCE toolbar around the description field.
  - Make some changes to the description by hitting 'save'. Try to edit
    another description, you should see the tinyMCE toolbar.

fixes CNVS-1865

Change-Id: I099e6b6f290868a6f09ca5937861e8c119fa62e4
Reviewed-on: https://gerrit.instructure.com/16988
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-01-21 17:54:38 -07:00
Ethan Vizitei b1d8f2ef3b user searching module
refs #CNVS-2326

Added a UserSearch module that provides
and interface for searching across the name,
the email, and the sis id (and the database id),
and added a trigram index on the columns
that will be searched against.

also made a slight refactor to the AR
initializer in order to expose
some of the behavior I wanted more granularly
and added some specs to cover it

fixed a small permissions bug in course.rb
and pulled some scoping out of the courses
controller down into the user search module

TEST PLAN:
  This is currently not accessible from
the site itself, this is just the ground
work for the eventual user search api endpoint.
The code is not called by anything currently in
production either so there is no need for
regression testing.  The one thing to check would
be the creation of new users (and pseudonyms and
communication channels).  There have been new
indexes added to columns on those tables
and there is some documentation indicating
that writing to these indexes can be time
consuming if the data set is quite large.  It
would be worth making sure that there have not
been any unacceptable performance regressions
in the creation of any of those record types in
a database that has a full load of data
(comparable to the production environment)

Change-Id: I8fb13a6ec714f27efc8012c5ed2bed4d963c24e6
Reviewed-on: https://gerrit.instructure.com/16459
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2013-01-21 17:25:32 -07:00
Zach Pendleton 2159034353 update canvas_connect gem version.
update to 0.0.2 for better compatibility with a wider range
of connect instances.

Change-Id: Ide388541e55151f07ea77be36fc70fc4d92203e1
Reviewed-on: https://gerrit.instructure.com/17009
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-01-21 16:38:09 -07:00
Ryan Florence e6df3032f6 added allow_student_discussion_topics to settings
test plan:
1. Go to course settings
2. click edit settings
3. click more options
4. check/uncheck the "Let students create
   discussion topics" checkbox
   - the setting should work

Change-Id: Icf096c3098f700234887d6a39a1c2f4d9c55de49
Reviewed-on: https://gerrit.instructure.com/16981
QA-Review: Cam Theriault <cam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2013-01-21 15:56:13 -07:00
Ryan Florence 4eb58af646 added ui to change discussion topics settings
closes CNVS-2848

test plan:
1. go to the discussions page as a user who can
   edit the course (teacher or admin)
2. click the gear in the tool bar
3. change the settings
4. log in as a student
   - the "new topic" button should be gone
   - user should not be able to attach files
     in a discussion reply

Change-Id: I82c70b6828c03b7f5b2e3937fb9f4e870971c4e2
Reviewed-on: https://gerrit.instructure.com/16962
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-01-21 15:56:05 -07:00
Joel Hough efe1e2615e don't choke setting assignment dates to nothing
fixes #CNVS-2694

setting an assignment event's date to nothing on calendar2 now makes
the assignment undated rather than throwing an error

test plan
- create a dated assignment
- from calendar2's "Edit Event" dialog, delete the due date and submit
- ensure that the assignment is now undated
- ensure that the assignment shows in the "Undated Events" list
- ensure that the assignment does not show on the calendar as a dated event

Change-Id: I304276ff4bfd59ac0ebc893617722bfc2e8bccae
Reviewed-on: https://gerrit.instructure.com/16873
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2013-01-21 15:10:13 -07:00
Jeremy Stanley 255e9d94b1 ruby 1.9: don't choke on course import with '~' filename
work around the issue where creating a temp file whose basename
starts with '~' fails on ruby 1.9

ruby issue: https://bugs.ruby-lang.org/issues/7547

test plan: try to import the course linked in the ticket

fixes #CNVS-2922

Change-Id: Iafbbae05c90dbef22e73e6311379e3aeee0a5f32
Reviewed-on: https://gerrit.instructure.com/16796
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-01-21 14:16:11 -07:00
James Williams 7b2f365419 create point for plugins to extend account api response
it doesn't do anything visible yet

test plan:
* make sure nothing's broken

Change-Id: I000ceb3d00f143aa512c823da4dda313c3f78286
Reviewed-on: https://gerrit.instructure.com/16910
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-01-21 13:50:01 -07:00
Jon Jensen 73c586fdc4 clean up .gitignore
remove a lot of things that are no longer relevant, DRY it up a bit and
make it a bit more explicit (root paths, better globbing)

test plan:
1. `git status`
2. all your previously ignored stuff should still be ignored, except
   perhaps editor stuff, which should really go in .git/info/exclude

Change-Id: I0c0f6dc3cd969bb6f90f26c1af83f1bd7ef852e4
Reviewed-on: https://gerrit.instructure.com/16994
Reviewed-by: Joe Tanner <joe@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2013-01-21 13:43:46 -07:00
Joe Tanner 0959e72e7f require choosing a file before adding a profile pic
closes #CNVS-2450

test plan:
- go to /profile/settings
- click on the profile picture
- in the popup click 'Upload a new Image'
- then click 'Add File' without choosing a file
- an error message should show up over 'Choose File'

Change-Id: Id68fb3176d292ff3f612e0d2976d21bf2ba92162
Reviewed-on: https://gerrit.instructure.com/16923
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2013-01-21 13:36:09 -07:00
Zach Pendleton 7535f68408 fix typo in discussions/announcement copy. fixes #CNVS-2965
test plan:
  * create an announcement;
  * delete the announcement and verify that the confirmation
    message reads, 'are you sure you want to delete this
    announcement?'

Change-Id: Iebc2f2d2f3139c1d65ac0d4b3f7bc5176d27a926
Reviewed-on: https://gerrit.instructure.com/16916
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2013-01-21 13:03:21 -07:00
Zach Pendleton 00a52d30b7 respect multiple section options for events.
fixes #CNVS-1854

when editing an event with multiple section dates, allow
user to change event to a single due date.

test plan:
  * create an event in a class with multiple sections and
    assign a due date for each section;
  * edit the event, uncheck the "Use a different date for
    each section" checkbox, and set/save a new date for the
    event;
  * verify that the event now has the single date chosen.

Change-Id: Ic28037f63420419bcc371d00171bbc8207dec2f5
Reviewed-on: https://gerrit.instructure.com/16874
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2013-01-21 13:03:13 -07:00
Mark Ericksen 59174863b0 Close Cal2 event popup to prevent getting "detached". Fixes #CNVS-2511
Testing Notes:
============
* Click an event on C2 so the popup is displayed. Click and drag the
  the event to another day. The popup should close when the drag starts
  instead of getting detached and going to the top-left corner.
* After a fresh page reload, click and drag (with the event
   popup NOT open) and verify that it correctly updates
   and supports clicking after being moved. (no errors in process)
* After dragging an event, it appears "disabled". This change
   also disabled the "click" handler so it won't show the popup.
* Forces popups to close when:
  * The browser window (and indirectly) the calendar
  * A calendar event is resized
  * A calendar event is moved
  * A calendar event is moved and while saving, a different
   event is clicked to display a popup.
  * A popup is shown on an "Undated Events" item and the
    item is being dragged out.

Change-Id: I51d65433bc0312aa533c96c3fc92747bafe6880f
Reviewed-on: https://gerrit.instructure.com/16608
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-01-21 12:30:41 -07:00
Jon Jensen fb07d7bdf2 don't give self enrollment users links to courses that haven't started
fixes #CNVS-2614

when users self enroll, don't give them a link to the course on the
confirmation page if it's restricted by date and not yet available. also
fix dashboard messaging when all of the user's enrollments are in
not-yet-started courses.

test plan:
1. create a course
2. set a start/end date and limit participation to the course dates
3. enable self enrollment
4. self enroll as a student
5. confirm that you get a link to the dashboard, but not to the course
6. on the dashboard, confirm that you see a message that states "You've
   enrolled in one or more courses that have not started yet"
7. click on courses on the top menu
8. confirm that you see the course under future enrollments
9. click on the course
10. confirm that you get an error page stating the course is not yet
    available

Change-Id: Ib63ac2a8f76e197acae44614a0702b784d874dce
Reviewed-on: https://gerrit.instructure.com/16813
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
2013-01-18 16:00:18 -07:00
James Williams 15787b1b36 add a vendor help link for external tools
add a optional vendor help link that can be included
in the external tool configuration

test plan:
* get configuration xml for an external tool
* add a property to specify the vendor_help_link
 by inserting the following xml:

   <lticm:property name="vendor_help_link">
     http://example.com/help
   </lticm:property>

  inside the tag
    <blti:extensions platform="canvas.instructure.com">

* add the external tool with the "Paste XML" option
* the external tool display should show a link

closes #CNVS-2446

Change-Id: I3d7a592e0ad8eedaa7690390f4d2183cf974e8a0
Reviewed-on: https://gerrit.instructure.com/16548
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-01-18 15:17:57 -07:00
Duane Johnson 23408a627b add error report logging to google docs, linked in, twitter oauth
We are currently unable to properly diagnose the problems being
encountered by users trying to link canvas to their google accounts.
This patch adds ErrorReport logging (:oauth) to help get to the
bottom of it, and adds LinkedIn and Twitter for good measure.

refs CNVS-3012

Change-Id: I2589921480f72c80b32591e4f5574b00d02796bf
Reviewed-on: https://gerrit.instructure.com/16965
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-01-18 13:50:54 -07:00
Shawn Meredith 0631e248f5 spec: teacher speed grader intermittent spec fix
Change-Id: I6f9679bc8e147aa9d361395f9770fb83455880ff
Reviewed-on: https://gerrit.instructure.com/16963
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
QA-Review: Jake Sorce <jake@instructure.com>
2013-01-18 13:43:38 -07:00
Cameron Matheson 394f39ed50 drop submissions in consistent order
closes CNVS-3096

This doesn't affect grades, but it does prevent confusion if a different
assignment is dropped on the student grades page vs gradebook.

Test plan:
* set up an assignment group with grade drop rules that multiple
  submissions satisfy (for example, all assignments are 10/10)
* make sure the same submission is dropped in the gradebooks and student
  grades page

Change-Id: I1567460c3d107934fb32670eddda95bc18786d9a
Reviewed-on: https://gerrit.instructure.com/16789
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2013-01-18 12:09:29 -07:00
Dave Donahue e41e16e15d accessibility changes for keyboard shortcuts on course assignments page
Fixes #CNVS-1257

Notes:
* Changes message for accessing keyboard shortcuts dialog
  to something screenreader-friendly
* Adds support for using a comma rather than question mark
  for JAWS compatibility
* Adds support for closing the dialog when pressing hotkey
  a second time and preserves focus in doing so
* Brings focus to the dialog and allows tabbing into the
  list of keyboard shortcuts
* Prevents tabbing away from modal dialog (patched jquery-ui.dialog)

Test plan:
1. Log in as a teacher
2. Go to a course
3. Click Assignments on the left
4. Using keyboard navigation, navigate past the Logout link to
   hear the updated keyboard shortcuts hotkey prompt
5. Press ,
6. Tab through the modal dialog to hear the list of shortcuts
7. Press , again to close the dialog

Change-Id: Ic8606c45a68f96726c7c851db3d900743a4cc9d8
Reviewed-on: https://gerrit.instructure.com/16628
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2013-01-18 12:08:08 -07:00
rob orton cdb58c1f34 check for empty string parameters
test plan
* you should be able to pass 'all terms' on a 
report with a term selector

Change-Id: Iaf8eb3c59f2818233477c490b3a030fc24ebfbd4
Reviewed-on: https://gerrit.instructure.com/16953
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Brad Humphrey <brad@instructure.com>
2013-01-18 11:29:21 -07:00
Erik Lyngved 1e81710239 hiding outcome instructions from students
Fixes #CNVS-1878

Notes:
* Previously, students were able to see teacher instructions on
  the outcomes page.
* This commit hides the instructions for students, and to avoid
  having an empty white box, selects the first outcome or group
  from the outcomes sidebar.
* I refactored some of the outcome selenium specs, mainly nesting
  and factoring out common code, but all previous specs are still
  present.

Test Plan:
* Log in as a teacher and go to a course's Outcomes page. You
  should see instructions titled "Setting up Outcomes."
  Make sure there are outcomes set up for the course.
* Log in as a student and access the same course's Outcomes page.
  There should not be instructions. Instead, the first item in the
  sidebar list should be selected, whether it is an outcome or an
  outcome group.
  (Please let me know if you'd like a screencast to demo this)

Change-Id: I9ff90fd9be2548c73ad14cae45895d678e0a81b3
Reviewed-on: https://gerrit.instructure.com/16877
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-01-18 10:25:12 -07:00
James Williams 90d9f7b7e2 don't send a request for every observed student on users tab
remedies a sub-optimal situation where a request was being
sent to retrieve the information for every single observed
user

also, fixes some development-only errors caused by
requests for missing observees

test plan:

* the simplest way to visually test the difference
would likely be to create many observers and observees (50+)
* notice on the users tab that the student information
for each observer appears at once, rather than slowly
(as each of the 50+ individual requests resolve)

happens to fix #CNVS-2367

Change-Id: I6405005ffb15117147f93de8ad0dc19d5285bb28
Reviewed-on: https://gerrit.instructure.com/16842
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-01-18 10:10:19 -07:00
Jacob Fugal a176b083f3 JSONToken helper module
for encoding/decoding a lightweight data structure as a base64 encoded
slug of json (e.g. for a URL)

Change-Id: I67aa20590628d3961a3a68f7e1178af548f8b5a6
Reviewed-on: https://gerrit.instructure.com/16711
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-01-18 09:49:28 -07:00
Ryan Florence b43abf9f79 fix jumpy android keyboard fixes #CNVS-2737
test plan:
1. go to canvas on offending android device
2. type your name in
   - keyboard should not bounce around

Change-Id: If7392e08660c9513ca3f50c19abef92a0e68a845
Reviewed-on: https://gerrit.instructure.com/16828
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Ruesch <joshr@instructure.com>
QA-Review: Josh Ruesch <joshr@instructure.com>
2013-01-17 19:41:40 -07:00
Ryan Florence f6529094d2 added DialogFormView
test plan:
1. specs should pass (there is no implementation
   anywhere to try)

note:
had to clean up after helpDialog specs that didn't
clean up after themselves

Change-Id: Ib0815cc1daddef754fedc6e2c6c342aec6deeec8
Reviewed-on: https://gerrit.instructure.com/16886
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-01-17 18:50:37 -07:00
Cameron Matheson 0de839e3fc ignore invalid assignment groups
refs #CNVS-1924

* If a course uses weighted assignment groups, assignment groups with 0
  points possible are always ignored.
* If the sum of assignment group weights in a course is less than 100%,
  scale the grade up to 100%

Test plan:
  Set up assignment groups to that match the above scenarios and make
  sure the totals are good.

Change-Id: I81ed523df79a863ba234c66cde367d2fb7def323
Reviewed-on: https://gerrit.instructure.com/16735
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-01-17 15:58:35 -07:00
Ryan Florence 18c828f20d added some helpers to QUnit
Change-Id: I71d94f50fe9c30fb561a4ddc14cced5fe4f20126
Reviewed-on: https://gerrit.instructure.com/16885
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-01-17 14:59:02 -07:00
Ryan Florence 8e114be4b2 make extending `View` more flexible
- no longer need to call super in `afterRender`
  (previously `filter`) to get all cacheEls, data
  bindings, etc.

- can extend `renderEl` instead of `render` to
  simply render the HTML of the element
  differently and still get all the afterRender
  stuff w/o calling it yourself

- `filter` -> `afterRender`

Change-Id: I3424f56934b6f2e184065b7d5cfd6cc787a97ac7
Reviewed-on: https://gerrit.instructure.com/16883
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-01-17 14:58:44 -07:00
James Williams 75b8817510 don't show hidden/locked files/folders to students in wiki sidebar
checks for locked/hidden status for the files and images tabs
on the wiki sidebar and doesn't show them to students

test plan:
* create a folder
 * lock it
 * or hide it
 * or disable the files navigation tab
* should not see the folder on sidebar as a student

* create a text file
 * lock it
 * or hide it
* should not see the file on sidebar as a student

* create an image file
 * lock it
 * or hide it
 * or disable the files navigation tab
* should not see the file in the images tab as a student

fixes #CNVS-2

Change-Id: I8d17a3c9b19d275a242c74a593736b17905e5ba9
Reviewed-on: https://gerrit.instructure.com/16511
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-01-17 13:19:01 -07:00
James Williams c3e2ddb19b link quizzes to assignments using assignment_migration_id
fixes a problem with certain D2L imports, where quizzes
had an attribute "assignment_migration_id" that wasn't being
used to actually find the assignment

test plan:
* import the example D2L import file
* the assignments in the group "Quizzes" should now
 be linked to the quizzes

closes #CNVS-1212

Change-Id: I7b5981ee5c88cee8a95ecc850e56cd9df7d6334e
Reviewed-on: https://gerrit.instructure.com/16600
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2013-01-17 09:05:13 -07:00
James Williams b900f55d0e gracefully handle invalid files on course copy
add a warning to the content migration instead of error out
when encountering a problem copying a file in the course
copy process.

test plan:
* try to copy a course that has an invalid file
(note: this might be difficult if not impossible to
set up through the UI... the easiest way
seems to be to run the following in the console:
  Attachment.update_all({:filename => nil},
  {:id => (-INSERT ATTACHMENT ID HERE-)})

fixes #CNVS-2169

Change-Id: Ie3cd11998f4a81ce8d79a756a8a65a31ec19bad3
Reviewed-on: https://gerrit.instructure.com/16705
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2013-01-17 09:04:56 -07:00
James Williams 6db8f7cafd keep columns regular on course settings users tab
test plan:

* add lots of users to a particular category,
 enough to trigger pagination
* then on the course settings users tab,
 scroll all the way down (to get the
 "loading more results" message)
* the column should not expand and
 push the other column

Change-Id: Ib67341c54a92f1f0dd063ec68bfc85f53c884cb3
Reviewed-on: https://gerrit.instructure.com/16285
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2013-01-17 09:02:57 -07:00
Ryan Florence 1884f8a585 added api to change a couple course settings
- allow_student_discussion_topics
- allow_student_forum_attachments

test plan:
- get /api/v1/courses/:course_id/settings, should
  get a json response with the two settings
- put /api/v1/courses/:course_id/settings with
  key:bool in the params and it should save

Change-Id: I36697fc9d071d17131fbfaa04a77082fa52a83cd
Reviewed-on: https://gerrit.instructure.com/16843
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-01-17 07:50:37 -07:00
Brian Palmer 10c949a2b9 pass the worker to unlock_orphaned_jobs as well
This can be useful for code hooks

test plan: no behavior change. jobs should still run as before.

Change-Id: I5016a8111ab2382811adb273148f2c72e9f50b24
Reviewed-on: https://gerrit.instructure.com/16884
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-01-16 16:24:10 -07:00
Cody Cutrer 35973e1c47 spec: fix a reload issue with plugins
Change-Id: Ic2cd13d34489ba22ee9e52909b3bdf1eeabfb95e
Reviewed-on: https://gerrit.instructure.com/16871
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <ethan@12spokes.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-01-16 14:58:30 -07:00
Ethan Vizitei 3dd5396418 authorize users to view files on remote shards
fixes #CNVS-2733

files_Controller was using "new" instead of "build"
on the attachments association for the user
to check rights.  Switching to build allowed
it to know which shard to look at.

TEST PLAN:
1) Login as a user (not a site admin, regular user)
 on a cluster remote from that
user's home cluster.

2) Click on the "settings" menu, top right corner.

3) Try to view your files tab.

4) you should not be prevented from viewing
your files due to an authorization error.

Change-Id: I8498084feb23e8de4b1301a0c8faf5d39f059295
Reviewed-on: https://gerrit.instructure.com/16841
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-01-16 14:54:40 -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
Brad Humphrey 224c18a7f3 mute assignments through the api
test plan:

 * create an assignment using the muted flag = true. It should be muted
 * update this assignment using the muted flag = false. It should not be muted
 * update this assignment without using the muted flag. It should not be muted

 * create an assignment using the muted flag = false. It should not be muted
 * update this assignment using the muted flag = true. It should be muted.
 * update this assignment without using the muted flag. It should be muted.

Change-Id: I07d1a83dc3cbbcb203ba4454f5d888b453898d7f
Reviewed-on: https://gerrit.instructure.com/16790
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-01-16 13:27:56 -07:00
Joe Tanner d74f46eb42 use @migrations_path when finding files for migrations
this fix is helpful for running specs outside of the current directory
(that's how my emacs plugin works and why I found the bug)

Change-Id: I9eaebcb279da236b4ec549f67bd322031cf9e4fd
Reviewed-on: https://gerrit.instructure.com/16530
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
2013-01-16 11:18:34 -07:00
Jon Jensen a1d2f65790 don't let users message the whole course if they can't send_messages
fixes #CNVS-2611

also fix broken account user permission check (an account user could view
all users in a course, regardless of permissions). simplify logic in
enrollment_visibility_level_for

test plan:
1. as a student, confirm you can message the whole course
2. under account permissions, revoke "Send messages to course members"
   from students
3. as a student, confirm you can only message admins in the course

Change-Id: I29d73c68b8d93c54616a515c699818025b4bb839
Reviewed-on: https://gerrit.instructure.com/16581
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
2013-01-16 11:06:23 -07:00
Cody Cutrer e637c94739 show sub accounts tab in site admin
they can be useful for organizing admins

test plan:
 * go to site admin
 * there should be a sub accounts tab

Change-Id: I89921e1d8973d3fcc4e5bb01d6115b99d92b6340
Reviewed-on: https://gerrit.instructure.com/16818
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-01-16 10:34:52 -07:00
Stanley Stuart 2409592c46 return null in $.toJSON for empty datepicker elements
Changes the behavior of $.toJSON to return null for datepicker elements
that have a blank 'date' data field (e.g. empty input boxes).
Previously, $.toJSON did not include the form element key/value because
$.extend does not include undefined properties. If someone were to
change a datepicker field's data 'date', the change would not be
reflected when someone called $.toJSON on the form element because
calling $(formElement).data( 'date' ) would return undefined, so the
consumer of $.toJSON would have to do some manual checking for the
missing input field's key.

Convenience!

test plan:
  - specs pass

Change-Id: I92c78e537bc08f216899c02817f66afabfb8583a
Reviewed-on: https://gerrit.instructure.com/16854
QA-Review: Stanley Stuart <stanley+gerrit@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-01-16 10:03:35 -07:00
Brian Palmer d2e735bb39 change how we build this error string
It's possible for an exception to have a nil message, in which case this
job worker process would die trying to do nil + "\n".

Change-Id: I7d6b4cb58fb47711e77ffc877b17f9248c401238
Reviewed-on: https://gerrit.instructure.com/16830
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <ethan@12spokes.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-01-16 09:38:00 -07:00