You need to use Pretty Big language for this assignment!See hints for using HTML in Racket.
</b>for bold face, etc.)
Hint: You will need to define four scripts---one each to create the main, authoring and preview pages, and one to handle the accept button. Review the Lab 6 hotel code for examples of how to manipulate HTML, but don't commit the same error of using a cookie in the wrong way (follow your hidden field revision).
Simplifications: Your server does not need to implement persistent storage of the posts (e.g., no files)---just store them in a global variable and use
set!. Also, there will be no extra credit for fancy HTML layout. As in the hotel example, we are interested here in the dynamic operation, not the graphical design, of the website.
Test your code with the following interaction sequence to make sure it does not have the same bug as the starter version of Lab 6:
You do not need to provide
check-expect's for this homework, as
conveniently testing web programs is beyond the scope of this course.
<b>Warning!</b> This is a bad idea.you want it to come out on the main page as:
Warning! This is a bad idea.i.e., in bold, not with the angle brackets. Given the way that x-expressions (xexpr's) are used in the Racket server, the easiest way to do this is to wrap a paragraph element around the string and parse it using
string->xexpr. For example,
(string->xexpr (string-append "<p>" "<b>Warning!</b> This is a bad idea." "</p>"))returns the list
(p () (b "Warning!") " This is a bad idea."), which you can then include in your reply page with the correct effect.
Turn in a single file hwk7.rkt containing your data structures and scripts, which automatically loads the server (like the Lab 6 starter file).
Indicate in a comment at the top what the starting URL should be!
Make sure that all students' names are in a comment at the top of the file.
This homework is based on an assignment in CS173 by Shriram Krishnamurthi at Brown U.