Purpose
The purpose of this module is to simplify the registration and course enrollment process. Right now, people has to register into ATutor first and then enroll into different courses. one course is enrolled each time. So, a registration and enrollment into 7 courses will take 8 steps:
1. create the account
2. enroll to course 1
3. enroll to course 2
4 -8. enroll to course 3-7
To simplify these steps to one step, this module allows ATutor administrator to customize their own registration form by selecting the fields to show on the form. One of the fields is to list all available courses for users to enroll. The save on the registration will register and enroll the user to all the selected courses.
Todo list
1. Admin module "Customize Registration Form": allow ATutor administrators to select fields that to be displayed on customized registration form. Other than all current fields in registration form, another customized information that administrators can select is "List courses for users to enroll" and types of the courses (public, protected, private) to list.
2. Once the customized information is defined, create "Registration form" dynamically based on these information, otherwise, use ATutor default registration process that is current registration form and process.
Admin Module "Customize Registration Form"
Sample interface
There are 6 fields are must-have in ATutor for ATutor's proper process and they are un-modifiable in the interface. These fields are: Login Name, Password, Password Again, Email Address, First Name, Last Name.
New tables
Table 1: customized_registration
To hold all the customization fields added by ATutor administrator.
Table Structure:
CREATE TABLE `customized_registration` (
`customized_registration_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
`linked_customized_registration_id` MEDIUMINT UNSIGNED NOT NULL,
`field_text` VARCHAR(250) NOT NULL default 0,
`is_required` tinyint(3) NOT NULL default 0,
`field_type` VARCHAR(50) NOT NULL default '',
`length` MEDIUMINT UNSIGNED NOT NULL default 0,
`height` MEDIUMINT UNSIGNED NOT NULL default 1,
`sequence` MEDIUMINT UNSIGNED NOT NULL default 0,
`is_customized` tinyint(3) NOT NULL default 0,
PRIMARY KEY (`customized_registration_id`)
);
Fields Explanation:
customized_registration_id: Primary key, auto increment
linked_customized_registration_id: The parent customized_registration_id when this row is options of check box, radio button, drop down list box
field_text: The text to display in registration form
is_required: To determine if the field is a required field in the registration form. 1 is required, 0 is not required
field_type: The field type, value is one of: 'Text', 'Text Area', 'Check Box', 'Radio Button', 'Drop Down List Box', 'CheckBox_option', 'RadioButton_option', 'DropDownListBox_option'
length: When field_type is 'Text' or 'Text Box', this field is for the length of the text box; when field_type is 'Radio Button', 'Drop Down List Box', 'CheckBox_option', this field is for the number of options
height: The number of rows when field_type is 'Text Box'.
sequence: The sequence number that the field is displayed on the registration form
is_customized: The flag that indicates the registration form is customized. 1 is customized, 0 is not. (We actually only needs 1 record for this flag. As I don't come up with a better place for it, leave it here for now.)
Initial Data:
INSERT INTO `customized_registration` VALUES (null, 0, 'Second Name', 0, 'Text', 30, 1, 1, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'Date of Birth', 0, 'Text', 30, 1, 2, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'Sex', 0, 'Text', 30, 1, 3, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'Street Address', 0, 'Text', 30, 1, 4, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'Postal/Zip Code', 0, 'Text', 30, 1, 5, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'City', 0, 'Text', 30, 1, 6, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'Province/State', 0, 'Text', 30, 1, 7, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'Coutry', 0, 'Text', 30, 1, 8, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'Telephone Number', 0, 'Text', 30, 1, 9, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'Web Site', 0, 'Text', 30, 1, 10, 0);
INSERT INTO `customized_registration` VALUES (null, 0, 'List Courses to Enroll', 0, 'Text', 30, 1, 11, 0);
Table 2: customized_registration_data
To keep data input by users on customized fields.
Table Structure:
CREATE TABLE `customized_registration_data` (
`customized_registration_data_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
`customized_registration_id` MEDIUMINT UNSIGNED NOT NULL default 0,
`value` blob NOT NULL default '',
PRIMARY KEY (`customized_registration_data_id`)
);
Fields Explanation:
customized_registration_data_id: Primary key, auto increment
customized_registration_id: Link to customized_registration.customized_registration_id
value: value of the field with customized_registration.customized_registration_id
Registration Form
Sample Interface
If "Courses to Enroll" is selected in "Customize Registration Form", a section "Courses to Enroll" will be displayed in registration form after section "Personal Information". This section lists all available courses. The user can select the courses he/she wants to enroll in. A save on registration form will do both registration and enrollment into selected courses for user. A shortcut "Check All" checkbox is provided to allow user to select all courses by one single click.
Another section "Additional Information" will be displayed after section "Courses to Enroll". It creates the fields of the types that are defined by the administrator. The values of the fields from the user are saved into table customized_registration_data.
how to fetch all controls like textbox,radiobutton stored in table in above code to make registration form?.......quike reply