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

Spring 2001 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 Spr2001: Which TA Grades Which Group Assignments 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 gt number (gt####x) without the"
studentGTNum _ 'MYGTNUM'.

"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"
studentEmail _   studentGTNum, ''.

"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, ' - ', studentGTNum, ' - ', 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'

Links to this Page