Commit Graph

24 Commits

Author SHA1 Message Date
Christine Yan c1eafebe28 Fix link for anonymous peer review
fixes GRADE-2160

Test plan:
- Create a course and assignment with Anonymous Peer reviews enabled
- Add 2 students with immediate notifications for peer reviews enabled
- Have both students submit to assignment
- As a student, go to Dashboard and click the Anonymous Peer Review link
under Recent Activity
- Check student's messages for Anonymous Peer Review notification and
follow the link
- Neither link should result in error

Change-Id: Ibd0cb0e72a5d370dfef15b1462a84a8b2a727b40
Reviewed-on: https://gerrit.instructure.com/199808
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-07-18 19:28:30 +00:00
Landon Gilbert-Bland 274d1a68fa Fix timestamp for group conversation in activity stream
This will now show the last message that the user was part of in
the activity stream instead of the last message sent to anyone in
the parent conversation.

Fixes COMMS-1468

Test Plan:
  * Have a course with at least one teacher and two students
  * As the teacher, send a message to both students
  * Go to student 1's dashboard and select the activity stream. Notice
    the timestamp for the message
  * Wait for 60 seconds
  * As student 2, reply to the message (only reply to the teacher).
  * If you have redis caching setup, flush the cache here by running
    `redis-cli` in a terminal, then running `flushdb`
  * As student 1, reload your dashboard and notice the timestamp for
    the conversation hasn't been changed.

Change-Id: I51968966643f351faaf46bcdfce542ec77617039
Reviewed-on: https://gerrit.instructure.com/165893
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
2018-09-26 18:24:51 +00:00
Jon Willesen 7f515bc1db remove invalid peer reviews from recent activity
categorize_stream_items now checks the :read permission instead of just
checking whether the assignment is published.

fixes ADMIN-530

test plan:
* create a peer review
* go to the course as a student
** see the peer review in the course activity
* remove peer reviews from the assignment
* flush redis cache
* student should no longer see the peer review on their recent activity

Change-Id: I4e047ae80a63729ac663c63cdba26a1548c65d48
Reviewed-on: https://gerrit.instructure.com/132654
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2017-11-22 21:01:44 +00:00
Simon Williams affa953f61 drop Message#asset_context and DelayedNotification#asset_context
name did not match usage, and all remaining usage can be satisfied in
other ways.

closes CNVS-38407

test plan: regression test message sending (immediate, delayed, and
dashboard notifications w/ stream items)

Change-Id: Ibe110527b4644cbaa417c53b2b53c2fd7e18dc9e
Reviewed-on: https://gerrit.instructure.com/120520
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Reviewed-by: Matt Smith <msmith@instructure.com>
Reviewed-by: Benjamin Christian Nelson <bcnelson@instructure.com>
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-08-22 17:47:51 +00:00
Landon Wilkins ec8d4e35ba da licença part 17
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I7207e8ca3ee16bc67219263692dea100d0d5ec59
Reviewed-on: https://gerrit.instructure.com/110038
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:53:50 +00:00
James Williams 67b8fb6025 improve user_dashboard recent activity stream performance
fix some N+1 queries, repeated time_zone calls,
and add a temporary cache around expensive stream item code

Change-Id: Iae5c385d6fd5917d9f35626e2d160ad71074f498
Reviewed-on: https://gerrit.instructure.com/87012
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-08 14:50:08 +00:00
James Williams 06a54136b2 rails 4.2: stream item fixes
refs #CNSV-26056

Change-Id: I2a87fa63249a882680d3ee0c76f08d458433f6f9
Reviewed-on: https://gerrit.instructure.com/69524
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-12-30 17:25:39 +00:00
Brandon Broschinsky dbc9c5151e Show anonymous user on peer reviews when setting enabled
refs: PFS-2039, CNVS-18186, PFS-2040, CNVS-18187

**Test Plan
1. Create assignment in course
2. require peer reviews on assignment, and select anonymous peer
reviews.
3. create a couple student enrollments in course, and teacher
4. assign peer reviews for assignment
5. as on student submit an assignment.
6. as a user assigned to peer review go to home page make sure
anonymous user shows for user on peer review.
7. go to perform peer review, make sure the students name
who made the submission doesn't show.
8. make comment on review and make sure anonymous user shows
when student reviews comments.
9. do the above without anonymous review checked and make sure
the names are visible.

1. Enable crocdoc
2. submit an assignment with an attachment for an assignment
with anonymous peer reviews.
3. review assignment in crocdoc, user should not be able
to view or create annotations.

