To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit a8ea6749 authored by scmalte's avatar scmalte
Browse files

Improved READMEs

parent 2fd3d283
...@@ -4,8 +4,10 @@ A collection for useful scripts for working with Moss in the context of ETH (eDo ...@@ -4,8 +4,10 @@ A collection for useful scripts for working with Moss in the context of ETH (eDo
## Installation ## Installation
``` ```shell
$ pip install --upgrade git+https://gitlab.ethz.ch/scmalte/mossutils.git` $ pip install --upgrade git+https://gitlab.ethz.ch/scmalte/mossutils.git
...
Successfully installed [...] mossutils [...]
``` ```
Argument `--upgrade` (re)installs the package, even if the version number hasn't changed. Argument `--upgrade` (re)installs the package, even if the version number hasn't changed.
...@@ -14,11 +16,11 @@ Argument `--upgrade` (re)installs the package, even if the version number hasn't ...@@ -14,11 +16,11 @@ Argument `--upgrade` (re)installs the package, even if the version number hasn't
**TODO:** Add instructions for how to obtain and prepare the involved data. See also `preprocessing/README.md`. **TODO:** Add instructions for how to obtain and prepare the involved data. See also `preprocessing/README.md`.
1. Obtain and prepare data 1. Obtain and prepare data, see `preprocessing/README.md`.
1. Run `mu-moss --help` for arguments that can/must be configured. Afterwards, run `mu-moss` as desired. 1. Run `mu-moss --help` for arguments that can/must be configured. Afterwards, run `mu-moss` as desired, e.g. `mu-moss -u 1234 -n 300 "./ex1/*/main.cpp"`.
`mu-moss` connects to the Moss service, uploads submissions and downloads the generated report. `mu-moss` connects to the Moss service, uploads submissions and downloads the generated report. This may take a while, and will probably not work for large `-n` values (3000 worked for me, 10,000 didn't).
1. Run `mu-revise`. 1. Run `mu-revise`.
......
...@@ -2,25 +2,16 @@ ...@@ -2,25 +2,16 @@
## Prerequisites ## Prerequisites
* Tested with Python 3.7
* Script `run_-_moss.py`
* https://pypi.org/project/mosspy/
* `pip install mosspy`
* Script `rename_to_legi.sh`: * Script `rename_to_legi.sh`:
* https://stedolan.github.io/jq/ * https://stedolan.github.io/jq/
* Download `jq` and add to path * Download `jq` and add to path
* Script `visualize.py` * TODO: Re-implement shell script in Python
* https://github.com/hjalti/mossum
* `pip3 install git+https://github.com/hjalti/mossum@master`
* Replace `<python3>/Lib/site-packages/mossum/mossum.py` with `MODIFIED-mossum.py`
* http://networkx.github.io/
* `pip install networkx`
## Tidying up files and directories ## Tidying up files and directories
* `cx-dump_bonus-exercise-1_2020-04-17.zip` contains the latest submission from each user * `cx-dump_bonus-exercise-1_2020-04-17.zip` contains the latest submission from each user
* Execute next commands on the level of the user directories, e.g. in `./bonus_exercise_1`, so that, e.g. `./bonus_exercise_1/<user>` are the individual user directories * Execute commands on the level of the user directories, e.g. in `./bonus_exercise_1`, so that, e.g. `./bonus_exercise_1/<user>` are the individual user directories
* Assumption: relevant files per submission are `<user>/details.json` and `<user>/files/main.cpp`, whereas all other files and directories can be deleted: * Assumption: relevant files per submission are `<user>/details.json` and `<user>/files/main.cpp`, whereas all other files and directories can be deleted:
...@@ -29,9 +20,9 @@ ...@@ -29,9 +20,9 @@
```plain ```plain
$ cd ./bonus_exercise_1 $ cd ./bonus_exercise_1
$ find -type f ! \( -iname details.json -or -iname main.cpp \) -delete $ find -type f ! \( -iname details.json -or -iname main.cpp \) -delete -print
$ find . -type d -iname cx_data -delete $ find . -type d -iname cx_data -delete -print
``` ```
* Move `<user>/files/main.cpp` to `<user>/main.cpp` and delete the (now empty) directory `<user>/files`: * Move `<user>/files/main.cpp` to `<user>/main.cpp` and delete the (now empty) directory `<user>/files`:
...@@ -39,11 +30,13 @@ ...@@ -39,11 +30,13 @@
```plain ```plain
$ cd ./bonus_exercise_1 $ cd ./bonus_exercise_1
$ find . -type d -iname files -execdir mv ./files/main.cpp . \; $ find . -type d -iname files -execdir mv ./files/main.cpp . \; -print
$ find . -type d -iname files -delete $ find . -type d -iname files -delete -print
``` ```
* Now, each `<user>` directory should only have two files in it: `<user>/main.cpp` and `<user>/details.json`
## Renaming user directories ## Renaming user directories
* Rename directories from user names to Legi numbers before submitting data to Moss, e.g. rename `scmalte` to `01-234-567`. The file `<user>/details.json` provides the Legi number. * Rename directories from user names to Legi numbers before submitting data to Moss, e.g. rename `scmalte` to `01-234-567`. The file `<user>/details.json` provides the Legi number.
...@@ -53,37 +46,7 @@ ...@@ -53,37 +46,7 @@
```plain ```plain
$ cd ./bonus_exercise_1 $ cd ./bonus_exercise_1
$ ../rename_to_legi.sh $ <path-to-mossutils>/rename_to_legi.sh
``` ```
The script prompts for confirmation before the first renaming is executed. The script prompts for confirmation before the first renaming is executed.
## Moss
### moss.py
* Edit `moss.py` and check configuration
* Execute `moss.py` from e.g. `./bonus_exercise_1/`:
```plain
$ cd ./bonus_exercise_1/
$ python ../moss.py
```
* If not configured otherwise, open `./bonus_exercise_1/moss-report.html` in your browser
### clusters.py
* Edit `clusters.py` and check configuration
* Execute `clusters.py` from e.g. `./bonus_exercise_1/`:
```plain
$ cd ./bonus_exercise_1/
$ python ../clusters.py
```
* If not configured otherwise, open `./bonus_exercise_1/clusters.html` in your browser
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