Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 3 additions & 29 deletions docs/devupdate.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
---
title: Moodle 5.2 developer update
title: Moodle 5.3 developer update
tags:
- Core development
- Moodle 5.2
- Moodle 5.3
---

{/* <!-- markdownlint-disable no-inline-html --> */}

This page highlights the important changes that are coming in Moodle 5.2 for developers.

## Badges API reorganisation {/* #badges-api-reorganisation */}

<Since version="5.2" issueNumber="MDL-82147" />

The Badges API is responsible for managing badges in Moodle, including their creation, management, and export to external platforms compliant with Open Badges standards. However, the current implementation has become complex and difficult to maintain, and can't be easily extended to support future versions of Open Badges.

To address these challenges, we're reorganising the API to significantly improve its structure and maintainability. Key changes include:

- Refactor JSON exporters to support multiple Open Badges schema versions (MDL-85621). This will allow for seamless integration with different schema requirements.

More information about the Badges API can be found in the [Badges API documentation](./apis/subsystems/badges/index.md).

## Activity chooser descriptions refinement {/* #activity-chooser-descriptions-refinement */}

<Since version="5.2" issueNumber="MDL-87117" />

The help descriptions within the Activity Chooser have been significantly updated for all core Activities and Resources to provide richer guidance:

- A new optional language string, `modulename_summary`, has been introduced to define a concise, single-paragraph introduction to the module.
- The existing `modulename_help` string has been refined to contain the detailed description, now structured with dedicated sections for:
- **Key features** to highlight the module's primary functionalities.
- **Ways to use it** to provide practical, application-focused examples.
- A new optional string, `modulename_tip`, is available for a supplemental section for best practices, advice, or effective usage tips.

Third-party activity modules and resources can adopt the same structure by adding these language strings (`modulename_summary`, `modulename_help`, and `modulename_tip`) to their plugin's language files. These strings should be placed in the plugin's language file, for example, `mod/pluginname/lang/en/pluginname.php`.
This page highlights the important changes that are coming in Moodle 5.3 for developers.
8 changes: 4 additions & 4 deletions docs/intro.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
id: introduction
title: Introduction
description: Developer documentation for Moodle 5.2.
description: Developer documentation for Moodle 5.3.
slug: /
tags:
- Getting started
---

Welcome to the Developer Documentation for **Moodle 5.2**.
Welcome to the Developer Documentation for **Moodle 5.3**.

This documentation is version-specific and includes a range of useful guides and information.

Expand All @@ -17,10 +17,10 @@ This documentation is version-specific and includes a range of useful guides and
- Look through our [guides to Moodle APIs](./apis.md)
- Browse our [Moodle feature](./guides.md) deep dives
- Interested in supporting the Moodle App in your plugins? Read the [Moodle App documentation](/general/app)
{/*- You may want to read the [Release notes](/general/releases/5.2) for Moodle 5.2 */}
{/*- You may want to read the [Release notes](/general/releases/5.3) for Moodle 5.3 */}

:::

import ReleaseStateSummary from '@site/src/components/ReleaseStateSummary';

<ReleaseStateSummary releaseName="5.2" />
<ReleaseStateSummary releaseName="5.3" />
2 changes: 1 addition & 1 deletion general/releases/5.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ReleaseNoteIntro } from '@site/src/components/ReleaseInformation';

<ReleaseNoteIntro releaseName={frontMatter.moodleVersion} />

If you are upgrading from a previous version, please see [Upgrading](https://docs.moodle.org/en/Upgrading) in the user docs.
If you are upgrading from a previous version, please see [Upgrading](https://docs.moodle.org/502/en/Upgrading) in the user docs.

## Server requirements {/* #server-requirements */}

Expand Down
2 changes: 1 addition & 1 deletion nextVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with Moodle. If not, see <http://www.gnu.org/licenses/>.
*/

const nextVersion = '5.2';
const nextVersion = '5.3';
const nextLTSVersion = '5.3';
const nextVersionRoot = `/docs/${nextVersion}`;

Expand Down
2 changes: 1 addition & 1 deletion static/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@

# Issue #955
# Redirect /docs/* to /docs/[nextVersion]/:splat
/docs/* /docs/5.2/:splat
/docs/* /docs/5.3/:splat
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 121 additions & 0 deletions versioned_docs/version-5.2/_utils.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/**
* Copyright (c) Moodle Pty Ltd.
*
* Moodle is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Moodle is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Moodle. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { type ReactNode } from 'react';
import ComponentFileSummaryGeneric, {
type ComponentFileSummaryDescription,
type ComponentFileSummaryProps,
} from '@site/src/components/ComponentFileSummary';
import { MDXProvider } from '@mdx-js/react';

import { getExample } from '@site/src/moodleBridge';

export {
getExample,
ComponentFileSummaryProps,
};

/**
* Fill the default properties.
* @param {Props} props
* @return {Props}
*/
export const fillDefaultProps = (props: ComponentFileSummaryProps): ComponentFileSummaryProps => ({
filetype: 'php',
examplePurpose: props.summary,
...props,
});

const normaliseDescription = (Value: ComponentFileSummaryDescription): null | React.JSX.Element => {
if (typeof Value === 'boolean' || !Value) {
return null;
}

if (typeof Value === 'string' || React.isValidElement(Value)) {
return (
<MDXProvider>
{Value}
</MDXProvider>
);
}

return (
<MDXProvider>
<Value />
</MDXProvider>
);
};

/**
* Get the preferred description given a standard properties value which contains an optional description,
* and/or extraDescription, and a DefaultDescription object.
*
* @param {Props} props
* @param {DefaultDescription} DefaultDescription The default description to use if the `description` property is empty
* @returns {MDXLayout}
*/
export const getDescription = ({
description = null,
extraDescription = null,
children = null,
}: ComponentFileSummaryProps, defaultDescription?: ComponentFileSummaryDescription): null | ReactNode | JSX.Element => {
if (children) {
const Description = normaliseDescription(children);
return (
<MDXProvider>
{Description}
</MDXProvider>
);
}

if (description) {
const Description = normaliseDescription(description);
return (
<MDXProvider>
{Description}
</MDXProvider>
);
}

const Description = normaliseDescription(defaultDescription);
const ExtraDescription = normaliseDescription(extraDescription);

if (Description) {
return (
<MDXProvider>
{Description}
{ExtraDescription}
</MDXProvider>
);
}

return null;
};

export const ComponentFileSummary = (initialProps: ComponentFileSummaryProps): JSX.Element => {
const props = fillDefaultProps({
examplePurpose: initialProps?.summary ?? null,
...initialProps,
});

props.description = getDescription(props, props?.defaultDescription ?? null);

if (props?.example || props?.defaultExample) {
props.example = getExample(props, props?.defaultExample ?? null);
}

return ComponentFileSummaryGeneric(props);
};
Loading
Loading