Description

Printing something like quiz results is truncated when using Sky High as a theme. For example, a quiz with 21 attempts gives a print out of 8 attempts on the first two pages, and two blank pages. The same quiz printed using another theme prints the total number of attempts/results.

Activity

Hi Tim, I have added you to this tracker issue for advice, as I don;t have any means of testing this with the amount of data needed to get a complete answer as to whether it is the theme or Moodle. I thought that you being the QUIZ Guru would be the best person to ask.

Mary Evans
added a comment - 25/Oct/11 12:02 AM @Tim Hunt
Hi Tim, I have added you to this tracker issue for advice, as I don;t have any means of testing this with the amount of data needed to get a complete answer as to whether it is the theme or Moodle. I thought that you being the QUIZ Guru would be the best person to ask.
Cheers
Mary

No idea. It is just a big table, so I would guess that the gradebook would show similar issues too. I don't think it takes that long to generate a lot of attempts. Just make a quiz with one true/false question.

Tim Hunt
added a comment - 25/Oct/11 12:13 AM No idea. It is just a big table, so I would guess that the gradebook would show similar issues too. I don't think it takes that long to generate a lot of attempts. Just make a quiz with one true/false question.

I am adding that this is not just a problem with quiz results. I was asked to make a PDF of a student's activity logs, and get the same truncated output. I will post it to the discussion about this issue after I remove the student's identification. After I switched to Serenity, the pdf printed just fine.

Rob
added a comment - 10/Nov/11 4:20 AM I am adding that this is not just a problem with quiz results. I was asked to make a PDF of a student's activity logs, and get the same truncated output. I will post it to the discussion about this issue after I remove the student's identification. After I switched to Serenity, the pdf printed just fine.

Since I don't have the facilities to test this out with the sort of data you are using, could you be so kind as to test this in both Overlay and Nonzero themes as these are the only other Blog style layouts in Moodle and should all produce the same results as you are finding with Sky High. If they work better, then we are closer to finding a fix for Sky High.
Thanks
Mary

Mary Evans
added a comment - 10/Nov/11 5:54 AM Hi Rob,
Since I don't have the facilities to test this out with the sort of data you are using, could you be so kind as to test this in both Overlay and Nonzero themes as these are the only other Blog style layouts in Moodle and should all produce the same results as you are finding with Sky High. If they work better, then we are closer to finding a fix for Sky High.
Thanks
Mary

Surprise! surprise! I managed to replicate this problem,,,and it not restricted to the one area, but rather as Tim says, it affects all reports. Like you say Rob, it truncates after the 8th/9th item and sends out blank pages! Very odd.
Ill test this in the other 2 themes.
Thanks
Mary

Mary Evans
added a comment - 10/Nov/11 6:18 AM - edited Surprise! surprise! I managed to replicate this problem,,,and it not restricted to the one area, but rather as Tim says, it affects all reports. Like you say Rob, it truncates after the 8th/9th item and sends out blank pages! Very odd.
Ill test this in the other 2 themes.
Thanks
Mary

Hi Rob,
I've just been testing this problem trying to find out why Sky High is so different. Can you do me a favour and test this using Binarius or Arialist as both of these themes have a separate report.php layout like Sky High, Serenity and quite a few other themes doesn't have a report layout. So this is possible the reason why you got a full report using Serenity and a truncated report using Sky High.

Looking as the actual file itself, there are changes in the head part which is alian to me, so I need to get this checked out to see if it is causing the problem.

At this point I am not sure how to resolve it...but there are enough Moodle developers who will know how to FIX this.

Mary Evans
added a comment - 10/Nov/11 10:18 PM Hi Rob,
I've just been testing this problem trying to find out why Sky High is so different. Can you do me a favour and test this using Binarius or Arialist as both of these themes have a separate report.php layout like Sky High, Serenity and quite a few other themes doesn't have a report layout. So this is possible the reason why you got a full report using Serenity and a truncated report using Sky High.
Looking as the actual file itself, there are changes in the head part which is alian to me, so I need to get this checked out to see if it is causing the problem.
At this point I am not sure how to resolve it...but there are enough Moodle developers who will know how to FIX this.
Thanks

Hi Rob, that's ODD as the report I ran off which I accessed via Settings > Site Administration > Reports > Config Changes printed the page missing off the right-hand side of the table. (using Arialist theme)

So that I get this right...can you list (in a similar fashion to how I mapped how I got to the report I pinted off) the steps you took to produce the report you printed?

Mary Evans
added a comment - 11/Nov/11 12:10 AM - edited Hi Rob, that's ODD as the report I ran off which I accessed via Settings > Site Administration > Reports > Config Changes printed the page missing off the right-hand side of the table. (using Arialist theme)
So that I get this right...can you list (in a similar fashion to how I mapped how I got to the report I pinted off) the steps you took to produce the report you printed?
Thanks
Mary

I did not try the config changes report for Arialist or Binarius. I PDF'ed quiz results in my test. I can confirm Arialist cuts off the right column in the config changes. This happens even if I dock all blocks. However, I do get all content to the bottom of the document. If I pring a user's activity logs, or quiz results, it is OK in Arialist. The issue with Sky High is that I get blank pages after 8 or so rows.

Rob
added a comment - 11/Nov/11 2:21 AM I did not try the config changes report for Arialist or Binarius. I PDF'ed quiz results in my test. I can confirm Arialist cuts off the right column in the config changes. This happens even if I dock all blocks. However, I do get all content to the bottom of the document. If I pring a user's activity logs, or quiz results, it is OK in Arialist. The issue with Sky High is that I get blank pages after 8 or so rows.
I appreciate your efforts Mary. Thanks again.

Ah...but HOW do you "...PDF quiz results...?
That's what I need to know as I have never done it, infact I was not aware you could.

Do I need a plugin?

What are the actual CLICK actions to do this?

This is VERY important as when we come to patch this we need to set the correct TESTING INSTRUCTIONS to reproduce the problem you encountered in the first place, for the tester to compare, before and after the patch is applied.

Mary Evans
added a comment - 11/Nov/11 4:24 AM Ah...but HOW do you "...PDF quiz results...?
That's what I need to know as I have never done it, infact I was not aware you could.
Do I need a plugin?
What are the actual CLICK actions to do this?
This is VERY important as when we come to patch this we need to set the correct TESTING INSTRUCTIONS to reproduce the problem you encountered in the first place, for the tester to compare, before and after the patch is applied.
Mary

Both install a print driver, and show up as a printer in Windows. The process is the same as printing on paper. I go to the quiz results report (or config changes, etc.). I hit Ctrl+P, choose PDF creator as my printer, and the software creates a PDF. I have also tried printing the quiz results from my initial forum post on a laser printer at work. The output is the same, just the PDF is viewed on screen.

Rob
added a comment - 11/Nov/11 7:47 AM I use Adobe Acrobat (not the free Reader) and the open source PDF Creator.
http://sourceforge.net/projects/pdfcreator/
Both install a print driver, and show up as a printer in Windows. The process is the same as printing on paper. I go to the quiz results report (or config changes, etc.). I hit Ctrl+P, choose PDF creator as my printer, and the software creates a PDF. I have also tried printing the quiz results from my initial forum post on a laser printer at work. The output is the same, just the PDF is viewed on screen.

Mary Evans
added a comment - 11/Nov/11 9:12 AM Thanks for this info Rob...much appreciated.
So the place you called the Report from is in the same place as all the other Reports then, in Site Administration > Reports?
That's even more interesting as these don't seem to use the repart.php layout that they are supposed to use. How very interesting!
Oh well I think I am getting nearer.

There seems to be a BUG in the way the layouts are defined in the theme's config.php.
It would appear that report.php (where defined in a theme) is not being used for the majority of the reports I tested.

What perhaps is even more interesting, is that the options, as defined for the print layout in config.php, are not being read.

As can be see with in the above example taken from theme/sky_high/config.php, the fact that it states NO FOOTER and NO BLOCKS it prints the report with blocks and footer. See attached PDF.

Seems a bigger problem than I first thought.

Perhaps one Tim might understand what's going on better than me as I'm absolutely clueless which it come to finding a FIX for this sort of thing!

