[Announcements] Marking all announcements read

This idea has been developed and deployed to Canvas LMS

In the student interface, currently it is not possible to select multiple or all announcements to make them marked as read. As a result, often times a student's announcement thread will fill up to the point that they will no longer be able to notice when an instructor sends out an announcement, thus creating the possibility of a student missing out on something important. 

53 Comments
Stef_retired
Instructure Alumni
Instructure Alumni

Hello,  @oakc1946  Welcome to the Canvas Community! By "student interface," are you referring to the Canvas Student App, or to the Student Dashboard View, or someplace else? Screenshots would help members evaluate this idea.

We also have an open discussion about this at https://community.canvaslms.com/message/121562-ability-to-mark-announcements-as-read 

We've placed this idea into Moderating status as we await your response.

Thanks!

oakc1946
Community Novice
Author

Hi Stefanie,

This is on the desktop version so not the mobile app. I'm referring to the

announcements page of a course when I am talking about there not being a

"Mark all read button."

Thanks,

Connor

On Thu, Nov 8, 2018 at 5:38 AM stefaniesanders <instructure@jiveon.com>

Stef_retired
Instructure Alumni
Instructure Alumni

Thanks for the clarification,  @oakc1946 ‌! The idea is open for voting.

i_s_bijl
Community Novice

As a student I would also appreciate an easy 'mark as read' button for the announcements.

I'll also send a link to this page to my class so other people know to vote here if they feel the same.

cjjudge
Community Novice

I would like to stress how frustrating not having the option to mark announcements as read can be. 

I tell my students at the beginning of the semester that they will receive primary course communication through announcements and so they need to properly set up their notification preferences, ideally to have the announcement emailed or otherwise sent to them. This means that often they read the announcement through some other means than logging into the announcements page. In the announcements page, not only is there not an option to select announcements and mark them as read, but there is no navigation between announcements. So, the student cannot open the most recent announcement and simply click a next page button to skip through all of the announcements to force them to be marked as read. Instead they must open an announcement, navigate back to the main announcements page, open the next announcement, navigate back to the main announcements page, open the next announcement....etc. It's irritating. As others have pointed out, this means that many students will see a semester's worth of unread announcements, and not realize when there is a new announcement that they've missed.

As an instructor, I recently had to copy a course to accommodate two students with incompletes who were not able to submit assignments or receive extensions after the semester end date. Due to copying the entire course, all announcements that I had posted from the previous semester showed up in my dashboard as unread and I had to go through this to get those notifications off. 

erin_cox
Community Novice

Here is a similar idea that focuses on the ability to move between announcements easily, like in pages:

https://community.canvaslms.com/ideas/13616-navigation-between-announcements 

samueldy
Community Member

This is possible, as of 11 Mar 2019, through v1 of the Canvas REST API. First, generate an API token from your Settings page (Account > Settings > Approved Integrations). (In the Python code below, I read my token from a JSON file saved at ~/.instructure/.instructure.json. You can set it up differently, if you want.)

This code gets the list of courses for the current user, loops through each of the unread announcements, and marks each as read. There is a 1 s time delay to avoid getting rate-limited by the API server.

Cheers,

Sam

# Using Canvas v1 API to access an Announcement and mark it as read

import json
import requests
import os
import datetime
import time


# Initialize some important variables:
HOME_DIR = os.path.expanduser("~")
API_FILE = os.path.join(HOME_DIR,".instructure",".instructure.json")

with open(API_FILE, 'r') as f:
    api_info = json.load(f)
   
TOKEN = api_info["token"]
auth = {"Authorization": "Bearer " + TOKEN}
MY_DOMAIN = "https://myschool.instructure.com"

start_date = datetime.datetime(1000,1,1).isoformat() # Necessary to list all announcements


# Get all courses
courses = requests.get(MY_DOMAIN + "/api/v1/courses", headers=auth)


def mark_announcement_read(course_id, disc_id):   
    conn_str = MY_DOMAIN + "/api/v1/courses/" + str(course_id) + "/discussion_topics/" + str(disc_id) + "/read.json"
    requests.put(conn_str, headers={**auth, **{"Content-Length": "0"}})


for course in courses.json():
    course_id = course["id"]
   
    nowtime = datetime.datetime.now().isoformat()
    # Retrieve all announcements that have been published in the course:
    params = {"context_codes[]": "course_" + str(course_id), "start_date": start_date, "end_date": nowtime}
    announcements = requests.get(MY_DOMAIN + "/api/v1/announcements", headers=auth, params=params)
   
    for announcement in announcements.json():
        # Delete the offending announcements
        if announcement["read_state"] == "unread":
            disc_id = announcement["id"]
            # print(announcement["title"])
            # Mark the offending announcement as read
            mark_announcement_read(course_id, disc_id)
            print("Marked " + announcement["title"] + " as read.")
            time.sleep(1)
print("Done.")

samueldy
Community Member

This is possible, as of 11 Mar 2019, through v1 of the Canvas REST API. First, generate an API token from your Settings page (Account > Settings > Approved Integrations). (In the Python sample code below, I read my token from a JSON file saved at ~/.instructure/.instructure.json. You can set it up differently, if you want.)

 

This code gets the list of courses for the current user, loops through each of the unread announcements, and marks each as read. There is a 1 s time delay to avoid getting rate-limited by the API server. The "per_page": 10000 parameter is to get all the announcements at once, so you can mark up to 10,000 announcements as read at once. Probably doesn't need to be that big; change as needed.

 

Cheers,

Sam

# Using Canvas v1 API to access an Announcement and mark it as read

import json
import requests
import os
import datetime
import time


# Initialize some important variables:
HOME_DIR = os.path.expanduser("~")
API_FILE = os.path.join(HOME_DIR,".instructure",".instructure.json")

with open(API_FILE, 'r') as f:
    api_info = json.load(f)
   
TOKEN = api_info["token"]
auth = {"Authorization": "Bearer " + TOKEN}
MY_DOMAIN = "https://myschool.instructure.com"

start_date = datetime.datetime(1000,1,1).isoformat() # Necessary to list all announcements


# Get all courses
courses = requests.get(MY_DOMAIN + "/api/v1/courses", headers=auth)


def mark_announcement_read(course_id, disc_id):   
    conn_str = MY_DOMAIN + "/api/v1/courses/" + str(course_id) + "/discussion_topics/" + str(disc_id) + "/read.json"
    requests.put(conn_str, headers={**auth, **{"Content-Length": "0"}})


for course in courses.json():
    course_id = course["id"]
   
    nowtime = datetime.datetime.now().isoformat()
    # Retrieve all announcements that have been published in the course:
    params = {"context_codes[]": "course_" + str(course_id), "start_date": start_date, "end_date": nowtime, "per_page": 10000}
    announcements = requests.get(MY_DOMAIN + "/api/v1/announcements", headers=auth, params=params)
   
    for announcement in announcements.json():
        # Delete the offending announcements
        if announcement["read_state"] == "unread":
            disc_id = announcement["id"]
            # print(announcement["title"])
            # Mark the offending announcement as read
            mark_announcement_read(course_id, disc_id)
            print("Marked " + announcement["title"] + " as read.")
            time.sleep(1)
print("Done.")

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
parijohn
Community Novice

As a student, I completely agree with you that it's frustrating to not have this feature. I read announcements via email rather than the actual tab, causing the notification symbol to pile up on my Dashboard for each course. Not having the ability to mark all as read is rather surprising. 

bm97
Community Novice

Was just going to suggest this feature as a great addition 

Student Dashboard View

as well as the announcements view directly