Commit Graph

2833 Commits

Author SHA1 Message Date
Jake Sorce c10b404097 upgrade to selenium 2.17 webdriver
Change-Id: I896f70f81a97ab3e9a3c2399aa17c420f72c1c54
Reviewed-on: https://gerrit.instructure.com/8206
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-01-23 09:30:38 -07:00
Jake Sorce 7215d2eb49 fixing some pending selenium tests
Change-Id: Ib8fe928589c858b893b1f17aacd9374a6e5c8212
Reviewed-on: https://gerrit.instructure.com/8177
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-01-20 16:06:21 -07:00
Jon Jensen 0b1655e76d conversation messages for submission comments, fixes #5443
this commit makes submission first-class citizens in conversations. this
means that when submission comments are added/deleted, or assignments are
unmuted, conversations and messages will be updated accordingly

the main impacts in the ui are:

1. submissions can be deleted from conversations. if a new comment is
   added, they will reappear
2. submissions factor into the message total for the conversation. each
   submission counts as a single message, even if there are multiple
   comments
3. submission messages affect unread-ness, and are reflected in the
   timestamp and text in the conversation preview

test plan:

1. confirm submissions appear in the appropriate conversations, i.e.
   * submissions with no comments should not appear in any conversations
   * submissions where there are comments but not by instructors:
     * should appear in each instructor's private conversation with the
       submitter
     * should not appear in the submitter's private conversations with
       anyone
   * submissions where there are comments by instructors:
     * should appear in each commenting instructor's private conversation
       with the submitter
     * should appear in submitter's private conversations with each
       commenting instructor
   adding or removing submission comments should update private
   conversations accordingly (e.g. when one teacher comments on a
   submission, it should be removed from the other teachers' private
   conversations with the submitter).
2. for each scenario above where the submission comments are added and
   appear in conversations, ensure that the submission as a whole behaves
   like a single conversation message, i.e.
   * the unread conversations count is incremented and the private
     conversation is marked as unread (if it didn't exist or was already
     read)
   * the latest submission comment and timestamp should be reflected in
     the conversation pane on the left side
   * you can delete the submission from the conversation. if new comments
     are posted on the submission, the submission should reappear in the
     conversation (provided it still matches the criteria in 1.). note
     that submission can not be forwarded to other conversations.
3. submissions should differ from traditional conversation messages in
   that:
   * they should not trigger conversation notifications
   * they should not create/bump conversation stream items. if a
     conversation has non-submission messages, the submission and its
     comments should appear in the stream item, but they should not
     cause it to jump to the top

migration:

existing submissions/comments will be migrated in, but not necessarily
through a traditional rails migration. to bring in those messages, run
the following from the rails console:

 Submission.find_each{ |s| s.create_or_update_conversations!(:migrate) }

Change-Id: I06dcb8728402a6c4c613d445b80432a1f2973b73
Reviewed-on: https://gerrit.instructure.com/8086
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-01-20 15:56:32 -07:00
Brian Palmer edf2e0a43a clean up some unused and inefficient indexes
We optimize one index to leave out null values, and drop a bunch of
indexes that aren't used, or aren't generally used.

Dropping the unused stream_items.user_id column also drops two more
large unused indexes.

test plan: n/a

Change-Id: I3872365151676e5ce0867f7d6826e5a0d4447bbd
Reviewed-on: https://gerrit.instructure.com/8200
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ben Chobot <bench@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-20 13:53:50 -07:00
Jake Sorce 7179d02d63 cleaning up sleeps in manage_groups selenium spec
Change-Id: I30560891cdbc8732bfc354468e8489d589ec788d
Reviewed-on: https://gerrit.instructure.com/8175
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-01-20 13:04:43 -07:00
Cody Cutrer d58dfaa134 improve error reports categories query on postgres
postgres can't/won't use the index for a DISTINCT query, so be a
bit more explicit with it to get it to use the index

test plan:
 * go to /error_reports
 * it should load fast, there should be a categories dropdown,
   and it should have a few things in it besides all categories
   (assuming you have some error reports)

