2 releases
new 0.1.1 | Jan 6, 2025 |
---|---|
0.1.0 | Jan 5, 2025 |
#307 in Filesystem
263 downloads per month
225KB
2.5K
SLoC
About
The head TA is the only person who needs to know how to use this program. This tool will create HTML reports containing students source code (syntax highlighted), and their test results. Distribute these reports to your TA's.
Installation
https://crates.io/crates/darwin_cli
cargo install darwin_cli
Ensure your install worked by running darwin_cli
. This should show the Darwin help message.
Quick Use
Download all student submissions zipfile from moodle
Download project sleleton. This should have the classic maven project structure:
skel
| -- pom.xml
| -- src
| -- main
| | -- (main files)
|
| -- test
| -- (test files)
Run darwin_cli grade PROJECT_SKELETON MOODLE_SUBMISSIONS_ZIPFILE
You will be prompted on which tests to run
Your reports will be in the report/ directory and the plagiarism report will be at plagiarism.html
View each by opening plagiarism.html or report/index.html in chrome.
Share the reports to your TA's and assign each TA one to grade.
Advanced CLI
1: Create Darwin Project
Run darwin_cli create-project PROJECT_SKELETON MOODLE_SUBMISSIONS_ZIPFILE
: Initialize darwin
This will create a .darwin folder containing copies of all submissions as diffs and the skeleton code. You are free to delete the source and submission folders now.
2: Check for plagiarism
darwin_cli plagiarism-check dest.html
3: Run tests
Figure out which tests are available using darwin_cli list-tests
Then run a test using darwin_cli test-all TEST [NUM_THREADS]
. I had the best results using 4 threads.
4: Create Report
darwin_cli create-report DEST-PATH NUM-PARTS [TESTS]
This will create your report at dest path split into N parts, including test results from the tests listed.
Commands
create-project
delete-project
list-students
list-tests
view-student-submission
test-student
test-all
view-student-result-summary
view-student-result-by-class-name
view-student-results-verbose
view-all-students-results-summary
view-all-students-results-by-class-name
download-results-summary
download-results-by-class-name
create-report
plagiarism-check
plagiarism-check-students
anonomize
clean
Stats
Memory Saving (Using PA1)
- All students submissions Zipped: 75M
- All student submissions Unzipped: 308M
- All student Diffs using autograder: 2MB
Memory reduction: 99.35%
Grading Speed increase
Significant. On the order of days.
1 thread
real 4m52.224s user 9m53.217s sys 0m35.208s
4 threads
real 2m51.790s user 16m56.524s sys 1m5.665s
8 threads
real 2m50.506s user 16m51.381s sys 1m10.835s
Create-Report
Reports should be generated by Head TA's to be distributed to TA's. This way, only one person needs to know how to use this software.
A report contains all students test results and code (syntax highlighted) in a easy to use html packet.
Report Folder Structure
report
| -- index.html (Contains student list)
| -- tests.html (Contains all tests with syntax highlighting, will be iframed into all student java files)
|
| -- students/
| | -- $(student_name)
| | -- $(filename).java
| | -- pom.xml
|
| -- styles/
Student Page
- Top left: Main button
- Top: File full name
- Left: File hierarchy + Links
- Middle Code for current file
- Right: Tests + tests failed
- Bottom: Next student, previous student
Plagiarism Detection
- Detection: Locality Sensitive hash using TLSH
- Visualising: https://en.wikipedia.org/wiki/Multidimensional_scaling aka Principal Coordinates Analysis (PCoA)
.darwin folder structure
.darwin
| -- main/ (For patching)
| | -- pom.xml
| | -- $(student classes eg. java/cs131/sequentialcommandbuilder.java)
|
| -- test/ (For symlinking into project)
|
| -- submission_diffs/
| | -- ${student_name}
|
| -- results/
| | -- ${student_name}_{test name}
| | -- compile_errors
|
| -- tests_ran
|
| -- project(\d+)/
| -- src
| | -- main (Patched version. To be compiled)
| | -- test (Symlink to .darwin/test)
|
| -- pom.xml (Patched version)
| -- target (Not persisted between runs)
Storing Diffs
Goal: Create diff of src/main folder and the pom.xml
To save space and simplify the project structure, we move each students pom.xml to src/main/ before creating the diff.
diff -ruN skel/src/main project/src/main > student.diff
Setting active project (Applying diffs)
rm -rf .darwin/project/src/main
rm -rf .darwin/project/target
cp -r .darwin/main/ .darwin/project/src/main
patch -d .darwin/project/src/main -p2 < .darwin/submission_diffs/<student_diff>
mv .darwin/project/src/main/pom.xml .darwin/project/pom
Dependencies
~15–26MB
~407K SLoC