490 likes | 560 Views
A cgi Strategy. David W. Brooks dbrooks1@unl.edu http://dwb.unl.edu. Pre-history Overview of tasks HyperCard Model RunRev I RunRev II Current. Tools. Videodisc Drivers AP Chemistry Graduate Advisor NSF Proposals Courses (Web only). 13 Videodisc Sides. Redox. AP Chemistry.
E N D
A cgi Strategy David W. Brooksdbrooks1@unl.edu http://dwb.unl.edu
Pre-history • Overview of tasks • HyperCard Model • RunRev I • RunRev II • Current
Tools • Videodisc Drivers • AP Chemistry • Graduate Advisor • NSF Proposals • Courses (Web only)
13 Videodisc Sides Redox
NSF Proposals All forms including budgets with computation and built-in rules.
Courses had full administration [“add” students; take quiz items; complete and submit essays; see progress]. Everything on-line except for grades. Bread & butter.
Works exceptionally well • Overnight restart • Backup • Data storage work arounds
For example, 30K limit on return size but no (important) limit on file/script size. So, when large amount of data to return (i.e., > 30 K), write html to a file and then upload the written file. Use multiple storage fields. Store scripts in buttons or other objects.
Two servers • dwb.unl.edu (OS 9) • chemmovies.unl.edu (OS X) ~ 15 gbytes/month each Bottom of the line iMacs
The Servers Will be replaced with xserves shortly after my return
Days are Numbered Choices: • retire • find a new delivery option
LifeChanging Event Shafer book (earlier) RunRev Workshop [met Rinaldi and felt it to be an almost religious experience -- like meeting a saint]
Jacque Landman Gay session on cgi No practice; thought would be just like HC. Went home really hyped. (2% never get the word.)
RunRev Approach I By mid-March I had figured out that I couldn’t write to a field, and that appleEvents were a problem with Apache. Discovered acgi Dispatcher Had stacks going just as in HC and was well on my way to implementing a 1-for-1 conversion of RunRev replacing HC. Had done LOTS of testing.
In September, disaster struck. I had software not mentioned running my theory course. Students submitted essays. I still have better evaluation tools than, say, BlackBoard. Things went haywire. Bottom line: acgi Dispatcher has a 211 byte limit (2048). I really need 215.
Ended up getting Randy Sargent (who programs robots for Martian landings among other things) to write a script that would allow enough input. Worked, but was kind of nasty. I showed up at RevCon West 2005 with one course stack working -- doing everything! I was anticipating going back to Lincoln to convert all of our courseware and other materials to what amounts to a HC upgrade.
Got some advice -- but I don’t remember from whom about making a change to use sockets. But then I heard a talk from Jerry Daniels [an unreconstructed hippie from Austin] about using xml-like files. His comments made a hugeamount of sense. I had seenhim show very impressivetools in 1/04, too. His “Inspect”stack tool is fantastic.
I decided to reconsider my entire strategy. I had considered mySQL. I had sat in on two courses in the Spring of 2005 (Steckelberg, Reichenbach). The notion of creating xml-like files had a great deal of appeal. Jerry convinced me it would be fast enough. In June 2005, I began looking at a new approach
RunRev Approach II Use a RunRev cgi scriptStore data in xml-like files That’s where I am today.
The xml-tools in the Darwin engine used in Mac OS didn’t seem to work for me. I bought the 3rd party tools from Sons of Thunder (Ken Ray) but it didn’t seem to do what I wanted. I reverted to kind.
Fake xml Line 1 lists all elements Line 2 defines file Line 3 and last line identify encompassing element Other lines are elements, data.
put ExtractXMLRecord(quizItemRecordPath) into quizItemRecord
function extractXMLRecord recordPath put URL("file:"&recordPath) into xxx replace numtochar(13) with linefeed in xxx put line 1 of xxx into recordKeys put recordKeys into recordName["theKeys"] delete line 1 to 4 of xxx repeat with x = 1 to the number of words of recordKeys put word x of recordKeys into currentKey put "</"¤tKey&">" into currentCloseTag get offset(currentCloseTag,xxx) put quote&(word x of recordKeys)"e into label put char 1 to (it-1) of xxx into recordName[value(label)] delete char 1 to it of xxx delete line 1 to 2 of xxx end repeat return recordName end extractXMLRecord
The net result of this is that all of the data is taken from elements and placed into an array in which it can be manipulated. Any changes can be recorded.
on rebuildXMLRecord recordName, mainTag, recordPath put recordName["theKeys"] into keysList put keysList&LF into yyy put "<?xml version='1.0' ?>"&LF after yyy put "<"&mainTag&">"&LF after yyy repeat with y = 1 to the number of words of keysList put word y of keysList into currentKey put quote¤tKey"e into label put "<"¤tKey&">"&LF&recordName[value(label)] after yyy repeat while ((last char of yyy = LF) or (last Char of yyy = return)) delete last char of yyy end repeat put LF&"</"¤tKey&">"&LF after yyy end repeat put "</"&mainTag&">" after yyy put yyy into URL("file:"&recordPath) end rebuildXMLRecord
Systematic Element NamingFirst Character “L”; data normally would be edited from a single line text-entry field in a WebForm “F”; data normally would be edited from a textarea entry field in a WebForm “A”; some kind of data list (with structure) “C”; data calculated or extracted and maybe should not be editable.
By having systematic naming, the files can be Web-edited using generic tools.
Hidden Fields Key info is place in hidden fields.
CalculatedTopic List Blue indicatesquestion
Content Buttons atbottom accessassessment. Green linksmean contenton UNL Server.
Time Stamp Used to prevent resubmitting answer. Since the feedback is immediate, prevents using back button, changing answer, and submitting for regrade. These are recorded in the question file.
Times vary from 5 milliseconds (tool script of some sort) to ~1,000 mseconds. Typical transactions take less 100 mseconds (on an iMac like the one running dwb.unl.edu). So far, performance has not been a problem. Also, there are several ways to think about improving performance.
Problems Having trouble with automatic e-mailing. Hopefully some variation or extension of a solution provided by André Garzia will start working.
Issues When to use a Web cgi and when to use a Web appliance. Used to have 30-40 stacks for teaching HC. Devin Asay has developed similar stacks for RunRev. We have made these into a Web appliance; should be available soon. We may start a writing project for grades 1-3 kids wih writing difficulties based upon earlier HCROBO-Writer.
Thanks Thanks for giving me the opportunity to describe our work. I’ll try to entertain questions, and will be very pleased to receive any suggestions you my have. Go Rev!