So far I have managed to create something with all the right data on it using:
if ($mycourses = get_my_courses($user->id, null, null, false, 21)) {
foreach ($mycourses as $mycourse) {
$course = get_record('course', 'id', $mycourse->id);
grade_report_user_profilereport($course, $user);
echo '<br><br>';
}
}
The output of which is attached; the problems I have is that the header row is repeated and where the tables are separate the column widths are inconsistent giving a very messy look.
I've had a play with creating a new grade report but always seem to end up with 'class does not exist' errors.
Is there a neater way to do this?
Thanks,
Mike
Would you be eager to share your "tutor tab" code? You seem to have worked out a very handy solution to problems which I need to sort out for my school which uses a similar system to your college (tutors who need to see the information you have shown on your tab).
I'd be very happy to help you refine your project I've started looking into this issue, to no avail yet.
Cheers,
Fred
Mike
I'll look into it over the weekend.
Fred
What would be nice would be all the averages displayed at the top, with the averages of nothing (for students enroled on enrichment club courses etc) to not get displayed. I can't see where the average rows are generated- any pointers anyone?
Thanks,
Mike
find attached a copy of my new grade/report/user/lib_allgrade.php- you'll need to change the case stattement in course/user.php to:
case "allgrade":
require_once $CFG->dirroot.'/grade/lib.php';
require_once $CFG->dirroot.'/grade/report/user/lib_allgrade.php;
grade_report_user_profilereport_allgrade($user);
break;
I'm still not sure on how to get all the totals to the top
Mike
I haven't forgotten about this but I was swamped last weekend (problem with my main install, sorted now)
I'll look into it ASAP.
Cheers,
Fred
I've tried to reproduce what you've done but some reason nothing will show. I have managed to create all of the extra needed tabs and so on but I think I'm messing things up when I try and alter the course/user.php file.
I'd really love to be able to help you with this but as things look at the minute I might have to start making a new report from scratch (I don't fancy that ) and access it from another place.
Any extra info on what to alter in the course/user.php file? I've been "playing" with this for a few hours and getting nowhere...
Cheers,
Fred
73,94d71
< case "allgrade":
< require_once $CFG->dirroot.'/grade/lib.php';
< require_once $CFG->dirroot.'/grade/report/allgrade/lib.php';
< grade_report_user_profilereport_allgrade($user);
< break;
<
<
< case "allatt":
<
< echo "<h4 align=center>Technical difficulties are being experienced- if you think these marks are wrong you are probably right</h4>";
< // echo "<h4 align=center>Please bear in mind that these marks are only updated once a day so may contain errors</h4>";
< require_once $CFG->dirroot.'/mod/attforblock/locallib.php';
<
<
< if ($mycourses = get_my_courses($user->id, null, null, false, 21)) {
< foreach ($mycourses as $mycourse) {
< $cm = get_record("course_modules", "id", $mycourse->id);
< print_user_attendaces($user, $cm, $mycourse,TRUE);
< }
< }
< break;
If you don't know what this is /how to use it let me know
Mike
thanks for this, I was trying with the older Diff output that you gave me last week.
I think I know where the problem lies. I've installed a clean version of 1.9.2, followed all instructions given in Diff files and posts with amendments and it still did not work. I was really starting to wonder until I (just - blush) realised something: I am calling something that doesn't exist on my server.
In the course/user.php file, line 75, I am requiring /grade/report/allgrade/lib.php which I simply don't have.
I cannot believe I did not notice it up until now!
Is there any chance to get a copy of the actual report folder that you created, as I don't have grade_report_user_profilereport_allgrade or anything that goes with it.
If the zip file is too big, feel free to email me it.
Cheers,
Fred
Mike, would you happen to have some sort of installation package / instructions for this tutor module that you created? I've tried getting it to work with the instructions posted in this forum topic, but am having a hard time getting it to work. (Mainly because of my lack of experience in PHP - I'm more of an object-oriented kind of guy.)
More importantly; which files should go where and what files should be changed in what way? With those instructions, I'm pretty certain I could get this puppy to work. And that would mean more feedback for you... ;) (Yes, I know, the incentive offered by me might not be the most fascinating one, but I'm trying, here... :p)
- Create moodle/grade/report/allgrade/ and put lib.php in it.
- Apply this patch to moodle/course/user.php
- Apply this patch to moodle/lang/en_utf8/moodle.php
- Apply this patch to moodle/user/tabs.php
Mike
Excellent! With those instructions I've gotten it to work! I still get a few notices / warnings / errors*, but, quite frankly, I don't mind those that much, since now I have this functionality!
About the errors; since I'm using Moodle 1.8.2, it's perfectly possible that they're related to that. I'll still look into them, of course, and will let you know of my progress.
Personally, I'm all to happy with this functionality, since it was a must-have for getting Moodle implemented at my workplace. Thanks, Mike! ^_^
*) Errors:
All grades:
Notice: Undefined variable: user in C:\xampp\htdocs\moodle\grade\report\allgrade\lib.php on line 95
Notice: Trying to get property of non-object in C:\xampp\htdocs\moodle\grade\report\allgrade\lib.php on line 95
All attendance:
Warning: require_once(C:\xampp\htdocs\moodle/mod/attforblock/locallib.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\moodle\course\user.php on line 89
Fatal error: require_once() [function.require]: Failed opening required 'C:\xampp\htdocs\moodle/mod/attforblock/locallib.php' (include_path='C:\xampp\htdocs\moodle/lib/pear;.;C:\xampp\php\pear\') in C:\xampp\htdocs\moodle\course\user.php on line 89
The grade ones are possibly down to me not understanding the reports 100% and bodging it together until it worked. I'll have a look and let you know how I get on
Mike
Sorry for the late reply, I had a day off; Yes, the attendance block isn't in use. I should've known that, but I didn't pay much attention to the errors yet, since I was still dancing about the tutor tab. ;) (And I fixed some other non-related stuff.)
Edit: I looked at the other two errors and fixed those as well. It turned out that those also used a function (grade tracking object?), not used in my company's version of Moodle. So I modified the code in allgrade/lib.php so that the used variable is now replaced with an empty value. (Code below, modified stuff in bold.) Not ideal, but since we're not using it, I don't see the harm. But would you have an idea what it does? (I'm sure that you are, actually... ;))
/// return tracking object
///$gpr = new grade_plugin_return(array('type'=>'report', 'plugin'=>'user', 'courseid'=>$course->id, 'userid'=>$user->id));
$gpr = "";
global $CFG;
parent::grade_report($courseid, $gpr, $context);
Mike
Mike
See attached what the all attendance tab looks like.
I'll upload a set of patches probably tomorrow
Mike
Can be found at http://tracker.moodle.org/browse/CONTRIB-814
Mike