Development of Web Survey (voting) system using ASP technology (1)

Source: Internet
Author: User
Tags definition mdb database requires access database
Web| Vote | Voting outline

This paper introduces a WEB survey system (also known as voting system) implemented by ASP Technology, which supports the creation and maintenance of browser-based survey projects, the dynamic generation of survey forms and the analysis of voting results.
Directory

I. Overview of the SYSTEM
Ii. creation and maintenance of investigation projects
Third, the formation of survey form and results analysis (source procedure)


I. Overview of the SYSTEM
Author: Cactus Studio

The WEB Survey system (or voting system) described in this article supports browser-based Survey project creation, management, and results analysis. The definition of a survey project and its subordinate issues, and the results of a user vote are stored in an Access database, and the survey form is generated dynamically by the script. The user answers the question with a radio button or check box, and the server records the survey results in the same database after the form is submitted. Through the analysis module of the WEB survey system, users can immediately be informed of the poll results of arbitrary survey items.

The entire system is database-centric, so this article can also be seen as a demonstration of maintaining a database in ASP applications, such as table creation, deletion, and browser-based database record creation, deletion, and editing, which are implemented by the server's dynamically generated SQL commands, JavaScript scripts.

I. Overview of the SYSTEM

㈠ System composition

From a functional perspective, the entire system can be divided into four parts, corresponding to the figure 1 to 44 pages. Figure 1 and Figure 2 are the system's maintenance interfaces. The page shown in Figure 1 is used to create a survey project, delete a survey item, or its voting results, and specify the survey project name and user password to access the investigation project editor shown in Figure 2.

"Figure 1 Webpollsystem_1.gif"



The page shown in Figure 2 is used to edit the issues that the specified survey project belongs to, and the features that are provided directly include creating new issues, deleting problems, changing the prompt text of the problem, and browsing issues, and using the above features to redefine the problem type. This system supports 5 types of questions: Yes/no (that is, simply answer "yes" or "no" questions), degree of approval (the system is predefined for such questions from "strongly opposed" to "fully endorsing" a total of 5 levels of answers), the level of custom semantics (predefined 7-level answers, but the specific meaning is defined by the user), Multiple options for customizing the hint text (the number of options and the text for each option hint are specified by the user. Only one answer can be selected for each question, multiple options to allow a check (the number of options and the text for each option hint are specified by the user, allowing multiple answers to be selected), and the following two types of questions allow up to 26 options. The middle of Figure 2 (above the bottom hint line) shows the editing interface for question type 4th (multiple options).

"Figure 2 Webpollsystem_2.gif"



Figure 3 is a survey form that is seen by WEB users. The 4 questions shown in the figure correspond to the previous 1-4 question types, and the 5th type of question (Allow check) requires a check box to answer the question, which is not shown in the figure. The user simply clicks the submit button at the bottom of the page when the selection is complete.

"Figure 3 Webpollsystem_3.gif"



Figure 4 is the statistical analysis page of the poll results.

"Figure 4 Webpollsystem_4.gif"



The ODBC system DSN named "Poll" in the Access database Poll.mdb. Each survey project requires the three tables defined in the following table, which are created automatically by ASP scripts when creating new survey projects, and their maintenance can be done through the browser. The names of the three tables are prefixed by S_, A_, and R_, followed by the name of the survey project, which is used to hold the question and question identification (STEM) of the survey project, the answer type (Answer), and the user answer (Response) respectively.

Problem Table (S_)
Field Name Type size Index description
ID Text 3 Yes primary keyword
Type Text 1 No
Noopinion Text 1 No
Stem Text No
Answer table (A_)
Field Name Type size Index description
ID Text 3 Yes primary keyword
Alabel Text 1 Yes main keyword
Answer Text No
User vote Results Table (R_)
Field Name Type size Index description
Responses Text No


Startup.html is responsible for generating the frame structure of the system maintenance page; Pollmaker.asp is responsible for generating the Figure 1 page and supporting other operations initiated from the page (survey project creation, deletion, voting result purge, etc.); itemmaker.asp is responsible for generating the Figure 2 page, Support the definition, editing, and deletion of issues that the investigation project belongs to. The survey form (Figure 3) is generated by pollwriter.asp, and the analysis of the voting results (Figure 4) is implemented by pollresult.asp. The work of the entire investigative system is database-centric: pollmaker.asp and itemmaker.asp need to create, delete, and modify the various tables that define the survey project in Poll.mdb; pollwriter.asp generate survey forms from S_ and A_ tables; When users submit questionnaires A function in a single time pollmaker.asp writes the results of the poll to the corresponding R_ table, pollresult.asp the text data in the combined S_ table and the A_ table, and the voting results in the R_ table, generating the result statistics chart for the current survey project.

㈡ how to create and edit a survey project

After the WEB survey system is properly installed (see the installation instructions in the source code attached to this article), you can open startup.html in the browser and the authentication page shown in Figure 1 appears. The Drop-down list box lists all the survey items that are currently defined in Poll.mdb. If you want to create a new survey project, you must first select "New POLL" in the list box, enter the name of the new survey item to the right of the list box, enter a password in the Password entry box (default is "Webpoll", uppercase or lowercase), and then click the Create/Edit survey Item button. To delete an existing result record for a survey project, or to delete the survey results with the survey project itself, use the Delete survey results or delete current survey items button.

Create or edit the questions that the survey project belongs to are in the page shown in Figure 2. Before you create a new problem, you should first select the appropriate question type (the radio button at the top of the page), and you must specify the number of options available for the multiple options or allow check types, and if the Allow no answer check box is selected, in addition to the Allow check All other types of problems are appended with a "Do not answer" option (radio button). After you have made these selections, a blank question definition form appears when you click the New button. You can then enter the question prompt text and, if necessary, enter the prompt text in the answer, which can be embedded in the HTML tag. If you want to change the type of problem or the number of answers, you need to remove the original problem definition before you create a new problem. All the creation and editing work is done on the client, and you can use the Save button to save these changes to the Poll.mdb database on the server.

The question navigation button in Figure 2 is used to view various issues in the current survey project, enter the question number after the go to the specified problem-〉 button, and then click the button to display the corresponding question. Newly defined issues are always added to the end of the survey project. If you want to place it in a different location, just enter the appropriate number and click the button after the move to the question button, and enter a value of 0 to move the problem to the front.

(To be continued)



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.