1. make sure that anonymous peer reviews are available when creating
   an assignment

2. make sure anonymous peer reviews are not available when creating
   a graded discussion.

Change-Id: I30220042ab9e30b226385398c63eb8792e640197
Reviewed-on: https://gerrit.instructure.com/56624
QA-Review: Adam Stone <astone@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Tested-by: Jenkins
Product-Review: Brandon Broschinsky <brandonbr@instructure.com>
2015-07-08 21:18:45 +00:00
Jacob Fugal e2d2783140 fix cross-shard dashboard links
fixes CNVS-18522

the links for the dashboard stream items need to be generated with the
domain root account's shard activated, not the user's shard.

test-plan:
 - have a course and user in root account A
 - enroll the user in the course
 - create some dashboard stream items for the user in the course (e.g.
   new discussion, assignment, etc.)
 - have the same user also associated with root account B on a distinct
   shard
 - view the user's dashboard while on account B's domain
 - links to items in the course (on account A's shard) should have a
   shortened global ID rather than just a local ID
 - following those links should successfully take you to the course on
   account A's domain

Change-Id: I75b269cf3f1eb3074a8f908dcd0c2249b325f8e6
Reviewed-on: https://gerrit.instructure.com/53961
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2015-06-18 15:21:52 +00:00
Jon Jensen 5a040333cd i18nliner(.rb)
this swaps out (most of) our ruby haax with i18nliner

test plan:
1. verify string extraction:
   1. `rake i18n:generate` before and after this commit
   2. confirm `config/locales/generated/en.yml` is identical
2. verify english defaults:
   1. use canvas in english
   2. confirm everything looks correct
3. verify translation keys/scopes:
   1. run canvas w/ RAILS_LOAD_ALL_LOCALES=true and optimized js
   2. use canvas in spanish
   3. confirm that todo está bien
4. confirm you can now use i18nliner-y features:
   1. call `t` without a key
   2. use the fancy erb block syntax

Change-Id: I979479c0889fe7e31ee0c962a4bd1998ab54d711
Reviewed-on: https://gerrit.instructure.com/42785
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-10-29 21:59:39 +00:00
Cody Cutrer 5d0008f18b don't use write_attribute as temp storage for conversation stream items
refs CNVS-15830

test plan:
 * involve yourself in a conversation
 * on your dashboard, the last message and last author info should be
   correct and not asplode

Change-Id: I997be1a0f40939d1999ffbc99ec7b28ed322ffbc
Reviewed-on: https://gerrit.instructure.com/41976
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-10-06 21:02:50 +00:00
Cody Cutrer 13b297c04b don't write a non-attribute onto models
refs CNVS-15830

this is deprecated in rails 3, and raises an error in rails 4

test plan:
 * dashboard and course streams should still work

Change-Id: I180ae447ac7f384659d91d6e8382e5a7d5703576
Reviewed-on: https://gerrit.instructure.com/41788
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-09-27 17:11:25 +00:00
Drew Bowman 99f8b1d73d give more access to peer reviews
fixes CNVS-1455

test plan:

- create a graded discussion that requires peer review
- the discussion should have a peer review icon in listings
- assign peer reviews to students
- the students should have a peer review link in their
  activity stream

Change-Id: I416c876c9e21b5ce2a72c46fceb7a33bdfd3f96e
Reviewed-on: https://gerrit.instructure.com/36459
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: David Josse <david@instructure.com>
2014-08-08 16:18:45 +00:00
Ethan Vizitei 3c19c96287 apply dual timezone filters
closes: CNVS-9814

add support throughout our formatting layer
to give us a way to convert values
to the wall clock time of the timezone for
a course (or really any other way we choose),
and then apply that to several selected
date/time displays.

TEST PLAN:

- Login as a user who's part of a course
with at least some data in each tab
- Check the following areas to ensure that
the correct timezone-differentiated hover
text is showing up:
  * Announcements -> Date Sent column
  * Announcement Detail -> Date Sent (top right)
  * Assignments -> Due Date column
  * Assignment Detail -> Due Date (bottom table)
  * Collaborations -> Start Date
  * Discussions -> Last Post Date
  * Discussions -> Due Date
  * Discussion Detail -> Post date of each reply
  * Modules -> (if locked) shows date to unlock
  * Quizzes -> Due Date
  * Syllabus -> Dates on the left
  * Syllabus -> Due dates on the right
  * Settings -> Course Details -> start/end date
  * Settings -> Sections -> start/end date
  * Recent activity page -> Everything

Change-Id: I048c2de85d9f9b196d35c6c65ae104dab7441eee
Reviewed-on: https://gerrit.instructure.com/34861
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2014-05-23 19:01:34 +00:00
Kenneth Romney 31361b5255 extract lib/text_helper to gems/canvas_text_helper
fixes: CNVS-12305

test plan:
summaries email should be formatted correctly with indentations.
twitter messages should not be longer than 140 characters.

Change-Id: I912a63b03c6c14de0c1d678063bb8fa33504d843
Reviewed-on: https://gerrit.instructure.com/33171
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-30 15:18:40 +00:00
Jon Jensen e6870fce02 fix cross-shard stream item dismissal, fixes CNVS-1404
1. make sure the returned stream item ids are relative to the user, not
   the domain, since we need to look up the instances by those ids from
   the user's shard later
2. make sure we actually handle shortened global ids, rather than
   asploding
3. just cache stream items on the user's shard, not on every shard the
   user visits. makes cache invalidation practical/possible

test plan:
1. set up canvas with redis and sharding
2. set up two additional shards (your user is in the initial/primary one)
3. enroll your user in a course in the second shard
4. as another user, do something that creates a stream item for the course
   (e.g. create an announcement)
5. as the original user, confirm that:
   1. you see the stream item on your shard's dashboard
   2. you can dismiss the stream item
   3. when you refresh the page, it is still dismissed
6. repeat step 4.
7. as the original user, confirm that:
   1. you can see the stream item on the shard 3 dashboard
   2. you can dismiss the stream item
   3. when you refresh the page, it is still dismissed
8. as the original user, confirm that the items are dismissed from your
   dashboard on all shards

Change-Id: I2c600685015640af36d9e33ac71e25cd536d7391
Reviewed-on: https://gerrit.instructure.com/24155
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-09-18 15:32:36 +00:00
Eric Berry 48ca088666 Locked graded discussions are now visible to students
fixes CNVS-5309

test steps:
- as a teacher, create a few discussion topics with graded
  checked and due, begin and until dates are in the future, past
  and current.
- as a student, view the discussions list and ensure that the
  present and past topics are visible but the future is not.
- click the past discussion topic and make sure you are able to
  view the discussion but not reply to it.
- click the present discussion and make sure that you can reply
  to it.
- as the student and teacher, ensure that the visible discussion
  topics appear in the stream items (dashboard) and the future
  do not (for the student).

Change-Id: Ibb0a3d05ae830e764c8068a6c9d4ead804e91139
Reviewed-on: https://gerrit.instructure.com/20082
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-05-02 17:21:31 +00:00
Jon Jensen c51c4fbe0c skip the message if we can't find the participant record
Change-Id: Ie771b72283de9831de182d72e2f6c26a7754e67a
Reviewed-on: https://gerrit.instructure.com/16338
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
QA-Review: Zach Wily <zach@instructure.com>
2012-12-22 08:48:24 -07:00
Cody Cutrer c78f334c4f get the last author from the last message, not the stream item
Change-Id: I3092383b8898f17f7bf1f4c97fb113f322f3797d
Reviewed-on: https://gerrit.instructure.com/16337
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-12-22 08:19:38 -07:00
Cody Cutrer 8adadea4ee avoid calling author on nil object
Change-Id: I6b6a5fb537a3e6fbd8321d124f3e4e3b905995e7
Reviewed-on: https://gerrit.instructure.com/16335
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2012-12-22 08:10:15 -07:00
Jon Willesen bb22a92259 creating submission comments no longer goes to author's inbox
To support instructors of MOOCs, making a submission comment
via gradebook or speedgrader should no longer create a
conversation message in the instructor's inbox. The
conversation will only exist in the sent folder.

If a private conversation between the teacher and student
already exists, the message will be added to the private
conversation and its state will not be modified for the teacher.

In general, the behavior of submission comments was changed so
that creating a submission comment does not create a message in
the author's inbox. Instead the message should appear in the
author's sent folder. This applies to all users (teachers and
students).

