Skip to content

Conversation

@TechnoMarc3
Copy link
Contributor

Hey everyone.
I added a Moodle integration to the TUM App.
The general Moodle section is now part of the general bottom navigation bar. For it to work, you have to save your TUMOnline login credentials within the settings (a new settings area has been created). Don't worry, your password will be stored with encryption and is only readable if you have a matching TUMOnline token.
This Moodle integration creates a shibboleth session (by using headless in app browser) and stores all relevant login information. These information are required to read course and module data from the Moodle api.

Also, I added vertical and horizontal support so every device is supported. Yet, there are no language keys used, but these will be added within a future commit.

Reach out to me if you have any suggestions, however I'd love to add Moodle to the app since there is no official Moodle app of TUM and a lot of people want a simple mobile app for Moodle

… as phones.

Also added better landscape views for home_screen.dart and campus_screen.dart to match an organized view for tablets.
This commit introduces a comprehensive Moodle integration, allowing users to view their courses and course content directly within the app.

- **Moodle Tab & Course View:** Adds a new "Moodle" tab to the main navigation. Users can see a list of their recent Moodle courses and tap on them to view details.
- **Course Content Display:** Course sections and their content (HTML, PDFs, external links) are now accessible. HTML content is converted to Markdown for native rendering, and links open in an in-app browser.
- **Shibboleth Authentication:** Implements a headless WebView to automate Shibboleth login, creating a seamless authentication experience. User credentials are encrypted and stored locally.
- **Password Management:** Introduces a new "Security & Passwords" section in settings for users to manage their TUM Online password, which is required for Moodle login.
- **File & PDF Handling:** Enables downloading and opening of files (like PDFs) from within the Moodle course view.
This commit introduces significant layout improvements for the Moodle component when viewed in portrait orientation.

- **`moodle_course_viewmodel.dart`**: Adjusts the course content and section selection layout to a `Column` for a better vertical fit in portrait mode. The course content list now scrolls horizontally.
- **`moodle_viewmodel.dart`**: The main course list now scrolls vertically in portrait mode, while retaining horizontal scrolling in landscape.
- **`moodle_course.dart`**: The course card widget now displays as a `Row` in portrait view, creating a more compact and readable list item. The course image size is also adjusted based on the device's orientation.
The height of the `ListTile` for Moodle course content was adjusted for landscape orientation to improve layout.
This commit refactors the UI for the Moodle course and course content views to provide a better layout in both portrait and landscape orientations.

Specifically, the sizing of various `SizedBox` and `ListTile` widgets has been adjusted in `moodle_course_viewmodel.dart`, `moodle_viewmodel.dart`, and `moodle_course.dart` to use screen-relative dimensions, improving responsiveness and consistency across different device orientations.
Moved the Moodle connection logic from `MoodleViewModel` to a shared function, `connectToMoodle`, now located in `home_screen.dart`. This function is now called earlier in the app's lifecycle, specifically after the student card or contact card is loaded, to pre-fetch Moodle courses.

This change prevents redundant Moodle API calls by caching the connection future and course data in the central `Api` class. The `MoodleViewModel` now utilizes this cached data, improving performance and showing a loading indicator while waiting for the initial connection. As a result, moodle now loads during the app's startup logic and every relevant data is cached within the Api.dart class. In fact, moodle loading times are drastically.
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.

1 participant