This repository contains a series of Python scripts designed to automate the processing of exercise submissions for an Informatiklabor course. The scripts handle various tasks including extracting submissions, processing and organizing data, generating previews, and creating a webpage to display these submissions.
Assumptions:
- A zip file named
Uebung 10.zipexists in thedatafolder. - Python environment is set up with necessary permissions to read from and write to the file system.
Extracts submissions from a zip file and organizes them in a specified directory.
Assumptions:
- The
1_Originalfolder exists and contains folders with or without zip files. - The
2_Extractedfolder may or may not exist. If it does, the script will ask for permission to overwrite.
Processes extracted files, handling additional zip files within submissions and reorganizing content.
Assumptions:
- The
2_Extractedfolder exists with subfolders, each potentially containing anaccept.txtfile. - The
3_Acceptedfolder may or may not exist. If it does, the script will ask for permission to overwrite.
Filters and prepares submissions for display, copying only those with an 'accept.txt' file and standardizing file names.
Assumptions:
- The
3_Acceptedfolder exists with subfolders, each containing anindex.htmlfile. - Selenium WebDriver and necessary browser drivers are correctly installed and configured.
Automates the taking of screenshots for each submission using Selenium, saving them for preview purposes.
Assumptions:
- The
3_Acceptedfolder exists with the necessary subfolders, each containingindex.htmlandpreview.png. - The system can handle file encoding (UTF-8) correctly.
Generates an HTML page to showcase the submissions, each with a screenshot and link to the submission.
Assumptions:
- The
2_Extractedfolder exists and contains multiple subfolders, each with an HTML file. - Python environment is set up with BeautifulSoup library installed for HTML parsing.
Analyzes HTML files in each subfolder for specific requirements such as headings, images, text blocks, lists, hyperlinks, tables, and CSS usage. Reports the findings for each submission.
To run these scripts, you need to have Python installed on your system along with several dependencies. We used Python 3.11, but other versions probably work aswell. To install these dependencies, navigate to the repository's root directory and run:
pip install -r requirements.txtEach script can be run individually as per the requirements of the exercise processing stage. Ensure that the data directory is structured as expected by each script.