Skip to content

Diodos 0.9

originally, diodos would be an opensource grading system. i had already started coding it, and it was also accepted by sourceforge. some weeks after, i decided with a friend from the national programming contest to make a system, where we could practice solving older problems from the contest. it should be based on diodos. we asked for permission for the problems, and we took it. but, they asked us not to make the source freely available. since then, only i have the code.

you can create a basic one, by using your posix knowledge, c++, and php. make sure you have compilers installed properly for all languages. then, you have to upload the source file using php, and execute your grader app while informing about the source filename. Parse the file to determine the language and the problem that it’s going tosolve. sourcefile should propably have appropriate headers commented, to make it easier for you.

then, compile the sourcefile, and post any errors tou the user. if no errors, continue to testing. fork a child process, and map the image of the binary. so you have full control over the binary in case it missbehaves. use time to check for execution time, and use the built-in rlimit, to set how much ram the binary has available, in case the problem has memory limits.move the binary to each testcases’ dir go over the execution process again. use diff to check the output.

last thing is to post results back to webpage. either at the beginning post a url where all info is going to be found later, or keep posting while doing (be careful with timeouts).

that’s basically all you need to know to code a grader.. of course it’s vulnerable, but that’s the general way you should work. you can jail the binary and do much more things, but it’s up to you if you know how and if you want to.

I have attached a screenshot of the current web interface of the application.

0.9 WUI

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*