Simple Search for Course and All Courses

Code-with-Ski
Community Coach
Community Coach
22
1184

A new Simple Search feature has been added to the Canvas LMS Mods (Basic) browser extension. This allows a user to search for content within a course or across their enrolled courses.

Within a course, Simple Search is added as a link on the course navigation menu.  It defaults to the second position on the course navigation menu, but using the browser extension options it's position can be adjusted to a different number.  This link will open the Simple Search dialog. It will present options for content to search within the course.

Simple search in course navigation menuSimple search in course navigation menu

 

Course simple search openCourse simple search open

 

On the "All Courses" page, Simple Search is added as a button in the upper-right. This button will open the Simple Search dialog. It will present options for content to search within the visible course enrollments.  There is an option to search current, past, and/or future enrollments.  Using the column search/filter options will allow focusing the search further by hiding courses to exclude from the search, since it will only search enrollments that are displayed.

All Courses simple search buttonAll Courses simple search button

 

All Courses simple search openAll Courses simple search open

 

Simple Search allows searching the following course content:

  • Syllabus body
  • Pages (title and body)
  • Assignments (title and body)
  • Discussion Topics (title and body)
  • Announcement Topics (title and body)
  • Files (name)
  • Module Items (name)

This feature uses the Canvas API to get the relevant course content that is selected to search. It will check if there are any matches in the retrieved results.  If so, it will add a row to the results table with the matching keyword/phrase highlighted (case insensitive search).  The results are collapsed by default but can be expanded to see a full view of the match. There is also a link to the matched content item that can be opened in a new tab.

Course simple search resultsCourse simple search results

 

22 Comments
dbrace
Community Coach
Community Coach

Great feature!

I have two questions:

  1. Does this use the same functionality that Instructure/Canvas is working on for "Smart Search (Feature Preview)"?
  2. If it does, do you anticipate any problems caused by both of them existing?

I would like to report a bug.

When on the "All Courses" page, I was doing a search and it got stuck about 75% through and presented this message.

Screenshot 2024-08-17 at 10.17.04 AM.png

It seems that you might need to:

  • add something like a "proceed" button or have the search continue despite the error
  • say which course the error is happening in
Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

Thank you!  I will investigate the error you reported and try to release a patch for it next week. Most likely, I will have it skip that type of error so it can continue searching the rest.  I'll be sure to look into adding more context to the error to help with further debugging in the future.

This Simple Search feature is independent of the Smart Search feature.  Thus, they can both be used without any issues.  Instructure/Canvas is using AI to power their Smart Search, and it looks like they are making a new API endpoint to have access to the Smart Search feature.  I'm not using that new API endpoint, nor am I using AI for my search.  I am only using the previously existing GET endpoints to get the selected item types and checking if any of those items have a match to the search query. 

I'm hoping Smart Search will eventually incorporate the same/similar features to what I have built into Simple Search (such as additional course content items, searching across courses, and ability to look for exact matches).  Until that time, I built this feature as a workaround based on common things I saw users asking for with a course search that I was able to implement.

dbrace
Community Coach
Community Coach

You are welcome, @Code-with-Ski! Without knowing the details, it might be helpful to mention an error occurred while searching through the course (saying which course, encouraging the user to manually review that course or to go into the course to do a search within it instead of from the "All Courses" page) but allow the rest of the searching to happen.

Thank you for those details. I knew that Instructure/Canvas was using AI for "Smart Search" but thought maybe you were already tapping into it already (but the timing just happened to be a coincidence).

When the time comes, can you please make a comment/update so that I can check again from "All Courses" to see it?  Thanks!

Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

Thank you for the suggestions on improving the messaging.  I'll take those into consideration as I work on the patch so that users can also be empowered to investigate the errors more too.

Yes, I will be sure to post a reply here when I submit the new update with a patch for this.  I am currently waiting for my most recent update that I submitted to get approved and hope it will be approved by Monday.  After its approved (v7.0.0), I will be able to submit another update for this issue.

Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

I have submitted version 7.1.0 for review.  Once it is approved, there will be improved loading message details with better error messages for Simple Search and the custom course reports.  I have also built in for it to still try to finish the report as best it can even if it runs into an error with getting some of the data.

dbrace
Community Coach
Community Coach

Thank you for letting me know, @Code-with-Ski. I will be on the look-out for it and let you know if I still experience a problem with it.

If/When it works from the "All Courses" page, I may have a suggestion for another location to use the "Simple Search" functionality and I will share it then.

Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

You're welcome!  I look forward to hearing your feedback

dbrace
Community Coach
Community Coach

Hi @Code-with-Ski! I just got a chance to use 7.1.0 and it work well! Thank you!

I have two suggestions related to Simple Search.

  1. Possibility from within a specific course but I think it would be more beneficial from the "All Courses", because of how long the list of "getting..." and "searching..." and "errors" could be, I think it would be helpful to also be able to download that.
  2. This is the suggestion that came to mind related to "Simple Search" that would benefit administrators.  When on an individual user account's user page, make it possible for the administrator to use "Simple Search" to search through all of the user's courses.
Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

I'm glad to hear that version 7.1.0 is working well for you now!

1. I was actually starting to think about that same thing to, especially as I just built and released my first user script.  Saving the log may be useful to document the information.  It can also make it easier to save the results so that any errors can be reviewed later, especially if there isn't time to fully audit the errors at the time of the search.  I'll be sure to share an update when I add this feature.

