版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、2013届本科生毕业设计(论文)外文翻译毕业设计(论文)外文翻译源代码需要联系qq:68661508学生姓名 专业班级 r机械08-3班 所在院系 机械工程学院 指导教师 职 称 讲师 所在单位 软件工程教研室 完成日期 2013 年 4 月 5 日外文原文behavior research methods 2005, 37 (4), 703-710generic html form processor: a versatile php script to save web-collected data into a mysql databaseanja s gritz and michael
2、 h birnbaumin the last decade, the execution of experiments and surveys via the world-wide web has become an established method (see birnbaum, 2001, 2004a, 2004b; kraut etal.,2004). several reviews have concluded that the quality of data achieved in online studies can be comparable to, and sometimes
3、 better than, that obtained. by more traditional methods involving a lab, paper questionnaires, or telephone interviews (birnbaum, 2001; krantz & dalal, 2000; mcgraw, tew, & williams, 2000). there are other advantages of web research. on the web, people can be tested at any time and place, laborator
4、y rooms or physically present experimenters are not necessary (so experimenter effects remain constant), and automated data handling reduces both the labor and error of data coding and entry (birnbaum & reips, 2005; gritz & schumacher, 2000).in addition, the web method allows one to collect large sa
5、mples inexpensively, which makes it possible to draw clear conclusions and to check their generality to different subsamples tested (birnbaum, 1999; reips, 2002). an example of an html web form is given in birnbaum (2000). such an html page can be placed on a server, where the participant can view i
6、t and fill in answers by typing in information and clicking on choices. when the participant is finished, he or she can then click on a button to send the data. birnbaums (2000) surveywiz and factorwiz are freely available programs that make it easy to create html forms for simple surveys and within
7、 subjects factorial experiments. reips and neuhaus (2002) have developed wextor, which is useful for generating web experiments that utilize (for instance) between subjects factorial designs with multiple pages for different conditions.sending data from an html formthere are three methods of receivi
8、ng data that have been collected through an html form. the first method is to use the “get” method and extract the form input from the server log files (see birnbaum & reips, 2005). a second method is to have the form data e-mailed to the researcher. this can be done by means of the html forms actio
9、n attributefor example,.however, some systems refuse such an action attribute if, for example, no e-mail client is set up (as might be the case for, e.g., computers in a public library). moreover, some browsers issue a more or less draconian alert, which the participant has to confirm for the data t
10、o be e-mailed. most problematic for large efforts, though, is the fact that each submission generates its own e-mail, so data need to be extracted from thousands of individual e-mails and merged into one data file. thus, whereas the e-mail method might be useful during testing of a form or for small
11、 efforts like obtaining rsvps to a party, the method is not practical for large research projects. the third method is to use server-side cgi (“common gateway interface”) scripts to process and save the form data. in this case, the action attribute of a web form sends the forms data to a cgi script
12、that is located on a web server (schmidt, 1997, 2000). an example of such an attribute is.thus, use of cgi requires the researcher to have access to a cgi-enabled directory on a web server. there are several benefits of using a cgi script: first, the cgi can process the data and save them in a file
13、format ready for analysis. order bias can be eliminated by presenting items and alternative answers in random order, and the cgi can reorganize the data. also, skip patterns can be incorporated into questionnaires. in addition, participants input can be validated in real time; for example, data erro
14、rs can be detected and respondents pointed to omitted items (gritz & schumacher, 2000).cgi scripts can be written in any language that a given server can execute, such as asp (“active server pages”),perl (“practical extraction and report language”), or php (“hypertext preprocessor”). php is an incre
15、asingly popular scripting language (see as with perl, php interpreters are open-source, free, and available for many different platforms. one can check the availability of php for ones own platform and download a suitable installation package from the downloads section of the php home at .run your o
16、wn server with apache, php, and mysqlthere are many advantages to running your own server (birnbaum & reips, 2005; schmidt, hoffman, & macdonald, 1997). you can configure the most common web servers to work with php. you can install php on a server by following the installation instructions that com
17、e with the downloaded package. in most cases, php is installed on the same server where the html forms reside, but it can also be installed on any other server where the data are to be saved. apache is a powerful, widespread, and flexible open-source web server. apaches web server comes already inst
18、alled in new macintosh computers, as are perl and php, and is freely available for pcs and almost any other platform from . there are two options for how a php script can store the data from the html form. one simple method is to have the script save the form data into a text file that
19、 is located on the server. for example, this might be a comma separated values (csv) file. after all data have been collected, the file can be read into a spreadsheet or statistical application.however, if participants input at some stage of the research needs to be used dynamically to determine the
20、 next question, or if the questionnaire consists of more than one html form, it is advisable to have ones php script save the form data into a database. the advantage of the database is that it can store information about the participant, make computations on those data, and dynamically respond to t
21、he participants behavior. using a database allows the server to keep track of a participant who may perform many tasks over a period of time.servers can use various database applications, including oracle, ms access, and mysql. we recommend mysql because it is an open-source, free, compact, fast, re
22、liable, robust, and multiuser database server that compiles on many platforms. its home page is . mysql databases can easily be administered with the free tool mysql control center (now succeeded by mysql administrator), which can also be downloaded from .a generic html form processor in phpa versat
23、ile php script called generic html form processor has been developed that processes any syntactically correct input from html forms. it is available, along with sample html forms, from the script creates “on the fly” a mysql database containing one data table. in the table, the script dynamically se
24、ts up columns for all submitted html input fields and saves the data in the previously created columns. thus, this script relieves researchers of the burdens of writing a cgi script and building a database to store their data for each new project. to run a survey or experiment, researchers merely ha
25、ve to complete the relatively simple task of creating html forms that fit their needs. there are many commercial and noncommercial html editors available that can assist the researcher with this task. for example, one of the two free programs surveywiz and factorwiz (birnbaum, 2000) might be used. a
26、s a result of this spectrum of possible usage, we will now describe five modes of use that require different levels of knowledge of php and server issues.1.the easiest mode for using generic html form processor is with one-page html questionnaires designed to save data on a server at the first autho
27、rs university. for this purpose, no knowledge of php and web servers is required. the only preparation necessary is to set the action attribute of your html form to the url (internet address) of generic html form processor. the html file itself can reside on any server. let us look at an example htm
28、l form called sample.htm. it contains most of the existing html input field types (see figure 1). figure 1 browser view of example one-page html form sample.htm2.the second mode consists of using generic html form processor with a multipage html questionnaire on the server at the first authors unive
29、rsity. this also requires no knowledge of php or server issues. however, you would have to make a few more changes in your html forms, as follows: first, as in the previous mode, you need to set the action attribute of each of the html forms to the url of generic html form processor. second, to tell
30、 the script which html page it needs to call up after processing the previous page, one extra line of html code must be inserted within the form tags. this line defines the hidden variable next_ page and its value, which is the location of the next html page. an example is shown below in which sampl
31、e2.htm is in the same web folder as generic html form processor:.alternatively, if the next page were called “page_two.html,” this line would read .if the next survey page were located on another server or not within the same directory as the first page, the value should be set to the absolute url o
32、f the second pagefor example,input type =“hidden” name= “next_ page” value=“http:/full_path_on_let us inspect an example survey that consists of three html pages. the first page is sample1.htm (see the source code in listing 2 and the browser view in figure 2), the second is sample2.htm, and the thi
33、rd is sample3.htm.figure 2 browser view of example html form sample1.htmto track individual participants across the pages of a multipage survey, a unique identifier needs to be passed from page to page. this is automatically accomplished by extracting an identifier for each participant (called op56)
34、 from the database and appending it to the query string of the next survey pagefor example, 16&nr93=1.the other transmitted variable, nr93, tells generic html form processor which page of a multipage survey it is dealing with. with the help of javascript, these two variables are extracted from the q
35、uery string and inserted into the html form as hidden variables. therefore, for each page of a multipage survey except the first, a javascript snippet (see the bold print in the sample2.htm source code in listing 3) needs to be pasted within the form tags.figure 3 depicts the browser view of the htm
36、l file sample2.htm.figure 3 browser view of example html form sample2.htmon the third page of our multipage study, sample3.htm, the researcher again needs to paste the javascript snippet between the form tags, but inclusion of the hidden variable next_ page is no longer necessary, because sample3.ht
37、m is the last page of the survey (see the source code in listing 4).figure 4 depicts the browser view of the html file sample3.htm.figure 4 browser view of example html form sample3.htmagain, the script creates a mysql database called“generic” with results table “generic.” because now there are thre
38、e html pages, the names and submission time stamps of pages 2 and 3 are recorded as well (see figure 5). retrieval of the survey data follows the same procedure described for the one-page case.figure 5 sample table with results from a three-page surveyfor implementing skip patterns in your survey, t
39、here are three options. the first method requires only html and is illustrated at the following url: both other methods use javascript. first, the skip pattern might be included within the same page of a survey (e.g., by having javascript display an additional item or response option if a particular
40、 answer has been selected prior to that). for example, if a respondent indicated having had a particular experience, an additional item could come up that would ask the respondent to de scribe this experience in more detail. the third option (and the second requiring javascript) would be to display
41、any contingent material on a consecutive page. as an example, look at the source code of the html file sample1a.htm in listing 5. this is a modified version of sample1.htm, with the bold text added. if in sample1a.htm a participant indicated that she was female, she would be directed to the interpos
42、ed page sampleextra.htm instead of directly to the page sample2.htm (not shown here, but you can see this example as well as others in action at the same method can also be used for randomization of survey pages. for this purpose, a javascript snippet could draw an element of an array at random. the
43、 next page displayed would be contingent on the element selected.3.the third mode involves using generic html form processor with a one-page html questionnaire on an accessible server with php and mysql. first, download generic html form processor from and extract it onto your server in a suitable d
44、irectory.to customize the scripts behavior, follow the guidelines in the script. alter the action attribute in your html form to the location of the script on your serverfor example,form method= “post” action= “http:/mthe first time the html form is submitted, the script creates a mysql database cal
45、led “generic” with a results table also called “generic.” data may be retrieved from your mysql database either by running a select syntax command or with the help of a graphical administration tool such as mysql control center.note that for the script to function properly, the researcher needs alte
46、r, insert, select, update, and create privileges for mysql. if the researcher wishes to use a public server, he or she might not have some of these privileges, because it is a security hazard to allocate global alter privileges to any user (in this case the researcher). there are three ways of deali
47、ng with this: (1) the researcher may ask the server administrator to create a minimal mysql database with one table in it (this should take less than 1 min) and to allocate the relevant privileges only for the single table within this database. there is no security risk involved in that. (2) since t
48、he alter privileges are needed only oncenamely, to define all possible columns in the mysql databasethe researcher may ask the server administrator to grant him or her alter privileges for 10 min only. in this interval, the researcher can fill out all input fields on all pages of the questionnaire w
49、ith practice data and submit it. (3) the researcher can set up his or her own server and grant him- or herself the needed privileges for this step.4.the fourth mode involves using generic html form processor with a multipage html questionnaire on a server to which you have access. first, put the scr
50、ipt on your server and, if desired, customize it. you will need to alter your html forms as described above for mode 2.5.finally, you are free to further customize generic html form processor to your particular needsfor example, by implementing a more sophisticated input validation. learning php wil
51、l allow you to completely customize your study. 中文翻译通用html表单处理器:将网络上收集到的数据保存到mysql数据库的多功能php脚本 在过去的十年里,通过万维网进行的实验和调查已成为一个既定的方法。(见伯恩鲍姆,2001年;克劳特等人,2004年)。从一些评论中我们可以总结到:通过网上研究获得数据的质量可以比得上有时甚至优于通过一些传统方法获得的数据的质量,这些方法包括包括实验、纸质问卷调查、电话采访等(伯恩鲍姆,2001年;克兰茨和达拉尔,2000年;麦格劳、克斯图和威廉姆斯,2000年)。网络研究还有其它的优势,在网上,人们可以随时随
52、地的测试,而实验室或实验者则并不是必须的(所以实验者的影响保持不变)。此外,自动化数据处理既减少了劳动力又减少了数据编码的错误和条目(伯恩鲍姆和瑞普思,2005年;戈瑞茨和舒马赫,2000年)。另外,网络的方法可以低廉地采集大量的样本,这使得到清楚的结论成为可能,并检查他们的一般性,这些一般性与其它被测试的子样本不同(伯恩鲍姆,1999年;瑞普斯,2002年)。伯恩鲍姆(2000年)给出了一个html 网络表单实例。这样的一个html页面可以放在一个服务器上,参与者可以浏览它并通过输入信息或点击选择项来填写答案。当参与者完成后,他或她可以通过点击按钮来发送数据。伯恩鲍姆的(2000年)surv
53、eywiz和factorwiz是可以免费得到的程序,这些程序可以轻易地创建html表单,这些表单用于简单的调查和在被试者之间进行因子试验。瑞普斯和诺伊豪斯(2002年)开发的wextor可以用来进行网络实验,这些实验使用(例如)主题因子设计和不同环境下的多个页面。从一个html表单中发送数据有三种方法可以通过一个html表单接收已经收集到的数据。第一种方法是使用“get”方法并从服务器日志文件上提取表单输入(见伯恩鲍姆和reips2005)。第二种方法是将表单数据发邮件给研究者。这可以通过使用html表单的“action”的属性来做到,例如:但是一些系统拒绝这样的“action”属性,例如没有
54、建立电子邮件客户端(可能是以下的情况比如图书馆的计算机)。另外,一些浏览器发出或多或少有些严厉的警告,参与者必须确认那些通过电子邮件发送的数据。对于大工作量来说棘手的问题是每一个提交都产生他们自己的电子邮件,所以需要从上千个独立的电子邮件中提出数据并将他们合并到一个数据文件中。因此,尽管电子邮件的方法对测试一个表单或者类似于获得一方回复的小工作量来说是有用的,该方法对于大型研究项目是不实用的。第三种方法是使用服务器端cgi(公共网关接口)脚本来处理和保存表单数据。在这种情况下,一个网络表单的“action”属性发送表单的数据到位于一个web服务器(施密特,1997年、2000年)的一个cgi脚
55、本上。该属性的一个实例如下:因此,使用cgi要求研究者能访问到位于一个网络服务器上的一个cgi使能目录。使用cgi脚本有一些好处:首先cgi可以处理数据并将它们以文件的形式保存以用来分析。顺序偏差可以通过随机的展示条目和备选答案来消除。而且cgi可以重组这些数据。此外,调查问卷中可以采用跳跃模式。另外,参与者的输入可以被实时验证。比如数据错误可以被检测到,受访者可以指出遗漏的条目(戈瑞茨和舒马赫,2000年)。cgi脚本可以用任何一种能被一个给定的服务器执行的语言写成,例如asp(“活动服务器网页”)、peal(“实际提取和报告语言”)或php(“超文本预处理器”)。php是一种日益流行的脚本语言(见 usage.php)。perl、php解释器
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年消防设施检测与维保服务合同5篇
- 2025年度安置房质量保证合同书3篇
- 2025年水泥制品环保技术转移合同3篇
- 2025年度高空坠落防护HSE施工安全协议3篇
- 二零二五年房产销售代理与广告宣传协议3篇
- 二零二五年鲜活水产品运输与质量监管协议3篇
- 2025年度免租金停车场租赁合同模板
- 2025版棋牌室三方合作协议-创新管理与行业规范4篇
- 2025年污水处理站污水处理设施设备租赁与维修合同3篇
- 2025年度留学签证担保与资金证明服务合同3篇
- 公司组织架构图(可编辑模版)
- 1汽轮机跳闸事故演练
- 陕西省铜川市各县区乡镇行政村村庄村名居民村民委员会明细
- 礼品(礼金)上交登记台账
- 普通高中英语课程标准词汇表
- 北师大版七年级数学上册教案(全册完整版)教学设计含教学反思
- 2023高中物理步步高大一轮 第五章 第1讲 万有引力定律及应用
- 青少年软件编程(Scratch)练习题及答案
- 浙江省公务员考试面试真题答案及解析精选
- 系统性红斑狼疮-第九版内科学
- 全统定额工程量计算规则1994
评论
0/150
提交评论