Non-core contributed modules

csv export in outline, statistics and participation course reports

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.5
  • Fix Version/s: None
  • Component/s: Patch: CSV export
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE

Description

Patch adds csv export functionality in course reports: outline, participation and statistics.

I did not use new downloads methods from refactored tablelib.php (MDL-14187). I did not have it in my moodle instance (ver. 1.9.5) and I wanted to be some how more economical in code changes adding this feature. So I have just added new method print_csv() to table class and use it similarly to some other exports found in app.

Export in participation report depends on my _ user profile fields in export_ improvement (CONTRIB-2395), but if some does not want profile fields in this export just skip hunks marked by [mod201009281545] in diff file.

Issue Links

Activity

Hide
Anthony Borrow added a comment -

Michael - I thought a patch might be a little more interesting to play with. Not sure if you have worked with evaluating one in CONTRIB. As usual, if you are too busy or not interested, just reassign it back to me. Thanks for your help. I'm going to try to get a couple chapters reviewed for two books I've been asked to review. Peace - Anthony

Show
Anthony Borrow added a comment - Michael - I thought a patch might be a little more interesting to play with. Not sure if you have worked with evaluating one in CONTRIB. As usual, if you are too busy or not interested, just reassign it back to me. Thanks for your help. I'm going to try to get a couple chapters reviewed for two books I've been asked to review. Peace - Anthony
Hide
Michael de Raadt added a comment -

Hi Pawel,

Thanks for contributing this. Sorry for the delay in getting to you.

I was able to apply your patch to my installation of Moodle 1.9.9.

I wasn't able to test the file produced from the Statistics page as I was testing this on a trial server and I didn't have any real data to use.

The link appeared on the activity report and I was able to download the file it produced.

The CVS file contained semicolons instead of commas to separate cells. When I opened the file each line appeared as a single cell.

Could you comment on this separator issue?

I'm looking forward to progressing this to CVS.

Michael;

Show
Michael de Raadt added a comment - Hi Pawel, Thanks for contributing this. Sorry for the delay in getting to you. I was able to apply your patch to my installation of Moodle 1.9.9. I wasn't able to test the file produced from the Statistics page as I was testing this on a trial server and I didn't have any real data to use. The link appeared on the activity report and I was able to download the file it produced. The CVS file contained semicolons instead of commas to separate cells. When I opened the file each line appeared as a single cell. Could you comment on this separator issue? I'm looking forward to progressing this to CVS. Michael;
Hide
Pawel Suwinski added a comment -

Hi Michael,

Sorry that now I am answering so late... I have just noticed that all tracker's messages went to my spam mbox ;/.

> The CVS file contained semicolons instead of commas to separate cells.
> When I opened the file each line appeared as a single cell.
>
> Could you comment on this separator issue?

I have used to use semicolons in CSV despite its name (I do not know why?) and I hardcoded it being unaware of it. To change it to commas just change ';' -> ',' in row:

echo strip_tags(implode(';', $row)) . "\n";

Show
Pawel Suwinski added a comment - Hi Michael, Sorry that now I am answering so late... I have just noticed that all tracker's messages went to my spam mbox ;/. > The CVS file contained semicolons instead of commas to separate cells. > When I opened the file each line appeared as a single cell. > > Could you comment on this separator issue? I have used to use semicolons in CSV despite its name (I do not know why?) and I hardcoded it being unaware of it. To change it to commas just change ';' -> ',' in row:
echo strip_tags(implode(';', $row)) . "\n";
Hide
Michael de Raadt added a comment -

Hi Pawel,

I've managed to get back to your patch and check the change you suggested.

I will now begin to set this up as a new component and put the modified patch into CVS.

Michael;

Show
Michael de Raadt added a comment - Hi Pawel, I've managed to get back to your patch and check the change you suggested. I will now begin to set this up as a new component and put the modified patch into CVS. Michael;
Hide
Michael de Raadt added a comment -

Modified patch, now separates cells with commas.

Show
Michael de Raadt added a comment - Modified patch, now separates cells with commas.
Hide
Michael de Raadt added a comment -

Hi Pawel,

I've created a new Tracker component for your code. That means if people find bugs or have suggestions they can report them here. You should also create a bug report here every time you update your code so people can see problems that have been fixed and improvements that have been made. Use the CONTRIB-XXXX code at the beginning of your CVS update descriptions.

I've uploaded your code to CVS. People will be able to download your code as a zip from the following URL soon (a daily process creates these zip files).

http://cvs.moodle.org/contrib/patches/csv_export.zip

The Tracker system has just changed and I am chasing up your role so you can be elevated from user to developer. I'll let you know when that happens.

CVS access has also recently changed, but as far as I know you will need to apply for write access to CVS in the following way. Login to http://moodle.org/cvs/ using your moodle.org login and password then add yourself as a developer there. In the reason area say that you are responsible for a new plugin and include the directory...

