|
-
October 7th, 2008, 04:17 PM
#1
Code comparation
Hi all,
i need to find a way to compare c# codes. In other words, i will have a coding question requiring the user to write some code and solution code for the question. Then i will get input code from the user according to that question and compare these two results. For example i will have a question like : "Write some code that calculates the sum of the numbers between 1 and 10." and solution of the question will be like:
Code:
int sum=0;
for(int i=1; i<=10; i++)
{
sum+=i;
}
After i get the user input i will compare the user's answer and my solution and user will get or lose points. But i need some suggestions for solving that problem. First, i mustn't compare codes as plain text because user may provide a different answer than my solution which is correct too. For example, users may write "int count=0;" instead of "int sum=0;" and they lose points eventhough their answers are correct. So i need a better technique to manage that. Actually what i need is to make the user's answer and my solution comparable by converting the codes to something unique. Please help me about that.
Any help would be greatly appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|