Change-Id: If7c71cd669e7eadc1792eefe1fb6e85a08c054ed
Reviewed-on: https://gerrit.instructure.com/8190
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-20 12:44:21 -07:00
Jake Sorce 947e651584 added resize_screen_to_default to wiki_and_tiny selenium spec
Change-Id: I4876093013b180832dd5ff54647c036615f19a78
Reviewed-on: https://gerrit.instructure.com/8171
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-01-20 10:39:07 -07:00
Ryan Florence 7edc8c7d2c unpublished quiz preview fixes #6528
previewing the quiz is posted, and then redirected
with a get request but the preview parameter was
not passed through to the redirect, now it is.

test plan:
1. start a new quiz
2. add and save a question
3. click 'preview quiz'

you ought to be able to preview the quiz

also fixed the spec to check for the presence of
the questions container, rather than the title
since the title is present whether you're able to
preview the quiz or not.

Change-Id: I87a3a179ed79f464b7c765c9f23ba48226bb86ca
Reviewed-on: https://gerrit.instructure.com/8099
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-20 09:47:21 -07:00
Jacob Fugal 3fa57b33e8 fix invitees visiting unpublished courses
don't try and accept! (or reject!) when they're not actually invited.
only show "invitation accepted/rejected" flashes when it actually
happened. don't allow previewing invitees to see unpublished courses.
don't show invitation related flashes when displaying a "you can't look
at this" page. fixes #6708.

test-plan:
  - create unpublished courses in the default account and in a
    non-default account
  - create a user for each course and invite them as students to the courses
  - try and visit the courses as the respective students
  - both should see the "this course hasn't been published yet" page
  - both should see no flash-notice on that page
  - neither should be accepted to their course
  - create a user and invite them to one of the courses as a teacher
  - try and visit the course as the teacher
  - should not see the "this course hasn't been published yet" page

Change-Id: I5e6ce4541621bdc3d6dac0efe62a2741f7addabf
Reviewed-on: https://gerrit.instructure.com/8079
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-20 09:11:20 -07:00
Jake Sorce 187b26b6d3 selenium file cleanup
Change-Id: I34431e9fcdd05626e0f7d2b9ecfe8d760a8145ee
Reviewed-on: https://gerrit.instructure.com/8174
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-01-19 17:03:16 -07:00
Jake Sorce 5adfc2234f clean up wait_for_dom_ready in selenium files
Change-Id: I3265319a5b31ea778aa881ee7582eab66c517dbd
Reviewed-on: https://gerrit.instructure.com/8176
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-19 16:13:21 -07:00
Ryan Florence 929fea181b added js_env view/controller helper
this helper is the mechanism to send data from
rails to the JavaScript w/o requiring an xhr
or dumping data into the DOM and pulling it back
out /barf

you can call it from a view or a controller

test case:
1. call `js_env :FOO => 'bar'` in a view or
   in a controller
2. load the page
3. open the web console and inspect the ENV
   global JavaScript variable
4. ENV.FOO should be 'bar', wassupnow?

Change-Id: Ie079ba0ee610fc6a9e837cd1301ee29b08201e65
Reviewed-on: https://gerrit.instructure.com/8170
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-01-19 16:10:19 -07:00
Simon Williams 5b67d4de94 show outcomes from all associated accounts; fixes #6800
we were showing outcomes for associated accounts for course contexts but not
sub-account contexts. now we are.

test plan:
- create an account level outcome
- create a sub-account level rubric
- click find outcome criteria
- ensure that the account level outcome is available

Change-Id: I64a8feacadecd3bbc12eedc3c1c5ccea9b16360c
Reviewed-on: https://gerrit.instructure.com/8125
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-19 12:58:07 -07:00
Ryan Shaw 2bc8ebd637 show muted assignment indicator in gradebook2
there was already a tooltip as you hover over
each submission and the header menu let you mute/
unmute but I guess people wanted to see the little
'muted' icon in the header as well

in the process I broke it out into its own
handlebars template

fixes: #6804

test plan:
 * mute an assignment
 * go to gradebook2
 * look for a little mute icon in the header of
   that  column like on gradebook1

