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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>