A. Demand analysis
1. The teacher randomly generates natural numbers, true fractions, false fractions, and arithmetic with parentheses of less than 3 operators by software and publishes them to students in a file format.
2. After the students have finished, submit the documents to the teacher, the teacher through the software to perform the correction
3. Correction results are returned as documents
4. To have a problem-solving ability
B. Functional design
Basic Features:
After running the program, into the graphical window, the teacher can click on the "Question" button, by selecting the number of questions and difficulty to make a question, the title files and answer files will be generated in the folder, and will also generate a folder to submit the answer to the title, and the folder to keep the results of the correction, the number of times to name. (e.g. "first-time. txt"). After the student completes the answer, add the text to the arranged folder. The teacher then corrects the assignment by correcting the button. The result is returned as a file.
Extended Features:
The question and the correcting is the independent function, after running the program the teacher may click the question button directly chooses to revise the first several times the assignment.
Advanced Features:
Not currently
C. Design implementation
Arithmetic class: fourops.py (contains build expression, check weight operation)
Grading class: correct.py (Check results)
Tree class: Tree.py
Class of Stack: stack.py
Interface class: app.py (Simple graphical interface)
D. Code description
Two-fork Tree weight:
The suffix expression is used to establish a two-fork tree to determine whether the binary number is isomorphic (i.e., using a finite sub-commutative subtree, to determine if the tree is the same note that only ' + ' and ' * ' can be exchanged, '-' and ' ÷ ').
To weigh:
E. Test run
1. Start running (Pythonui interface, simple point):
2. Generate a question
2.1 Generate three folders (separate items, assignments to be corrected, and grading results)
3. Correction
Click the ' Correct ' button to select the job to be corrected.
4. Display PSP
5. Summary
Code running efficiency is not very high, the main sentence weight when the complexity of the algorithm is high, when generating a large number of problems, the speed is slow, to be improved later.
6. Source code:
The program source code has been submitted to the code cloud Warehouse, address →https://gitee.com/pu1996/four_operations/
Arithmetic python version