fixes #CNVS-1162

test plan:
 - As a teacher, create a submission comment from gradebook.
 Make sure the comment doesn't show up in the teacher's inbox.
 - As a teacher, create a submission comment from speedgrader.
 Make sure the comment doesn't show up in the teacher's inbox.

 - In general, create submission comments as a teacher and a
 student and run through the following combinations of states:

 - Existing Private Conversations:
   - If a private conversation between the student and the
   teacher already exists, the state of the message should not
   be updated for the submission comment author.
   - If a private conversation between the student and the
   teacher does not already exist, the message should only show
   up in the sent folder for the submission comment author.

 - Notification Preference: Mark new submission comments as read
   - Setting this should still prevent incoming submission
   comment messages from showing up in the instructor's inbox
   or changing the state of an existing private conversation.

 - Muted Assignments:
   - When an assignment is unmuted and only one user has made
   submission comments, that user should be treated as the
   message author.
   - When an assignment is unmuted and more than one user has
   commented on the submission, the message is treated as a new
   message for everyone.

Change-Id: Ic55cc64f181e8a0c560fe325bd31ea65082568d2
Reviewed-on: https://gerrit.instructure.com/16007
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2012-12-19 16:32:33 -07:00
Cody Cutrer bdbeeb992d cross shard dashboards
two major pieces:
 * use context_type/context_id instead of context_code for
   three relations so that sharding extensions will
   automatically work
 * deserialize stream item data as actual AR objects instead
   of OpenObject (for similar reasons)