I have already tried adding defining embedded.php as a possible layout for printing. I have added a print.css to base theme to see if that made any difference. I purged the cache just to make sure...but made no one jot of a differnce.

Mary Evans
added a comment - 11/Nov/11 10:17 AM Hi,
I think I have caught the little critter!
There seems to be a BUG in the way the layouts are defined in the theme's config.php.
It would appear that report.php (where defined in a theme) is not being used for the majority of the reports I tested.
What perhaps is even more interesting, is that the options, as defined for the print layout in config.php, are not being read.
// Should display the content and basic headers only.
'print' => array(
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
),
As can be see with in the above example taken from theme/sky_high/config.php, the fact that it states NO FOOTER and NO BLOCKS it prints the report with blocks and footer. See attached PDF.
Seems a bigger problem than I first thought.
Perhaps one Tim might understand what's going on better than me as I'm absolutely clueless which it come to finding a FIX for this sort of thing!
I have already tried adding defining embedded.php as a possible layout for printing. I have added a print.css to base theme to see if that made any difference. I purged the cache just to make sure...but made no one jot of a differnce.
Not sure how this will pan out Rob...but we are getting ever closer.
Cheers
Mary

This is a PDF of the report I rand off from Site Administration > Reports > Config Changes using Sky High theme. Notice the side blocks are visible. Although there is No footer, but there is hardly any of the main body of the report either!

Mary Evans
added a comment - 11/Nov/11 10:27 AM This is a PDF of the report I rand off from Site Administration > Reports > Config Changes using Sky High theme. Notice the side blocks are visible. Although there is No footer, but there is hardly any of the main body of the report either!
I'm surprised that this has not come to light before now!

Hi Mary,
I tested your workaround but - I'm sorry to say it - I can't get sky_high work as it should.
We have two improvements until now:

report "Config changes" has the body class .pagelayout-report

the table is not truncated at the right side when we print the report (print version is .content-only)
But still only a few items of the table are printed on my system with sky_high (and nonzero). Rob, could you please test the workaround on your systems!?

In the meanwhile I will test and dig again:

Should we use the (unused) layout report.php?

Is there something wrong with the extra content wrapper?

What's about the "post-footer"?

Should we change the report layout to a r4eal side-pre - content - layout?

Dietmar Wagner
added a comment - 14/Nov/11 3:44 PM Hi Mary,
I tested your workaround but - I'm sorry to say it - I can't get sky_high work as it should.
We have two improvements until now:
report "Config changes" has the body class .pagelayout-report
the table is not truncated at the right side when we print the report (print version is .content-only)
But still only a few items of the table are printed on my system with sky_high (and nonzero). Rob, could you please test the workaround on your systems!?
In the meanwhile I will test and dig again:
Should we use the (unused) layout report.php?
Is there something wrong with the extra content wrapper?
What's about the "post-footer"?
Should we change the report layout to a r4eal side-pre - content - layout?
Will be back!
Dietmar

Mary Evans
added a comment - 14/Nov/11 6:22 PM Hi,
I forgot that I had changed the page-footer. It was written in a strange way so rewrote it as follows...
<!-- END OF FOOTER -->
I changed this...
<!-- START OF FOOTER -->
<div id="page-footer">
<div class="footnote"><?php echo $footnote; ?></div>
<?php
echo $OUTPUT->login_info();
echo $OUTPUT->standard_footer_html();
?>
</div>
<!-- END OF FOOTER -->
</div>
</div>
<p class="helplink">
<?php echo page_doc_link(get_string('moodledocslink')) ?>
</p><center>
<?php
echo $OUTPUT->home_link();
echo $OUTPUT->standard_end_of_body_html() ?>
</center>
</body>
</html>
to this...
<!-- START OF FOOTER -->
<div id="page-footer">
<div class="footnote"><?php echo $footnote; ?></div>
<?php
echo $OUTPUT->login_info();
?>
</div>
<!-- END OF FOOTER -->
</div>
</div>
<p class="helplink">
<?php echo page_doc_link(get_string('moodledocslink')) ?>
</p>
<center><?php
echo $OUTPUT->home_link();
echo $OUTPUT->standard_footer_html(); ?>
</center>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</body>
</html>
I don't much like the use of center tag but it's not doing any harm so I left it but if I was to do this fix I would rewrite that and create a rule in the CSS
Notice I brought the output for standard footer to the very end of the page, this allows the 'performance info' to print in the footer, which it refused to do before this change.
But whether this has something to do with the printing, I don;t know...I need to re-test.
Sorry about that Deitmar.
I'll reset the code and add the patch and see where I get.
Cheers
Mary

