Computer program answering and scoring system, method, device and storage medium

By designing a computer program answering and scoring system, using multiple modules to automatically scoring the computer program answering, solving the problem of time-consuming and labor-consuming manual scoring, and improving scoring efficiency and accuracy.

CN111914541BActive Publication Date: 2025-02-11BEEHIVE ONLINE (GUANGZHOU) EDUCATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010632290.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-02
Publication Date
2025-02-11
Estimated Expiration
2040-07-02

AI Technical Summary

Technical Problem

The existing technology is difficult to efficiently score computer programs to answer questions, resulting in the use of a lot of manpower and time, affecting the implementation of large-scale computer programming exams and education.

Method used

A computer program answering and scoring system is designed, including a word grammar checking module, an input and output comparison module, a test case testing module and a static program comparison module. Through the scoring of these modules, the total score of computer program answering questions is automatically calculated.

Benefits of technology

It realizes automatic scoring of computer program answers, reduces the scoring burden of teachers, improves the accuracy and efficiency of scoring, and saves the scores as electronic documents, which facilitates long-term preservation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111914541B_ABST
    Figure CN111914541B_ABST
Patent Text Reader

Abstract

The present invention discloses a computer program answer scoring system, method, device and storage medium. The computer program answer scoring system includes a lexical grammar checking module, an input-output comparison module, a test case test module and a static program comparison module. Each module is used to determine a first score, a second score, a third score and a fourth score according to the computer program answer, so as to determine the total score of the computer program answer. The present invention can submit computer program answers online, realize automatic scoring of computer program answers, reduce the tedious and repetitive workload caused by marking and grading, improve the accuracy of correcting and grading computer program answers in homework or examinations, and easily save the scores as electronic documents, which is conducive to long-term preservation of scores; by evaluating computer program answers from multiple angles such as lexical grammar errors, the total score obtained has good comprehensiveness. The present invention is widely used in the field of computer technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a computer program question answering and scoring system, method, device and storage medium. Background Art

[0002] With the popularization of computers, educational institutions such as schools and training institutions are increasingly offering computer programming courses, which has created a demand for computer programming ability examinations and assessments. Computer program questions are a type of question in computer programming exams or classroom assignments or experimental tasks, which require candidates to write computer programs based on the questions, that is, submit computer program answers, and the examiners read the computer programs and score them according to the scoring rules. Since computer program answers are generally presented in a special computer language, their readability is worse than natural language, and are affected by the candidate's personal programming style, even if the computer program answers are written in the same computer language and contain the same content, the content displayed may be completely different. Therefore, manual scoring of computer program answers will take up a lot of manpower and time, which is not conducive to large-scale computer programming exams, and thus not conducive to large-scale computer programming education. Summary of the invention

[0003] In response to at least one of the above technical problems, an object of the present invention is to provide a computer program question-answering and scoring system, method, device and storage medium.

[0004] In one aspect, an embodiment of the present invention includes a computer program question-answering and scoring system, comprising at least one of the following:

[0005] A lexical and grammatical checking module, configured to perform a lexical and grammatical check on the computer program answer, and determine a first score according to lexical and grammatical errors existing in the computer program answer and locations of the lexical and grammatical errors;

[0006] An input-output comparison module, configured to input standard input data into the computer program to answer the question, compare the standard output data with the output of the computer program to answer the question, and determine a second score based on the comparison result;

[0007] A test case testing module, configured to generate a test case and enable the computer program to answer questions and execute the test case, and determine a third score according to the execution result;

[0008] A static program comparison module, used for performing keyword similarity comparison and syntax tree similarity comparison on the computer program answer, and determining a fourth score according to the comparison result;

[0009] The first score, the second score, the third score and / or the fourth score are used to determine the total score of the computer program answering question.

[0010] Furthermore, the first score, the second score, the third score and the fourth score are all deduction points of the initial score of the computer program answering the question.

[0011] Furthermore, the determining of the first score according to the lexical and grammatical errors existing in the answer of the computer program and the locations of the lexical and grammatical errors includes:

[0012] When there are lexical and grammatical errors in the computer program answer, determine the value of the first score or the proportion of the first score according to the type, number and location of the lexical and grammatical errors, and send the initial score after deducting the first score to the static program comparison module;

[0013] When there are no lexical or grammatical errors in the computer program answer, the initial score is sent to the input-output comparison module.

