Git Product home page Git Product logo

decision-trees's Introduction

Decision Trees

  • Contributors: codeforthepeople, simonwheatley
  • Tested up to: 3.5.1
  • Stable tag: 1.2
  • Requires at least: 3.5.1

Provides a custom post type to create decision trees in WordPress.

Description

The plugin comes with the ability to add simple links from a decision node to the possible answers you can give to that node, e.g. the node might ask "How many legs does it have?" then provide links to "it has two legs", "it has four legs", "it has six legs", etc.

It is possible to extend the plugin to provide range based answers, meaning you could ask a user to type in a date or length in cm, and then calculate the decision node which correctly answers this dynamically.

Installation

  1. Download and unzip the plugin.
  2. Copy the decision-trees directory into your plugins folder.
  3. Visit your Plugins page and activate the plugin.

Screenshots

Visualising your decision tree in the admin area Visualising your decision tree in the admin area

A decision node with some answer links A decision node with some answer links

A decision node showing the two preceding answers and the link to change them A decision node showing the two preceding answers and the link to change them

Changelog

1.2

  • Displays history above the current node content.

1.1

  • Allows construction of basic decision tree with simple answers
  • Outputs answers

1.0

  • Work in progress

decision-trees's People

Contributors

johnbillion avatar scottsweb avatar simonwheatley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

decision-trees's Issues

Spec

Decision trees will be a plugin which allows a user to create one or more branched (dendritic) decision trees from the WordPress admin area. A decision tree will consist of two or more nodes which each explain a question or item which requires a decision. Each node will have a number of one way paths from it to other nodes, I am referring to these as "answers".

This diagram from Wikipedia illustrates the kind of decision trees this plugin will handle. Note the simple branching structure, and that all nodes only link to their own child nodes, and there is no "doubling back" or "linking across". I hope this will keep a good level of simplicity, and help users to maintain a coherent mental model of each tree.

File:Investment_decision_Insight

The plugin will register a CPT called "Decision Trees".

Editing

Required elements of a node:

  • A title
  • At least one answer

Initially we will just require multiple choice answers, which could be implemented as an array of links (most probably), or an array of radio buttons (I'm not sure why Smart Answers implements the selection mechanism as a form, it seems less crawlable… but perhaps they're not bothered). I'd like to have it so that the selection mechanism for the answers can be extended using another plugin.

Here's a mockup showing how I think of the selection meta box with just the basic multiple choice answers available:

Decision Tree simple

In the model above, when you add an answer you are simultaneously adding a new child node and defining the answer text. If no title is provided, the answer text should be used for the title; however it should be possible for the text of the answer leading to a node to be separate from the title of that node.

I think re-parenting nodes will not be necessary.

Here's mockup showing how the selection meta box might work with some additional selection mechanisms enabled:

Decision Tree metabox

As an admin user, it would be useful to be able to navigate an entire decision tree while it is in draft, before it's published. This would require filtering permalinks to make them preview compatible.

It would be useful to be able to publish an entire decision tree in one action, rather than having to set the post_status on each node in turn.

Display

The answer links (or other selection mechanism) should be appended using the_content filter, and should have lots of lovely classes and IDs for CSS.

If no answer text has been provided, then the title of the child nodes should be used.

There should be no archive view for the Decision Trees CPT.

Behaviour when deleting answers / nodes

Currently you cannot delete an individual answer from the editing screen. We need to decide on the desired behaviour.

When you delete an answer, should it also delete the answer node? If so, should this be recursive so all its answers and nodes are deleted too?

cc simonwheatley

Bug when removing node

When you remove a node, it triggers a PHP error:

NOTICE: TRYING TO GET PROPERTY OF NON-OBJECT IN /WP-CONTENT/PLUGINS/DECISION-TREES-MASTER/DECISION-TREES.PHP ON LINE 690

Thank you,

CSS object names

Sorry for my obvious ignorance.
I want to style the output pages different than the default.
In wordpress I can use the custom css in customizer to add code to all or some pages.
For example, if I want to make certain text bold or a different font or justification or color.
But I don't know the names of the objects?
If someone would write a couple styling examples and list the names of the containers or objects? then less technical users could style the output. Like me =)

awesome plugin! but what happens if i insert a new answer in a complex tree?

This seems to be the only plugin which works right out of the box. Thank you guys!
I read the other issues regarding deleting answers. But what if i want to add a new answer in between an existent tree? do i have to delete the other following answer first and start from that new answer now? whats the best way?

kind regards
nic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.