0

Hello,

Am new here but I will appreciate if I can get an answer.

I am to build a miniature automatic feedback for programming assignment system in PHP as a final year project.

This system will take a programming assignment in C either through a web form or a text file and check for errors. It will then notify the uploader of the program of the errors and possible corrections expected. It isn't necessarily going to be a grading system.

I just want to know how to start with this. Anyone who has any idea what I can do to acheive my objective should please help out.

Thanks.

5
Contributors
13
Replies
41
Views
3 Years
Discussion Span
Last Post by SalmiSoft
Featured Replies
0

If you run the source code through a compiler you can gather the compiler output and parse it to find the errors reported by the compiler. Then analyse the error list and suggest causes and/or fixes. For common things like undeclared or mis-spelt variables, missing include files and so on, it would be possible to provide guidance for novice level students. To provide anything useful for more advanced students would be much harder.
Is that the sort of thing you are considering?

Edited by SalmiSoft: spelling/typo

0

@Salmisoft, how then can i add a compiler tothe web project? I'm thinking of minimising the project to do just common things like undeclared or mis-spelt variables, missing include files and so on, since anything more than that is far higher than my strength.

0

I am getting away from my area of expertise by answering this, so I hope someone with more knowledge can comment. In essence it should be simple though. Use a compiler that you can run from the command line, passing in the name of a source code file. Then all you have to do is write the user's source code to a temporary file and start the compiler with the name of that temp file as a command line parameter. I don't know PHP but I think you need an Exec or System command to start the compiler.
Redirect the compiler to a text file. Then you can open that file, read it, and find the error messages.

In this sense the compiler is not really added to the web project, merely launched from your code.

0

Thanks all. I finally got an approval today from my supervisor to develop just the framework and she will program the solution herself. Thanks once again.

0

Hmm...I just mailed my hosting provider and they said they can't provide such (compiling on their servers) using a shared hosting... I think I'll just develop d framework and leave the implementation to my lecturer

0

I think I'll just develop d framework

No offence but writing your own c compiler is no easy task... If this is just purely academic, you might get away with a very stripped down ad hoc compiler.

It might not necessarily be a bad thing. It wouldn't be much of a project otherwise.

0

Just to add more info., here is a good example of a PHP script that can compile C .

I prefer using the exec("your_compiler_command_here 2>&1", $res, $err);

$res and $error are the text file error log.

That's all I can tell you. I am pretty rusty with C. The last time I played with it was, when I was trying to write a game about two characters throwing bananas at each other.

0

@iamthwee: I don't think anyone would write a compiler just for this. Better to run an existing compiler and capture the error messages. It could still be a good project if it explained the error messages in terms a novice programmer could understand, and provided good guidance about how to fix the problems.

0

That's a really good example to use as a starting point. A project that tailored those explanations to the actual code compiled, guided the user to the code that produced the error, highlighted the problem in the actual code, and suggested how the code could be corrected, should be a great help to novice programmers.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.