Moodle App Documentation

repository·main·Indexed 21 days ago

https://github.com/moodlehq/moodleapp

Source code and developer documentation for the official Moodle mobile application (version 5.3.0). Includes guides on development environment setup, ESLint configurations, and the cordova-plugin-moodleapp API surface, which provides services for secure storage, install referrers, and device diagnostics for managing hardware permissions across Android and iOS.

Tokens
13.5K
Snippets
45
Records
71
Agent score
76%

What's inside Moodle App

  1. Access Moodle App documentation

    main

    The Moodle App repository provides several documentation resources depending on your needs:

    • User documentation: For end-users looking to use the app features.
    • Developer documentation: For developers looking to understand the app's architecture and codebase.
    • Development environment setup: Detailed instructions for setting up a local environment to build and run the app.
    • Release Notes: Information regarding changes, new features, and fixes in specific versions.

    For reporting issues, use the Bug Tracker.

  2. Update AddonCalendarCalendarComponent filter input (v5.1.0)

    main

    In version 5.1.0, AddonCalendarCalendarComponent no longer checks for changes inside the filter input object.

    Action Required: If you change a property within the filter object, you must create a new object reference to ensure Angular detects the change.

    // To trigger change detection:
    this.filter = { ...this.filter, courseId: 1 };
  3. Handle immutable files in core-files component (v5.2.0)

    main

    In version 5.2.0, the core-files component was updated to treat the files input array as immutable to improve performance and change detection.

    Action Required: Do not mutate the existing array using methods like push() or splice(). Instead, you must provide a new array reference to trigger an update. Use the spread operator or concat() to create a new array.

    // Do NOT do this:
    this.files.push(newFile);
    
    // DO this:
    this.files = [...this.files, newFile];
    // OR this:
    this.files = this.files.concat(newFile);
  4. Migrate from moment to dayjs (v5.0.0)

    main

    In version 5.0.0, moment and moment-timezone were removed in favor of dayjs.

    Action Required:

    • Use dayjs for date manipulation.
    • moment is deprecated for use in site plugins; use native Date parsing functions instead.
  5. Configure ESLint for the Moodle App project

    main

    The project uses a flat configuration system via eslint.config.mjs. It defines several distinct configurations based on file patterns:

    1. Application Source (src/**/*.ts): Uses appConfig, which includes Angular, TypeScript, JSDoc, and Stylistic rules. It ignores test and story files.
    2. Cordova Plugin (cordova-plugin-moodleapp/src/ts/**/*.ts): Uses cordovaPluginConfig, which extends the app config but uses a specific tsconfig.json located in the plugin directory.
    3. Test Files (src/**/*.test.ts, src/testing/**, src/**/tests/**): Uses testsConfig, which extends the app config and adds jest plugins and recommended rules.
    4. HTML Templates (src/**/*.html): Uses Angular template recommended rules for linting HTML files.

    Key Configuration Details:

    • Inline Templates: The angular.processInlineTemplates processor is enabled to allow linting of component templates defined within TypeScript files.
    • TypeScript Project: The parser uses tsconfig.app.json by default to limit the files loaded by the TypeScript compiler.
    • Globals: Both browser and node globals are enabled.
    import { defineConfig } from 'eslint/config';
    
    export default defineConfig([
        // ... configuration blocks for different file patterns
    ]);
  6. Migrate CoreLoginHelper functions to object-based parameters (v5.3.0)

    main

    In version 5.3.0, the following CoreLoginHelper functions were modified to group all optional parameters into a single object:

    • openBrowserForSSOLogin
    • openBrowserForOAuthLogin
    • prepareForSSOLogin
  7. Update CoreCourses API usage (v5.2.0)

    main

    In version 5.2.0, direct usage of siteId in certain CoreCourses methods has been deprecated. These methods now accept CoreSitesCommonWSOptions instead.

    Affected Methods:

    • CoreCourses.getCoursesByField
    • CoreCourses.getCourseByField