2. That sounds like a useful placement too and still keeps the search limited to the same type of context current available with the "All Courses" search.  I would want to see if I can build at least a couple more filter options on the user's course list to give a closer set of filtering options to what I have created on the "All Courses" list.  In the meantime, if the admin user has permission to act as the user, they could use the Simple Search from the "All Courses" while acting as them.  I'll add this to my queue and provide an update when I'm able to add this feature for admins.  This way even if an admin doesn't have permission to act as a user, they could still search the courses of a user if they have access to view the content in those courses.

dbrace
Community Coach
Community Coach

@Code-with-Ski 

Awesome to know that we were on the same page related to #1, even before I mentioned it.

#2: Yes it is possible to "act as" a person but I also try not to do that because (especially for students) it technically falsifies their academic record and I only use it when I am troubleshooting something specific and attempting to duplicate a problem.

Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

With version 7.2.0, you should now see a Simple Search option in the course enrollments box for users.  You should also see new filter options for the user's role in the course, course name, and course code.

I also updated the loading messages in all custom reports and the simple search to allow for downloading the loading messages.

dbrace
Community Coach
Community Coach

Thank you @Code-with-Ski! I did notice those changes and appreciate the ability to filter.  I am not sure if there is a better way to do it but if I did not have a 24" monitor hooked up to my laptop I probably would not have the screen real estate for all of the filters and search options.

Maybe one possibility would be to bump the "Search course name" and "Search course code" down a line so that filters are on one-one and searches are on another-line.

Question about the "Search course code" search.  In the API, is that searching for course_code or sis_course_id or both?

I will say, the ability to filter and use your Simple Search option will be really helpful if a student (or instructor) gives us the name of something (or words that are inside of something) but did not tell us which course it was in.

Thank you for all of your efforts!

Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

You're welcome!  The filters and search options should automatically flow to a new row if there isn't enough space.  I can look into adjusting the order/grouping to have the searches in their own row/set of rows and the select menus to their own row/set of rows.

The "Search course code" searches the "course_code" that is loaded in under each of the course names in the course enrollments list.  If the feature to load in the "course_code" isn't enabled, then it shouldn't add that search option.  If the ability to search the SIS Course ID is something that you would find useful, it is something I can look into adding as another piece of information to append and make searchable.

dbrace
Community Coach
Community Coach

@Code-with-Ski 

The search options do automatically flow from one row to the next based on the width of the web browser.  I think placing the filter dropdowns on one row and search boxes on a different would help with consistency, at least for me because I do not always have my browser window at full screen.

All of the courses that I manage have something in course_code and sis_course_id but our sis_course_id field contains a little bit more information.  If it were up to me, if it is possible, I would have "Search course code" search both fields.

Thanks again!

Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

Thank you for the clarification!  I'll look into grouping the search fields together in their own row and the select menus to their own row to improve the UI.  I'll also look into adding an option to load in the SIS Course ID for each course enrollment and provide a search input for that too.

dspiel
Community Participant

Love your tools.. THANK YOU for all you do! here is the but 😄 Is it possible to move it to the bottom of active navigation or a selection to have it at the top or bottom?

dbrace
Community Coach
Community Coach

Hi @Code-with-Ski. I see that version 7.3.0 has been released. Thank you for putting the search boxes on a different row, before the filter dropdown menus.

I would like to let you know about a bug. The filter dropdown menu for "All Terms" is not working. I am able to use all of the other filters but not "All Terms".

Code-with-Ski
Community Coach
Community Coach
Author

@dspiel 

You're welcome!  I'm glad to hear you love the tools 😀  For the placement of the Simple Search link in the course navigation, you can change its placement in the browser extension options.  if you have the extension pinned, you can right-click on the icon and click "Options".  If it isn't pinned, you can click the extensions puzzle icon, then click the 3 dots to the right of the Canvas LMS Mods (Basic) extension and click "Options".  You will want to expand "Course" and then expand "Global".  You can then change the number that is set for the "Simple search course navigation position".  It defaults 2, but you can make it any number you want.  If you set it as a high number like 100, then it will just place it at the end of the course navigation.  After you make the change, click "Save" at the bottom of the Options page.  Once you refresh the Canvas course page, you should see the Simple Search link get added in the position that you set.

If this doesn't work, please let me know.

Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

You're welcome!  Thank you for the suggestion for the UI improvement. 

Also, thank you for letting me know about that bug.  I thought I tested all the filters again before I made the final version, but I must have missed that one.  I have found the bug and just submitted v7.3.1 with a patch that will resolve the issue.  Once you see version 7.3.1, please let me know if you notice any other issues.  Thanks!

dbrace
Community Coach
Community Coach

Thanks for pushing that out so quickly, @Code-with-Ski. I will be on the lookout for it.

The search boxes actually helped me work around the bug because of how we name and code (both the course_code and the sis_course_id) our course shells.  It was just an extra step after discovering the bug.

Code-with-Ski
Community Coach
Community Coach
Author

@dbrace 

You're welcome!  I'm glad that other new search options helped as a temporary workaround and hope the new update gets approved in the Chrome Web Store soon.

dbrace
Community Coach
Community Coach

everything is working in 7.3.1

thank you!