当前位置:主页 > 科技论文 > 软件论文 >

动静态结合的程序自动评阅技术研究及系统实现

发布时间:2018-11-13 12:59
【摘要】:在线考试系统中对于主观编程题通常采用动态评阅方式:编译并执行预先设置的测试用例,根据运行结果与用例预期输出是否一致评阅程序。动态评阅方式在程序无法编译的情况下不能给出相应的分数,这对于程序的评判是不客观的。因此,本文在对国内外程序自动评阅技术研究的基础上,通过分析教师手工评阅过程,提出了一种采用动静态结合的程序自动评阅方法。该方法从程序的“值”(动态)和“内容”(静态)两个角度评判程序,使得程序的评阅更加客观、准确和全面。动态评阅方式主要借助于相应的编译工具,检查程序有无语法错误,根据能否得到正确输出结果给出相应的得分。而静态评阅方式对程序进行分析,主要包括程序的词法分析、语法分析、语句提取和学生程序与参考程序的相似度计算。词法分析阶段使用flex工具产生了一个词法分析器。flex使用正则表达式对关键字、标识符、运算符、界符、注释等进行了识别。语法分析阶段使用bison工具产生了一个语法分析器。bison使用文法产生式描述编程语言的书写规则。本文以C语言为例,将词法分析器与语法分析器结合使用,提取了程序中词法、语法正确的语句。参考程序与学生程序相似度的计算主要分为四个部分:预处理、标准化、中间表示形式、相似度算法。在预处理过程中,删除了注释、连续换行、连续空格等与程序本质无关的部分。为了减少程序的多样化表达,使得相似度结果更为准确,提出了一些标准化规则。为了充分表达程序的语法结构,本文选取程序控制流图为中间表示形式,对控制流图采取深度优先遍历方式,并求取学生程序与参考程序遍历结果之间的最长公共子序列,从而计算出相似度,对学生程序进行静态评阅方式评分。基于以上技术设计并实现了一个在线考试系统。系统具有管理员、教师、学生3种角色,可以实现选择题、判断题、编程题的自动评阅。对于程序的评阅,实现了动静态结合的评阅方式。通过分析学生程序在手工评阅、动态评阅、动静态结合评阅方式下的得分,验证了本文提出的动静态结合的评阅方法的评分能更接近教师手工评阅得分。该方法使得程序的评阅更客观、合理,减轻了教师手工评阅的工作量,也对程序智能评阅技术研究有一定的借鉴作用。
[Abstract]:In the online examination system, the subjective programming questions are usually evaluated dynamically: compile and execute the pre-set test cases, and evaluate the program according to the result of the test and the expected output of the use case. The dynamic evaluation method can not give the corresponding score when the program can not compile, which is not objective to the evaluation of the program. Therefore, on the basis of the research on the technology of automatic evaluation of programs at home and abroad, this paper puts forward a method of automatic evaluation of programs by combining dynamic and static state with the analysis of teachers' manual evaluation process. This method judges the program from the point of view of "dynamic" (dynamic) and "content" (static), which makes the evaluation of the program more objective, accurate and comprehensive. With the help of the corresponding compiling tools, the dynamic evaluation method checks whether there are any syntax errors in the program, and gives the corresponding score according to whether the correct output results can be obtained. The static evaluation method mainly includes the lexical analysis of the program, sentence extraction and the similarity calculation between the student program and the reference program. Flex uses regular expressions to identify keywords, identifiers, operators, bounds, comments, etc. The parser phase uses the bison tool to produce a parser. Bison uses grammars to describe the writing rules of a programming language. Taking C language as an example, this paper combines the lexical analyzer with the parser to extract the correct lexical and grammatical statements in the program. The calculation of similarity between reference program and student program is divided into four parts: preprocessing, standardization, intermediate representation and similarity algorithm. In the preprocessing process, deleted comments, consecutive line breaks, continuous spaces and other parts of the program independent of the nature. In order to reduce the diversity of program expression and make the similarity result more accurate, some standardized rules are proposed. In order to fully express the grammatical structure of the program, this paper selects the program control flow graph as the intermediate representation, adopts the depth-first traversal method for the control flow diagram, and obtains the longest common subsequence between the student program and the reference program traversal result. In order to calculate the similarity, the static evaluation of the student program score. Based on the above technology, an online examination system is designed and implemented. The system has three roles: administrator, teacher and student. It can realize automatic evaluation of multiple choice questions, judgment questions and programming questions. For the program review, the implementation of the dynamic and static combination of the review mode. By analyzing the scores of students' programs in manual, dynamic, dynamic and static ways, it is verified that the evaluation method proposed in this paper can be more close to the teachers' manual evaluation scores. This method makes the evaluation of program more objective and reasonable, reduces the workload of manual evaluation of teachers, and also has a certain reference to the research of intelligent evaluation technology of program.
【学位授予单位】:四川师范大学
【学位级别】:硕士
【学位授予年份】:2017
【分类号】:TP311.52

【参考文献】

相关期刊论文 前10条

1 陈新;;基于程序控制流图源代码相似程度分析系统[J];计算机系统应用;2013年03期

2 王克朝;王甜甜;苏小红;马培军;童志祥;;面向程序理解的系统依赖图构建算法[J];哈尔滨工业大学学报;2013年01期

3 古平;张锋;周海涛;;一种程序源代码相似度度量方法[J];计算机工程;2012年06期

4 熊浩;晏海华;郭涛;黄永刚;郝永乐;李舟军;;代码相似性检测技术:研究综述[J];计算机科学;2010年08期

5 王倩;苏小红;马培军;;有语法错误的编程题自动评分方法研究——用局部语法分析和采分点匹配实现[J];计算机工程与应用;2010年17期

6 熊浩;晏海华;黄永刚;郭涛;李舟军;;一种基于BP神经网络的代码相似性检测方法[J];计算机科学;2010年03期

7 陈浩;王广南;孙建华;;一种基于图的程序行为相似性比较方法[J];计算机应用研究;2010年02期

8 梅宏;王千祥;张路;王戟;;软件分析技术进展[J];计算机学报;2009年09期

9 马培军;王甜甜;苏小红;;基于程序理解的编程题自动评分方法[J];计算机研究与发展;2009年07期

10 王甜甜;苏小红;马培军;;程序标准化转换中的指针分析算法研究[J];电子学报;2009年05期

相关博士学位论文 前1条

1 王甜甜;结构语义相似的程序识别方法研究[D];哈尔滨工业大学;2009年

相关硕士学位论文 前10条

1 任浩;基于静态分析的C程序控制流图构造方法研究[D];内蒙古师范大学;2013年

2 胡正军;程序代码相似度检测方法研究及应用[D];中南大学;2012年

3 吴艳玲;基于WEB的C语言编程题自动阅卷系统的设计与实现[D];电子科技大学;2011年

4 王伟;C冗余代码及相关缺陷检测方法研究[D];哈尔滨工业大学;2010年

5 张宏伟;基于语义理解的编程题自动评分系统的研究与实现[D];大连海事大学;2010年

6 李彦臣;基于后缀语法树的代码抄袭检测研究[D];内蒙古师范大学;2011年

7 赵彦博;基于抽象语法树的程序代码抄袭检测技术研究[D];内蒙古师范大学;2010年

8 封战胜;基于GCC抽象语法树文本的C源程序语义分析方法研究[D];哈尔滨工业大学;2009年

9 王兰;应用于C语言无纸化考试的自动阅卷系统的研究[D];吉林大学;2007年

10 程金宏;程序代码相似度度量研究[D];内蒙古师范大学;2007年



本文编号:2329175

资料下载
论文发表

本文链接:https://www.wllwen.com/kejilunwen/ruanjiangongchenglunwen/2329175.html


Copyright(c)文论论文网All Rights Reserved | 网站地图 |

版权申明:资料由用户067be***提供,本站仅收录摘要或目录,作者需要删除请E-mail邮箱bigeng88@qq.com