complete activity report - not scalable enough?

complete activity report - not scalable enough?

by Przemyslaw Stencel -
Number of replies: 23

I'm having problems displaying my "Activity Report - Complete" - I can never display it in full. Most of the times it just breaks somewhere around the posts I sent to the Forum Module discussion.

I noticed it because I wanted to have a look at a post which I sent to the Quiz Module forum some time ago - I couldn't find it using search so decided to use the activity report - no success sad

Is this because there is some kind of built-in limit of posts one can write in Moodle? wink Or maybe a server's or browser's timeout setting?

Average of ratings: -
In reply to Przemyslaw Stencel

Re: complete activity report - not scalable enough?

by Przemyslaw Stencel -

Could I ask a few Using Moodle's 'regulars' (users who have posted a large number of discussion messages here in this course) to check if you are experiencing the same problem.

Have a look at the "Activity Report -> Complete" and let me know whether you are able to get the whole page displayed.

I have checked in my Outline Activity Report and I have posted 500+ messages here - the full report page doesn't seem to be capable of displaying this many, but I don't know whether it's a browser issue that I can fix on my end, or something else.

Whatever the reason, what do you think of implementing some kind of paging on that page? I think the most logical way to do it would be to split the page according to the course topics/weeks which the forum messages belong to. And if a certain topic still has too many messages, it could be further split into subpages. Comments?

In reply to Przemyslaw Stencel

Re: complete activity report - not scalable enough?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes, indeed - I see the same thing. I don't know yet why it's dying, though.

Splitting it up by section makes sense, at the very least.

Volunteers?
In reply to Martin Dougiamas

Re: complete activity report - not scalable enough?

by Pavel Petrov -
I am volunteer, although I am not sure I'll be able to do it very fast. Tell me if there are any deadlines with this.

In reply to Pavel Petrov

Re: complete activity report - not scalable enough?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Great!  How about tomorrow night?   wink 

Seriously though, within a week would be great!
In reply to Martin Dougiamas

Re: complete activity report - not scalable enough?

by Pavel Petrov -
Oooops. smile Within a week... I can say only that I'll try to make it in a week. It can appear that it'll be quite easy to make this change, I have to see the code first.
In reply to Pavel Petrov

Re: complete activity report - not scalable enough?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Did anything happen yet on this, Pavel?   smile
In reply to Martin Dougiamas

Re: complete activity report - not scalable enough?