Hi Mary,
it's somehow frustrating.
I updated to a newer Moodle version(now: 2.1.2+ BUILD (20111010)] in order to have a clean installation, applied the patches to admin/report/backups/index.php and admin/report/configlog/index.php (body class .pagelayout-report is ok), added the CSS for .pagelayout-report and later altered the general.php footer.
And can't get it working, more precisely FF 8 , IE 8 , Chrome 15 (+ yes!), Opera 11 .
In the printed version of the backup report only 20 of 47 existing courses are shown.
No idea! Your Moodle version?
Cheers
Dietmar

Hi,
My Moodle version is 2.0.5 (20111102 CVS) with FF8 and IE9 (although I did not check it in IE)

I have just tested this in Moodle 2.1.2 (20111102 CVS) with FF8 & Chrome 15 (more print options) and works fine but only prints the data of the page displayed on screen.

What you are getting is probably the same as I am except I was only looking at the number of items on the page which, in earlier (pre patch test) only ran off 8 lines and overlayed with the sidebar as well. But with the patch I am getting the whole page of data.

So the problem we are looking at now is how to print off the whole of the data in "any" report, as opposed to one page at a time manually!

Mary Evans
added a comment - 15/Nov/11 5:28 AM Hi,
My Moodle version is 2.0.5 (20111102 CVS) with FF8 and IE9 (although I did not check it in IE)
I have just tested this in Moodle 2.1.2 (20111102 CVS) with FF8 & Chrome 15 (more print options) and works fine but only prints the data of the page displayed on screen.
What you are getting is probably the same as I am except I was only looking at the number of items on the page which, in earlier (pre patch test) only ran off 8 lines and overlayed with the sidebar as well. But with the patch I am getting the whole page of data.
So the problem we are looking at now is how to print off the whole of the data in "any" report, as opposed to one page at a time manually!
Mary

Now, what does that mean in connection to your comment?
I think it means that I/we have neither a Moodle version issue nor a browser issue.
In my opinion the culprit is hiding in the pagelayout of Sky_high general.php.

Dietmar Wagner
added a comment - 15/Nov/11 11:28 PM Hi Mary,
thanks for your comment. Did I understand you correctly that your printed version of the report Config changes includes the whole table regardless of how many rows the table has? Hmmmm!?
I poked around a little bit in this matter and I hope I made a step foreward - for my system!
My starting point: The small patch for admin/report/configlog/index.php.
I) I tried to print report Config changes with Arialist: 30 of 30 items! (=> attachment )
II) I did the same with Sky_high and your CSS workaround: 11 of 30 items! (=> attachment)
III) After
changing in sky_high/config.php (I don't use sky_high's own report.php!)
'report' => array(
'file' => 'general.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
)
to
'report' => array(
'theme' => 'base', // !!!!!
'file' => 'report.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
)
and
replacing your CSS workaround for Sky_high with the rules for .pagelayout-report in Base (without any media print CSS)
printing reports with the pdfcreator works absolutely fine: 30 of 30 items (=> attachment)
Now, what does that mean in connection to your comment?
I think it means that I/we have neither a Moodle version issue nor a browser issue.
In my opinion the culprit is hiding in the pagelayout of Sky_high general.php.
Back to the digging tools!
Cheers
Dietmar

Mary Evans
added a comment - 16/Nov/11 1:52 AM Hi Dietmar,
I think you are correct in your assumption.
I am busy re-basing some Moodle commits, for other issues in the pipeline, so I wont be able to look at Sky-High unlil later.
Thanks again for your help in solving this problem.
Cheers
Mary

