Skip to content

Redesign the plugin for a new way of importing/requesting courses - #31

Open
TamaroWalter wants to merge 8 commits into
mainfrom
redesign/courserequest
Open

Redesign the plugin for a new way of importing/requesting courses#31
TamaroWalter wants to merge 8 commits into
mainfrom
redesign/courserequest

Conversation

@TamaroWalter

@TamaroWalter TamaroWalter commented Jul 28, 2026

Copy link
Copy Markdown
Member

🔀 Purpose of this PR:

  • Fixes a bug
  • Updates for a new Moodle version
  • Adds a new feature of functionality
  • Improves or enhances existing features
  • Refactoring: restructures code for better performance or maintainability
  • Testing: add missing or improve existing tests
  • Miscellaneous: code cleaning (without functional changes), documentation, configuration, ...

📝 Description:

This PR redesign the whole process of importing and requesting courses with a completely new backend structure and a modern react component frontend.

Backend:

Base for the new structure is a campus_management interface, that serves as API to specific course management systems (cms) outside of moodle. Class implementations (like his_lsf.php and sap.php) access a specific Database and read from them. They are the only place where the plugin connects to outer systems.

Three new Databatables where added that are the new main thing the plugin works with:

  • local_lsf_unification_courses: An abstracted course from any cms. Is used as a layer between a cms course and a moodle course, where attributes can be edited and saved without accessing the other two layers.
  • local_lsf_unification_course_requests: saves courses that had a course requests on behalf of a teacher
  • local_lsf_unification_imported_courses: lookup table for courses that were imported to moodle

Two new service classes manage the campus_management-classes. They provide the main logic/core functions, obscure the exact cms for the plugin, makes CRUD-operations on the new datatables.

  • cms_service: Calls cms functions, provides function to add requests and to import courses
  • dashboard_service: Functions for read-only data for the frontend

REST API:
A REST controller was added that takes calls from the frontend, validates if every required data is there and then calls the right service. It serves as the main layer between frontend and backend.

Frontend:
The new frontend has two parts: a dashboard that only shows imported/requested courses and a step wizard that replaces the old flow of importing/requesting courses. It guides the user through the process, while a "cache" object is getting build in the background. On a submission, this cache gets send to the Rest Api and the service. The cache holds:

  • the course that is getting imported/requested
  • every additional important data

Note on categories: The old "helptable" for matching lsf categories to moodle categories is not used. The teacher needs to manually assign the course to an existing moodle category in the import process.


📋 Checklist

Please confirm the following (check all that apply):

  • I have phpunit and/or behat tests that cover my changes or additions.
  • Code passes the code checker without errors and warnings.
  • Code passes the moodle-ci/cd pipeline on all supported Moodle versions or the ones the plugin supports.
  • Code does not have var_dump() or var_export or any other debugging statements (or commented out code) that
    should not appear on the productive branch.
  • Code only uses language strings instead of hard-coded strings.
  • If there are changes in the database: I updated/created the necessary upgrade steps in db/upgrade.php and
    updated the version.php.

🔍 Related Issues


🧾📸🌐 Additional Information (like screenshots, documentation, links, etc.)

TamaroWalter and others added 4 commits May 29, 2026 10:35
This introduces an interface that is to be implemented by an LSF and
SAP-SLcM connection class. Currently only one function from
lib_his.php was added to the interface but eventually every necessary
function in lib_his.php relevant to both LSF and SAP-SLcM should be
abstracted and added to this interface.
Add a sample implementation of the campus_management interface for
HIS-LSF. Note that this implementation of courses_of_teacher() does
not respect the max_import_age admin setting. This needs to be fixed.
@TamaroWalter
TamaroWalter requested a review from dlmsr July 31, 2026 14:53
Add three tables that will be used in the new plugins structure:
- courses: stores an abstraction of courses of any cms
- course_requests: stores requests for a new course that was done on behalf of a teacher
- imported_courses: stores courses that were imported into moodle
The backend has a new classes structure with different substructures:
- local/cms: An interface structure with classes that can access a course management systems database and fetch data
- local/models: An implementation of the new datatable entities to make the work with it easier
- local/dto: data transfer objects that get transferred to the frontend
- route/api: A complete REST api for a new frontend that can handle different requests to import a course or to save a course request for a teacher
- route/schema: Only description on how the data looks like that is being transferred on the REST api
A new react frontend is introduced to the plugin. A short summary:
- dashboard.php: new entrypoint for the user to access lsf_unification. Only calls the react component
- js/Dashboard.tsx: A new dashboard that shows courses that were imported or requested from an cms to moodle
- js/services: A service that connects the frontend to the backend rest api
- js/wizard: A "Step Wizard" that guides the user through the workflow or either importing an own course or to request a course on behalf of a teacher.
@TamaroWalter
TamaroWalter force-pushed the redesign/courserequest branch from ad11c4c to 7d3a9b4 Compare July 31, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants