Re: I want to compare two AppleWorks files
Re: I want to compare two AppleWorks files
- Subject: Re: I want to compare two AppleWorks files
- From: T&B <email@hidden>
- Date: Tue, 23 Jan 2001 14:43:20 +1100
I teach a class on AppleWorks and my students have assignments from a book
to which I have "answers" in the form of actual computer files.
The most logical way to do this is with an AppleWorks database document. For instance, there are 10 records, one for each question/answer combo. Fields would include question number, question text and answer. You can discuss this more on the AppleWorks discussion forums at:
http://www.tandb.com.au/appleworks/links/
What I would LOVE to do is have the students submit their completed work
via email, with a particular file naming scheme
Eodora can certainly handle checking email and extracting attachments.
and then have a folder script
If you mean Folder Action Script, I think that is unnecessary. Whatever script you end up with that pulls the attachment out of the email should also initiate the next step. It's silly to rely on a folder action script that requires that the folder be open etc.
which compares the students' file against the master
You can write a script to compare two AppleWorks databases. In fact, there is already one at:
http://www.tandb.com.au/appleworks/compare_db/
The current version 1.2 of that script is for AppleWorks 6 only, but I am working on an AppleWorks 5 compatible version.
The basic AppleWorks syntax for your specific need (untested) is something like:
set marks to {}
tell application "AppleWorks 6"
set correctDB to reference to database of document "Correct"
set studentDB to reference to database of first document whose name is not "Correct"
set questionNs to value of field "question number" in every record in correctDB
repeat with questionN in questionNs
try
set studentAnswer to value of field "answer" in first record in studentDB whose value of field "question number" is questionN
on error
set studentAnswer to "Question deleted"
end error
set correctAnswer to value of field "answer" in first record in correctDB whose value of field "question number" is questionN
if studentAnswer is correctAnswer then
set mark to "Correct"
else
set mark to "Incorrect"
end if
set end of marks to {{questionN,mark}}
end repeat
end tell
You then need to parse the marks list into an email or whatever
Is this possible? I think so, but I'm still learning just what AppleScript
is capable of.
You can learn AppleScript, along with examples in AppleWorks, at:
http://www.tandb.com.au/applescript/tutorial/
If you have any follow up questions, please post back to this forum or one of the AppleWorks forums, not directly to me.
Thanks,
Tom
T&B