Thank you for the time and effort you are putting in to solve this. I notice your proposed patches are all for site reports. Would course level reports be fixed by these as well? It was printing quiz results that this was first noticed by my teachers. They are often asked to bring print-outs of common assessment data to meetings where they may not have access to a computer.

Rob
added a comment - 18/Nov/11 11:59 PM Hi Dietmar,
Thank you for the time and effort you are putting in to solve this. I notice your proposed patches are all for site reports. Would course level reports be fixed by these as well? It was printing quiz results that this was first noticed by my teachers. They are often asked to bring print-outs of common assessment data to meetings where they may not have access to a computer.
Rob

Thanks for adding these, I'll get them done ASAP that's if Rajesh has no objections.
I'd also like you help with another page layout problem in anothet tracker issue. I'll add you as a watcher to it then you can see the problem.

Mary Evans
added a comment - 19/Nov/11 1:33 AM @Dietmar
Thanks for adding these, I'll get them done ASAP that's if Rajesh has no objections.
I'd also like you help with another page layout problem in anothet tracker issue. I'll add you as a watcher to it then you can see the problem.
Cheers
Mary

Mary Evans
added a comment - 21/Nov/11 8:28 PM - edited Hi Dietmar,
As you will see above I added the fixes, and set 'workflow' to 'Waiting for integration review'.
However, while I was doing the fixes, I found that of the 9 you mentioned only 8 were present in Moodle 2.2, and only 6 in both Moodle 2.1 & 2.0.
Spamcleaner was missing from Moodle 2.2, and Loglive from Moodle 2.1 & 2.0.
I also found that Log and Stats were already coded in Moodle 2.1 & 2.0 but in settings.php. You can check this out here...
https://github.com/lazydaisy/moodle/blob/MOODLE_21_STABLE/admin/report/log/settings.php
I presume this is OK?
Cheers
Mary

2) The code in admin/report/logs/settings.php and admin/report/statistics/settings.php does not add the body class .pagelayout-report to the reports "Logs", "Live logs" and "Statistics". I tested it just this moment. So it would have made sense to integrate the 3 course level patches too. MDL-29904 is fixed anyway.

Dietmar Wagner
added a comment - 22/Nov/11 12:19 AM Hi Mary,
that's one small step for ...
1) I'm only using Moodle 2.1 (and 1.9 as fallback) in the moment and can't say anything to other moodle versions.
My report menu shows the following items:
Comments
Backups
Config changes
Course overview
Logs
Live logs
Question instances
Security overview
Spam cleaner
Statistics
!?
(May be the number of reports depends on specific admin settings.)
2) The code in admin/report/logs/settings.php and admin/report/statistics/settings.php does not add the body class .pagelayout-report to the reports "Logs", "Live logs" and "Statistics". I tested it just this moment. So it would have made sense to integrate the 3 course level patches too. MDL-29904 is fixed anyway.
Cheers
Dietmar

There were quite a few more reports in Moodle 2.2 which had index.php but not on your list. I was tempted to add the report layout to them, but didn't as I was not sure if I was doing the correct thing.

Mary Evans
added a comment - 22/Nov/11 2:11 AM - edited There were quite a few more reports in Moodle 2.2 which had index.php but not on your list. I was tempted to add the report layout to them, but didn't as I was not sure if I was doing the correct thing.
You can see what I mean here...
https://github.com/lazydaisy/moodle/blob/master/report/
And if you check line 45 in this page...
https://github.com/lazydaisy/moodle/blob/master/report/participation/index.php
you will see this setting...
$PAGE->set_pagelayout('admin');
which is why the report pages are not actually using the report layout page...which is interesting in itself!
What do you think?
Mary

Mary Evans
added a comment - 22/Nov/11 2:19 AM - edited Following on from my last comment...
https://github.com/lazydaisy/moodle/blob/master/report/questioninstances/settings.php
This shows the settings.php from questioninstances...where it lists the following...
$ADMIN->add('reports', new admin_externalpage('reportquestioninstances', get_string('pluginname', 'report_questioninstances'), "$CFG->wwwroot/report/questioninstances/index.php", 'report/questioninstances:view'));
I am wondering now if what I added in the index will affect these settings?
M

