View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Summer 2000 Turnin Information

To electronically turn in a lab or a project, you will need to run the script below from inside Squeak. There are five things you need to edit in the script below:

If you have only one file to submit (like ""), you can use it as MYFILE. If you have multiple files (like "lab2.txt" and ""), then you should zip them up:
and use the zip filename as MYFILE.

The TA and Student Grading Page for Summer 2000 page tells you which TA is yours. You need to know who your TA is so you can fill in their email address in the script below. (Email addresses for TAs are on the Admin Pages.)

When you run the script, it will send your submission to your TA. It will also send a copy to the cs2340@cc account. That account should bounce a copy of your mail back to your prism mailbox–this way you can get confirmation that the script "worked" simply by seeing if you receive a copy of your submission in your mailbox. (It should take at most a minute or two before you should get your confirmation mail.)

Cut and paste the text below into a squeak workspace:

| message fileName studentEmail tAEmail 
  connectedSMTP projectName studentName fileStream |

"Variables that you need to set"
"Filename to be sent. If you have multiple files,
 please pkzip or tar-gzip"
fileName _ 'MYFILE'.

"Enter your prism e-mail address"
studentEmail _ ''.

"Enter your name as it appears on the roles."
studentName _ 'FIRST LAST'.

"Enter your TA's e-mail"
tAEmail _ ''.

"Enter the project name. This will be either 
 p<num> or l<num> where <num> is some number"
projectName _ 'PROJECT'.

"You can ignore the rest of this"
"Get the file and Mime encode it"
fileStream _ StandardFileStream oldFileNamed: fileName.
fileStream binary.
message _ Base64MimeConverter mimeEncode: ((MIMEDocument content:
(fileStream contentsOfEntireFile)) contentStream).

"Create the header"
header _ 'To: ', tAEmail, String cr,
  'CC:', String cr,
  'Subject: cs234x/', projectName, '/', studentName, String cr,
  'Mime-Version: 1.0', String cr,
  'Content-type: APPLICATION/OCTET-STREAM; charset=US-ASCII; name="',
  fileName, '"', String cr,
  'Content-Transfer-Encoding: BASE64', String cr,
  'Content-Description: ', studentName, ' submission for',
  projectName, String cr,
  'Content-Disposition: attachment; filename="', 
  fileName,'"', String cr, String cr.

"Connect to the SMTP server and send it off to the TA
 and cs2340 account"
"If you are sending from off campus you may need to 
 change this smtp server"
connectedSMTP _ SMTPSocket usingServer: ''.
connectedSMTP mailFrom: studentEmail.
connectedSMTP recipient: tAEmail.
connectedSMTP recipient: ''.
connectedSMTP data: (header, (message contents)).

"Tell them it's ok"
(PopUpMenu labels: 'ok') startUpWithCaption: 'Files Transmitted'.

That's it!

Links to this Page