A role-based Online Survey System built with ASP.NET Web Forms and VB.NET. Three roles: Survey Builder, Surveyor, and Survey Administrator each has a dedicated interface through session-based authorization. Builders can create surveys and add MCQ or True/False questions, Surveyors attempt active surveys, the Administrator can manages users, control survey visibility, set surveyor anonymous, and views results.
| Table | Key Columns | Purpose |
|---|---|---|
| Users | UserID, Name, Email, Password, Role, IsAnonymous | All users with role and anonymity flag, which is set by Admin. |
| Surveys | SurveyID, Title, CreatedBy, IsActive | Survey records, Admin can activate or deactivate. |
| Questions | QuestionID, SurveyID, QuestionText, QuestionType | MCQ or TrueFalse questions belonging to a survey. |
| Options | OptionID, QuestionID, OptionText | 4 options for MCQ, True/False auto-inserted for T/F questions. |
| Responses | ResponseID, SurveyID, UserID, QuestionID, SelectedOptionID, SubmittedAt | Surveyor answers, UserID is NULL for anonymous surveyors. |
| # | Test Case | Output |
|---|---|---|
| 1 | For invalid credentials | "Invalid Email or Password" is shown |
| 2 | When surveyor accesses Admin URL | Is Redirected to Login.aspx |
| 3 | When builder adds MCQ question | Question + 4 options are saved, confirmation is shown |
| 4 | If builder adds True/False question | True and False options are auto-inserted |
| 5 | When No active surveys | Surveyor will see "No surveys available." |
| 6 | When surveyor submits responses | Responses are saved and result summary is shown |
| 7 | When anonymous surveyor submits | Response is saved with NULL UserID |
| 8 | If Admin deactivates survey | Survey is removed from Surveyor's active list |
| 9 | If admin tries to delete his own account | Then "You cannot delete your own account." is dispayed |
Uses ADO.NET sqlConnection, sqlcommand and data reader with the connection string from ConfigurationManager.ConnectionStrings("Survey_DB").
Session("UserID"), Session("Role"), and Session("IsAnonymous") are set on login and checked on every protected page's Page_Load. The add questions page uses AutoPostBack on the question type dropdown to show/hide the mcq options panel, and OUTPUT INSERTED.QuestionID to immediately get the new question's ID for option insertion.