Rather than all members approving node, this module would be more useful to me if it approved nodes based on a ratios of member approval.

Here is one scenario
* More that %25 must vote for any action.
* If 70% of voting members approve the node, than the content gets published.
* If less than 30% approve the node, it gets deleted.

For example, if there are 20 members in a group.
* 4 members must vote for any action.
* If 3/4 approve, it gets published.
* If 2/4 approve, than at 3 more people need to approve it before it gets published. The voting would be 5/7.
* If 1/4 deny, the node is deleted.
* If 2/4 approve, than 3 more need to deny it before it is deleted. The voting would be 2/7.

Comments

mradcliffe’s picture

Assigned: Unassigned » mradcliffe

I completely agree. Sorry, I have been busy, but I did read this a couple of weeks ago when it came in.

nikmahajan’s picture

Can't you create any such content approval module based on the ratios for Drupal? There is no such module that exists for drupal as of now. If someone creates it, it will be great way of giving back to the drupal community.

mradcliffe’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Active » Fixed

Implemented in 2.x branch.

philbar’s picture

Status: Fixed » Active

Good work! I'm testing it out as I write this.

What I was thinking was something a little more complicated on your end, but much more practical because it is more dynamic. For example, many group members might be inactive at any given time or there could be a sudden surge of group activity. To account for this, the percentage of threshold should only be for voters, rather than all member.

Read the description in the original post if you are still unclear.

In my opinion, there should be three option.

1) Minimum number of votes needed to consider nodes for approval?
i.e. "4" members need to vote for the node to be considered for approval

2) What threshold of voters need to approve the node for it to be published?
i.e. "70%" of voters need to approve node for it to be published

3) What threshold of voters need to deny the node for it to be deleted? (Use "0" to never automatically delete nodes)
i.e. "70%" of voters need to deny content for it to be deleted from the database

It appears the feature you have added is #2 but instead it being a threshold of "voters", it is of "all OG members". What is the likelihood of getting #1 and #3 implemented?

mradcliffe’s picture

Just a FYI, this won't be available until drupal.org refreshes the snapshot releases. Use the 6.x-2.x dev release.

You make a good point. Thank you for following up.

mradcliffe’s picture

Status: Active » Needs work
  • added a quorum setting (reviewers / total members), changed threshold (now, approved / reviewers).
mradcliffe’s picture

I think the best way to accomplish all these options is to provide a hook for other modules to do so.

I have created hook_ona which will be called when a node is flagged as approved (or rejected) and when a user approves or rejects a node. It provides the $node object, the $user object of the user that triggered it, and a $tally array which contains useful counts of total members, total reviews, total approved, and total rejected (see readme).

That way a module can make its own thresholds. I'm keeping the approval threshold and quorum settings for now though.

It also got me thinking... maybe it's best to be very generic and then add contrib modules to handle global flags (via flag as it is in 2.x) and do other operations. Though that's far in the future.

nikmahajan’s picture

Hey, I don't understand how it approves or rejects. I tried the module to check its functionality and found that authors themselves can approve or reject their content which shouldn't be there anyway. Meanwhile content still appears on the site.
And can you explain more about Threshold and Quorum settings. I think threshold is the percentage of approvals needed in order to approve the content globally. And quorum means percentage of reviewers required in order to approve or reject the content. Tell me if I am wrong.
One more question, if I set threshold to 70% then it will mean that atleast 7 out of 10 should approve the content but how is it possible with this module. Content gets approved even if any of the authenticated users approves it, 7 is too away.

mradcliffe’s picture

This is really 4 separate issues, maybe branch into documentation, bug report, new feature issues?

  • The module tracks a node's approval status abstractly. In the 1.x version I had just hardcoded separate paths like publish/unpublish or a separate node_status table. However I thought it best to abstract things so that anyone else could extend the functionality. With hook_ona you can define your own workflow such as deleting or publishing a node on approval threshholds. Or override og_node_approval.
  • Yes there is currently no option to prevent authors who are group members and have the review role from being able to review their own content. This was not in the original spec. for the module (well, not exactly). Can you please open a new feature request?
  • settings:
    • threshhold: approved users / approved + rejected users
    • quorum: approved + rejected users / total group members
  • Can you explain this more? The global flag that is flagged/unflagged on approve/reject is what it means to be approved or not. Do you mean published? You can probably set up your content type to not auto-publish modules on save. And then a flag action *or* use hook_ona to publish/unpublish it. Or do you mean that there is a bug and 6 people approving it actually flags it. Please clarify.

Thank you for your feedback.

philbar’s picture

Matt, I sent you regarding this issue.

mradcliffe’s picture

Title: Option for Ratios » Option for Ratios, og_node_approval API for acting on state changes
Status: Needs work » Fixed

Issue added for more ui-based integration. Fixed.

See #402698: Rules/Token Integration.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.