Download & Extend

Gradebook & user profile aggregates

Project:Gradebook
Version:6.x-2.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I have setup a basics school administration system using content profiles for the student profiles and Gradebook, OG Gradebook and OG for the marks system

Each OG is a "subject" and each student has several subjects. Each subject consists of multiple assignments that each get a mark in that subjects gradebook
So each subject ends up with an aggregate mark for each student.

I would like any guidance that anyone may have in how to display these aggregates on the students profile page. So in effect each students profile (which is only visible privately) becomes a report card that can be printed and posted or e-mailed at the end of a semester to the student and parents.

Can anyone provide me with any direction as to how I would go about collecting the gradebook aggregates and displaying them on a user page?

Thanks
Gregg

Comments

#1

look into the views and computed fields modules

#2

Title:Gradebook & Content Profile» Gradebook & user profile aggregates

Thanks Seniorheff

I am familiar with views 2 and the computed fields module, only in my explorations of gradebook so far I have only come across the current view fields listed below

Gradebook Assignment: Due Date
Date on which the Gradebook Assignment is due.

Gradebook Assignment: Possible
Possible points for assignment.

Gradebook Assignment: Publish Date
Date on which the Gradebook Assignment was published.

None of these seem right for what I am looking for as I need to aggregate the mark that each student received per organic group (subject) as indicated circled in red on the actual gradebook.
So in the attached example, the subject is "Computer Design", the student is "Gregg Coppen" and the Aggregate is the circled percentage

I would like for this percentage to appear on the students user profile next to the groups (subjects) that the student is a part of Eg.

Computer Design 1 - 80%
Drawing 1 - 50%
Graphic Design - 90%

I have changed the title of this issue to reflect the fact that it is not integration with Content Profile that I would like to do, it is more integration with the user profile.

Thinking about this more, maybe it is more an OG gradebook issue and not a normal gradebook one.

Any guidance on how I would access these aggregates from the organic groups using views would be greatly appreciated.

Thanks
Gregg

AttachmentSize
gradebook-aggregate.jpg 81.04 KB

#3

Cross posted in the OG Gradebook issue queue as well as a feature request
http://drupal.org/node/636004

#4

Status:active» postponed (maintainer needs more info)

I suppose this would be best suited to gradebook rather than og_gradebook, since the gradebookapi is sufficient to provide this summary.

How about producing a block that contains a two column summary table with gradebook name and overall grade? This block could then be enabled on all profile pages (or any other page that you like).

Since gradebook already implements hook_block, and the api is sufficient to produce the summary list, it wouldn't take much additional code.

I can post a patch tonight if you think this would work.

#5

Status:postponed (maintainer needs more info)» needs review

This patch adds a Course Grades block that can be displayed on the users profile pages (or any other page). It is a simple table with the gradebook name (i.e. Course name, linked to the gradebook page) and the overall grade from the gradebook.

Its not as configurable as a view would be, but if you need it in a hurry, this might do. Let me know what you think.

AttachmentSize
613352_grade_summary_block.patch 2.13 KB

#6

Thanks very much, I will test it shortly and feedback here

#7

Thanks very much, I will test it shortly and feedback here

#8

Sorry for the dupe above.

Thanks again for yr speedy response to my feature request.

In my initial testing, the block that i display on the user profile page does not seem to be filtered by the user that is being viewed. I tried it with a username and a uid in the URL and with a block and within a panel and the behaviour was the same.

The block seems to display all the og subjects and not just the ones the user is part of.
It also shows all grades listed as empty even though some of the og gradebooks do have marks entered and are generating aggregates.

Thanks for the patch and hope this helps

#9

It sounds like you were viewing the block as the admin? I set it up so that only the logged-in user could see their grades. Try logging in as the student and you should see only the appropriate og subjects.

I suppose if the logged in user is the admin or the teacher, then they should be able to see the grade block for the student, when looking at the student's profile page. The problem with this is that blocks do not take arguments, so I don't know of a way to make that work.

I am also working on getting the views integration to the point that you can prepare the view that you would like.

Thanks for the feedback.

#10

Hi MGN

Yes unfortunately for my use case the students cannot access their own grades as they are not given usernames or logins. A school admin will view and e-mail the entire profile to a user as a "report card"

