Newer
Older
---
title: "Dojo"
date: "2024-01-11"
---
# Le Dojo
* Plateforme d'exercices pour la programmation,
* Outil à la ligne de commande basé sur `gitedu`,
* Correction automatique des exercices,
* Fait maison par Michël Minelli (aller en A403 pour le voir),
* En cours de développement, n'hésitez pas à ouvrir des [\alert{Issues}](https://gitedu.hesge.ch/dojo_project/issues).
* Installer `docker`!
* Voir [\alert{le lien suivant}](https://docs.docker.com/engine/install/).
* [\alert{Activez l'exécution}](https://docs.docker.com/engine/install/linux-postinstall/) de docker sans les privilèges super utilisateur·trice
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Installation
* Détails sur [\alert{ce lien}](https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/wikis/UserDocumentation/0-Installation).
## Résumé
\footnotesize
* Naviguer sur la [\alert{page release}](https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/releases),
* Choisir le package pour l'architecture de son choix [\alert{Ubuntu/Debian}](https://gitedu.hesge.ch/api/v4/projects/12972/packages/generic/dojo_debian-pkg-x64/3.2.0/dojo.deb),
* A la CLI (toujours Debian/Ubuntu)
```console
wget https://gitedu.hesge.ch/api/v4/projects/12972/packages/generic/dojo_debian-pkg-x64/3.2.0/dojo.deb
sudo dpkg -i dojo.deb
```
* Est-ce que ça a marché?
```console
$ dojo
Usage: dojo [options] [command]
CLI of the Dojo application
Options:
-h, --help display help for command
-H, --host <string> override the Dojo API endpoint (default: "https://rdps.hesge.ch/dojo/api")
-V, --version output the version number
```
# Authentification
* Détails sur [\alert{ce lien}](https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/wikis/UserDocumentation/1-Authentification).
## Résumé
* Authentification via `gitedu`
```console
dojo session login
```
* Ouverture de gitedu dans votre navigateur,
* Cliquer sur *autoriser*,
* Est-ce que ça a marché?
```console
$ dojo session test
ℹ Checking Dojo session:
✔ The session is valid
✔ Student permissions
✔ Teaching staff permissions
✔ Admin permissions
ℹ Checking Gitlab token:
✔ Read access
✔ Write access
```
# Faire un exercice (1/3)
* Détails sur [\alert{ce lien}](https://gitedu.hesge.ch/dojo_project/projects/ui/dojocli/-/wikis/UserDocumentation/3-Exercise-creation).
## Création de l'exercice
* Création de l'exercice (liste chaînée de strings)
```C
$ dojo exercise create --assignment linked_list_string_stack
...
✔ Exercise successfully created
ℹ Id: 9016b1ae-77d6-454d-b795-d8bc2770ea05
ℹ Name: DojoEx - linked_list_string_stack - orestis.malaspin - 2
ℹ Web URL: https://gitedu.hesge.ch/dojo/exercise/dojo-ex_linked_list_string_stack_9016b1ae-77d6-454d-b795-d8bc2770ea05
ℹ HTTP Repo: https://gitedu.hesge.ch/dojo/exercise/dojo-ex_linked_list_string_stack_9016b1ae-77d6-454d-b795-d8bc2770ea05.git
ℹ SSH Repo: ssh://git@ssh.hesge.ch:10572/dojo/exercise/dojo-ex_linked_list_string_stack_9016b1ae-77d6-454d-b795-d8bc2770ea05.git
```
# Faire un exercice (2/3)
## Récupération de l'énoncé
* Clonage de l'exercice
```console
$ git clone ssh://git@ssh.hesge.ch:10572/dojo/exercise/dojo-ex_linked_list_string_stack_9016b1ae-77d6-454d-b795-d8bc2770ea05.git
```
* Astuce on peut aussi faire les 2 en une fois:
```C
$ dojo exercise create --assignment linked_list_string_stack -c .
```
# Faire un exercice (3/3)
## Exécution des tests
* Faire l'exercice
```console
$ cd dojo-ex_linked_list_string_stack_9016b1ae-77d6-454d-b795-d8bc2770ea05
$ dojo exercise run --verbose
```
* Yaka faire l'exercice, commit, et push!