Commit 21c50a3f authored by Markus Klinik's avatar Markus Klinik
Browse files

README

parent 12949aa5
...@@ -10,12 +10,15 @@ Brightspace integration is called **pp-bs-daemon**. The rule checker is written ...@@ -10,12 +10,15 @@ 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 in Rascal, which runs on the Java Virtual Machine. The Brightspace daemon is
written in Python 3. written in Python 3.
Running Personal Prof directly is only useful for development and debugging.
For checking assignments you always want pp-bs-daemon.
## Running Personal Prof ## Running Personal Prof
To run Personal Prof, you need a rascal jar and the Personal Prof source code. 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` Both are included 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 and the source code in `src`. To run Personal Prof, you have to call java as
follows. follows.
...@@ -26,8 +29,8 @@ $ java -Xmx1G -Xss32m -jar lib/rascal-0.15.2-SNAPSHOT.jar Main.rsc <ruleset-name ...@@ -26,8 +29,8 @@ $ java -Xmx1G -Xss32m -jar lib/rascal-0.15.2-SNAPSHOT.jar Main.rsc <ruleset-name
- Rascal sometimes needs lots of memory to parse big projects, the official - Rascal sometimes needs lots of memory to parse big projects, the official
Rascal documentation recommends running java with `-Xmx1G -Xss32m` Rascal documentation recommends running java with `-Xmx1G -Xss32m`
- Due to the way Rascal module loading works, you have to run it from the - You have to run it from inside the directory where `Main.rsc` is. This is due
directory where `Main.rsc` is to the way Rascal module loading works.
- Rascal needs absolute paths to open files. The path to the project under test - Rascal needs absolute paths to open files. The path to the project under test
must be absolute must be absolute
- To see which rulesets are available, look at the big switch statement in - To see which rulesets are available, look at the big switch statement in
...@@ -36,13 +39,11 @@ $ java -Xmx1G -Xss32m -jar lib/rascal-0.15.2-SNAPSHOT.jar Main.rsc <ruleset-name ...@@ -36,13 +39,11 @@ $ java -Xmx1G -Xss32m -jar lib/rascal-0.15.2-SNAPSHOT.jar Main.rsc <ruleset-name
There is a script `run.sh` which simplifies running Personal Prof. This script There is a script `run.sh` which simplifies running Personal Prof. This script
can handle relative paths to the project under test. can handle relative paths to the project under test.
1. Run the script
``` ```
$ ./run.sh <ruleset-name> <path-to-student-project> $ ./run.sh <ruleset-name> <path-to-student-project>
``` ```
For example For example
``` ```
$ ./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/ $ ./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/
...@@ -53,14 +54,14 @@ at |java+class:///hangman/Gallows| ...@@ -53,14 +54,14 @@ at |java+class:///hangman/Gallows|
# Running The Brightspace Daemon # Running The Brightspace Daemon
The Brightspace deamon is a Python 3 program that periodically polls pp-bs-daemon is a Python 3 program that periodically polls Brightspace for new
Brightspace for new student submissions. When a new student submission is student submissions. When a new student submission is detected, the daemon
detected, the daemon downloads it, runs Personal Prof, and uploads the downloads it, runs Personal Prof, and uploads the resulting feedback to
resulting feedback to Brightspace. Brightspace.
For all this to work, the daemon needs two dependencies: the Personal Prof and For all this to work, the daemon needs two dependencies: Personal Prof and
no-bs. no-bs is a Python library and command line program to interact with no-bs. no-bs is a Python library and command line program to interact with
Brightspace. Both dependencies are included in this repository. Brightspace. Everything you need is included in this repository.
no-bs is a component that can run independently of the daemon. You have to set 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 up no-bs first, before you can run the daemon. no-bs has its own configuration
...@@ -68,10 +69,12 @@ file, and you have to use no-bs to log in to Brightspace. This needs to be done ...@@ -68,10 +69,12 @@ 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 only once. Logging in with no-bs stores a long-term authentication cookie on
your computer. your computer.
The basic steps to set up no-bs are described in this README. For more The basic steps to set up no-bs are described as follows. For more
information about no-bs see information about no-bs see
https://gitlab.science.ru.nl/objectorientatie/brightspace-grading-tool https://gitlab.science.ru.nl/objectorientatie/brightspace-grading-tool
## To run the pp-bs-daemon, follow these steps.
1. Clone repository 1. Clone repository
``` ```
...@@ -112,7 +115,8 @@ For pp-bs-daemon you have to set `rascalJar` and `personalProfInstallPath` ...@@ -112,7 +115,8 @@ For pp-bs-daemon you have to set `rascalJar` and `personalProfInstallPath`
$ vim ~/.config/grading-tools/app.json.config $ vim ~/.config/grading-tools/app.json.config
``` ```
7. Install d2lvalence python module 7. Install d2lvalence python module. This command will install it into your
local python package store.
``` ```
$ pip3 install D2LValence $ pip3 install D2LValence
...@@ -136,10 +140,37 @@ $ ./no-bs list-folders <course-id> ...@@ -136,10 +140,37 @@ $ ./no-bs list-folders <course-id>
``` ```
$ export PYTHONPATH=`readlink -f brightspace-grading-tool/grading-tool-python` $ export PYTHONPATH=`readlink -f brightspace-grading-tool/grading-tool-python`
$ screen
$ ./personal-prof run <course-name> <folder-id> <target-directory> <ruleset-name> $ ./personal-prof run <course-name> <folder-id> <target-directory> <ruleset-name>
``` ```
11. Keep the daemon running
It is recommended to run the daemon on a server, not your personal laptop. lilo
works fine, but an AWS instance or something similar should also work (not
tested). To keep the daemon running when you are logged out, use `screen`. All
the above setup procedure needs to be repeated on lilo.
```
$ ssh <science-login>@lilo.science.ru.nl
$ cd path/to/personal-prof/brightspace-integration
$ export PYTHONPATH=`readlink -f brightspace-grading-tool/grading-tool-python`
$ screen
```
From inside screen, open a new tab per pp-bs-daemon instance you need. In each
week we typically need four instances. Two for the current assignment, two for
the resit. That's because of the stupid Brightspace restriction that you can
only have group categories with at most 200 groups. One instance per group
category.
screen quick-reference:
- `Ctrl-a c` create new tab
- `Ctrl-a n` switch to next tab
- `Ctrl-a p` switch to previous tab
- `Ctrl-a d` detach screen to backgrond. You can log out now.
- `$ screen -r` re-attach to a running screen
# Contributing # Contributing
......
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