Skip to content

Commit b783d77

Browse files
authored
Initial commit, moved from experimental git here.
1 parent 39c791b commit b783d77

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5512
-0
lines changed

LICENSE.md

Lines changed: 595 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Jupyter Moodle plugin
2+
3+
This Moodle plugin integrates Jupyter Notebooks to offer a virtual programming environment.
4+
5+
The plugin connects to a JupyterHub server and authenticates the Moodle users on the JupyterHub Server. That way they
6+
can access a Jupyter notebook from within Moodle.
7+
8+
Automated grading of Jupyter Notebooks is provided through [Otter-Grader](https://otter-grader.readthedocs.io/en/latest/).
9+
A quick introduction for writing assignments in the Otter-Grader format and a demo Notebook can be fond here:
10+
[AutograderNotebook.md](documentation/AutograderNotebook.md)
11+
[demo.ipynb](documentation/demo.ipynb)
12+
13+
## Plugin Installation
14+
15+
**Make sure you have a compatible JupyterHub and Grading API running and reachable.
16+
Details on how to set this up can be found here: https://github.com/forschungsprojekte-II-ws2223/jupyterhub-gradeservice**
17+
18+
Download the latest version of this plugin [here](https://github.com/forschungsprojekte-II-ws2223/moodle-mod_jupyter/releases/download/1.0/moodle-mod_jupyter.zip) and add it to your Moodle installation.
19+
20+
### Manual installation
21+
22+
1. Clone this repository:
23+
24+
```shell
25+
git clone git@github.com:forschungsprojekte-II-ws2223/moodle-mod_jupyter.git jupyter
26+
```
27+
28+
(The folder name should be jupyter not moodle-mod_jupyter)
29+
30+
1. Add third-party dependencies with [composer](https://getcomposer.org/download/):
31+
32+
```shell
33+
cd jupyter && composer install
34+
```
35+
36+
1. Add the folder to your moodle installation.
37+
38+
## Development Environment Setup
39+
40+
Follow [this](https://github.com/forschungsprojekte-II-ws2223/setup/blob/main/DevEnvSetup.md) guide for setting up the development environment.
41+
42+
There's an .editorconfig in this repo, please use it while working on it.
43+
44+
[EditorConfig VS Code Extension](vscode://extension/EditorConfig.EditorConfig)
45+
46+
## License
47+
48+
**Kuenstliche Intelligenz in die Berufliche Bildung Bringen (KIB3)**
49+
**2022 summer semester student project of University of Stuttgart**
50+
51+
This program is free software: you can redistribute it and/or modify it under
52+
the terms of the GNU General Public License as published by the Free Software
53+
Foundation, either version 3 of the License, or (at your option) any later
54+
version.
55+
56+
This program is distributed in the hope that it will be useful, but WITHOUT ANY
57+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
58+
PARTICULAR PURPOSE. See the GNU General Public License for more details.
59+
60+
You should have received a copy of the GNU General Public License along with
61+
this program. If not, see [GNU license](https://www.gnu.org/licenses).
62+
63+
## Additional resources
64+
65+
- [Moodle official development main page](https://docs.moodle.org/dev/Main_Page)
66+
- [Moodle official output api page](https://docs.moodle.org/dev/Output_API)
67+
- [Moodle official javascript page](https://docs.moodle.org/dev/Javascript_Modules)
68+
- [Moodle official development activity modules page](https://docs.moodle.org/dev/Activity_modules)
69+
- [Moodle programming course](https://www.youtube.com/playlist?list=PLgfLVzXXIo5q10qVXDVyD-JZVyZL9pCq0)
70+
71+
## Development Team
72+
73+
- Buchholz, Max
74+
- Günther, Ralph
75+
- Klaß, Robin
76+
- König, Solveigh
77+
- Marinic, Noah
78+
- Schüle, Maximilian
79+
- Stoll, Timo
80+
- Weber, Raphael
81+
- Wohlfart, Phillip
82+
- Zhang, Yichi
83+
- Zoller, Nick
84+
85+
developed this plugin in the context of the Student Project of University of Stuttgart in the Summer Semester 2022

amd/build/repository.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/repository.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/reset_notebook.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/reset_notebook.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/startup.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/startup.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/submit_notebook.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/submit_notebook.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/src/repository.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { call as fetchMany } from "core/ajax";
2+
3+
export const submitNotebook = (user, courseid, instanceid, filename, token) =>
4+
fetchMany([
5+
{
6+
methodname: "mod_jupyter_submit_notebook",
7+
args: {
8+
user,
9+
courseid,
10+
instanceid,
11+
filename,
12+
token
13+
},
14+
},
15+
])[0];
16+
17+
export const resetNotebook = (user, contextid, courseid, instanceid, autograded) =>
18+
fetchMany([
19+
{
20+
methodname: "mod_jupyter_reset_notebook",
21+
args: {
22+
user,
23+
contextid,
24+
courseid,
25+
instanceid,
26+
autograded
27+
},
28+
},
29+
])[0];

amd/src/reset_notebook.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { resetNotebook } from "./repository";
2+
3+
const Selectors = {
4+
actions: {
5+
resetButton: '[data-action="mod_jupyter/reset-notebook_button"]',
6+
},
7+
};
8+
9+
export const init = async ({ user, contextid, courseid, instanceid, autograded }) => {
10+
document.addEventListener("click", (e) => {
11+
if (e.target.closest(Selectors.actions.resetButton)) {
12+
callResetNotebook(user, contextid, courseid, instanceid, autograded);
13+
document.getElementById("iframe").src += ""; //This is only for github supplied notebooks.
14+
}
15+
});
16+
};
17+
18+
const callResetNotebook = async (user, contextid, courseid, instanceid, autograded) => {
19+
const response = await resetNotebook(user, contextid, courseid, instanceid, autograded);
20+
window.console.log(response);
21+
};

0 commit comments

Comments
 (0)