This is a good point about blocks not accepting arguments, i was not aware of that. So then my only option is for it to be a view that can be filtered by userid or username.

If there is anything I can do to assist getting this closer to being views compatible please let me know. I would happily contribute some dollars to helping to make this happen fairly soon.
Please let me know paypal details and how much time/money you think this may take to complete.

Thanks for your efforts so far
Gregg

#11

Hi MGN

Please let me know if it is possible to get a rough timeframe on this views integration?

If you are too busy then I need to look at engaging another programmer to assist with this.

As I have mentioned I am happy to pay for your time

Thanks
Gregg

#12

Status:needs review» active

Hi Gregg,

Sorry, I am still trying to figure this out. I am not that familar with Views integration and haven't been able to find good/easy documentation or examples to work from on this.

So I am holding off on that and instead I am working on adding a tab to the user's profile page that will summarize the student's grades. I'll make this themeable, so anyone can easily modify the format to suit their needs.

I should be able to post a new patch in the next day or so.

#13

Status:active» needs review

This patch adds a Grade Summary tab to the account page of any user who has a grade in a gradebook. Access to the tab is limited to the owner of the account and users with administer gradebook permission. The page format can be modified using a theme override of the theme_gradebook_grade_summary function.

Can you try this out (patch is against the current 6.x-2.x-dev version) and let me know if this is sufficient, and or any other ideas.

Eventually I would like to extend the views integration so that this could be done with views. I am going to write this up as a separate task.

AttachmentSize
613352_user_grade_tab.patch 3.57 KB

#14

Thanks MGN, I will test this out and report back. Much appreciated for helping to find a solution to this issue.

#15

It works great thanks. I may have a few questions about integrating it on the main profile page rather than in a tab but I can confirm it works as requested.

Thanks so much for this
Gregg

#16

Hi MGN

I am trying to integrate the grade summary table directly on my user profile page rather than in a tab.

I am not sure if I have the order of things right here but this is what I have done so far

1.) Created a user-profile.tpl.php and have done some initial layout work with the $profile variables.

2.) Then I copied and pasted this function to my template.php file with "sadp" being the name of my theme.

function sadptheme_gradebook_grade_summary($account, $data) {

// If no data is available, print a helpful message!
if (empty($data)) {
$output = t('No grades are available for @user', array('@user' => $account->name));
return $output;
}

$headers = array(t('Course'), t('Grade'));
$rows = array();
foreach ($data as $tid => $entry) {
$row = array();
$gradebook = $entry['gradebook'];
$grade = $entry['grade'];
$row[] = l($gradebook->name, 'gradebook/'. $tid);
// Get the term grades.
$row[] = theme('gradebook_term_grade', $gradebook, $grade, TRUE);
$rows[] = $row;
}
return theme('table', $headers, $rows);
}

Can you please help me with how I would output a useful variable that I can use to display this grades table on the actual profile page?

Sorry but I am quite new to theme overriding and custom variables and I am coming up against a brick wall when it comes to implementing what I think I know :)

Thanks
Gregg

#17

In gradebook.module, add the following function:

<?php
function gradebook_preprocess_user_profile(&$variables) {
 
$variables['grade_summary'] = gradebook_page_grade_summary($variables['account']);
}
?>

Visit admin/build/modules to clear the cache and rebuild the theme registry so the preprocess function is registered.

Now $grade_summary is the themed gradebook page grade summary table.

Now you can modify your themes user-profile.tpl.php file to print the table on the user profile page. If your theme doesn't already have this file, you can create your own by copying the user-profile.tpl.php file from the core user module to your theme directory and modifying it to suit your needs. Something as simple as this could work...

<div class="grade-summary">
    <?php print $grade_summary; ?>
</div>

Note that I haven't thought about security here....anybody visiting a user's profile page will see the grade summary table now. I think this can be fixed in the user-rofile.tpl.php file if necessary.

Note that you don't need to copy the theme_gradebook_grade_summary($account, $data) function to your template.php file unless you want to modify it, say changing the format or adding additional information to the table.

#18

Thank you so much , will give it a try

Thanks
Gregg

#19

Status:needs review» reviewed & tested by the community

it works great. thanks for your help and patches.
Much appreciated
Gregg

#20

Status:reviewed & tested by the community» fixed

Committed to 6.x-2.x-dev

#21

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here