Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Login] Summary Statistics #9518

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

skarya22
Copy link
Contributor

@skarya22 skarya22 commented Dec 20, 2024

Brief summary of changes

  • Added a customizable summary of LORIS statistics to the Login page for guest users to see
  • A new table was created that is populated with the counts of pinned dataquery queries, and separated by project
  • This table is read by the login module for projects with showSummaryOnLogin as true in the Project database table.
  • If no data is populated, then the summary is not shown on the login page
  • Data is populated by the new tool: tools/update_login_summary_statistics.php. It must be run for the data in the summary to be updated.
  • Some queries are not necessarily possible in the DQT, so in-order to keep it customizable for projects, I added the ability to add SQL files to a folder in project/tools/Login_Summary_Statistics that can be added to the summary list.
image

Testing instructions (if applicable)

  1. Run the patch and the script, then open the login page and see that the page is unchanged
  2. Login as admin, and go to the dataquery module. Create a query that includes the column Project. Run the query then go back to the dataquery homepage and pin the query to the login page. Give it a name, and leave out the 's' for plural (for example, Male Participant instead of Male Participants).
  3. Run the script, then logout and see that the summary appears with a dropdown of all projects. When you select a different project, the count should change.
  4. Change a project to showSummaryOnLogin = FALSE in the Project SQL table.
  5. Re-run the script and note that the project is no longer in the dropdown, and the 'All Projects' count has decreased.
  6. Try creating a new query that you only want to show for one project. To do this, create the query, including the Project column, then add a filter for Project = 'Pumpernickel'. Pin the project as before.
  7. Run the script, and open the login page. See that the query is not included in the All Projects section, nor in other projects, and is only shown in Pumpernickel.
  8. Now, try adding a query such as this to project/tools/Login_Summary_Statistics and see that it is now populated with Site.
    Site.txt

CCNA OVERRIDE PR

@skarya22 skarya22 added the State: Discussion required PR or issue that requires the resolution of a discussion with the relevant parties to proceed label Dec 20, 2024
@skarya22
Copy link
Contributor Author

The configuration for the summary statistics is currently done in two ways:

  1. Pin a query from the datadict module to the Login Page
  2. Add an SQL query to the project/tools/Login_Summary_statistics folder.

I had really liked the datadict integration, but after finishing I tried to test out some queries that we have on CCNA and realized they weren't possible. For instance, getting the distinct amount of sites with sessions for each project. I then added the ability to add SQL patches, which is a lot more simple.

This PR needs discussion on whether I should just stick with the SQL files, or also keep the ability to pin queries from the DQT before I continue work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State: Discussion required PR or issue that requires the resolution of a discussion with the relevant parties to proceed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant