Open source --Python assessment tools
The assessment tools to write experimental work using only the Python language.
Program idea is based on fast matching text .
Compile test.py run
1.GUI interface
GUI interface using PyQt5 complete, simple, easy to use
2. Logical Operation
2.1 operational requirements
First, uniform use of cyclic codes require students to read a string of the form data is read to ensure that the data reading efficiency.
Then directly print (json.dumps (dic)) in the form of print out answers to ensure unified output format.
Line input and output for one line. Master file named student ID, such as '041702324.py'
2.2 code gets
Directly gitpython library, extracts a specified link address in the assessment tools github repository. The clone operation codes and their dependent files to a local folder. To ensure that the dependencies needed to run the program, such as .json .xlsx, etc.
2.3 program execution
Before the implementation of the program, in order to ensure the program input and output correctly. We used the way input and output redirection.
However, when you first encounter a fatal problem windows, the Chinese encoding in windows console is not utf-8
Format type, and can not be converted properly encoded.
So he borrowed ideas pivot Tong Ding students, directly modify the code evaluation, respectively, plus the following code is the code before and after.
# -*- coding: utf-8 -*-
import sys,os
sys.stdin=open(r'./input.txt','r',encoding='utf-8')
sys.stdout=open(r'./output.txt','w',encoding='utf-8')
...
sys.stdout.close()
sys.stdin.close()
Sys library directly stdin, stdout, to redirect input, print data is received and output directions.
Then execute
os.system('python '+文件名)
Direct program run python console
The answer than 2.4
After obtaining output.txt 2.3, the standard answer answer.txt progressive alignment can be.
3. Performance Comparison Program
This assessment tool includes not only functionally test a single point Tianshu Star comparison function to ensure that the program does not make you bug the program terminates 0 points, taking into account the poor python performance aspect, if the program uses a lot of additional The file xlsx, json run too slowly as a result, if a single input and output, the test will cause slower. So we use the program to quickly read all the data directly to a single run, and output all the data.