Change-Id: If728a4f11241440d377264123c0824edf05f12b3
Reviewed-on: https://gerrit.instructure.com/8114
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-01-19 12:39:51 -07:00
Jake Sorce d29b88bd81 updated selenium specs to use assert_flash_error and assert_flash_notice
Change-Id: I622214e35944a62acdb0324181a83926769f60d1
Reviewed-on: https://gerrit.instructure.com/8164
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-19 12:03:00 -07:00
Jake Sorce 95d90025f1 breaking up selenium wiki_spec
Change-Id: Ib229227d7755c25a4c95eab8cd18efd62d45e680
Reviewed-on: https://gerrit.instructure.com/8110
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-01-19 09:46:59 -07:00
Brian Whitmer 5e500c6b0a support https for retrieving lti xml configs
net http needs some additional config in order
to support https requests.

fixes #6938

test plan:
- try adding an external tool with an http url config
  (like http://lti-examples.heroku.com/config/course_navigation.xml)
- make sure it adds correctly

- try adding an external tool with an https url config
  (like https://lti-examples.heroku.com/config/course_navigation.xml)
- make sure it adds correctly

Change-Id: Ia26c7d383069bccf761f18a2993f352002cc868a
Reviewed-on: https://gerrit.instructure.com/8139
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-19 09:37:54 -07:00
Brian Whitmer 5ec76f22b3 fix sizing on external tool buttons
tinymce buttons are by default 20x20, but the external tool
icons are expected to be standard 16x16 icons, so they were
getting stretched. This fixes that using css to add some
padding for external tool buttons in tinymce.

fixes #6937

test plan:
- configure an external tool with an editor button on a course
  (like http://lti-examples.heroku.com/config/editor_button.xml)
- go to the rich editor in that course
- make sure the icon isn't stretched and ugly
- make sure the rest of the styling for the rich editor still
  looks the same

Change-Id: Ic46e37a812c20f70c00771cebe4e5cb9ccadc5f3
Reviewed-on: https://gerrit.instructure.com/8138
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-19 09:36:23 -07:00
Brian Palmer f279c75443 process page views from redis in transactional batches
This should make the database much happier

test plan: turn on queue mode for page views, generate a few page views,
and verify that they're still stored to the db after the job runs.

Change-Id: If90b543b805c7f599ce1865b669d4943cafb220d
Reviewed-on: https://gerrit.instructure.com/8161
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-18 17:01:03 -07:00
Jake Sorce 4e95a0f1bc modified selenium specs for IE
Change-Id: I61645b4d6fd54e96b0af186e532ef09e3f43e190
Reviewed-on: https://gerrit.instructure.com/8090
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-18 15:29:23 -07:00
Bryan Madsen 8c95f276cf flag selenium gradebook2 comment spec as pending
the test frequently fails when executed on aws

Change-Id: I70b1ea54b085754591e5ce1233ede3ce3c1c4dad
Reviewed-on: https://gerrit.instructure.com/8153
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-01-18 14:56:51 -07:00
Simon Williams db37920cf0 hide discussions from observers; closes #6825
provides a role override permission for viewing discussions. primarily useful
for disallowing observers from reading discussion, although by default it is
enabled.

test plan:
- create a course
- create a discussion (d1) in that course
- create a discussion assignment (d2) in that course
- log in as an observer and make sure you can see both discussions above
- log in as an admin and revoke the read_forum permission for observers
- log back in as the observer and make sure you can't see the discussions
- also check that the assignment shows the assignment page, but does not
  redirect to the associated discussion.

Change-Id: I4c6441c781c24e6aadacbfc23dcc307c772ecd2c
Reviewed-on: https://gerrit.instructure.com/8069
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-01-18 14:49:22 -07:00
Brian Whitmer 1ecfa15a2f course_navigation typo in stylesheet
fixes #6936

test plan:
- add a tool with course navigation from the external tools tab
  (like http://lti-examples.heroku.com/config/course_navigation.xml)
- make sure the tool says "Course navigation configured"
  in the external tools tab

Change-Id: I745d64d6557be4b90851c3301409ffb459a32fe2
Reviewed-on: https://gerrit.instructure.com/8137
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-18 11:19:56 -07:00
Brian Whitmer e0a12c0d97 account-level tools couldn't be configured by url
previously this would only work for course-level tools

fixes #6935

test plan:
- try adding a tool to an account by url configuration
- make sure it doesn't die

Change-Id: Id04a0619bd733d351098731cf2db67f8a26936dd
Reviewed-on: https://gerrit.instructure.com/8136
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-18 11:16:42 -07:00
Brian Palmer f8ada30070 only queue the process_attachment job when the attachment is created
If the job took more than a few seconds to start, more jobs for the same
attachment would get continually queued up.

fixes #6931

test plan: try to download a eportfolio export or submissions zip with
delayed jobs not running. you should only see one job queued up, no
matter how many times your browser does AJAX queries for status.

Change-Id: Icbdb75bf1c9e9f76af82b8d1bcb48e4b7e17abe5
Reviewed-on: https://gerrit.instructure.com/8129
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-18 09:19:34 -07:00
Jon Jensen 28b3e8da84 fix conversation loading errors, closes #6812
Change-Id: Idaafd241be4dfa62197245e792342d11a1cc046e
Reviewed-on: https://gerrit.instructure.com/8109
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-01-17 21:23:54 -07:00
Jake Sorce 7463327968 upgrading selenium webdriver to 2.15.0
Change-Id: Ie5b8d087c70ff6ab6117257770f2f6274583a41d
Reviewed-on: https://gerrit.instructure.com/8094
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-17 17:44:24 -07:00
Brian Palmer df391f36ed i18n:check skip vendor/ except for vendor/plugins/
test plan: run rake i18n:check, it should skip stuff like vendor/ruby

Change-Id: I67e0e75515d3506f8c03352573848a053a5102d0
Reviewed-on: https://gerrit.instructure.com/7828
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-01-17 15:53:36 -07:00
Brian Palmer 23a9facbee handle Timeout::Error in redis caching
Hook into the redis library at a pretty low level, to try and do
everything we can to avoid erroring if redis goes down. This applies to
both redis-as-cache and redis-as-data-store.

test plan: Set up redis and caching in your local instance. Point it to
both an existing box on a port not running redis, and a non-existent IP.
In both situations, you should not see caching errors or redis data
errors. After the first error, it shouldn't attempt to hit redis again for 5
minutes.

Change-Id: I101b2d3d2123151b244eb82ba78b176ed1f4d5ad
Reviewed-on: https://gerrit.instructure.com/8097
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-17 13:13:50 -07:00
Cody Cutrer bf80ea4eb9 handle MalformedCSV errors gracefully fixes #6814
run the file completely through the parser before giving it to the
importers, and fail-fast with a useful error message

test plan:
 * import an SIS file with mismatched quotes
 * you should get a warning about malformed CSV, not a reference
   to "Error while importing CSV. Please contact support."

Change-Id: If785910e76bce6fcc2efe5507febcbfc14727a05
Reviewed-on: https://gerrit.instructure.com/8095
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-01-17 10:56:52 -07:00
Jon Jensen 7acc8b91be make group conferences available to course admins, fixes #6681
this brings the overly strict tab display permission in line with the
other controller/view checks... provided an admin can manage or even
just view group pages, they can see web conferences.

Change-Id: I8412b3e62ad053e33a1219f1c52dbdf0b1110958
Reviewed-on: https://gerrit.instructure.com/8102
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jon Jensen <jon@instructure.com>
2012-01-17 10:23:00 -07:00
Ryan Shaw ea973909f5 fix include_ungraded_assignments behavior of gradebook2
When I made gradebook2 I thought "include ungraded
assignments" was to show/hide "not-graded" assignments
it is actually there to adjust how final scores are
displayed. So that was bug 1

bug 2 was that toggling that setting did not
actually update final grade percentages.

also, reword the setting in the header to say:
"Treat ungraded as 0's"
instead of:
"Include Ungraded Assignments"
because it is less confusing

test plan

 * create an assignment of type 'not-graded'
 * make sure it does not show up in gradebook2
 * in gradebook2 click the "Treat ungraded as 0's"
   option in the cog menu in the header
 * make sure that total columns change to reflect
   treating ungraded assignments as a score of 0

Change-Id: I276d02dfcf13acafd49ce2697a8f4b4bca6bef64
fixes: #6765
Reviewed-on: https://gerrit.instructure.com/8107
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
2012-01-17 09:47:11 -07:00
Bryan Madsen b9b8381843 fix intermittently failing selenium specs
Change-Id: I06fb42b44dc807399862f5f8a6d93d8cd911a74c
Reviewed-on: https://gerrit.instructure.com/8093
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
2012-01-17 09:43:05 -07:00
Cody Cutrer e8c05e675d fix returning the correct pseudonym in the API
test plain:
 * create a user with multiple pseudonyms in multiple accounts
 * API requests should return the pseudonym info only of
   pseudonyms that apply to the account related to the request
   being sent
 * SIS info should be returned even if a non SIS pseudonym is
   listed first

Change-Id: I895cc6fe2854dcd768590eeae16304b6092f2317
Reviewed-on: https://gerrit.instructure.com/8081
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-17 08:50:22 -07:00
Ryan Shaw 9f5735924a fix gradebook2 "add a comment" spec
this is mostly just to get rid of some useless
`keep_trying_until`s

Change-Id: Iaac9f67a5db482e3858c53eacd99bbb497f12f61
Reviewed-on: https://gerrit.instructure.com/8045
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-01-16 21:36:11 -07:00
Ryan Florence 6ce1be26b6 moved rubric criterion comments fixes #6659
comments were supposed to display when you clicked
a green bubble in the grade summary page, but they
didn't

this commit changes the behavior to display the
comments in the table instead of hidden in a popup

test plan:

1. create a new assignment
2. add a rubric to the assignment
3. click 'user this rubric for assignment grading'
4. ensure that 'free-form' comments is unchecked
5. turn in the assignment as a student
6. open the assignment in speed grader
7. click "view rubric"
8. click the green comment bubble and add a comment
9. go to /courses/:course_id/grades/:student_id
10. click 'show all details'
11. view the "instructor comments" under the
    description of the criterion

Change-Id: I80008fb1ea8b17db045edc067595d7430978bb78
Reviewed-on: https://gerrit.instructure.com/8067
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-16 20:31:36 -07:00
Zach Wily 5896d1fd78 don't error on the comm prefs page; refs #6914
When a user's immediate messages start getting throttled (like when they've
received 50 in a day), we create a NotificationPolicy for that user with no
Notification. That's not an ideal design, but rather than fix that now, we're
just going to make sure those policies don't cause errors

test plan:
 * See specs.

Change-Id: Ib262b256a9d4fe5fe7fd882d6848883e7a40cb59
Reviewed-on: https://gerrit.instructure.com/8096
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-16 14:46:48 -07:00
Bracken Mosbacker 52d33b968b add ability to add designers on course settings page
Before this you could only add designers through SIS, now
you can add it like any of the other roles

Test Plan:
* add a designer to a course
* Note, because of #6194 designers can't see unpublished courses right now

closes #4057

Change-Id: Ia1fc0dba52605430097c663de876bdc4b951b09b
Reviewed-on: https://gerrit.instructure.com/7253
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-16 14:19:22 -07:00
Ryan Shaw 6d54e8335b populate middle_score of curveGradesDialog on open
Change-Id: I1ea86a4146be03496668946192938d13957f75a4
Reviewed-on: https://gerrit.instructure.com/8071
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-01-16 13:49:10 -07:00
Cody Cutrer d102d750f4 stubs for sharding specs
test plan: n/a

Change-Id: I4ae3f7cff199e1afe8daf58877e6d6edfe03ddcd
Reviewed-on: https://gerrit.instructure.com/8057
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-16 11:05:57 -07:00
Zach Wily 179a10ff87 don't send files to users in public courses we shouldn't; fixes #6868
ContentZipper for some reason was allowing fetching all files (as if a
teacher) when user was not specified. This fixes that and requires correct
permissions when zipping up a folder.

It also runs a migration which will delete existing folder zip files for
anonymous users, since those are cached.

test plan:
 * Create a public course and put some files in it.
 * Lock and hide some of those files.
 * Log out and browse to the course files.
 * Choose "download zip file".
 * Verify that the zip file you get only has visible files in it.

Change-Id: Icf5929f7d1dbc4a7f2122337aff9ed6ae003af12
Reviewed-on: https://gerrit.instructure.com/8085
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-16 10:50:47 -07:00
Jon Jensen 4e3bec93cf prevent duplicate key errors, fixes #6379
1. fixed a double ajax post issue in chrome/safari
2. more generally, added transactional retry smarts to
Assignment.find_or_create_submission for anywhere else this could happen

test plan:

1. ensure submissions are created without errors in all supported dbs
(e.g. normal submission and what-if scores for unsubmitted assignments)
2. ensure what-if scores are logged properly in all supported browsers
and do not result in duplicate ajax calls

Change-Id: I0ea7c3de4588f8da4d4707dc8ee547929648a5f8
Reviewed-on: https://gerrit.instructure.com/7950
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-01-16 10:50:03 -07:00
Brian Palmer c57a56a4a9 don't store broadcast policy procs on AR objects
After saving an object that has a broadcast policy, it has a bunch of
procs stored in an instance variable. This breaks Marshal, and thus
caching.

This doesn't fix any known bugs, it's just a precaution against future
issues arising.

refs #6867

test plan: This isn't reproducable from the app, though it's
simple enough from the rails console.

Change-Id: If47b4618966ac82d472fc8d2303fd333aa2001ce
Reviewed-on: https://gerrit.instructure.com/8049
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-16 10:48:19 -07:00
Cody Cutrer 31f9b3ffea explicitly use memoizeable in communication_channel
we include memoizable in AR::Base in an initializer, but that runs
after plugin initializers, so we have to do this if a plugin needs
to use CommunicationChannel in its initializer

test plan: n/a

Change-Id: Iddd4141ab816b0b98358bdda3a325a0725f81994
Reviewed-on: https://gerrit.instructure.com/8082
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-01-16 10:14:18 -07:00
Brian Palmer d3afd88e6b remove base object from json error responses
refs #6733

test plan: make an api call leaving out a required parameter, and verify
that the errors response doesn't include the full AR object with all
attributes.

Change-Id: I4ab629a04060f5f92afa5ce71fe6ef1dee1b520b
Reviewed-on: https://gerrit.instructure.com/7713
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2012-01-16 10:10:26 -07:00
Jacob Fugal 39b5821b13 fix adding logins from user-in-account page
with recent refactoring around API, PseudonymsController#create started
assuming @context was an Account. but POSTing to /users/X/pseudonyms
still sets a User as the @context. make the controller treat that
correctly.

test-plan:
  - go to the account page (/accounts/X)
  - add a user; go to that user's page (/accounts/X/users/Y)
  - click "Add Login" and fill in and submit the form
  - there should not be an "Oops" flash

Change-Id: I61eba093b6cb9c46849f5d03426fce039645e47e
Reviewed-on: https://gerrit.instructure.com/8080
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-15 23:26:25 -07:00
Jacob Fugal 317378f775 straighten out course designer permissions
fixes #6194

test-plan:
  - create a course
  - create a user
  - add the user to the course as a designer
    (course.add_designer(user).accept in script/console)
  - the user should be able to do almost everything a teacher can in the
    course
  - the user should *not* be able to view grades or user notes
  - the user should *not* be included in the course roster

Change-Id: Id0e642fb19906529627917fffac26f0dae378bcc
Reviewed-on: https://gerrit.instructure.com/8047
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
2012-01-13 18:56:50 -07:00
Jake Sorce f15899da85 adding to the assignments selenium spec
Change-Id: Ifedece12e9275cf0f2cd4042b08c3e3dd2937191
Reviewed-on: https://gerrit.instructure.com/8077
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-01-13 17:55:16 -07:00
Jake Sorce 5f1ab7a1e9 adding student tests to the collaboration selenium spec
Change-Id: I888cf8b0905953a7f635381b19a90bb903fc50c9
Reviewed-on: https://gerrit.instructure.com/8060
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-01-13 17:06:53 -07:00
Cody Cutrer a81a4ea5c3 add data model validation that a pseudonym has an account and user
this is already true, just make sure it stays that way

test plan: n/a

Change-Id: Ia7340e8de57b18da509d51580b5827c7069af80a
Reviewed-on: https://gerrit.instructure.com/7166
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2012-01-13 16:25:51 -07:00