Hi Mary,
@questioninstances: I'm sure that after applying the corresponding patch the body class .pagelayout-report is attributed to the report "Questioninstances". And that is what we wanted to achieve, isn't it?
Cheers
Dietmar

Dietmar Wagner
added a comment - 22/Nov/11 2:29 AM Hi Mary,
@questioninstances: I'm sure that after applying the corresponding patch the body class .pagelayout-report is attributed to the report "Questioninstances". And that is what we wanted to achieve, isn't it?
Cheers
Dietmar

Thanks to everyone for the hard work put into fixing this issue. I just updated my production site to the latest 2.1.2+ thinking the fixes were included. The integration is listed in recent changes. However, I am still getting truncated print jobs using Sky High (quiz results and config changes). Have the fixes not been included yet? Should I wait until next week?

Rob
added a comment - 27/Nov/11 2:39 AM Hi all,
Thanks to everyone for the hard work put into fixing this issue. I just updated my production site to the latest 2.1.2+ thinking the fixes were included. The integration is listed in recent changes. However, I am still getting truncated print jobs using Sky High (quiz results and config changes). Have the fixes not been included yet? Should I wait until next week?
Rob

Hi Rob,
Yes it is in the current download for 2.1.2+, however, you may be in a situation where your current site's cache needs purging.

To do this go to Settings > Site Administration > Development > Purge all caches Clicking this link takes you to a page where there is a button to click which actives the process it takes a little while to clear the cache. Once this is done, you can return to the report page and refresh your browser in the normal way or try clicking the Ctrl + F5 keys together as this forces a complete refresh of the page.

Mary Evans
added a comment - 27/Nov/11 5:58 AM Hi Rob,
Yes it is in the current download for 2.1.2+, however, you may be in a situation where your current site's cache needs purging.
To do this go to Settings > Site Administration > Development > Purge all caches Clicking this link takes you to a page where there is a button to click which actives the process it takes a little while to clear the cache. Once this is done, you can return to the report page and refresh your browser in the normal way or try clicking the Ctrl + F5 keys together as this forces a complete refresh of the page.
You can then try the printing process again.
Let me know how you get on.
Thanks
Mary

I cleared the server cache and my browser. I also upgraded my test site and do not see the fix. Just to be clarify, I upgraded to Moodle 2.1.2+ (Build: 20111125). I will try a fresh download/install today after I get into the office.

Rob
added a comment - 28/Nov/11 11:36 PM Hi Mary,
I cleared the server cache and my browser. I also upgraded my test site and do not see the fix. Just to be clarify, I upgraded to Moodle 2.1.2+ (Build: 20111125). I will try a fresh download/install today after I get into the office.
Rob

Mary Evans
added a comment - 29/Nov/11 1:09 AM I would not do anything more, Rob as this is now a theme issue, and nothing to do with the patches which have just been applied.
I'm going to create a sub-task to deal with this issue.
Thanks for your patience.
Mary

I made an update to the latest version of 2.1.2+ thisafternoon.
The patches for atttributing the right body class to the reports are integrated.
But the workaround for sky-high itself (footer, CSS for .pagelayout-report and @ media print)is missing for some reason.

Dietmar Wagner
added a comment - 29/Nov/11 1:54 AM Hi Rob, hi Mary,
I made an update to the latest version of 2.1.2+ thisafternoon.
The patches for atttributing the right body class to the reports are integrated.
But the workaround for sky-high itself (footer, CSS for .pagelayout-report and @ media print)is missing for some reason.
Cheers
Dietmar

Rob
added a comment - 29/Nov/11 2:06 AM Hi Mary and Dietmar,
You two are great. Thank you for getting back to me so quickly.
Mary, will the sub-task be part of this tracker issue? If not, will you please link to it here so I can add myself as a watcher?
Rob

Mary Evans
added a comment - 29/Nov/11 4:22 AM - edited @Dietmar
That's because I left them off to see if the patch worked without them. Apparently it does for some reports, but not for others as Rob is still finding out.
I can concentrate better now on Sky High in MDL-30500 and see if we can find any more issues related to the layout for this theme.
Thanks
Mary