by Pavel Petrov -
Nope sad(.. Just a bit.
I had some timing duties here, and Przemek found a little bug in what i've sent you before (the preview question thing) so I'm trying to repair it now.
In reply to Martin Dougiamas

Re: complete activity report - not scalable enough?

by Przemyslaw Stencel -

Splitting it up by section makes sense, at the very least.

We've discussed it with Pavel and came up with a few suggestions, but some doubts and questions as well smile. We'd appreciate any feedback and comments.

Here's what the paged version of the report could look like: http://stencel.info/files/moodle_screenshots/report1.gif

Question 1: should it always be paged, or only if the user has posted more than n messages in the course? Question 2: if the latter, then n = how many?

Question 3 is what to do with topics which even with paging have a lot of posts to display (I'm sure this might be for example the case with "Using Moodle" topics 2 or 4)? Should they be paged further? How about this: http://stencel.info/files/moodle_screenshots/report2.gif? In this case I believe there is no question of whether it should always be paged - it should. But there is still Question 4: what is the number of messages in a topic that sets the cut-off line for paging?

Any ideas, guys?
Przemek

In reply to Przemyslaw Stencel

Re: complete activity report - not scalable enough?

by Gustav W Delius -

Hi Przemek,

regarding your questions 3: how about only showing the 5 most recent posts in each forum and then a link to show all. The page that shows them all should then be paged.

And the activity report should only be paged when it gets long because in 99.9% of courses it will be rather short and paging would be a nuisance.

In reply to Gustav W Delius

Re: complete activity report - not scalable enough?

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
IMO The paging would be quite complicated to implement sad

How about this instead of the dropdown menu? Shall I send a patch to Martin for review?

Attachment tabbed.gif
In reply to Petr Skoda

Re: complete activity report - not scalable enough?

by Przemyslaw Stencel -
Great! This should solve the problem of the page not fully loading. Please, do send it to Martin - we'll see what he says. Thanks! big grin
In reply to Petr Skoda

Re: complete activity report - not scalable enough?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Petr,

although your solution is very elegant, I'm not really sure if it will scale fine with courses having a lot of sections. Instead, the drop-down menu will scale fine.

Anyway, some type of paging will be necessary, because some sections can be too much individually. So I think that, the drop-down plus paging should be the solution.

But, taking a look to the code, I think that it's really difficult to make the paging, because every module_user_complete() function is being invoked independently, so it's impossible to control the number of "actions" showed for each of them.

The solution should involve passing some extra parameters (the number of actions printed and the size of the paging) to such functions and to make them return some value too (the number of actions printed by it. Only then, that view could include paging, I think! If anybody has another alternative....

About optimisation, I think that all that functions are executing queries based in the userid, and moduleid fields. If theory is being applied, used tables should have indexes in that fields (because they are foreign_keys). It should improve things a lot (more if done with all the fks in Moodle!!), although I think that, in this case, the problem can be the "render" time instead of the "DB query" time!!

Ciao smile

In reply to Eloy Lafuente (stronk7)

Re: complete activity report - not scalable enough?

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Hi Eloy!

I have created a bug report and only then found your answer :-\ (see bug #2119).
But it should be easy to implement a drop-down menu - replace only several lines of the code in my patch smile

I have tested the tabs with some 30 sections and it seemed OK to me, but I agree that it is too much "visible" - drop-down would be nicer.

I have tested my Action report/Complete on my Moodle account. It usually stops at about 240kB (both in IE, and FF). If I hit the reload button it loads completely 540kB - my connection is ADSL 512kbit/s. It is interesting that only the first request fails for me, can anybody comfirm it?

skodak
In reply to Petr Skoda

Re: complete activity report - not scalable enough?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Petr,

your behaviour could confirm that the timeout for that report is produced at "render" time instead of "database" time. All the contents being displayed are cached (if enabled) so, next requests haven't to render (format, filter, clean...) everything again and the page will "advance" (finish in your case).

About your solution, really cool if it works. wink I think that the dropdown menu will be better but it's only my opinion. Can you send an image to see how is it when a lot of sections are present?

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: complete activity report - not scalable enough?

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
...here it is. I did not try to fix the <hr /> under the tabs.

Of course in IE the tabs would look a bit more rectangular. wink


Attachment tabs.gif
In reply to Petr Skoda

Re: complete activity report - not scalable enough?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Oh, really a bit overloaded tongueout, isn't it?

Anyway, opinions will be welcome...

Ciao smile

In reply to Eloy Lafuente (stronk7)

Re: complete activity report - not scalable enough?

by Przemyslaw Stencel -
Personally, I prefer the drop-down menu.

Thank you, Petr and Eloy! smile
In reply to Przemyslaw Stencel

Re: complete activity report - not scalable enough?

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
It seems to be a timing thing. I get different elements displayed at the bottom of the report every time. Hit refresh - you'll see what I mean.

mike
In reply to Przemyslaw Stencel

Re: complete activity report - not scalable enough?

by Martín Langhoff -
Could it be that the code is selecting too much into memory, or doing an inefficient SQL SELECT? Maybe can be fixed with a JOIN and or a few extra indexes...

Can anyone who is seeing this problem report whether PHP is hitting memory constraints, and if mysql is consuming CPU while the users wait?

It's probably a smart thing to fix the "slow/die" issue, and make sure it's running well. UI changes are good if they make sense from a user perspective, but if the logic is slow/inefficient it'll still break for large scale installations.

We're rolling out with a lot of users & courses, I haven't heard anything about this particular page not scaling. Yet ;)
In reply to Przemyslaw Stencel

Re: complete activity report - not scalable enough?

by Geoff Wilbert -

Hi  - a related issue: I notice that in complete/outline a student can view all activity reports for a topic even if it is hidden. I'd prefer it not to show them at all?

I will be looking into a fix for this for our site and am happy to post the hack if anyone is interested, I just thought it may be an idea to incorporate this into the scalability mods...

In reply to Geoff Wilbert

Re: complete activity report - not scalable enough?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Geoff,

could you create a bug in http://moodle.org/bugs detailing the problem and then, tons of thanks, post your hack there? Then developers could check (and use) it if everything seems to work! Posting a reference to the bug in this discussion will be a nice thing too...

TIA and ciao smile
In reply to Eloy Lafuente (stronk7)

Re: complete activity report - not scalable enough?

by Geoff Wilbert -

Sure thing - actually this was mostly fixed in 1.4.3. (I was on 1.4.2) (Bug #2032) but the hidden topics still show up in the reports albeit with no items.

So my reported bug (and fix? (works for me)): Bug #2185 - Student Activity report shows hidden topics

cheers

In reply to Geoff Wilbert

Re: complete activity report - not scalable enough?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Geoff,

Bug 2185 has been fixed and closed applying your patch. Seems to work. Thanks!

Ciao smile