采用语法分析和编辑距离的SQL脚本评阅方法
The Automatic Marking Method of SQL Script Based on Syntax Analysis and Levenshtein Distance

作者: 刘 霞 , 陶 莉 , 周余洪 , 马可辛 , 刘晓强 :东华大学,上海;

关键词: SQL语句自动阅卷词法分析语法分析字符串编辑距离 SQL Sentence Automatic Marking Lexical Analysis Syntax Analysis Levenshtein Distance

摘要: 针对数据库测试中SQL脚本类题目,提出基于语法分析和字符串编辑距离相结合的自动阅卷算法。该算法首先对答案进行词法分析和语法分析,获得SQL语句的语法分析树,并基于字符串编辑距离从标准答案集中选择最匹配的标准答案,以及对语法树的节点进行相似度比较,并根据评分标准,实现题目的自动评阅。阅卷系统采用开源语法分析器——ANTLR3.4VS2010实现自动评阅。该自动阅卷算法得到参考评分,同时可以指出错误点,并且更好地支持答案的多样性和容错性,实现高效率、较精确的阅卷结果。

Abstract: An automatic marking algorithm based on syntax analysis and string Levenshtein distance for SQL script in database tests was proposed. Firstly, through the lexical analysis and syntax analysis for student’s answer, the syntax analysis tree is obtained. Secondly, the most matched standard answer is chosen from the standard answers set by comparing the string edit distance between the student’s answer and the standard answers. Thirdly, by comparing the similarity of all the corresponding nodes of the two syntax analysis tree, the mark is achieved based on the score value of the standard answer. The marking system is implemented using open source parserANTLR3.4 and VS2010. This automatic marking method not only can give reference scores, but also point out the error position. Furthermore, it supports efficient and accurate marking for multi-answers with fault tolerance.

文章引用: 刘 霞 , 陶 莉 , 周余洪 , 马可辛 , 刘晓强 (2014) 采用语法分析和编辑距离的SQL脚本评阅方法。 软件工程与应用, 3, 9-14. doi: 10.12677/SEA.2014.31002

参考文献

[1] 柏雪 (2013) 主观题自动阅卷系统的研究与设计. 硕士论文, 西南交通大学教育技术学, 成都.

[2] Burstein, J., Chodomw, M. and Leaeoek, C. (2004) Automatic essay evaluation: The criterion online writing service. AI Magazine, 25, 27-36.

[3] Flesca, S., Masciari, E., et al. (2005) Fast detection of XML structural similarity. IEEE Transactions on Knowledge and Data Engineering, 17, 160-175.

[4] 由东友 (2012) SQL Server考核自动阅卷系统设计与实现. 硕士论文, 吉林大学, 长春.

[5] 陈尧妃, 陈焕通 (2009) SQL Server数据库技能测评方案的设计与实现. 计算机应用与软件, 11, 147-149.

[6] 孙鸿伟 (2011) 基于相似度计算的编程题自动评判方法研究. 硕士论文, 哈尔滨工程大学, 哈尔滨.

[7] 周汉平 (2011) Levenshtein距离在编程题自动评阅中的应用研究. 计算机应用与软件, 5, 328-331.

[8] 杨巍巍 (2013) 单向贴近度匹配法在主观题自动阅卷中的应用. 数字技术与应用, 4, 77-78.

[9] 潘旭, 康慕宁 (2011) 基于ANTLR的试卷识别和导入系统的研究. 电子设计工程, 7, 45-49.

分享
Top