Compatibility note: This version is compatible from Moodle 4.5 to Moodle 5.1.
Added
- The share panel now enables itself once the certificate has been issued. The panel re-reads its own state on
pageshow (including a restore from the back/forward cache) and when the tab becomes visible again, so the student no longer has to reload the page after downloading the certificate.
- The AI assistant card is now rendered in that same refresh. The card moved to its own
local_socialcert/ai_card partial, so the browser renders it through core/templates from the very same markup the server uses, with no duplicated HTML in JavaScript.
- New
local_socialcert_get_share_state web service. It reports the panel state for the user in session — issue present, share URL, verification warning and assistant availability, including the card context while the assistant is really available — and never creates a certificate issue.
- New
local_socialcert_log_share web service. The write function the panel calls when the LinkedIn window opens; it revalidates that the credential really was shareable before recording anything.
- Own capabilities:
local/socialcert:viewsharepanel and local/socialcert:useaiassistant. Both are checked in the module context and allowed by default only for the student archetype, so the share panel and the AI assistant can now be restricted by role without changing who reaches them today.
- Event logging through
certificate_shared and ai_text_generated. Every share and every successful generation is recorded in the platform logs, so the consumption of AI credits is traceable from Moodle.
- The newly available share action is announced in the live region of the panel, so assistive technology reports the state change without moving the focus.
- The credential expiry date now travels to LinkedIn when the certificate carries an expiry element.
Changed
- The AI assistant card lives in its own Mustache partial. Server-side rendering and client-side rendering share a single source of truth, so they can never disagree.
- **The card expansion logic moved from an inline `