Tips & Tricks

Please do NOT use this section of the forum to request help if Joomdle does not work for you in some particular way. Your post will be deleted.

Custom PDF grade report

  • Justin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 6 months ago #1 by Justin
Custom PDF grade report was created by Justin
Hi

I need some advice, I have managed to create a custom "My Grades" page using a Course Grades view override.
I am currently able to generate a PDF version of the report which students can download, the problem is that once downloaded there is no way of telling to who this report belongs, I would like to add user info to the report that is generated.

What would the coding look like that I would need to add to pull Moodle profile field into the report so that I can add a Name, Surname, ID number and possibly one or two custom profile fields to the report?

Thank you in advance

Please Log in or Create an account to join the conversation.

More
6 years 6 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Custom PDF grade report
Hi.

> What would the coding look like that I would need to add to pull Moodle profile field into the report so that I can add a Name, Surname, ID number and possibly one or two custom profile fields to the report?

Easiest way is not show Moodle's user info, but Joomla's.
Just use regular Joomla getUser function, and then use the results to echo the info anywhere you want.

You could also get info from Moodle, but this is more complex:
- You would need to call web service function: user_details
- Then use result to echo info anywhere you want

Example code:
Code:
$user_info = JoomdleHelperContent::call_method ('user_details', $username); echo $user_info['firstname'];

Please let us know if you need any more info.

Please Log in or Create an account to join the conversation.

  • Justin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 6 months ago #3 by Justin
Replied by Justin on topic Custom PDF grade report
Hi

Thank you, I have decided to use the get user option you mentioned.
The problem I had is since I use easyprofiles I did not think this would work.
For anyone with the same situation here it the code that can be used
Code:
<?php require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php'); $user=JsnHelper::getUser(); ?> <?php echo $user->getField('field Alias');?>

Please Log in or Create an account to join the conversation.

More
6 years 6 months ago #4 by Antonio Durán
Replied by Antonio Durán on topic Custom PDF grade report
Great, thanks for the feedback.
I moved your last message to a new topic.

Please Log in or Create an account to join the conversation.