Creating an online judge from scratch

后端 未结 4 828
梦如初夏
梦如初夏 2021-01-31 00:15

I\'ve participated in a few online programming contests and found the online judges used quite remarkable in functionality.

Coming to the point of the topic, my college

4条回答
  •  独厮守ぢ
    2021-01-31 00:56

    I am not sure what an online judge is, but I assume it is a piece of software to evaluate programs for correctness.

    I would use some build, test and analysis libraries for this. Examples would be Ant, JUnit, and Checkstyle.

    You would take the code provided by the participant, and drop it into a file. Use the build tool to compile it.

    • build fails: 0 points
    • build succeeds with warnings 1 point
    • build succeeds without warnings 2 points

    Then run some tests, that verify the correctness of the solution.

    • For each test passed: 1 point

    Finally run some code analysis utility to judge the quality of the code.

    • minus 1 point for each complaint of the utility

    Of course you might want to shift the point values to your needs.

提交回复
热议问题