Commit Graph

20 Commits

Author SHA1 Message Date
Ryan Florence c53a4eaa16 added course data to Submission stream items
test plan:
1. make a request to the user activity stream api
2. observe the course data
3. make sure it matches what the course api would
   return

Change-Id: I13cae11545567a5662bb247f96f93f823d301d52
Reviewed-on: https://gerrit.instructure.com/11725
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-06-21 10:04:32 -06:00
Brian Palmer 9be4a8edea improve cross-shard collection item and activity stream support
Create upvotes in the upvoting user's shard, so we can query for them,
and make the upvote_count and post_count cached counts update properly
cross-shard.

Remove a foreign key constraint that was preventing users on other
shards from posting items to a collection.

Create stream_item_instances on the user's shard, and make sure to query
them from there.

Further work should be done to optimize :include so that we can
efficient pull in the stream items for the instances.

test plan: as a user on one shard, interact with a collection on another
shard -- posting to it, upvoting/downvoting, cloning items from that and
other shards. verify you don't get errors, missing data, or incorrect
counts.

Change-Id: I91aeebd404cd20663a533b2f38c08ec90c65868e
Reviewed-on: https://gerrit.instructure.com/11228
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-06-07 14:31:45 -06:00
Brian Palmer 25d698a003 add collection items to the activity stream
When a new item is created, all users following the collection will get
an activity stream post, except for the user who created the item.

This stream item type doesn't show up in the existing dashboard, but is
returned by the API.

test plan: use the api to create two users, and a collection, and have
them both follow the collection. Have user A create an item in the
collection. Verify that user B gets a stream item, but user A doesn't.

Change-Id: I84b6e537ce913e17e9480074ecce08bc99f3e14b
Reviewed-on: https://gerrit.instructure.com/11205
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-06-06 14:13:41 -06:00
Brian Palmer 5b04db4372 fix notifications showing up in course streams
They weren't using the course/group for the context_code, so they would
only show up in the global stream.

Note this doesn't fix existing stream items, just new ones going
forward.

test plan: add an assignment or generate any other sort of notification
that gets sent to the stream. verify that it shows up both on the
dashboard and on the individual course/group stream.

Change-Id: Icfa1430545e80c575c76960a7267ae1d7d8ddad4
Reviewed-on: https://gerrit.instructure.com/10842
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-17 14:47:28 -06:00
Brian Palmer 3a570ddfbe paginate the activity stream apis
These were hard coded to always return 21 items, same as the dashboard
screens in the web UI. They're now fully pagniated, though the per_page
default in this case is 21, to match the old behavior.

test plan: make an api call to users/self/activity_stream and
courses/X/activity_stream, and verify the pagniation. this touches the
code for the activity stream in the ui in a refactor, but shouldn't have
any visible changes.

Change-Id: I8da63eb4e03bb616d66d0af27efa30ef786dd3dd
Reviewed-on: https://gerrit.instructure.com/10678
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-05-17 10:57:39 -06:00
Cody Cutrer b92c17f11d don't infer the current user for nil DiscussionTopic#user in the stream
fixes #8403

test plan:
 * import an external content package with discussion topics
 * make sure to find a discussion topic that has no author
 * on the dashboard of a user that has a stream item about that topic
   it should not show that the current user is the author

Change-Id: I681be31462a82591d60665dce967aa1548ef3a07
Reviewed-on: https://gerrit.instructure.com/10579
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-05-08 12:55:24 -06:00
Jon Jensen db48cddd3e uncheck group comment by default, fixes #7206
also added checkbox (and api support, etc.) to assignment submission
forms and gradebook2

test plan:
1.  create a group assignment
2.  as a student, go to submit the assignment
3.  ensure the group comment checkbox is present and unchecked on all
    submission forms (file upload, text entry, etc.)
4.  ensure that checking it sends a group comment and leaving it
    unchecked does not
5.  go to the submission details
6.  ensure that the group comment checkbox is unchecked by default
7.  as a teacher, go to the speedgrader and ensure the checkbox is
    unchecked
8.  go to the gradebook and ensure the checkbox is unchecked
9.  go to gradebook2 and ensure it is unchecked and functional (wasn't
    present before)
10. delete all comments and go to the dashboard. ensure that when you go
    to add the first comment, you have a working group comment checkbox
    (if there are existing comments on the stream item, you won't have a
    real comment form, just a link that looks like a text area)

Change-Id: I009b797c2b391c20f41f33c7c0b8afdd4b57dbd3
Reviewed-on: https://gerrit.instructure.com/8978
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-03-01 14:05:35 -07:00
Jon Jensen a41081cf22 fix dashboard notifications for appointments
display stream items for new and updated appointment groups, as well as
when someone signs up another user (e.g. group signup)

