Delphi Automated Marking Program

Status
Not open for further replies.
I am trying to write an automated marking program in Delphi. It should work by polling a mailbox (POP3) every few minutes (seconds during a practice contest), test the program for correctness, allowing it only 2 seconds to execute and email results (SMTP) back to the sender.

Here is the breakdown so far:
Polling:
- retrieve messages from the mailbox constantly
- save all of the attachments
- create a new checking thread if mail exists

Marking:
- compile the program (c++, java, pascal, turing), and check for success
- run the program on a test case, kill it if it takes too long
- check the output against another file
- send an email back to the sender

The email stuff is where I am really having trouble, does Delphi have any VCL stuff to take care of this (I've looked through the help and come up with nothing)? What other ways can I do this?

Do the compilers send out exit codes? How do I check these from Delphi?

How can I terminate a process after it has run for a certain time?

Any other suggestions about improving this are also appreciated.
 
Can I get the address so I can send my program to hack root ? :)

Getting return code:
http://groups.google.com/groups?hl=en&selm=38788626.7ED9A089%40gmx.net

Delphi has an SMTP component built in, the one on the FastNet tab. But I've always used NT's CDO.

You could use the TerminateProcess api call if an app's been going too long. TerminateProcess is certainly frowned upon, but you have bigger concerns, like people sending the code for a big fat trojan or virus or pamela anderson pictures.

Be sure to consult google groups for all your Delphi questions, prepending searches with:
author:100113.1101@compuXXserve.com
That's Peter Below, the nice helpful delphi loving gentleman.
 
Fortunately this is only going to be used by the programming group at a highschool and I know all the people there so there shouldn't be any crazy hacking going on. I haven't created the email account yet so there's nothing for you to root at the moment :p. The termination is only used to make sure algorithms finish in the specified runtime.

I think I can deal with this Fastnet stuff (I'm still a bit new to the Delphi VCL), although I don't know why it didn't show up in my help file searches.

Thanks for all the useful stuff.

Edit: missed a period.
 
Status
Not open for further replies.