A cgi Strategy

48
A cgi Strategy David W. Brooks [email protected] du http://

description

A cgi Strategy. David W. Brooks [email protected] 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. - PowerPoint PPT Presentation

Transcript of A cgi Strategy

Page 1: A cgi Strategy

A cgi Strategy

David W. [email protected]

http://dwb.unl.edu

Page 2: A cgi Strategy

• Pre-history

• Overview of tasks

• HyperCard Model

• RunRev I

• RunRev II

• Current

Page 3: A cgi Strategy

Tools

• Videodisc Drivers

• AP Chemistry

• Graduate Advisor

• NSF Proposals

• Courses (Web only)

Page 4: A cgi Strategy

13 Videodisc Sides

Redox

Page 5: A cgi Strategy

AP Chemistry

Page 6: A cgi Strategy

Graduate Advisor

Page 7: A cgi Strategy

NSF Proposals

All forms including budgets with computation and built-in rules.

Page 8: A cgi Strategy

Courses

Page 9: A cgi Strategy

Courses had full administration [“add” students; take quiz items; complete and submit essays; see progress].

Everything on-line except for grades.

Bread & butter.

Page 10: A cgi Strategy

HyperCard Model

Page 11: A cgi Strategy

• Works exceptionally well

• Overnight restart

• Backup

• Data storage work arounds

Page 12: A cgi Strategy

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.

Page 13: A cgi Strategy

Two servers• dwb.unl.edu (OS 9)

• chemmovies.unl.edu (OS X)

~ 15 gbytes/month each

Bottom of the line iMacs

Page 14: A cgi Strategy

The Servers

Will be replaced with xserves shortly after my return

Page 15: A cgi Strategy

Days are Numbered

Choices:

• retire

• find a new delivery option

Page 16: A cgi Strategy

LifeChanging

Event

Shafer book (earlier)RunRev Workshop

[met Rinaldi and felt it to be an almost religious experience -- like meeting a saint]

Page 17: A cgi Strategy

Jacque Landman Gay session on cgi

No practice; thought would be just like HC. Went home really hyped.

(2% never get the word.)

Page 18: A cgi Strategy

RunRev Approach IBy 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.

Page 19: A cgi Strategy

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.

Page 20: A cgi Strategy

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.

Page 21: A cgi Strategy

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.

Page 22: A cgi Strategy

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

Page 23: A cgi Strategy

RunRev Approach II

Use a RunRev cgi script

Store data in xml-like files

That’s where I am today.

Page 24: A cgi Strategy

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.

Page 25: A cgi Strategy

Fake xml

Line 1 lists all elements

Line 2 defines file

Line 3 and last line identify encompassing element

Other lines are elements, data.

Page 26: A cgi Strategy
Page 27: A cgi Strategy

put ExtractXMLRecord(quizItemRecordPath) into

quizItemRecord

Page 28: A cgi Strategy

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 "</"&currentKey&">" into currentCloseTag get offset(currentCloseTag,xxx) put quote&(word x of recordKeys)&quote 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 recordNameend extractXMLRecord

Page 29: A cgi Strategy

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.

Page 30: A cgi Strategy

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&currentKey&quote into label put "<"&currentKey&">"&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&"</"&currentKey&">"&LF after yyy end repeat put "</"&mainTag&">" after yyy put yyy into URL("file:"&recordPath)end rebuildXMLRecord

Page 31: A cgi Strategy

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.

Page 32: A cgi Strategy

By having systematic naming, the files can be Web-edited using generic tools.

Page 33: A cgi Strategy

Hidden Fields

Key info is place in hidden fields.

Page 34: A cgi Strategy

Courses

Page 35: A cgi Strategy

CalculatedTopic List

Blue indicatesquestion

Page 36: A cgi Strategy

Content

Buttons atbottom accessassessment.

Green linksmean contenton UNLServer.

Page 37: A cgi Strategy

Item

Page 38: A cgi Strategy

Assessment

Page 39: A cgi Strategy

Assessment

Page 40: A cgi Strategy

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.

Page 41: A cgi Strategy

Performance

Page 42: A cgi Strategy

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.

Page 43: A cgi Strategy

Favorites

Page 44: A cgi Strategy
Page 45: A cgi Strategy
Page 46: A cgi Strategy

Problems

Having trouble with automatic e-mailing. Hopefully some variation or extension of a solution provided by André Garzia will start working.

Page 47: A cgi Strategy

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 HC ROBO-Writer.

Page 48: A cgi Strategy

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!