oliviervalentin / moodle-report_coursemanager

Course Managet is a report tool for Moodle for helping teachers to clean and manage their courses and contents. It is based on an automatic task which calculates reports, that are displayed in a general dashboard and directly in courses.
GNU General Public License v3.0
8 stars 5 forks source link

Error when running run_orphan_submissions_report_task #69

Open bfriesenvcc opened 3 months ago

bfriesenvcc commented 3 months ago

When I try to run the run_orphan_submissions_report_task for the first time, I get this (We're using Moodle 4.1.7):

Execute scheduled task: Course Manager report for orphaned submissions (report_coursemanager\task\run_orphan_submissions_report_task) ... started 15:09:06. Current memory use 14.3 MB. ... Start coursemanager report for orphaned submissions.

Notice: Trying to get property 'id' of non-object in /data/shares/our-path-removed/report/coursemanager/classes/task/run_orphan_submissions_report_task.php on line 63

Notice: Trying to get property 'id' of non-object in /data/shares/our-path-removed/report/coursemanager/classes/task/run_orphan_submissions_report_task.php on line 64 ... used 5 dbqueries ... used 0.079356908798218 seconds Scheduled task failed: Course Manager report for orphaned submissions (report_coursemanager\task\run_orphan_submissions_report_task),Invalid course module ID (SELECT id,course FROM {course_modules} WHERE id IS NULL [array ( )]) Debug info: SELECT id,course FROM {course_modules} WHERE id IS NULL [array ( )] Backtrace:

oliviervalentin commented 3 months ago

Hi, thank your for your message ! Very strange... Just to be sure :

That's when the code tries to retrieve context that it bugs... I'm turning with a 4.1.3+ version, and I didn't encountered this problem...

Olivier

bfriesenvcc commented 3 months ago

We definitely have assignments, yes, but they are the NEW assignments (id=43) not the old, disabled assignments (id=1).

Based on what you said, I edited the code on line 59 to include id=43 and it ALMOST worked. It eventually timed out and now I'm getting a task lock.

image image

oliviervalentin commented 3 months ago

OK. So that was it : I declared that assign was activity "1", but for some installations, that could be another number ! I think I should add first a request to check that idnumber for this activity. The time lock should disappear soon. Let me know if the process finally successfully ended.

Just to know : will you use the whole plugin and all its features ? Or are you in fact only interested by the orphan submissions fetaure ? If that's the last case, and other users do the same, I should maybe isolate it in a separate and independant plugin...

Olivier

bfriesenvcc commented 3 months ago

I can see that it ran, but perhaps didn't complete. image

This report would be amazing if we could drill down to look at the assignment files within each assignment and see their submission dates so we could verify how old they were and delete with confidence. I know that's asking a lot, but if you think it's possible, I will submit a feature request for the future.

I haven't delved deeply into the other reports, but for us it would mostly be the orphaned submissions. The other reports may be useful, but very infrequently. Due to how WE organize things, we wouldn't miss them if they weren't available.

Thanks for all your fast responses. You get two thumbs up from me!!

bfriesenvcc commented 3 months ago

Having had a closer look, I do like several of the Statistical reports.

oliviervalentin commented 3 months ago

Ok; so first, I put this ticket as "bug". I must add a request to find the correct ID for assign activity.

I also had a return concerning this tool during french MoodleMoot this week. Somebody also told me that it would be interesting to define a limit date from which assign files are considered as orphan or not. I don't know if I will extract this feature as a plugin in the future, but it seems clear that I must ameliorate it.

As this plugin still evolve since 3 years, feel free to propose any request, ideas, amelioration aso !

Olivier

bfriesenvcc commented 2 months ago

I totally agree with a date limit. I was thinking, last week, that if I ran the report right after an instructor had "accidentally" unenrolled someone, then we could lose that student's files. A date limit would eliminate that risk.

oliviervalentin commented 2 months ago

I added a new issue #73 to keep this enhancement in mind. Feel free to add any comments if necessary ! This is my last week before university closure for holidays. I will make it... when I can ! 😄