There are a few modules to enable content rating in Drupal. Most of these modules only supports one criteria. So I decided to develop a module to enable site administrators to define multi-criteria rating system for contents. Also they could present average of ratings in content page and custom Views.
Site builder can establish several criteria for rating in module global settings. Criteria could be overrided by each content or taxonomy.
Here is a presentation of rating form in a content:

This module add a pseudo-field to Drupal. It also adds a custom field to views to display average of ratings for each content. Site builder can select one two display formats for rating: summary or full. He/she can decide which display format will be used for each content_type&view_mode.
Link to sandbox project: https://www.drupal.org/sandbox/meshkinsoft/2328351
git: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/meshkinsoft/2328351.git multi_criteria_content_rating
I checked this module in http://pareview.sh/pareview/httpgitdrupalorgsandboxmeshkinsoft2328351git. I resolved all errors.
It based on Drupal 7.
Comments
Comment #1
sebto commentedComment #2
pkamerakodi commentedHi,
Could you please share the links of projects for which you performed manual review.
Prajwal
Comment #3
sebto commentedHi Prajwal,
I haven't performed manual review for any other projects. I didn't know anything about that. Could you please guide me what should I do?
Comment #4
stefank commentedHi @sebto,
Help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)
Comment #5
pkamerakodi commentedHi,
Thanks for the contribution, mean while some small suggestions if you like to update.
Automated Review as some warnings and errors
http://pareview.sh/pareview/httpgitdrupalorgsandboxyelban2330529git
Manual Review
Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt/README.md
Yes
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
YES
Coding style & Drupal API usage
1) i dont the schemas defined getting used.
class="views-field views-field-mc-content-rating-vote-avg"> class="field-content">' . $output . '2) delete the defined schemas in unistall hook
3) Looks like you are updating node object in multi_criteria_content_rating_rating_full_results but the node object is not accepted as reference.
4) Not a good practice
$output = ' $max_range) . '%;">' .
(number_format($avg, 2) + 0) . '';
$output = '
';
Try preparing a renderable array and use drupal render.
Did just a first round of review, will do some more testing around.
Prajwal
Comment #6
sebto commentedHi Prajwal,
Do you think my module is duplicate? If yes, which modules?
I will improve output of module. I already checked site in PAReview. I resolved all errors except two. Those errors are related to name of two methods which are declared in Views. So I cannot resolve them. I didn't resolve warnings. Is it necessary to resolve the causes of warnings? Most of them are related to trailing comma after last element of array.
Comment #7
sebto commentedHi Prajwal,
I deleted all used variables in hook_schema(). You said "delete the defined schemas in unistall hook".
Database tables defined by hook_schema() will be removed automatically. So your review has serious misunderstanding of Drupal API.
Comment #8
sebto commentedI used renderable array instead of html code for this part:
$output = '' .
(number_format($avg, 2) + 0) . '';
$output = ' ' . $output . ' ';
Comment #9
sebto commentedHi Prajwal,
Your review has serious bugs. I don't update $node object in function 'multi_criteria_content_rating_rating_full_results'. It seems you don't read codes correctly.
Comment #10
t-loHi sebto,
The pareview warnings should be cleaned up for coding standards.
I'll take a closer look at the code now.
Comment #11
t-loRunning through all the code now, some small things:
multi_criteria_content_rating.install
incorrect comment for the hook uninstall:
multi_criteria_content_rating.admin.inc
Spelling mistake "Allowd" suggest "Allowed" in form item title
Duplicated form item title:
The item "multi_criteria_content_rating_coloring" could do with some decent instructions or perhaps splitting into multiple feilds
Until you've saved a new formatter via the admin form the first time, the "Node type" dropdown is empty, the first submit also gives the following error:
It looks like these could be solved by either:
Disabling creation of new formatters until the allowed content type section had been filled in.
Or, allowing all node types by default, adding the function "multi_criteria_content_rating_get_node_types_options" as the default value of the variable "multi_criteria_content_rating_node_types"
You've got it with a blank array as the default value in several places
Comment #12
t-loComment #13
t-loI get the following Fatal PHP error when I visit a node I'm expecting to see the rating on:
#
I can't see where the variable "mc_content_rating_term_fields" is ever set to anything other than an empty array which seems to explain that.
It looks like you meant to use the variable you set in the admin here:
variable_set('multi_criteria_content_rating_term_fields', $allowd_fields);(also further misspelling of "allowed" throughout as "allowd")
Comment #14
t-lounless I'm mistaken the same variable name issue is present in includes/views/multi_criteria_content_rating_views_handler_rating_avg.inc
the variable "mc_content_rating_max_range" isn't referenced anywhere else, although there is a "multi_criteria_rating_max_range" used elsewhere
Comment #15
t-loit's worth noting the two variables "mc_content_rating_max_range" and "mc_content_rating_term_fields" aren't removed by the uninstall_hook, so if you used to use these variablew names they won't be cleared on uninstall and could still be present in your dev environment
Comment #16
t-loA similar naming issue in multi_criteria_content_rating_criteria_modes.class.inc gives a PDO error when the variable is used in the "getCriteriaMode" function, as the table "mc_content_rating_criteria_modes" isn't created in the hook_schema.
The correct table is probably "multi_criteria_content_rating_criteria_modes"
Comment #17
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.