Skip to content

Conversation

@GuiLeme
Copy link
Collaborator

@GuiLeme GuiLeme commented Jul 25, 2025

What does this PR do?

It does 4 things:

  • Deprecates function sendGenericDataForLearningAnalyticsDashboard for being too verbose and not really following the SDK general pattern;
  • Creates 2 functions inside a wrapper object called pluginApi.learningAnalyticsDashboard:
    • upsertUserData: it will basically replace the deprecated function mentioned with one extra feature - one can write data on behalf of another user if moderator;
    • deleteUserData: Deletes entry from LAD json data;
    • clearAllUsersData: Deletes the entry for all user's data in LAD;
  • Fixes issue with total entry miscounting for user;
  • Refactor general flow of upserting/deleting plugin data to/from LAD;

Motivation

Deleting plugin data from the LAD was the first motivator for this PR, but then also include the possibility of a user publish or remove data on behalf of another user is also useful.

More

Closely related to the PR on CORE: bigbluebutton/bigbluebutton#23619

To use the new features just do:

const targetUserId = 'abcd-efg';
pluginApi.learningAnalyticsDashboard.upsertUserData(
  {
    cardTitle: 'Example Title',
    columnTitle: 'link sent by user',
    value: '[link](https://my-website.com/abc.png)'
  },
  targetUserId,
);

pluginApi.learningAnalyticsDashboard.deleteUserData(
  {
    cardTitle: 'Example Title',
    columnTitle: 'link sent by user',
  },
  targetUserId,
);

pluginApi.learningAnalyticsDashboard.clearAllUsersData(cardTitle);

@github-actions
Copy link

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@GuiLeme GuiLeme changed the base branch from main to v0.0.x July 25, 2025 20:06
@gustavotrott
Copy link
Collaborator

gustavotrott commented Jul 26, 2025

It might be useful having a pluginApi.learningAnalyticsDashboard.clearData function.
what do you think?

@gustavotrott
Copy link
Collaborator

gustavotrott commented Jul 26, 2025

On second thought, it seems that each row is strictly associated with a specific user.
In that case, how about renaming the functions as follows:

  • upsertDataupsertUserRowData
  • deleteDatadeleteUserRowData

And a new one: clearAllUserRowsData

@GuiLeme
Copy link
Collaborator Author

GuiLeme commented Aug 5, 2025

@gustavotrott, I understand that you meant upsertUserRowData as in adding a new data to the row of that specific user, but to me, that naming gives the impression that it will upsert a new user row (like create a new row), which is incorrect, it seems misleading.

That said, we could rename to just:

  • upsertDataupsertUserData
  • deleteDatadeleteUserData
  • clearAllUsesData;

I am thinking that this rename could be useful if we plan to add other types of data into the learning analytics dashboard, not related to the user, necessarily... Like presentation related, or something like that. What do you say?

@GuiLeme GuiLeme requested a review from Arthurk12 August 22, 2025 12:23
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