Skip to content

Support an individual fullname #720 - #736

Open
stellargela wants to merge 1 commit into
mdjnelson:MOODLE_500_STABLEfrom
elearning-univie:1-alternativen-fullname-fur-zertifikate-definieren
Open

stellargela wants to merge 1 commit into
mdjnelson:MOODLE_500_STABLEfrom
elearning-univie:1-alternativen-fullname-fur-zertifikate-definieren

Conversation

@stellargela

Copy link
Copy Markdown

add #720

@mdjnelson

Copy link
Copy Markdown
Owner

Can you please squash these commits into one? Thanks.

@mdjnelson

Copy link
Copy Markdown
Owner

Also, please address this issues found in GitHub Actions. Cheers. :)

@stellargela
stellargela force-pushed the 1-alternativen-fullname-fur-zertifikate-definieren branch from abb7d4d to 83864f0 Compare January 27, 2026 14:21
@stellargela

Copy link
Copy Markdown
Author

Hi,
I hope, I fixed all the issues now. Cheers :)

@mdjnelson

Copy link
Copy Markdown
Owner

This looks good. However, I would not have a global setting for these but I would put it as an option in the element. The core plugin should not know or care about the settings of elements. :)

@mdjnelson
mdjnelson force-pushed the MOODLE_500_STABLE branch 2 times, most recently from 41d9c5d to a1494a8 Compare March 15, 2026 16:12
@mwreichel

Copy link
Copy Markdown
Contributor

Hi @mdjnelson,
thank you for your feedback to the fixed version of @stellargela.

So would it be ok for you if we implement these admin settings to the elements in the same way instead?

Our approach with an admin setting in the core plugin was to define a global naming scheme. In our case the defined scheme should be used automatically by any element plugin and editing users shouldn't be able to define the scheme on their own.

Thanks in advance,
Martin

@mdjnelson

Copy link
Copy Markdown
Owner

Thanks for explaining the use case. I understand why you want a site-wide certificate name format, and I’m fine with that being configured by an administrator rather than by each editing teacher.

My concern is where the logic lives. This behaviour is specific to the studentname and teachername certificate elements, so I’d prefer the settings and formatting logic to live inside the relevant element plugin(s), not in the core mod_customcert plugin. The core plugin should not need to know that these particular elements have a custom fullname policy, nor should it contain helper classes/settings that only those elements use.

mod_customcert already supports element plugins loading their own settings: after the main customcert settings, it creates the customcertelements category and calls each customcert element plugin’s load_settings() method. So an admin-level, globally enforced setting can still be implemented, but it should be owned by the element plugin rather than by mod_customcert itself. This keeps the separation clean: core provides the certificate/element framework, while each element owns its own rendering policy.

In this PR, the new mod_customcert\fullname_certificate class and the customcert/fullname + customcert/fullnameformat settings are added to the core plugin, but the settings are only consumed by the studentname and teachername elements. That creates coupling between core and specific element behaviour. If another name-related element wanted similar behaviour later, we’d either have to keep expanding core or make the global setting mean different things for different elements.

Could you move this into the relevant element plugin(s) instead? For example, the element plugin could expose the admin setting, contain the formatting helper, and use it consistently in both PDF rendering and HTML preview. The setting can still be global/admin-controlled, so editing users do not need to choose the format per certificate element.

Thanks for your patience and hard work! :)

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.

4 participants