Non-core contributed modules

Stats report-_- reports de resources that a course uses

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Add a project here
  • Labels:
    None
  • Environment:
    any one
  • Database:
    MySQL
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE

Description

this is a new block of stats

Activity

Hide
Anthony Borrow added a comment -

Joao - I am just getting this now and will try to look at it later this week. Thanks for sharing the code. Am I correct that you are wanting this block added to CONTRIB? Peace - Anthony

Show
Anthony Borrow added a comment - Joao - I am just getting this now and will try to look at it later this week. Thanks for sharing the code. Am I correct that you are wanting this block added to CONTRIB? Peace - Anthony
Hide
Anthony Borrow added a comment -

Joao - Thanks for contributing the estatisticas block: As I have started to review and test it, I have a few suggestions, comment, questions.

1) First, I would encourage renaming the block to statistics
2) In terms of coding, I would rename variables to English read-able since others will be looking at the code and it is written in English I would avoid strings with names like verestats, etc.
3) I did not see the language file /lang/en_utf8/block_estatisticas.php
4) You should not need to connect to the database if you are requiring the config.php - I would encourage you to look at how Moodle gets records (check out the get_record and get_records which are defined in /lib/dmllib.php.Learning to do so would decrease your dependence on mysql and allow your block to function with other databases as well.

I would also suggest that you test the code with debugging set to show All reasonable PHP errors (not developer mode). Doing so will help to catch notices like:

Catchable fatal error: Object of class admin_root could not be converted to string in /home/arborrow/Moodle/code/19stable/admin/pagelib.php on line 149

Warning: mysql_connect() [function.mysql-connect]: Access denied for user '19stable'@'localhost' (using password: YES) in /home/arborrow/Moodle/code/19stable/blocks/estatisticas/dados1.php on line 31

Warning: mysql_connect() [function.mysql-connect]: Access denied for user '19stable'@'localhost' (using password: YES) in /home/arborrow/Moodle/code/19stable/blocks/estatisticas/dados2.php on line 28

At this point, I do not find the block to be functional and think we need to work on making some improvements to make it more stable before adding it to CVS. The reason I am hesitating is that we may decide to change the way the block is implemented and do away with dados1,php, dados2.php, dados3.php (which should also probably be renamed to their English equivalents). Unfortunately CVS does not deal well with file renaming and moving things around so I would rather work on that here and then upload.

Let me know if you have any questions or if there is anything I can do to help.

Peace - Anthony

Show
Anthony Borrow added a comment - Joao - Thanks for contributing the estatisticas block: As I have started to review and test it, I have a few suggestions, comment, questions. 1) First, I would encourage renaming the block to statistics 2) In terms of coding, I would rename variables to English read-able since others will be looking at the code and it is written in English I would avoid strings with names like verestats, etc. 3) I did not see the language file /lang/en_utf8/block_estatisticas.php 4) You should not need to connect to the database if you are requiring the config.php - I would encourage you to look at how Moodle gets records (check out the get_record and get_records which are defined in /lib/dmllib.php.Learning to do so would decrease your dependence on mysql and allow your block to function with other databases as well. I would also suggest that you test the code with debugging set to show All reasonable PHP errors (not developer mode). Doing so will help to catch notices like: Catchable fatal error: Object of class admin_root could not be converted to string in /home/arborrow/Moodle/code/19stable/admin/pagelib.php on line 149 Warning: mysql_connect() [function.mysql-connect]: Access denied for user '19stable'@'localhost' (using password: YES) in /home/arborrow/Moodle/code/19stable/blocks/estatisticas/dados1.php on line 31 Warning: mysql_connect() [function.mysql-connect]: Access denied for user '19stable'@'localhost' (using password: YES) in /home/arborrow/Moodle/code/19stable/blocks/estatisticas/dados2.php on line 28 At this point, I do not find the block to be functional and think we need to work on making some improvements to make it more stable before adding it to CVS. The reason I am hesitating is that we may decide to change the way the block is implemented and do away with dados1,php, dados2.php, dados3.php (which should also probably be renamed to their English equivalents). Unfortunately CVS does not deal well with file renaming and moving things around so I would rather work on that here and then upload. Let me know if you have any questions or if there is anything I can do to help. Peace - Anthony
Hide
Anthony Borrow added a comment -

I did notice that you had the following typo that was causing the mysql_connect error:

Instead of:

$myUser = $CFG->dbname;

I think that should be:

$myUser = $CFG->dbuser;

Peace - Anthony

Show
Anthony Borrow added a comment - I did notice that you had the following typo that was causing the mysql_connect error: Instead of: $myUser = $CFG->dbname; I think that should be: $myUser = $CFG->dbuser; Peace - Anthony
Hide
Anthony Borrow added a comment -

In this screenshot, you have hard coded the output in Portuguese. I think all of these should be converted to language strings. Let me know if you need help with that. It is just a matter of using get_string and of course creating the strings and language files. Peace - Anthony

Show
Anthony Borrow added a comment - In this screenshot, you have hard coded the output in Portuguese. I think all of these should be converted to language strings. Let me know if you need help with that. It is just a matter of using get_string and of course creating the strings and language files. Peace - Anthony
Hide
Anthony Borrow added a comment -

Joao - For now, I am going to reject your CVS write request (http://moodle.org/mod/cvsadmin/edituser.php?action=edit&user=247) only because I am trying to get caught up on reviewing all of the requests. Once you are able to patch things up in your block based on my comments above and we add the code to CVS I can go back and approve it. Peace - Anthony

Show
Anthony Borrow added a comment - Joao - For now, I am going to reject your CVS write request (http://moodle.org/mod/cvsadmin/edituser.php?action=edit&user=247) only because I am trying to get caught up on reviewing all of the requests. Once you are able to patch things up in your block based on my comments above and we add the code to CVS I can go back and approve it. Peace - Anthony
Hide
Anthony Borrow added a comment -

Joao - I just noticed that your block uses get_config and set_config for various settings. It is preferred that blocks (especially non-core blocks) use the mdl_config_plugins table rather than mdl_config. Let me know if you have questions about that. Peace - Anthony

Show
Anthony Borrow added a comment - Joao - I just noticed that your block uses get_config and set_config for various settings. It is preferred that blocks (especially non-core blocks) use the mdl_config_plugins table rather than mdl_config. Let me know if you have questions about that. Peace - Anthony
Hide
Anthony Borrow added a comment -

Joao - It appears you have not been active on the Moodle.org forums and that you are not intending to submit an updated version of the code. I have posted a comment in the Moodle Modules and Plugins database entry you created (http://moodle.org/mod/data/view.php?d=13&rid=2190) encouraging folks to review my comments above and asking if anyone is interested in picking up where you left off. Thanks for making the code available and do not hesitate to let me know if there is anything I can do to be supportive. Peace - Anthony

Show
Anthony Borrow added a comment - Joao - It appears you have not been active on the Moodle.org forums and that you are not intending to submit an updated version of the code. I have posted a comment in the Moodle Modules and Plugins database entry you created (http://moodle.org/mod/data/view.php?d=13&rid=2190) encouraging folks to review my comments above and asking if anyone is interested in picking up where you left off. Thanks for making the code available and do not hesitate to let me know if there is anything I can do to be supportive. Peace - Anthony
Hide
Anthony Borrow added a comment -

Closing all of my resolved issues. Peace - Anthony

Show
Anthony Borrow added a comment - Closing all of my resolved issues. Peace - Anthony

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: