sensei icon indicating copy to clipboard operation
sensei copied to clipboard

Students Reports page showing blank

Open StefMattana opened this issue 2 years ago • 10 comments

Two different users have reported this issue, using the latest version of Sensei Pro (WCPC) on their websites.

  • 5853722-zen
  • 5854567-zen

One of them reports that:

We are receiving a No Students Found message on this report. Courses are showing on the Courses tab. We have updated to v4.9.1. Our staging site is at v4.8.1 and is displaying our list of students correctly on the reports.

They tried a plugin/theme dance with no results; disabling Sensei Pro (WCPC) and using just Sensei LMS which did not help either.

Upon further investigation (Slack convo) @m1r0 replicated the issue by dropping the sensei_comment_type_user_id SQL index in the wp_comments table

To verify this is correct, we need to ask for a database dump, which is what I asked both users to provide.

Meanwhile, @Imran92 figured out a quick fix by disabling the part of the query that’s causing the issue:

add_filter( 'sensei_students_report_last_activity_filter_enabled', '__return_false' );

This would fix the issue but also disable the “Last Activity” feature in the reports -- worth noting for the users I offered this option to both users to try out.

Next steps depend on what and how the users can provide database dumps to check.

StefMattana avatar Jan 18 '23 13:01 StefMattana

Support References

This comment is automatically generated. Please do not edit it.

  • [ ] 5853722-zen
  • [ ] 5854567-zen
  • [ ] 6183929-zen

github-actions[bot] avatar Jan 18 '23 13:01 github-actions[bot]

Relates to #6134.

m1r0 avatar Jan 18 '23 13:01 m1r0

User in 5854567-zen provided database backup file.

cena avatar Jan 18 '23 20:01 cena

Updating the issue here with a fix.

Assuming that the sensei_comment_type_user_id index could have been removed manually from the database* -- and therefore the users may have access to the database, the fix requires manual action.

Manually recreating the index running CREATE INDEX sensei_comment_type_user_id ON wp_comments ( comment_type, user_id ); should fix the issue. The wp_comments can be replaced with the name of the comment table if it’s something else.

Noting that this fix won’t have the users lose the ability to filter by date in reports because of the snippet fix.

*investigations led possibly to the woo_idx_comment_type index is still present in the database, and both indexes are created at the same time in code. Hence, the sensei_comment_type_user_id index could have been manually deleted.

StefMattana avatar Jan 19 '23 13:01 StefMattana

Additional note from Imran:

With certain versions of mysql, you may need to use the query with ‘global’, so the query to need to run is SET GLOBAL SQL_MODE ='ALLOW_INVALID_DATES';

Then you should run the index generating query CREATE INDEX sensei_comment_type_user_id ON c3_comments ( comment_type, user_id );

In case this still doesn’t work, bes to use the snippet fix for now until a fix is prepared.

cena avatar Jan 20 '23 17:01 cena

This ticket 6183929-zen is possibly related:

I navigated to Sensei LMS>Reports and do not see any students listed. I can find the students under Courses but I do not see an average grade for students anywhere and need to know a cumulative score for all their lessons/quizzes...

Noting that this user also has issues with grading (GH issue here) so this might not be 100% the same issue.

StefMattana avatar Apr 12 '23 07:04 StefMattana

This issue was reported by Gonzalo in Slack: p1705512099856069-slack-C03BXN7UQ5V

m1r0 avatar Jan 19 '24 13:01 m1r0

When adding the index to Gonzalo's site, I noticed that the sensei_comment_type_user_id index was missing but there was an existing index named comment_type_user_id. This might be important so I'm adding it here.

image

m1r0 avatar Jan 19 '24 14:01 m1r0

@m1r0 Just curious if we fixed this one or if it's still outstanding?

donnapep avatar Mar 07 '24 17:03 donnapep

It's still outstanding. We did a manual fix in Gonzalo's case.

I couldn't determine why the index was not created. It's either a bug that happens in some specific case or the index was removed manually.

m1r0 avatar Mar 11 '24 10:03 m1r0