d120 / d120/pyfeedback

Integrate splitting of tutor evaluation

Open
#238 0 comments 0 reactions 0 assignees View on GitHub
enhancement low-priority
Dominant language
Python
Stars
6
Forks
4
PR merge metrics
No merged PRs in 30d

Description

There is currently the following script but it would be nice to integrate this into the software
```python
from PyPDF2 import PdfFileReader, PdfFileWriter
import sys
import subprocess
import re
from shlex import quote

reg = re.compile(r'(?:Gruppe:\s*)(\d*)')
inputfilename = sys.argv[1]
inputfilename_safe = quote(inputfilename)
input = PdfFileReader(open(inputfilename, 'rb'))
pages = input.getNumPages()
gruppe = 1

output = PdfFileWriter()
outfilename_prefix = inputfilename.split('.pdf',1)[0]
# We do not know the group number yet so we do a dumy replace
outfilename = '{}-Gruppe-{}.pdf'.format(outfilename_prefix, '{}')
for i in range(1, pages + 1):
ret = subprocess.getoutput('pdftotext -f {0} -l {0} {1} -'.format(i, inputfilename_safe))
if 'für Frage' in ret and i != 1:
outfile = open(outfilename.format(gruppe), 'wb')
output.write(outfile)
outfile.close()
output = PdfFileWriter()
gruppe = int(reg.search(ret).group(1))
output.addPage(input.getPage(i - 1))
outfile = open(outfilename.format(gruppe), 'wb')
gruppe += 1
output.write(outfile)
outfile.close()
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the tutor-evaluation workflow and any PDF import or export entry point; the issue provides only a standalone Python script, not repository files or tests. Done means the software incorporates splitting tutor evaluations into group-specific PDF outputs without requiring the separate script.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.