contrib/patches/csv_export/

Once you have this access (access is approved by a human) you will be able to commit changes to your code.

There is some information about using CVS with Moodle at...

http://docs.moodle.org/en/CVS_for_Developers

You should also create an entry in the Moodle Modules and Plugins Database.

http://moodle.org/mod/data/view.php?id=6009

Add the following links

CVS = http://cvs.moodle.org/contrib/patches/csv_export/
Bugs = http://tracker.moodle.org/browse/CONTRIB/component/10860
Downdload = http://cvs.moodle.org/contrib/patches/csv_export.zip

In your description, as well as describing your patch, I recommend directing people to report bugs on the bug tracker as you will be notified of those, but you won't be notified of responses to your M&P entry.

Start some documentation in Moodle Docs and link to that in your M&P entry.

http://docs.moodle.org/en/csv_export

Add [[Category:Contributed code]] to the bottom of your Moodle Docs page so it can be indexed as contributed code.

Add a discussion topic to the appropriate forum and announce your new plugin providing links. Again, direct people to report bugs on the bug tracker.

http://moodle.org/course/view.php?id=5

You probably want to announce on the "Contributed modules and plugins" forum.

Add a link to the new topic in your M&P entry.

Once you have a complete M&P entry, let me know and I will approve it.

For some more info, be sure to check out...

http://docs.moodle.org/en/Development:Guidelines_for_contributed_code

Thanks again for contributing. If you need any help in future, feel free to contact me.

Michael;

Show
Michael de Raadt added a comment - Hi Pawel, I've created a new Tracker component for your code. That means if people find bugs or have suggestions they can report them here. You should also create a bug report here every time you update your code so people can see problems that have been fixed and improvements that have been made. Use the CONTRIB-XXXX code at the beginning of your CVS update descriptions. I've uploaded your code to CVS. People will be able to download your code as a zip from the following URL soon (a daily process creates these zip files). http://cvs.moodle.org/contrib/patches/csv_export.zip The Tracker system has just changed and I am chasing up your role so you can be elevated from user to developer. I'll let you know when that happens. CVS access has also recently changed, but as far as I know you will need to apply for write access to CVS in the following way. Login to http://moodle.org/cvs/ using your moodle.org login and password then add yourself as a developer there. In the reason area say that you are responsible for a new plugin and include the directory... contrib/patches/csv_export/ Once you have this access (access is approved by a human) you will be able to commit changes to your code. There is some information about using CVS with Moodle at... http://docs.moodle.org/en/CVS_for_Developers You should also create an entry in the Moodle Modules and Plugins Database. http://moodle.org/mod/data/view.php?id=6009 Add the following links CVS = http://cvs.moodle.org/contrib/patches/csv_export/ Bugs = http://tracker.moodle.org/browse/CONTRIB/component/10860 Downdload = http://cvs.moodle.org/contrib/patches/csv_export.zip In your description, as well as describing your patch, I recommend directing people to report bugs on the bug tracker as you will be notified of those, but you won't be notified of responses to your M&P entry. Start some documentation in Moodle Docs and link to that in your M&P entry. http://docs.moodle.org/en/csv_export Add [[Category:Contributed code]] to the bottom of your Moodle Docs page so it can be indexed as contributed code. Add a discussion topic to the appropriate forum and announce your new plugin providing links. Again, direct people to report bugs on the bug tracker. http://moodle.org/course/view.php?id=5 You probably want to announce on the "Contributed modules and plugins" forum. Add a link to the new topic in your M&P entry. Once you have a complete M&P entry, let me know and I will approve it. For some more info, be sure to check out... http://docs.moodle.org/en/Development:Guidelines_for_contributed_code Thanks again for contributing. If you need any help in future, feel free to contact me. Michael;
Hide
Michael de Raadt added a comment -

Hi Anthony,

Could you please add Pawel to the contrib-developer group?

Thanks.

Show
Michael de Raadt added a comment - Hi Anthony, Could you please add Pawel to the contrib-developer group? Thanks.
Hide
Michael de Raadt added a comment -

Hi, Pawel.

I noticed that there is not yet an entry in the Modules and Plugins database for this contribution. Are you still wanting to share it?

Michael;

Show
Michael de Raadt added a comment - Hi, Pawel. I noticed that there is not yet an entry in the Modules and Plugins database for this contribution. Are you still wanting to share it? Michael;
Hide
Pawel Suwinski added a comment -

Hi

I have lost the thread because of a little brake in "moodling". I will pass through the docs you wrote and I will add it to Modules and Plugins soon.

Show
Pawel Suwinski added a comment - Hi I have lost the thread because of a little brake in "moodling". I will pass through the docs you wrote and I will add it to Modules and Plugins soon.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: