CVS edit link for pm530

I've written a Yahoo Answers like module for drupal, and I would like to call it Drupal Userpoint Answers. This modules had been used by two production websites.

Features:

1. Users with permission can create question nodes.
2. Integrates with userpoints.
3. Questioners determine which is the best answer
3. Best answerers can get userpoints from the questioners.

I would like to summit this module to the community with your permission.

Comments

pm530’s picture

StatusFileSize
new6.14 KB
pm530’s picture

Status: Postponed (maintainer needs more info) » Needs review
pm530’s picture

StatusFileSize
new30 KB

Please review this code

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Module review

See the Drupal coding standards to understand how a module code should be written.

pm530’s picture

Status: Needs work » Needs review
StatusFileSize
new5.74 KB

Fixed the format problems. It has been checked by the code module. Please review.

avpaderno’s picture

Status: Needs review » Needs work
  1. ; Information added by drupal.org packaging script on 2008-06-02
    version = "6.x-1.2"
    core = "6.x"
    project = "userpoints_best_answer"
    

    Remove that information, which is added by the packaging script.

  2.     'title' => t('User Point Best Answer Settings'), 
    

    Menu title and description are not passed to t() because that is already done by Drupal core code.

  3. There is a problem with the line ending character, that in some places seems to be the one used by Windows.
  4.       if ($award_points < 0) {
            form_set_error('', t('Invalid.'));
          }
    

    The error message is too generic; the users cannot understand what is wrong.

    If the error is not caused by the users, then showing such message can just confuse them. In the case that value is negative, it could be better to do as it is zero; the code could register the error using watchdog().

  5.   $award_points =(int) $award [0] ['value'];
    

    The line should be formatted as $award_points = (int) $award[0]['value'];.

    Generally speaking, when the code access the index of an array, the code should be written as $array['index'], without any spaces between.

pm530’s picture

Status: Needs work » Needs review
StatusFileSize
new5.91 KB

Thanks for your help. Updated, please review.

avpaderno’s picture

Status: Needs review » Needs work

See point #5 in my previous comment; there are code lines that still use code like $a ['index'] = $value. The space between the variable name, and the open square bracket needs to be removed.

pm530’s picture

StatusFileSize
new5.91 KB

My Bad, Fixed. Please review.

pm530’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -Module review

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

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

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