Interactive Tree

Experimental ::: block_interactivetree
Maintained by hemalatha arun
used to built dynamic hierarchical tree.
Latest release:
7 sites
3 downloads
4 fans
Current versions available: 1

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:

http://www.jstree.com/


Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4

Contributors

hemalatha arun (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • David Mudrák
    Fri, 1 May 2015, 5:18 PM

    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/Debugging

    Please 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).

  • David Mudrák
    Wed, 3 June 2015, 5:26 PM

    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.

    • Your block creates DB tables tree_data and tree_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 a mod_tree installed, too).
    • How did you conclude that "Only admin has the capability to create inline tree structure block"? (as said in your README). It is apparently not the case. In fact, I can't see any access control at all for the AJAX requests against tree_node.php
    • jQuery code like $.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.
    • The selectors in your 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 like div#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.

  • David Mudrák
    Tue, 9 June 2015, 4:14 AM

    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.

  • hemalatha arun
    Thu, 11 June 2015, 2:07 PM
    Hi, I have addressed those issues , which is in Moodle Tracker . Please review.
  • David Mudrák
    Fri, 12 June 2015, 12:33 AM

    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

    • You check for the capability only to decide what javascript will be used at the page. But you have no access control at all in scripts that actually execute things. Anybody in the world can call the tree_node.php and let it do all the changes in the database, for example.
    • Speaking of the database, the way you use the DB API is very uncommon. There is no need for $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.
    • Things like protected $DB; (with no actual usage of it) just have no sense and make the whole code look suspicious and confusing.
    • etc.

    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.

  • Dan Marsden
    Fri, 6 May 2016, 5:58 PM
    Hi there,

    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!
  • hemalatha arun
    Wed, 11 May 2016, 11:09 PM
    Hi ,

    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
  • Dan Marsden
    Thu, 12 May 2016, 10:13 AM
    you still seem to be using parameters for the field names eg: "osid" "osleft" and you still have the params for "structure_table" and "data_table" in the code but you aren't using them? - I'm struggling to see the justification for any of the params in the protected $default = array() - removing that array and putting the field names directly into the sql would greatly improve the readability of your code.

    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.
  • hemalatha arun
    Thu, 12 May 2016, 1:05 PM
    Thanks for your suggestions and guidelines, I will look into class members accessibility and also try to adjust again Travis-ci.
  • hemalatha arun
    Fri, 27 May 2016, 10:47 PM
    Hi Dan Marsden,

    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.
  • hemalatha arun
    Fri, 27 May 2016, 10:50 PM
    Updated code is available on Github.
    Url: https://github.com/hemacarun/moodle-block_interactivetree
  • David Mudrák
    Fri, 12 Aug 2016, 6:00 PM

    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.

  • hemalatha arun
    Fri, 12 Aug 2016, 6:30 PM
    Thank you..sure I will try to improve code as well as enhancing functionality.
  • Germán and Temudgin
    Sat, 13 Aug 2016, 12:42 AM
    Hi,
    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.
1 2
Please login to post comments