A comprehensive Moodle block plugin that provides powerful course-specific content search functionality across all major activity types.
- Simple, intuitive search form within the block
- Comprehensive search across all major activity types in the current course
- Displays search results with content previews and direct links
- Accessible design with proper ARIA roles and semantic HTML
- Responsive layout that works on desktop and mobile devices
- Modular architecture for easy extension
The plugin provides deep content search across all major Moodle activity types:
- Activity and resource names and descriptions (all modules)
- Assignment titles and descriptions
- Page content
- Label content
- URL and File resource descriptions
- Forum Content: Posts, discussions, and topics with direct links to discussions
- Book Content: Chapter titles and full chapter content with links to specific chapters
- Wiki Content: Wiki page titles and content with links to specific pages
- Glossary Content: Terms (concepts) and definitions with links to specific entries
- Quiz Content: Question names, question text, and feedback from the question bank
- Lesson Content: Lesson page titles and content
- Workshop Content: Submission titles and content
- Feedback Content: Feedback items and presentation text
- Database Content: Data module records and field content with links to specific records
- Smart Content Detection: Automatically detects which modules are installed and searches accordingly
- Contextual Results: Shows activity type, parent activity name, and content preview
- Direct Navigation: Results link directly to specific content (chapters, posts, entries, etc.)
- Permission Aware: Respects course module visibility and user permissions
- Performance Optimized: Efficient database queries with proper indexing
- Copy the plugin files to
/blocks/course_search/in your Moodle installation - Visit the admin notifications page to complete the installation
- The block will be available to add to course pages
- Add the "Course Search" block to a course page
- Enter search terms in the search form
- Click "Search" to view comprehensive results
- Results are displayed with:
- Activity title and parent activity name
- Activity type (e.g., "Book - Chapter", "Forum - Post")
- Content preview with highlighted search terms
- Direct links to specific content locations
- "synchronously" - Finds the term in book chapters, forum posts, quiz questions, lesson pages, etc.
- "assignment" - Finds assignment titles, descriptions, and any content mentioning assignments
- "discussion" - Finds forum discussions, posts, and any related content
- "quiz" - Finds quiz questions, feedback, and quiz-related content across all activities
- Proper semantic HTML structure
- ARIA labels for screen readers
- Keyboard navigation support
- High contrast styling
- Responsive design for all devices
This plugin does not store any personal data. It only searches existing course content that users already have access to.
- Compatibility: Moodle 4.0+ (backwards compatible with 3.9+)
- Database: Uses core Moodle APIs for secure database access
- Standards: Follows Moodle coding standards and best practices
- Security: Includes proper capability checks and SQL injection protection
- Styling: Responsive Bootstrap-compatible styling with custom CSS
- Architecture: Modular design with separate search functions for each activity type
- Performance: Optimized database queries with conditional module loading
The plugin is designed for easy extension. To add support for additional activity types:
- Create a new search function following the pattern:
block_course_search_search_[module]_content() - Add the function call to the main search function
- Follow the existing patterns for database queries and result formatting
The plugin searches the following core Moodle tables:
course_modules- Activity instancesforum_posts,forum_discussions- Forum contentbook_chapters- Book contentquestion,quiz_slots- Quiz questionslesson_pages- Lesson contentwiki_pages- Wiki contentglossary_entries- Glossary termsworkshop_submissions- Workshop contentfeedback_item- Feedback contentdata_content,data_records- Database module content- Plus module-specific tables for each activity type
BC Public Service Agency.
Coming soon but open.