Solved

Online Test

Posted on 2006-11-30
7
244 Views
Last Modified: 2010-04-06
Hello guys:
I’m currently working on a website and I will like to create an online quiz for customers, the quiz will have 10 questions and will have textboxes for the user to enter email, first name, last name and the answers. I will give them the answer and then 4 multiple choice for them to choose and a text box for them to enter the answer:

1) Which Country singer is nicknamed the "Gentle Giant."
 
A) Porter Wagoner
B) Jim Ed Brown
C) Bobby Bare
D) Don Williams

 Whenever they summit the test the script will make sure that all the questions were answer and that the email, first and last fields have been enter, if the user is missing something they will get a page showing them what fields are missing.

The next step is to save that info to a csv file on my ftp site I will like to include the following fields: Date, email, first, last, a1,a2,a3,a4,a5,a6,a,7,a8,a9,a10 to the cvs file and every time users take the test keep appending data to that file.

Then last stepis to send an email to the user showing them that they either answer all of the questions right or showing them which answers the mist and what the correct answer is.

I’m not to sure what script language to use. I’m good with html, average with java and don’t know too much about cgi or perl.

I need some guidance on how to accomplish this task. I really appreciate any tips or ideas

Thanks in advance.
0
Comment
Question by:Oneill0003
  • 4
  • 3
7 Comments
 
LVL 5

Expert Comment

by:dasmaer
ID: 18046214
if you're good with HTML and know some Java then I'd go with PHP (sounds odd right?).

PHP is really easy to pick up and is much like C (Java is also like C). In PHP handling files is easy, and getting form values is even easier.

Java is also good, but you'd need JSP's and servlets to get it going, if you install Resin then the deployment becomes easier than Apache with PHP.

If you want something easy to learn go with PHP, if you want to get going quickly with your existing knowledge get Resin.

D
0
 

Author Comment

by:Oneill0003
ID: 18046395
Thanks for the tip dasmaer, but I forgot to mention that at this moment we do not host our website in house and we don’t have much access to the back end of the site, as far as I know we are running MySQL 4.0 and the language used is EASY language very old and almost out dated. So with that in mind I really can’t use PHP since at this moment I cannot install a compiler on the server. What about creating the form using CGI? I don’t know much about it but will not mind learning it.
0
 
LVL 5

Expert Comment

by:dasmaer
ID: 18046466
CGI is a technology rather than a language. Common Gateway Interface if memory serves me right.  What it does is get the webserver to run requests past a system such as PHP, the JVM or Perl and then stream the result over HTTP.

You'd need to get something installed on the server to do the legwork, old CGI stuff was written in C and then Perl... after perl people stopped calling it CGI and started instead of refering to the scripting language in use.  If you are on a Windows Server with IIS5(or over), then you will almost certainly have VBS installed so you can use ASP (unless you have a very paranoid Network Admin).

If the server is Apache and its on Unix, then you'll almost certainly have Perl somewhere already (I'd be shocked if it wasn't there).  Because you're using MySQL the odds are you're server in UNIX of some flavour and Perl is the way forward for you.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Expert Comment

by:dasmaer
ID: 18046487
Of course, there is always the possibility that you're on Windows with Apache as the server, or another HTTP server I've not mentioned. If that is the case, see if you can get your Admin to install Apache with PHP as its free.
0
 

Author Comment

by:Oneill0003
ID: 18046614
So you really don’t write CGI code you use CGI to run PERL code right?

Once again I apologies for not given all the specs from the beginning, our website is hosted on a Linux server running Red Hat 8.0 and like I said earlier we are using MySQL 4.0, I have a guy in staff that is really good with Linux and we are able to log to the back end whenever we need something. So the question is what should I look for to be able to run PERL scripts in this server, and really how do I get started on my script?

Thanks for your help!
0
 
LVL 5

Accepted Solution

by:
dasmaer earned 500 total points
ID: 18046757
What you need is the CGI.pm (perl modules) as these will sort out all of the HTTP transactions you need. These come pre-installed on Red Hat so you'll be fine, an example Hello World would be:

#!/usr/bin/perl                #this is the path on the server to where perl can be found, an alternative is /bin/perl

use CGI qw/:standard/;   #tells perl we're doing HTTP
print header,                  #print HTTP headers
start_html('Hello World'),# output some html
h1('CGI.pm is simple.'),  #and more
end_html;                     #end html

See: http://perl.about.com/od/cgiweb/a/perlcgipm.htm for the full example.  You can also google for "Perl CGI" and you'll get a lot of hits back. I first started Perl at College and I learnt from the Book "Sams Teach Yourself Perl in 21 days", which puts Perl into 21 lessons which take about 30 mins to read each.

Good luck.
0
 

Author Comment

by:Oneill0003
ID: 18048338
Great info!
Thanks for your help.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now