Assignment 3: CGI and Python
2 December 2015 (5pm)
The third assignment is about CGI programming using Python. This involves capturing user input, and processing that input in an appropriate fashion. Thus, an understanding how information is transmitted via a web browser is important, along with how that information can be accessed and used to return a new webpage to the user, based on that input.
The purpose of this assignment is for you to demonstrate the
following learning outcomes and for me to assess your achievement
of them.
Students should:
While it's entirely possible to write (at least some of)
the functionality of these problems in, say, JavaScript,
the intention of this exercise is to show me that
you can program (at least at a beginner's level) in Python,
and combine that knowledge with the CGI technology that
we have discussed in class.
So, for example, while you could write a (purely) JavaScript
function that could test whether a string is a palindrome
and implement this on an appropriate web page,
doing so won't earn you any sort of credit for
this assignment.
Use Python (called from a web page that you design, and
Python code that you write) to do this job!
Write a webpage called palindrome.html which will test strings (which may
or may not include numbers) to
see if they are palindromes.
The user can input a string, and then
a script will check to see if the string is a palindrome or not, displaying
the result to the user on another page (include the original string that they input
in the displayed output). You should disregard the case of
letters, as well as spaces and any punctuation symbols in the sentence (use Python
string routines to deal with these issues) when you check to see if it is a palindrome.
For example, the string "Madam, I'm Adam" is a palindrome (disregarding
upper/lower case, spaces, and punctuation symbols), and the number 15751 is
a palindrome too. The strings "Ma'am, I'm Adam" and "34546" aren't.
For an extra 1-15 points, allow the user to input up to five strings at once
and display results for all of them on the same page.
If the user only inputs one or two strings to test, then you should
only output information about those strings (i.e. don't assume that they will
enter exactly five strings).
Write a web page called rateme.html which allows
visitors to rate your home page. That is, create a small web
page with radio buttons with which the visitor can rate your
home page as very good, good, so-so, bad, or very bad.
The overall results of the survey should be stored on the
web server. After pressing the submit button, the overall
survey results should be shown to the visitor.
For extra 1-15 points, your system should survey ratings
by distinct visitors only, and
also allow someone to change their rating.
Since you're going to be using Python and CGI server for these tasks,
you need to place your files in the proper directory as mentioned in class
so that these scripts will execute properly.
Include links to your pages on your home page as well.
Having your webpages online is a necessary part
of this assignment so that I can accurately
check they are working correctly (i.e. gathering input
from a user who utilizing a browser).
As for the last assignments, you must submit your webpages
via the Department's
Coursework Submission System. That's the "official proof" that your
assignment has been submitted on time. Please include whatever
files (e.g. HTML, external CSS files, Python scripts)
are appropriate in
your submission. You can create one zipped file for your
submission. Please do not use the RAR (or some other
proprietary) format!
Please remember to have your webpages online so that I can access them via
a web browser and to submit them to the
Coursework Submission System
by 5pm on the day they are due.
When submitting your solution, don't forget to include
a completed
Declaration
of Academic Integrity.
This assignment contributes 1/4 of the 75% continuous
assessment part of the course grade. The maximum possible
grade on this assignment is 100 points.
Failure in this task can be compensated by higher marks on
the other assessments of the module.
Important note:
It is assumed as part of this assignment that the HTML code
you write will satisfy the HTML5 standards!! (Include an appropriate
Document Type Declaration
and consider using the
W3C online validator.)
Failure to satisfy the HTML5 standards
can result in losing marks from your grade.
Grade | Classification | Percentage | Qualitative Description |
---|---|---|---|
A* | Good Distinction | 80+ | Factually almost faultless; perceptive and focused treatment of all issues. Clearly directed; logical; comprehensive coverage of topic; strong evidence of reading/research outside the material presented in the programme; substantial elements of originality and independent thought; very well written. critical and scholarly presentation. |
A | Distinction | 70-79 | Logical; enlightening; originality of thought or approach; good coverage of topic; clear, in-depth understanding of material; good focus; good evidence of outside reading/research; very well written and directed. |
B | Good Pass | 60-69 | Logical; thorough; factually sound (no serious errors); good understanding of material; evidence of outside reading/research; exercise of critical judgement; some originality of thought or approach; well written and directed. |
C | Pass | 50-59 | Worthy effort, but undistinguished outcome. Essentially correct, but possibly missing important points or inadequate treatment. Largely derived from material delivered in the programme, but with some evidence of outside reading/research; some evidence of critical judgement; some weaknesses in expression/presentation. |
D | Compensatable Fail | 40-49 | Incomplete coverage of topic; evidence of poor understanding of material; Poor presentation; lack of coherent argument. Very basic approach to a narrow or misguided selection of material. Lacking in background and/or flawed in structure. |
F | Fail | < 40 | Serious omissions; significant errors/misconceptions; poorly directed at targets; evidence of inadequate effort. Shallow and poorly presented work showing failure in understanding. |
The University's standard policy on lateness penalties will be applied with respect to the latest electronic submission of the assessment. See Section 6 of the Code of Practice on Assessment for further details.