CVS edit link for GDI

I wrote a new module 'quizreg'. This module allows administrators to choose a quiz to perform anonymous users if they want to register on the website. Quizzes which may select administrators should be created by using module Quiz. Also I will maintain my module.
CommentFileSizeAuthor
#12 quizreg.zip4.86 KBGDI
#8 quizreg.zip4.85 KBGDI
#5 quizreg.zip4.86 KBGDI
#1 quizreg.zip5.01 KBGDI

Comments

GDI’s picture

StatusFileSize
new5.01 KB

Quizreg module is required Quiz module installed. Quizreg is using existent quizes to use one of they for testing users before registering on website. It can be used to limit the number of users based on their knowledge or it can be used as a spam control.

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Needs review
Issue tags: +Module review

Remember to change the status, when you upload new code.

GDI’s picture

I`m sorry. :)

avpaderno’s picture

Status: Needs review » Needs work

See the Drupal coding standards to understand how a module code should be written.
In particular, see the part about the namespace respect, and how the code should be formatted.

GDI’s picture

Status: Needs work » Fixed
StatusFileSize
new4.86 KB

Module was checked and fixed for drupal coding standards. See in attachment.

avpaderno’s picture

Status: Fixed » Needs review
avpaderno’s picture

Status: Needs review » Needs work

The coding standards report also how to name constants, Drupal variables, and functions.

GDI’s picture

StatusFileSize
new4.85 KB

I added some quotes in variable_get() function arguments. But I didn't found any problems with name constants and functions. Could you give me some examples of my faults?

GDI’s picture

Status: Needs work » Needs review
dave reid’s picture

Things like:

define('MESSAGE_BEFORE_QUIZ',       t("You must to perform our test before registration on our website."));

define('AFTER_PASSED_QUIZ_REDIRECT_URL', 'user/register');

define('AFTER_FAILED_QUIZ_REDIRECT_URL', '<front>');

define('MESSAGE_ERROR_BEFORE_QUIZ', t("Quiz error. If you see this message, please contact to site administrator."));

Are much more useful to users as variables and admin options instead of constants. Plus, they aren't prefixed with your module name, so they could technically collide with other constants.

avpaderno’s picture

Status: Needs review » Needs work

The same is true for functions, which should have the name of the module prefixed to their names (using the right name for functions is called namespace respect).

I am changing the status because the reported points have not been resolved.

GDI’s picture

Status: Needs work » Fixed
StatusFileSize
new4.86 KB

I fixed function and constants names.
These constants

define('QUIZREG_MESSAGE_BEFORE_QUIZ',       t("You must to perform our test before registration on our website."));
define('QUIZREG_AFTER_PASSED_QUIZ_REDIRECT_URL', 'user/register');
define('QUIZREG_AFTER_FAILED_QUIZ_REDIRECT_URL', '<front>');
define('QUIZREG_MESSAGE_ERROR_BEFORE_QUIZ', t("Quiz error. If you see this message, please contact to site administrator."));

are using for storing default values in quizreg settings form. I also added comments to them.

dave reid’s picture

Status: Fixed » 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.