test plan:
 * run the predeploy migration, but not the postdeploy one
 * view your dashboard on a shard other than your home shard;
   it should be identical to your home shard
 * view courses that you are enrolled in with the same id but on
   different shards. the activity stream should have the correct
   data for the course in that shard, for both courses (i.e.
   no mixing of data from the two shards)
 * do actions that generate new stream items, and verify the new
   items appear correctly for the above two steps
 * run the postdeploy migration, wait for the job to finish, then
   repeat the test plan

Change-Id: I8d5fcadb8d971acf7388a12e9151a3e927751f44
Reviewed-on: https://gerrit.instructure.com/15462
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-29 17:36:24 -07:00
Jon Jensen 8a5e2bd922 hide conversation stream items where user is last author, fixes #11407
test plan:
1. log in as User A
2. send a message to User B
3. log in as User B
4. the conversation should show on the dashboard
5. reply to the conversation
6. the conversation should no longer show on the dashboard

Change-Id: I0da7cfd004deff2ae04e9d187f6171ed1b4b28b0
Reviewed-on: https://gerrit.instructure.com/15033
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-11-11 21:56:23 -07:00
Simon Williams dd62ef5805 new dashboard design
the new dashboard design categorizes recent activity into buckets that can be
expanded/collapsed, and inidividual messages can be dismissed.  the categories
are announcements, conversations, discussions and assignments.  this redesign
applies to the homepage dashboard, the group home page, and the course homepage
when "recent activity dashboard" is selected as the course home page type.o

the motiviation is that the dashboard should capture and present in one place
important information happening in all the user's courses or groups, and allow
for jumping into this information to see more details:

- announcements/discussions should show on the dashboard when they are created,
  or when there are root replies to recent announcements
- conversations should show on the dashboard when there is new activity
- assignments should show on the dashboard when they are created, or when
  changes are made at least a couple hours after being created

the presence of a dashboard item means there is activity for that item that may
be of interest to the user.  additionally, the dashboard items will show
read/unread state (excluding assignments) for items which the user has not yet
viewed.

additionally, global messages such as course inivitations, account level
announcements, and new user messages have been restyled, but will keep their
place above the recent activity widget on the dashboard.

test plan:
- visit many exising user's dashboards and make sure they are functional in the
  new style.
- visit canvas as a brand new user (no enrollments), a new user enrolled in
  a new course and make sure the dashboard is restyled and the messaging makes
  sense.
- make an account level announcement and make sure it shows up on user's
  dashboards.
- create all different types of conversations: single, group, bulk private,
  from submission comment, add user to convo, etc. and make sure the
  appropriate dashboard items appear and make sense
- create discussions and announcements, reply to them at the root level and at
  the sub entry level (sub entries will not make new dashboard items), test
  from both a read and unread user's perspective, making sure dashboard items are
  correct. (note that read/unread state will not be correct for existing items
  before this code is applied, but should be correct for future items moving
  forward)
- dismiss dashboard items and account announcements, make sure they stay
  dismissed.
- test creating assignments, waiting > 2 hours, and updating due dates or other
  assignment details. make sure items appear. note that unread state will not
  exist for assignment notifications.

closes #10783
refs #11038
refs #11039

Change-Id: I276a8cb1fae4c8a46425d0a368455e15a0c470c5
Reviewed-on: https://gerrit.instructure.com/14540
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-11 21:56:16 -07:00