摘要
目前绝大多数的C++程序评测是通过对程序运行结果和标准测试用例的比对,给出非对即错的2值评判。而在虚拟实验室和慕课中,需要结合程序源码给出更全面客观的评价。针对此问题,通过建立C++源代码的抽象语法树,改进了结果相似度和程序代码相似度的计算方法,使其能够反映程序语义之间的相似度,并在此基础上建立了C++代码综合评价模型。通过实际检验,和人工批改相比较平均批改准确率达到了92.11%,并以百分制的方式给出评价结果。结合程序语义的评价,不仅对学生而言给出了更公正的评分,也为后续的虚拟实验室智能在线指导提供了基础。
Most C++ judge systems give a wrong or right binary grade, by comparing the results of programs and the standard testing cases. However, a more objective judge with considering the source code is needed in virtual labs and moocs. The method of computing the code similarity and the consequence similarity was enhanced to reflect the syntax similarity between the programming codes, by constructing an abstract syntax tree of the C++ code. Then a synthetical judge model about the C++ code was constructed. The average accuracy of this system reached 92. 11% compared with manual grading. A percent grade system replaced binary grade system that commonly adopted. A fairer mark was given because the systems not only considered the program's consequence but also considered the construction and syntax of the code. The system also provides the foundation of online intelligent guidance in virtual lab.
出处
《计算机应用》
CSCD
北大核心
2015年第A01期183-185,191,共4页
journal of Computer Applications
关键词
在线评测
抽象语法树
代码相似度
慕课
程序设计
online judge
abstract syntax tree
code similarity
Massive Open Online Course (MOOC)
programming