removed unused message templates, fixed date_string range to just show a
single date if date parts are the same

test plan:

1. publish an appointment group and ensure all pertinent students get a
dashboard notification
2. add times to an appointment group and ensure all pertinent students
get a dashboard notification
3. sign up a group for a timeslot and ensure all other group members
get a dashboard notification

Change-Id: Id0dec52c0376fb6e14b0f26bb60e4695b25f7591
Reviewed-on: https://gerrit.instructure.com/7938
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-10 13:40:25 -07:00
Bracken Mosbacker 5c57abea78 don't show discussion responses in stream when not allowed
Discussions have an option to not allow users to see replies
until they've posted themselves. This worked correctly on the
discussion page itself, but the user would still see the
replies in their stream

This also removes that option, and the delayed posting option
from group discussion topics. These settings are useless in
that context because all users are admins and can see the
topics anyway.

Test Plan:
 * create a topic in a course and check the box "Replies are not visible until after users post"
 * post a reply to that topic as the teacher
 * log in as a student in that course and go to your dashboard
 * you should see the topic in the stream but not the response you created as a teacher

closes #4706

Change-Id: I0c50a3adb8e18ea74d209f4c9a5ac429b7faaf0e
Reviewed-on: https://gerrit.instructure.com/6684
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-04 12:27:27 -06:00
Zach Pendleton 9572eb1fa2 add "mute" function to assignments. fixes #5101
"Mute Assignment" links in gradebook and speedgrader
stop all announcements, emails, and stream items for grades
and comments from appearing until the teacher unmutes the
assignment.

Change-Id: Id74b305b568ff86e2a0e6f9319cfa40bb98b1bcd
Reviewed-on: https://gerrit.instructure.com/5779
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Zach Pendleton <zachp@instructure.com>
2011-09-30 17:28:25 -06:00
Zach Pendleton 488da4fd2e only display undeleted messages in dashboard. fixes #5460
Stop storing recent messages in conversation stream, as streams
don't exist on user level and so can't reflect user differences
in deleted messages.

Change-Id: I4750f7c58bf80e9f06060eb089fe83cfc5668d2b
Reviewed-on: https://gerrit.instructure.com/5646
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-09-22 15:35:32 -06:00
Jacob Fugal 1a761c2d1f explicit utc db times in update_all
update_all's update hash doesn't have any magic performed on bare Time
objects; it assumes any Time object it's given is already in UTC. using
a TimeWithZone object (regardless of timezone), which Fixnum#ago and
friends happen to return, is still fine.

Change-Id: I297b2a3211b896b5225ebcfaaee3c1eb56e55fb6
Reviewed-on: https://gerrit.instructure.com/5351
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-08-30 16:46:25 -06:00
Brian Palmer 3d9eead696 api for the activity stream, closes #4740
Change-Id: If3a56f635dd6dbd93edc920f0bd0c5cadd709490
Reviewed-on: https://gerrit.instructure.com/4748
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-08-23 09:13:20 -06:00
Jacob Fugal 0d86332f91 Conversations in the dashboard stream
and ContextMessages out

Change-Id: I70a17794a2054b865c719114e41537927e97dc6d
Reviewed-on: https://gerrit.instructure.com/4877
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-31 16:47:07 -06:00
Brian Palmer 92feb2bcdb replace ActiveRecord::Base calls with subclass calls where it makes sense
This was already a small issue if the job queue was on a different
database driver than the main database, and it'll become more important
as more AR connections are introduced.

Change-Id: I204becadd32bb935df096e8c937a04bb6962f0b2
Reviewed-on: https://gerrit.instructure.com/4601
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-18 13:56:08 -06:00
Cody Cutrer bdbebfaec8 check all models for protecting attributes refs #3847
Change-Id: I7cba6e26ad98e91723e2ccf0a28b8db79bb37b5c
Reviewed-on: https://gerrit.instructure.com/3631
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-25 17:38:50 -06:00
Zach Wily a0c02b40f7 don't include the submission body in submission stream items
We're only using submission stream items for displaying submission comments,
so the body is not necessary and a waste of space.

Change-Id: Ic214eb53565368c3550f8238a83f6120a624e62b
Reviewed-on: https://gerrit.instructure.com/3126
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-04-16 17:45:32 -06:00
Brian Palmer 520fb21130 remove legacy stream item support, closes #3647
Change-Id: I9c6d5d02726eb523672c413a81112b17d82fc62c
Reviewed-on: https://gerrit.instructure.com/2229
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-02-10 09:52:45 -07:00
Brian Palmer e988de9906 remove old stream items with a periodic job, refs #3647
Change-Id: I4d66747016f5ce13d02ea413e362153633f0362a
Reviewed-on: https://gerrit.instructure.com/2228
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-02-10 09:52:38 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00