Moodle Plugins directory: Interactive Tree | Moodle.org
Interactive Tree
This block used to create inline tree structure block.
This block developed using jquery jstree.
Provides context menu to do following actions:
- Create node
- Rename the node
- Delete node
Installation Process:
Admin:
- admin has the capability to create inline tree structure block.
- When block is installed, You can see only one node name as root node, Right click on that node ,You can find the context menu popup with including create, delete and rename option.
- Using those menu option,You can easily create tree structure block(root and leaf nodes).
- Using configuration link, we can add link to those nodes
Ex: If you have course like java,php etc, under that have number of topics , In that scenario , we can easily create create tree structure block root node as course and topics as leaf nodes.
This is very helpful and easy to create custom tree structure block.
Users:
Only they can see tree structure block which is created by admin.They can access like normal block.
Capability:
Unique capability block/interactivetree: manage created, Presently manager and teacher have the capability to edit and manage the block
And also it supports drag and drop functionality to arrange the nodes.
To get more information use below mentioned reference link:
Hi. I am sorry but there are multiple issues with this block and I can not approve it yet. Please pay attention to all the validation warnings raised (most notably the presence of the
.git
folder in the plugin package), as well as other reported suggestions (such as missing bug tracker URL and source code URL).The usability of your block should be improved. I found it quite difficult to actually set up and use. It would help to have better description and examples that would explain how the block is useful for education.
I am getting
Warning: Invalid argument supplied for foreach() in /blocks/interactivetree/block_interactivetree.php on line 112
. Please make sure you have the developer debugging mode on when developing Moodle plugins - see https://docs.moodle.org/en/DebuggingPlease go again through the https://docs.moodle.org/dev/Plugin_contribution_checklist The overall coding style is far from Moodle standards and it violates important patterns (such as the namespacing policy in case of the
class.tree.php
file).Hi hemalatha. Thanks for providing updated versions. Most of the coding issues, that were raised last time, are not still fixed. Please follow the suggestions in the checklist mentioned above and make sure you understand all requirements.
tree_data
andtree_struct
. It is not a valid name. Block's tables must start with the plugin's full component name (also known as frankenstyle) as their prefix to avoid collisions and accidental removal of the tables (e.g. if there was amod_tree
installed, too).tree_node.php
$.get('blocks/interactivetree/tree_node.php?operation=copy_node'...)
leads to wrong URL requested when editing the block from the course main page. This leads to invalid URL like /course/blocks/... and the AJAX fails. Surely there should be a capability to edit the contents of the block and teachers (not only admins) should be allowed to do that by default. Otherwise this would loose most of its potential IMHO.styles.css
are likely to affect HTML outside the scope of your block. Please note that these CSS files from all the plugins are concatenated and the final big file is sent to the browser, regardless the actual viewed page. So, your selectors likediv#container
may be applied at any page of the site. More than that, your block is attempting to style background color and other properties of the<body>
tag which is hardly what anybody would want.I am sorry but this has quite a long way yet to go before we can approve it in this Plugins directory. The concept is indeed interesting and useful in certain situations. But the implementation must be improved a lot.
Hi again. The CONTRIB component in the Moodle tracker has been created for you at https://tracker.moodle.org/browse/CONTRIB/component/15434/ as requested, and I used it to report some remaining issues with the block.
Hi. I am sorry but I can't approve this plugin. As I said above, the overall implementation must be improved a lot to reach the minimum quality standards we try to keep here. The issues reported into the tracker were just examples of some problems. I did not expect seeing the block back immediately after they were addressed. Please, let me suggest to spend more time by studying how other Moodle blocks are developed, what coding patterns are and are not used etc. Every time I look into the code, I see more and more things that should be rewritten or at least fixed. For example
tree_node.php
and let it do all the changes in the database, for example.$DB->get_prefix()
any more since Moodle 2.0. Passing the actual database tables names via the manager class constructor just complicates things with no benefit; it is over-engineered for no good reason. Composing the SQL queries without parameters binding (via?
or:named
placeholders) is only a source of possible security problems.protected $DB;
(with no actual usage of it) just have no sense and make the whole code look suspicious and confusing.Let me suggest to keep working on the block and keep its Github repository up-to-date (why is not the most recent version uploaded here available at Github, too?). Announce your work on it in General plugins forum at moodle.org and ask for the feedback there. Again, the idea is indeed interesting, but there is some work to do yet. And repeatedly submitting your work in progress for review here is not an effective way to achieve it.
you have not responded to any of David's concerns and have not commented or closed issues in the bug tracker for things you think have been fixed - This plugin still needs a lot more work. I agree with David's comments above, in particular your use of the DB API is not great - there appears to be no reason for the variables "structure_table" and "data_table" in your code - you should remove them and include the table names directly in all SQL statements you use.
I would also recommend that you integrate Travis-ci directly into your github repository:
https://moodle.org/mod/forum/discuss.php?d=323384
This will automatically run a number of checks on your code and help you to improve the overall coding standard.
Please don't just ignore the comments/feedback you have been given, please re-read all of David's comments and respond to the issues created in the tracker and the issues mentioned here before you submit a new version of your plugin.
Thanks!
I have addressed those issues which are in the tracker, but not able change the some of the issues statuses.
As per your suggestion,
1. Added access control inside the script as well as tree_node.php.
2. Composing the SQL queries with parameter binding.
3. Integrated with Travis-ci testing tool and I got a success message.
4. Used table name instead of variables in SQL statements.
you can find the updated code in the git repository for moodle 2.9 version. I would like to make sure that everything working fine, Before Requesting for approval again, Please suggest me how to achieve this.
Thanks
It also looks like you have not configured travis-ci correctly. please review the post I linked to above again:
https://moodle.org/mod/forum/discuss.php?d=323384
and adjust your .travis.yml file so that it uses the template from Mark Nielsen mentioned (and linked to) directly in that discussion post. Your first correct run of travis with the correct template will provide a number of failures related to coding guidelines.
I have successfully configured Travis-ci.
As per Travis-ci, Plugin is error free now. Kindly can you confirm me so that I could go ahead.
Thanks.
Url: https://github.com/hemacarun/moodle-block_interactivetree
https://integration.moodle.org/job/Precheck%20remote%20branch/26310/artifact/work/smurf.html
Hi again. Thanks for setting up the Travis integration. I can see the code has improved since the first versions submitted here. Unfortunately I still found it failing on PostgreSQL databases as it uses MySQL specific syntax in certain places, such as
INSERT ... ON DUPLICATE KEY UPDATE
. Please try to use standard DB API in as many cases as possible to avoid these incompatibilities. This block has a potential to offer a nice and useful functionality and it would be pity if it could not run on all Moodle installations.I have moved the block into the Incubating category to give you an opportunity to gather more feedback on it from other community testers as well. Good luck with further development and improvements of the code.
I wanted to translate your interactive tree plugin, but AMOS (https://lang.moodle.org/ ) does not have the English language strings available for translation.
Can you please look at the developer's documentation at https://docs.moodle.org/dev/Translating_plugins#Plugins_with_coding_errors ?
Thanks in advance for your help.