[0014] Further, determining the second score according to the comparison result includes:

[0015] When the comparison result is that the output of the computer program answering the question does not match the standard output data, determine the value of the second score or the ratio of the second score according to the type, quantity and location of the non-matching parts of the output of the computer program answering the question and the standard output data, and send the initial score after deducting the second score to the static program comparison module;

[0016] When the comparison result is that the output of the computer program answering the question matches the standard output data, the initial score is sent to the test case testing module.

[0017] Further, determining the third score according to the execution result includes:

[0018] When the input and output results of the plurality of test cases do not match, determining the value of the third score or the ratio of the third score according to the type, quantity and location of the mismatched parts between the input and output results of each test case, and sending the initial score after deducting the third score to the static program comparison module;

[0019] When the input and output results of the multiple test cases match, the initial score is returned as the total score.

[0020] Further, determining a fourth score according to the comparison result includes:

[0021] When the comparison result is that there are similar keywords or similar syntax trees between at least two of the computer program answers, the value of the fourth score or the ratio of the fourth score is determined according to the type, quantity and location of the similar keywords or similar syntax trees, and the score sent by the input-output comparison module, the test case test module or the static program comparison module is deducted from the fourth score and returned as the total score;

[0022] When the comparison result is that there are no similar keywords or similar syntax trees between any of the computer program answers, the initial score is returned as the total score.

[0023] On the other hand, an embodiment of the present invention also includes a computer program question answering and scoring method, comprising the following steps:

[0024] Performing a lexical and grammatical check on the answer to the computer program question, and determining a first score according to lexical and grammatical errors present in the answer to the computer program question and locations of the lexical and grammatical errors;

[0025] inputting standard input data into the computer program to answer the question, comparing the standard output data with the output of the computer program to answer the question, and determining a second score based on the comparison result;

[0026] generating a test case and causing the computer program to answer questions and execute the test case, and determining a third score according to the execution result;

[0027] Performing keyword similarity comparison and syntax tree similarity comparison on the answers to the computer program question, and determining a fourth score according to the comparison results;

[0028] The first score, the second score, the third score and / or the fourth score are used to determine the total score of the computer program answering question.

[0029] Furthermore, the first score, the second score, the third score and the fourth score are all deduction points of the initial score of the computer program answering the question.

[0030] On the other hand, an embodiment of the present invention further includes a computer device, including a memory and a processor, wherein the memory is used to store at least one program, and the processor is used to load the at least one program to execute the method described in the embodiment.

[0031] On the other hand, an embodiment of the present invention further includes a storage medium storing processor-executable instructions, wherein the processor-executable instructions are used to execute the method described in the embodiment when executed by the processor.

[0032] The beneficial effects of the present invention are as follows: the computer program answering and grading system in the embodiment of the present invention can submit computer program answers online, realize automatic grading of computer program answers, reduce the tedious and repetitive workload brought by marking and grading, and liberate the labor of teachers; it can improve the accuracy of grading computer program answers in homework or examinations, and easily save the scores as electronic documents, which is conducive to long-term preservation of scores; specifically, the lexical and grammatical checking module, the input and output comparison module, the test case testing module and the static program comparison module respectively evaluate the computer program answers from the perspectives of lexical and grammatical errors, program standardization degree, program execution correctness and static program accuracy, and the final output total score at least comprehensively considers the influence of the above two perspectives, and the obtained total score has good comprehensiveness. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A schematic diagram of the content presented by the examinee terminal in an embodiment of the present invention;

[0034] Figure 2 A schematic diagram of the structure of a computer program question answering and scoring system in an embodiment of the present invention;

[0035] Figure 3 A schematic diagram of the contents presented by the examination paper terminal in an embodiment of the present invention;

[0036] Figure 4 The figure is a flow chart of a method for scoring computer program questions in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.

[0038] Example 1

[0039] In this embodiment, the computer program answering and scoring system can be a series of computer codes with corresponding functions that have been executed, or a computer system that is running such computer codes. It can be divided into a candidate end, a background, and a marking end. The content presented on the candidate end can be as follows: Figure 1 As shown, the examinee reads the question displayed in the question display area, enters the computer code, i.e., the computer program answer in the code input area, and then clicks the submit button, and the computer program answer is uploaded to the backend.

[0040] In the embodiments of the present invention, referring to Figure 2,The background of the computer program answering and scoring system includes a lexical and grammar checking module, an input and output comparison module, a test case testing module, a static program comparison module and an output module.

[0041] In an embodiment of the present invention, the lexical grammar checking module, the input-output comparison module, the test case test module, and the static program comparison module use a deduction system to score the computer program answer. For example, for the computer program answer submitted to the background, its initial score can be set to 100 points, and then the first score obtained by the lexical grammar checking module, the second score obtained by the input-output comparison module, the third score obtained by the test case test module, and the fourth score obtained by the static program comparison module are used as the deduction points of the initial score of the computer program answer, that is, after deducting the first score, the second score, the third score, and the fourth score from the initial score, the total score of the computer program answer is obtained.

[0042] In the embodiments of the present invention, referring to Figure 2 , the lexical and grammatical checking module performs lexical and grammatical checking on the computer program answers submitted to the background. If the lexical and grammatical checking module detects lexical and grammatical errors from the computer program answers, then the type and quantity of lexical and grammatical errors in the computer program answers, as well as the location of each lexical and grammatical error (for example, in which line of the code), find the pre-set weight of each type of lexical and grammatical error, multiply the weight of its location, determine the deduction corresponding to each lexical and grammatical error, add up the deductions corresponding to all lexical and grammatical errors, obtain the first score itself or the proportion of the first score to the initial score, then deduct the first score from the initial score, and send the computer program answers and the score remaining after deducting the first score from the initial score to the static program comparison module. If the lexical and grammatical checking module does not detect lexical and grammatical errors from the computer program answers, then the lexical and grammatical checking module does not deduct points from the initial score, that is, the initial score is still 100 points, and the lexical and grammatical checking module sends the computer program answers and the initial score to the input-output comparison module.

[0043] In the embodiments of the present invention, referring to Figure 2, the input-output comparison module performs input-output comparison on the computer program answer sent by the lexical and grammatical checking module, that is, the input-output comparison module inputs the standard input data into the computer program obtained by running the computer program answer, and compares the standard output data with the output of the computer program obtained by running the computer program answer. If the input-output comparison module finds that the output of the program obtained by running the computer program answer does not match the standard output data, then the type and quantity of the non-matching parts of the output of the computer program answer and the standard output data, and the location of each non-matching part (for example, in which line of the standard output data), find the weight of the standard output data corresponding to each non-matching part set in advance, multiply it by the weight of its location, determine the deduction corresponding to each non-matching part, add up the deductions corresponding to all lexical and grammatical errors, obtain the second score itself or the proportion of the second score to the initial score, then deduct the second score from the initial score, and send the computer program answer and the score remaining after deducting the second score from the initial score to the static program comparison module. When the comparison result is that the output of the computer program answer matches the standard output data, the initial score is sent to the test case test module. If the input-output comparison module does not detect any mismatch between the output of the program obtained by running the computer program and the standard output data, the input-output comparison module will not deduct points from the initial score, that is, the initial score remains 100 points, and the input-output comparison module sends the computer program answer and the initial score to the test case test module.

[0044] In the embodiments of the present invention, referring to Figure 2 , the test case test module generates multiple test cases, and executes each test case using the computer program answer sent by the input and output comparison module. If the test case test module detects that the input and output results of not all test cases match, that is, the input and output results of at least two test cases do not match, the test case test module identifies the type, quantity and location (for example, the row of the input and output results) of the mismatched parts between the input and output results of each test case, finds the pre-set weight of each type of mismatched part, multiplies the weight of its location, determines the deduction corresponding to each mismatched part, adds up the deductions corresponding to all mismatched parts, obtains the third score itself or the proportion of the third score to the initial score, and sends the computer program answer and the score remaining after deducting the third score from the initial score to the static program comparison module. If the test case test module detects that the input and output results of all test cases match, then the test case test module does not deduct the initial score, that is, the initial score is still 100 points, and the test case test module sends the initial score as the total score to the output module, and the total score output by the output module is the initial score of 100 points.

[0045] Reference Figure 2 The static program comparison module may receive the computer program answers sent by the lexical and grammar checking module, as well as the remaining score after deducting the first score from the initial score; the static program comparison module may also receive the computer program answers sent by the input-output comparison module, as well as the remaining score after deducting the second score from the initial score; the static program comparison module may also receive the computer program answers sent by the test case testing module, as well as the remaining score after deducting the third score from the initial score. For the received computer program answers and the score remaining after deducting the first score, the second score or the third score from the initial score, the static program comparison module performs the following processing: performing keyword similarity comparison and syntax tree similarity comparison on the computer program answers. If similar keywords or similar syntax trees are found between at least two computer program answers, the static program comparison module identifies the type, quantity and location of the similar keywords or similar syntax trees, finds the pre-set weight corresponding to each similar keyword or similar syntax tree, multiplies the weight of its location, determines the deduction corresponding to each similar keyword or similar syntax tree, adds up the deductions corresponding to all similar keywords or similar syntax trees, obtains the fourth score itself, or the proportion of the fourth score to the score remaining after deducting the first score, the second score or the third score from the initial score, and then deducts the fourth score from the score remaining after deducting the first score, the second score or the third score from the initial score, thereby obtaining the total score; for example, if the static program comparison module receives the score remaining after deducting the first score from the initial score from the lexical and grammatical checking module, the static program comparison module deducts the fourth score from the score remaining after deducting the first score from the initial score, thereby obtaining the total score. If the static program comparison module finds that there are no similar keywords or similar syntax trees between any two or more computer program answers, the static program comparison module returns the initial score as the total score, that is, the total score returned in this case is 100. The total score obtained by the static program comparison module is sent to the output module.

[0046] In the embodiment of the present invention, the marking terminal can be viewed by the invigilator, and the content presented by the marking terminal can be as follows: Figure 3 As shown, the marking end obtains the first score, the second score, the third score, the fourth score and the total score obtained by answering a computer program question from the background.

[0047] It can be seen from the above embodiments that, by using the computer program answering and grading system in the embodiments, computer program answers can be submitted online to achieve automatic grading of computer program answers, thereby reducing the tedious and repetitive workload caused by marking and grading, and liberating the labor of teachers; the accuracy of grading computer program answers in homework or exams can be improved, and the scores can be easily saved as electronic documents, which is conducive to long-term preservation of scores; specifically, the lexical and grammatical checking module, the input and output comparison module, the test case testing module and the static program comparison module respectively evaluate the computer program answers from the perspectives of lexical and grammatical errors, program standardization degree, program execution correctness and static program accuracy, and the final output total score at least comprehensively considers the influence of the above two perspectives, and the obtained total score has good comprehensiveness.

[0048] In the embodiments of the present invention, referring to Figure 4 , the computer program answer scoring method comprises the following steps:

[0049] S1. performing a lexical and grammatical check on the computer program answer, and determining a first score according to lexical and grammatical errors existing in the computer program answer and the locations of the lexical and grammatical errors;

[0050] S2. inputting standard input data into the computer program to answer the question, comparing the standard output data with the output of the computer program to answer the question, and determining a second score based on the comparison result;

[0051] S3. Generate a test case and execute the test case by answering the question in the computer program, and determine a third score according to the execution result;

[0052] S4. Perform keyword similarity comparison and syntax tree similarity comparison on the computer program answer, and determine a fourth score based on the comparison results.

[0053] The first score, second score, third score and / or fourth score in steps S1-S4 are used to determine the total score of the computer program answering the question. Specifically, the first score, second score, third score and fourth score are all deduction points of the initial score of the computer program answering the question.

[0054] By executing steps S1-S4, the same technical effects as the computer program answering and grading system in the embodiment of the present invention can be achieved, including: computer program answers can be submitted online to achieve automatic grading of computer program answers, reducing the tedious and repetitive workload caused by marking and grading, and liberating teachers' labor; the accuracy of grading computer program answers in homework or exams can be improved, and the scores can be easily saved as electronic documents, which is conducive to long-term preservation of scores; specifically, computer program answers are evaluated from the perspectives of lexical and grammatical errors, program standardization degree, program execution correctness, and static program accuracy, and the final output total score at least comprehensively considers the influence of the above two perspectives, and the obtained total score has good comprehensiveness.

[0055] In an embodiment of the present invention, a computer device includes a memory and a processor, wherein the memory is used to store at least one program, and the processor is used to load the at least one program to execute the control method in the embodiment to achieve the same technical effect as described in the embodiment.

[0056] In an embodiment of the present invention, a storage medium stores processor-executable instructions, which are used to execute the control method in the embodiment when executed by the processor to achieve the same technical effect as described in the embodiment.

[0057] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it may be directly fixed or connected to another feature, or it may be indirectly fixed or connected to another feature. In addition, the descriptions of up, down, left, right, etc. used in this disclosure are only relative to the relative positional relationship of the components of the present disclosure in the accompanying drawings. The singular forms of "a", "said" and "the" used in this disclosure are also intended to include the plural forms, unless the context clearly indicates other meanings. In addition, unless otherwise defined, all technical and scientific terms used in this embodiment have the same meaning as those generally understood by technicians in this technical field. The terms used in the specification of this embodiment are only for describing specific embodiments, not for limiting the present invention. The term "and / or" used in this embodiment includes any combination of one or more related listed items.

[0058] It should be understood that, although the term first, second, third etc. may be adopted to describe various elements in the present disclosure, these elements should not be limited to these terms. These terms are only used to distinguish the same type of elements from each other. For example, without departing from the scope of the present disclosure, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element. The use of any and all examples or exemplary language ("for example", "such as" etc.) provided by the present embodiment is only intended to better illustrate embodiments of the present invention, and unless otherwise required, the scope of the present invention will not be limited.

[0059] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose.

[0060] In addition, the operations of the process described in this embodiment may be performed in any suitable order, unless otherwise indicated in this embodiment or otherwise clearly contradicted by the context. The process described in this embodiment (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as a code (e.g., executable instructions, one or more computer programs, or one or more applications) executed jointly on one or more processors, by hardware or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.

[0061] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or a portion thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described in this embodiment includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention also includes the computer itself.

[0062] The computer program can be applied to input data to perform the functions described in the present embodiment, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on the display.

[0063] The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same means, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention. Within the scope of protection of the present invention, its technical scheme and / or implementation method may have various modifications and changes.

Claims

1. A computer program question-answering and scoring system, characterized in that: Include at least one of the following: A lexical and grammatical checking module, configured to perform a lexical and grammatical check on the computer program answer, and determine a first score according to lexical and grammatical errors existing in the computer program answer and locations of the lexical and grammatical errors; An input-output comparison module, configured to input standard input data into the computer program to answer the question, compare the standard output data with the output of the computer program to answer the question, and determine a second score based on the comparison result; A test case testing module, configured to generate a test case and enable the computer program to answer questions and execute the test case, and determine a third score according to the execution result; A static program comparison module, used for performing keyword similarity comparison and syntax tree similarity comparison on the computer program answer, and determining a fourth score according to the comparison result; The first score, the second score, the third score and / or the fourth score are used to determine the total score of the computer program answering question; The step of determining a first score according to lexical and grammatical errors existing in the computer program answer and locations of the lexical and grammatical errors comprises: When there are lexical and grammatical errors in the computer program answer, according to the type, number and location of the lexical and grammatical errors, find the preset weight of each type of lexical and grammatical errors, multiply the weight of the location, determine the deduction corresponding to each lexical and grammatical error, add up the deductions corresponding to all lexical and grammatical errors, determine the value of the first score or the ratio of the first score, and send the initial score after deducting the first score to the static program comparison module; When there are no lexical and grammatical errors in the computer program answer, sending the initial score to the input-output comparison module; Determining the second score according to the comparison result includes: When the comparison result is that the output of the computer program answering the question does not match the standard output data, according to the type, quantity and location of the non-matching parts between the output of the computer program answering the question and the standard output data, find the preset weight of the standard output data corresponding to each non-matching part, multiply the weight of the location where it is located, determine the deduction corresponding to each non-matching part, add up the deductions corresponding to all lexical and grammatical errors, determine the value of the second score or the ratio of the second score, and send the initial score after deducting the second score to the static program comparison module; When the comparison result is that the output of the computer program answering the question matches the standard output data, sending the initial score to the test case testing module; The determining of the third score according to the execution result includes: When the input and output results of the plurality of test cases do not match, according to the type, quantity and location of the mismatched parts between the input and output results of each test case, find the preset weight of each type of mismatched parts, multiply the weight of the location thereof, determine the deduction points corresponding to each mismatched part, add up the deduction points corresponding to all the mismatched parts, determine the value of the third score or the ratio of the third score, and send the initial score after deducting the third score to the static program comparison module; When the input and output results of the plurality of test cases match, the initial score is returned as the total score; Determining a fourth score according to the comparison result includes: When the comparison result is that there are similar keywords or similar syntax trees between at least two of the computer program answers, according to the type, quantity and location of the similar keywords or similar syntax trees, find the preset weight corresponding to each similar keyword or similar syntax tree, multiply the weight of the location, determine the deduction score corresponding to each similar keyword or similar syntax tree, add up the deduction scores corresponding to all similar keywords or similar syntax trees, determine the value of the fourth score or the ratio of the fourth score, and return the score sent by the input-output comparison module, the test case test module or the static program comparison module after deducting the fourth score as the total score; When the comparison result is that there are no similar keywords or similar syntax trees between any of the computer program answers, the initial score is returned as the total score.

2. The computer program question answering and scoring system according to claim 1, characterized in that: The first score, the second score, the third score and the fourth score are all deduction points of the initial score of the computer program answer.

3. A computer program question-answering and scoring method, characterized in that: The following steps are involved: Performing a lexical and grammatical check on the answer to the computer program question, and determining a first score according to lexical and grammatical errors present in the answer to the computer program question and locations of the lexical and grammatical errors; Inputting standard input data into the computer program to answer the question, comparing the standard output data with the output of the computer program to answer the question, and determining a second score based on the comparison result; generating a test case and causing the computer program to answer questions and execute the test case, and determining a third score according to the execution result; Performing keyword similarity comparison and syntax tree similarity comparison on the answers to the computer program question, and determining a fourth score according to the comparison results; The first score, the second score, the third score and / or the fourth score are used to determine the total score of the computer program answering question; The step of determining a first score according to lexical and grammatical errors existing in the computer program answer and locations of the lexical and grammatical errors comprises: When there are lexical and grammatical errors in the computer program answer, according to the type, number and location of the lexical and grammatical errors, find the preset weight of each type of lexical and grammatical errors, multiply the weight of the location, determine the deduction corresponding to each lexical and grammatical error, add up the deductions corresponding to all lexical and grammatical errors, determine the value of the first score or the ratio of the first score, and send the initial score after deducting the first score to the static program comparison module; When there are no lexical and grammatical errors in the computer program answer, sending the initial score to the input-output comparison module; Determining the second score according to the comparison result includes: When the comparison result is that the output of the computer program answering the question does not match the standard output data, according to the type, quantity and location of the non-matching parts between the output of the computer program answering the question and the standard output data, find the preset weight of the standard output data corresponding to each non-matching part, multiply the weight of the location where it is located, determine the deduction corresponding to each non-matching part, add up the deductions corresponding to all lexical and grammatical errors, determine the value of the second score or the ratio of the second score, and send the initial score after deducting the second score to the static program comparison module; When the comparison result is that the output of the computer program answering the question matches the standard output data, sending the initial score to the test case testing module; The determining of the third score according to the execution result includes: When the input and output results of the plurality of test cases do not match, according to the type, quantity and location of the mismatched parts between the input and output results of each test case, find the preset weight of each type of mismatched parts, multiply the weight of the location thereof, determine the deduction points corresponding to each mismatched part, add up the deduction points corresponding to all the mismatched parts, determine the value of the third score or the ratio of the third score, and send the initial score after deducting the third score to the static program comparison module; When the input and output results of the plurality of test cases match, the initial score is returned as the total score; Determining a fourth score according to the comparison result includes: When the comparison result is that there are similar keywords or similar syntax trees between at least two of the computer program answers, according to the type, quantity and location of the similar keywords or similar syntax trees, find the preset weight corresponding to each similar keyword or similar syntax tree, multiply the weight of the location, determine the deduction score corresponding to each similar keyword or similar syntax tree, add up the deduction scores corresponding to all similar keywords or similar syntax trees, determine the value of the fourth score or the ratio of the fourth score, and return the score sent by the input-output comparison module, the test case test module or the static program comparison module after deducting the fourth score as the total score; When the comparison result is that there are no similar keywords or similar syntax trees between any of the computer program answers, the initial score is returned as the total score.

4. The computer program question-answering and scoring method according to claim 3, characterized in that: The first score, the second score, the third score and the fourth score are all deduction points of the initial score of the computer program answer.

5. A computer device, characterized in that: The invention comprises a memory and a processor, wherein the memory is used to store at least one program, and the processor is used to load the at least one program to execute the method according to claim 3 or 4.

6. A storage medium storing instructions executable by a processor, characterized in that: The processor-executable instructions are used to perform the method according to claim 3 or 4 when executed by the processor.