major re-formatting and other edits in README

This commit is contained in:
2023-03-05 13:37:07 +00:00
parent e7f451d4f6
commit c0b674311c

109
README.md
View File

@@ -5,81 +5,128 @@ Blackboard Gradebook Organiser
## Description ## Description
**Blackboard Gradebook Organiser** is a tool for organising a downloaded gradebook with assignment submissions from [Blackboard Learn ⧉](https://en.wikipedia.org/wiki/Blackboard_Learn). **Blackboard Gradebook Organiser** is a tool for organising a downloaded gradebook with assignment submissions from [Blackboard Learn ⧉](https://en.wikipedia.org/wiki/Blackboard_Learn).
The submission files are organised per student, by extracting the student number from the submission file names and creating a directory per student. Any compressed files (.zip, .rar, .7z) are extracted into the student's directory, with any remaining files submitted individually also moved into the student's directory. Student comments from submissions are also extracted into a single text file for convenient access and review. The submission files are organised per student, by extracting the student number from the submission file names and creating a directory per student. Compressed files are extracted into the student's directory, and any remaining individually submitted files are also moved into the student's directory. Student comments from the submissions are also extracted into a single text file for convenient access and review.
Optionally, after organising a gradebook, you can inspect submissions to detect duplicated files from different submissions/students by generating and comparing SHA256 hashes. See section [Inspect submissions](#inspect-submissions-mag) for details. Optionally, after organising a gradebook, you can inspect the submissions to detect duplicated files from different submissions/students by generating and comparing SHA256 hashes. See section [Inspect submissions](#inspect-submissions-mag) for details.
### Features ### Features
- Extracts, and organises per student, the content of submitted compressed files with extensions: .zip, .rar, .7z - Extracts, and organises per student, the content of submitted compressed files with extensions: `.zip`, `.rar`, `.7z`
- Detects invalid/corrupt files - Detects invalid/corrupt files
- Doesn't extract macOS system generated files (ignores directory *__MACOSX* inside the compressed file)
- Doesn't extract macOS system generated files (ignores directory `__MACOSX` inside the compressed file)
- Deletes each compressed file after successful extraction into student directory - Deletes each compressed file after successful extraction into student directory
- Organises per student any remaining individually submitted files - Organises per student any remaining individually submitted files
- Checks and extracts any comments from the student submission generated text files - Checks and extracts any comments from the student submission generated text files
- Checks if any compressed files (from the contents of the submitted compressed files) have been extracted and organised per student - Checks if any compressed files (from the contents of the submitted compressed files) have been extracted and organised per student
- The path of any extracted and organised compressed files will be displayed on the terminal - they need to be extracted manually - The path of any extracted and organised compressed files will be displayed on the terminal - they need to be extracted manually
- [Inspect submissions](#inspect-submissions-mag) by generating and comparing SHA256 hashes of submitted files :new:
- [Inspect*s* submissions](#inspect-submissions-mag) by generating and comparing SHA256 hashes of submitted files
## Instructions ## Instructions
### Download gradebook ### Download gradebook
- Go to the course page on Blackboard - Go to the course page on Blackboard
- Go to *Grade Centre -> Full Grade Centre* - Go to *Grade Centre -> Full Grade Centre*
- Find assignment and click on the arrow for more options, and select *Assignment File Download*
- Find the assignment and click on the arrow for more options, and select *Assignment File Download*
- Select all (click *Show All* at the bottom first, to display all users) and click submit to generate the gradebook zip file - Select all (click *Show All* at the bottom first, to display all users) and click submit to generate the gradebook zip file
- Wait for the generated download link to appear, and click to download - Wait for the generated download link to appear, and click to download
### Extract gradebook ### Extract gradebook
- Extract the downloaded gradebook in a new directory inside *BB_gradebooks* Extract the downloaded gradebook in a new directory inside [*BB_gradebooks*](BB_gradebooks)
### Run script ### Run script
- Before running the script for the first time, install the required packages Before running the script for the first time, install the required packages:
- `python -m pip install -r requirements.txt`
- If running on Linux/Mac, you also need to have *unrar* installed in order to be able to extract .rar files ```python
python -m pip install -r requirements.txt
```
Note: If running on Linux/Mac, you also need to have `unrar` installed in order to be able to extract *.rar* files
- `sudo apt install unrar` for Linux - `sudo apt install unrar` for Linux
- `brew install rar` for Mac - `brew install rar` for Mac
- Provide the name of the directory (from section *Extract gradebook* above) as an argument when running the script
- `python organise_gradebook.py GRADEBOOK_DIR_NAME` Provide the name of the directory (from section ***Extract gradebook*** above) as an argument when running the script:
- While running, the script displays on the terminal information and stats about the gradebook submissions and files
```python
python organise_gradebook.py GRADEBOOK_DIR_NAME
```
While running, the script displays on the terminal information and stats about the gradebook submissions and files.
### Post-run ### Post-run
- All submission files can be found - organised in directories per student number - in directory *BB_submissions* under the sub-directory named after the gradebook name provided when running the script - All submission files can be found - organised in directories per student number - in directory [*BB_submissions*](BB_submissions), under the sub-directory named after the gradebook name provided when running the script
- e.g. `python organise_gradebook.py GRADEBOOK_DIR_NAME` creates the directory *GRADEBOOK_DIR_NAME* inside *BB_submissions*
- e.g. `python organise_gradebook.py AssignmentX` creates the directory `AssignmentX` inside [*BB_submissions*](BB_submissions)
- Each student directory contains the student's extracted and individually submitted files, and the text file generated by Blackboard with the submission (which also contains any comments left by the student) - Each student directory contains the student's extracted and individually submitted files, and the text file generated by Blackboard with the submission (which also contains any comments left by the student)
- All comments found in the gradebook are extracted in a text file in *BB_submissions*, with the gradebook name as prefix
- e.g. *AssignmentX_comments.txt* will be created for gradebook *AssignmentX* - All comments found in the gradebook are extracted in a text file in [*BB_submissions*](BB_submissions), with the gradebook name as prefix
- e.g. `AssignmentX_comments.txt` will be created for gradebook `AssignmentX`
- Compressed files are deleted after successfully extracting and organising the contents - Compressed files are deleted after successfully extracting and organising the contents
- any invalid/corrupt compressed files are moved into folder *\_\_BAD\_\_* inside the gradebook directory
- Any invalid/corrupt compressed files are moved into folder `__BAD__` inside the gradebook directory
## Inspect submissions :mag: ## Inspect submissions :mag:
### Information ### Information
- Generates SHA256 hashes for each submitted file, and outputs list to CSV file - Generates SHA256 hashes for each submitted file, and outputs list to CSV file
- Can exclude files from hashing, if provided with a CSV file listing the file names - Can exclude files from hashing, if provided with a CSV file listing the file names
- Compares the generated hashes and finds any duplicate hashes - ignores duplicates if they are by the same student/submission - Compares the generated hashes and finds any duplicate hashes - ignores duplicates if they are by the same student/submission
- Finds all files with a duplicated hash and outputs them to CSV file with the following information: Student ID, file path, file name (without path), SHA256 hash
- Finds all files with a duplicated hash and outputs them to CSV file with the following information: *Student ID*, *file path*, *file name* (without path), *SHA256 hash*
- Further inspection and filtering needs to be done manually - Further inspection and filtering needs to be done manually
### Usage ### Usage
- For this feature you also need to install the pandas package For this feature you also need to install the pandas package:
- `python -m pip install pandas`
- Usage: `python inspect_submissions.py GRADEBOOK_DIR_NAME`
- Note: run **after** organising a gradebook with `organise_gradebook.py`
- (Optional) In order to exclude files from hashing, create a CSV file in directory *csv* to provide the file names to be excluded
- e.g. for AssignmentX: create *AssignmentX_excluded.csv*, with a column named "exclude_filename" and list the file names
- Note: the directory *csv* is automatically created when you run `inspect_submissions.py` - you need to create it manually if you want to exclude files before the first run
- Generated CSV files can be found in directory *csv*, with *GRADEBOOK_DIR_NAME* as file name prefix
- e.g. inspecting submissions for *AssignmentX* will create 2 csv files:
- *AssignmentX_file_hashes_[datetime].csv* - all files and their hashes
- *AssignmentX_suspicious_[datetime].csv* - files with duplicate hashes
## Notes ```python
python -m pip install pandas
```
To inspect the submissions run:
```python
python inspect_submissions.py GRADEBOOK_DIR_NAME
```
**Note:** run ***after*** organising a gradebook with [*organise_gradebook.py*](organise_gradebook.py)
Generated CSV files can be found in directory `csv`, with the inspected submission's name as file name prefix - e.g. inspecting submissions for `AssignmentX` will create 2 CSV files:
- `AssignmentX_file_hashes_[datetime].csv` - all files and their hashes
- `AssignmentX_suspicious_[datetime].csv` - files with duplicate hashes
*(Optional)* In order to exclude files from hashing, create a CSV file in directory `csv` to provide the file names to be excluded - e.g. for `AssignmentX` create:
- `AssignmentX_excluded.csv` with a column named `exclude_filename` and list the file names
**Note:** the directory `csv` is automatically created when you run `inspect_submissions.py` - you need to create it manually if you want to exclude files before the first run.
## General notes
The Blackboard generated name for submission files must follow the pattern: The Blackboard generated name for submission files must follow the pattern:
> ANYTHING_STUDENTNUMBER_attempt_DATETIME_FILENAME > ANYTHING_STUDENTNUMBER_attempt_DATETIME_FILENAME