Commit 5d36f3bc authored by Markus Klinik's avatar Markus Klinik
Browse files

README

parent ab2d2b71
# Personal Prof
Rascal implementation of a simple rule checker for student Java assignments.
Rascal implementation of a rule checker for student Java assignments. See also
the accompanying paper
https://gitlab.science.ru.nl/objectorientatie/personal-prof-paper
Personal Prof consists of two parts: The rule checker itself and the
Brightspace daemon. The rule checker is called **Personal Prof**, the
Brightspace integration is called **pp-bs-daemon**. The rule checker is written
in Rascal, which runs on the Java Virtual Machine. The Brightspace daemon is
written in Python 3.
## Running the rule checker
## Running Personal Prof
To run Personal Prof, you need a rascal jar and the Personal Prof source code.
Both can be found in this repository. The rascal jar can be found in `src/lib`
and the source code in `src`. To run Personal Prof, you have to call java as
follows.
```
$ cd src
$ java -Xmx1G -Xss32m -jar lib/rascal-0.15.2-SNAPSHOT.jar Main.rsc <ruleset-name> <absolute-path-to-project-under-test>
```
- Rascal sometimes needs lots of memory to parse big projects, the official
Rascal documentation recommends running java with `-Xmx1G -Xss32m`
- Due to the way Rascal module loading works, you have to run it from the
directory where `Main.rsc` is
- Rascal needs absolute paths to open files. The path to the project under test
must be absolute
- To see which rulesets are available, look at the big switch statement in
`Main.rsc`
There is a script `run.sh` which simplifies running Personal Prof. This script
can handle relative paths to the project under test.
1. Run the script
$ ./run.sh <ruleset-name> <absolute-path-to-student-project>
```
$ ./run.sh <ruleset-name> <path-to-student-project>
```
For example
$ ./run.sh hangman /home/mkl/radboud/teaching/object-orientation/oo-grading-2019/assignment02/thout/70827-16116\ -\ Asgn\ CS\ Group\ 125\ -\ Jordy\ Schoolmeesters\ -\ Feb\ 10\,\ 2019\ 22_55/
Version: 0.13.0-SNAPSHOT
error("All I/O should happen in the view class",|java+class:///a2/Gallows|)
error("Always explicitly specify access modifiers: public, protected, or private",|java+field:///a2/User/input|)
```
$ ./run.sh hangman ~/tmp/oo-grading-2020/assignment02-hangman/grading/TA_Name/128863\ -\ 34172\ -\ AsgnA\ 142\ -\ Student\ Name\ -\ 2020-02-16T09_23_57.733Z/submission/
Gallows should use StringBuilder
at |java+class:///hangman/Gallows|
```
# Running The Brightspace Daemon
The Brightspace deamon is a Python 3 program that periodically polls
Brightspace for new student submissions. When a new student submission is
detected, the daemon downloads it, runs Personal Prof, and uploads the
resulting feedback to Brightspace.
## Running the test cases
For all this to work, the daemon needs two dependencies: the Personal Prof and
no-bs. no-bs is a Python library and command line program to interact with
Brightspace. Both dependencies are included in this repository.
There are some test projects and test cases to check that the rules give
correct error messages. To run the tests, use the test script. The test script
looks for all files `*Spec.rsc` and executes them
no-bs is a component that can run independently of the daemon. You have to set
up no-bs first, before you can run the daemon. no-bs has its own configuration
file, and you have to use no-bs to log in to Brightspace. This needs to be done
only once. Logging in with no-bs stores a long-term authentication cookie on
your computer.
$ ./test.sh
1. Clone repository
To test only specific files, specify them on the command line.
```
$ git clone --recurse-submodules https://gitlab.science.ru.nl/objectorientatie/personal-prof.git
$ cd personal-prof
```
$ ./test.sh Assignment02RulesSpec.rsc Assignment03RulesSpec.rsc
3. Optional: Run tests
```
$ ./test.sh
```
4. Create config directories for no-bs and pp-bs-daemon
```
$ mkdir -p ~/.config/grading-tools
$ mkdir -p ~/.config/personal-prof
```
## Developing the rules
5. Copy config files to config direcotries
To develop rascal code, use eclipse-rcp. Follow the instructions here:
https://www.rascal-mpl.org/start/
```
$ cd brightspace-integration
$ cp app.json.config ~/.config/personal-prof
$ cp brightspace-grading-tool/grading-tool-python/app.json.config.default ~/.config/grading-tools/app.json.config
```
6. Edit config files. For no-bs you have to set `lms_url` and `courses`.
```
$ vim ~/.config/personal-prof/app.json.config
```
# Running The Brightspace Integration
For pp-bs-daemon you have to set `rascalJar` and `personalProfInstallPath`
1. Clone repository
```
$ vim ~/.config/grading-tools/app.json.config
```
$ git clone --recurse-submodules https://gitlab.science.ru.nl/mklinik/personal-prof.git
$ cd personal-prof
7. Install d2lvalence python module
3. Optional: Run tests
```
$ pip3 install D2LValence
```
$ ./test.sh
8. Log in with no-bs
4. Create config directories
```
$ cd brightspace-grading-tool/grading-tool-python/
$ ./no-bs login-manual
```
$ mkdir -p ~/.config/grading-tools
$ mkdir -p ~/.config/personal-prof
9. See if it works
5. Copy config files to config direcotries
```
$ ./no-bs list-courses
$ ./no-bs list-folders <course-id>
```
$ cd brightspace-integration
$ cp app.json.config ~/.config/personal-prof
$ cp brightspace-grading-tool/grading-tool-python/app.json.config.default ~/.config/grading-tools/app.json.config
10. Start the daemon
6. Edit config files
```
$ export PYTHONPATH=`readlink -f brightspace-grading-tool/grading-tool-python`
$ screen
$ ./personal-prof run <course-name> <folder-id> <target-directory> <ruleset-name>
```
$ vim ~/.config/personal-prof/app.json.config
$ vim ~/.config/grading-tools/app.json.config
7. Install d2lvalence python module
$ pip3 install D2LValence
# Contributing
If you want to work on Personal Prof, use eclipse-rcp.
8. Log in
## Developing the rules
$ cd brightspace-grading-tool/grading-tool-python/
$ ./no-bs login-manual
To develop rascal code, use eclipse-rcp. Follow the instructions here:
https://www.rascal-mpl.org/start/
9. See if it works
$ ./no-bs list-courses
$ ./no-bs list-folders <course-id>
## Running the test cases
There are some test projects and test cases to check that the rules give
correct error messages. To run the tests, use the test script. The test script
looks for all files `*Spec.rsc` and executes them
$ ./test.sh
To test only specific files, specify them on the command line.
$ ./test.sh Assignment02RulesSpec.rsc Assignment03RulesSpec.rsc
9. Start the server
$ export PYTHONPATH=`readlink -f brightspace-grading-tool/grading-tool-python`
$ screen
$ ./personal-prof run ...
## References
# References
- Rascal official website https://www.rascal-mpl.org/
- Rascal github https://github.com/usethesource/rascal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment