Introduction: This article records the process of using Python to process the statistical process of homework submissions in online schools. Finally, paste the statistical results in the corresponding column of the final test score. This process provides data support for the final grade submission.
关键词
: grades , statistics
01 Homework Submission
I. Introduction
In 2023, the weekly homework submitted by the students of Signal and System CDIE in the online school will be counted through Python programming.
2. Job processing
1. Homework download
Download assignments submitted by each student in batches from the online school. Together with the make-up, there are a total of 15 homework compressed files.
▲ 图1.2.1 网络下载得到的作业文件
Use bandzip to unzip these files individually into the HWWORK subdirectory.
▲ 图1.2.2 解压缩后的文档目录
2. Job statistics
The results processing procedure is as follows:
from headm import *
hwdir = r'D:\Temp\HWWORK'
dirdim = os.listdir(hwdir)
idid = 4
idstr = tspgetdopstring(idid).split('\r\n')
iddim = [s for s in idstr if len(s) > 2]
hwdim = [0] * len(iddim)
for d in dirdim:
dirstr = os.path.join(hwdir, d)
hwfile = os.listdir(dirstr)
for f in hwfile:
ff = f.split('_')[0]
idindex = iddim.index(ff)
hwdim[idindex] = hwdim[idindex]+1
for i in range(len(iddim)):
printff(iddim[i], hwdim[i])
clipboard.copy('\r\n'.join([str(i) for i in hwdim]))
Use CTRL+V in EXCEL to paste the grades into the corresponding grade column.
3. Processing results
▲ 图1.2.3 处理后的结果
※ Summary ※
This article records the process of using Python to process the statistics of homework submissions in online schools. Finally, paste the statistical results in the corresponding column of the final test score. This process provides data support for the final grade submission.
● Links to related diagrams: