Browse Source

tld-751 @fixed icone jupyter

raphael 2 years ago
parent
commit
98a724363c

+ 2
- 1
Resources/assets/Images/build-images.js View File

@@ -1,3 +1,4 @@
1 1
 require('./icon-jupyter.svg');
2 2
 require('./icon-ls-jupyter.svg');
3
-require('./ico-reset.svg');
3
+require('./ico-reset.svg');
4
+require('./icon-jupyter-min.svg');

+ 23
- 0
Resources/assets/Images/icon-jupyter-min.svg View File

@@ -0,0 +1,23 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="33" height="33" viewBox="0 0 33 33">
2
+  <g id="JupyterIconMin" transform="translate(2 2)">
3
+    <g id="Ellipse_180" data-name="Ellipse 180" fill="#f37726">
4
+      <path d="M 14.5 30 C 10.35980033874512 30 6.467410087585449 28.38772010803223 3.53983998298645 25.46015930175781 C 0.612280011177063 22.53259086608887 -1 18.64019966125488 -1 14.5 C -1 10.35980033874512 0.612280011177063 6.467410087585449 3.53983998298645 3.53983998298645 C 6.467410087585449 0.612280011177063 10.35980033874512 -1 14.5 -1 C 18.64019966125488 -1 22.53259086608887 0.612280011177063 25.46015930175781 3.53983998298645 C 28.38772010803223 6.467410087585449 30 10.35980033874512 30 14.5 C 30 18.64019966125488 28.38772010803223 22.53259086608887 25.46015930175781 25.46015930175781 C 22.53259086608887 28.38772010803223 18.64019966125488 30 14.5 30 Z" stroke="none"/>
5
+      <path d="M 14.5 0 C 6.491870880126953 0 0 6.491870880126953 0 14.5 C 0 22.50812911987305 6.491870880126953 29 14.5 29 C 22.50812911987305 29 29 22.50812911987305 29 14.5 C 29 6.491870880126953 22.50812911987305 0 14.5 0 M 14.5 -2 C 16.72661018371582 -2 18.88766860961914 -1.563470840454102 20.92316055297852 -0.7025299072265625 C 22.88821029663086 0.1286201477050781 24.65258026123047 1.318050384521484 26.16725921630859 2.832740783691406 C 27.68194961547852 4.347419738769531 28.87137985229492 6.111789703369141 29.70252990722656 8.076839447021484 C 30.5634708404541 10.11232948303223 31 12.27338981628418 31 14.5 C 31 16.72661018371582 30.5634708404541 18.88766860961914 29.70252990722656 20.92316055297852 C 28.87137985229492 22.88821029663086 27.68194961547852 24.65258026123047 26.16725921630859 26.16725921630859 C 24.65258026123047 27.68194961547852 22.88821029663086 28.87137985229492 20.92316055297852 29.70252990722656 C 18.88766860961914 30.5634708404541 16.72661018371582 31 14.5 31 C 12.27338981628418 31 10.11232948303223 30.5634708404541 8.076839447021484 29.70252990722656 C 6.111789703369141 28.87137985229492 4.347419738769531 27.68194961547852 2.832740783691406 26.16725921630859 C 1.318050384521484 24.65258026123047 0.1286201477050781 22.88821029663086 -0.7025299072265625 20.92316055297852 C -1.563470840454102 18.88766860961914 -2 16.72661018371582 -2 14.5 C -2 12.27338981628418 -1.563470840454102 10.11232948303223 -0.7025299072265625 8.076839447021484 C 0.1286201477050781 6.111789703369141 1.318050384521484 4.347419738769531 2.832740783691406 2.832740783691406 C 4.347419738769531 1.318050384521484 6.111789703369141 0.1286201477050781 8.076839447021484 -0.7025299072265625 C 10.11232948303223 -1.563470840454102 12.27338981628418 -2 14.5 -2 Z" stroke="none" fill="#fff"/>
6
+    </g>
7
+    <g id="path" transform="translate(3.96 18.187)">
8
+      <g id="path17_fill" data-name="path17 fill" transform="translate(0 0)">
9
+        <path id="Tracé_1375" data-name="Tracé 1375" d="M10.464,7.287A11.288,11.288,0,0,1,0,0,11.156,11.156,0,0,0,4.088,5.286a11.156,11.156,0,0,0,6.376,2,11.157,11.157,0,0,0,6.376-2A11.157,11.157,0,0,0,20.928,0,11.332,11.332,0,0,1,10.464,7.287Z" transform="translate(0 0)" fill="rgba(255,255,255,0)" stroke="#fff" stroke-linejoin="round" stroke-width="2"/>
10
+      </g>
11
+    </g>
12
+    <g id="path-2" data-name="path" transform="translate(3.96 3.417)">
13
+      <g id="path18_fill" data-name="path18 fill" transform="translate(0 0)">
14
+        <path id="Tracé_1376" data-name="Tracé 1376" d="M10.464,0A11.235,11.235,0,0,1,20.928,7.286,11.156,11.156,0,0,0,0,7.286,11.337,11.337,0,0,1,10.464,0Z" transform="translate(0 0.001)" fill="rgba(255,255,255,0)" stroke="#fff" stroke-linejoin="round" stroke-width="2"/>
15
+      </g>
16
+    </g>
17
+    <g id="path-3" data-name="path" transform="translate(11 7.587)">
18
+      <g id="path9_fill" data-name="path9 fill" transform="translate(0)">
19
+        <path id="Tracé_1367" data-name="Tracé 1367" d="M2.881,6.8c0,2.22-.206,2.942-.735,3.475A3.507,3.507,0,0,1,0,10.986l.141,2.568A7.226,7.226,0,0,0,4.557,12.2a4.885,4.885,0,0,0,1.1-1.789,4.409,4.409,0,0,0,.2-2.016V0H2.881Z" transform="translate(0)" fill="#fff"/>
20
+      </g>
21
+    </g>
22
+  </g>
23
+</svg>

Resources/assets/Scss/test_css.scss → Resources/assets/Scss/jupyter.scss View File

@@ -12,6 +12,16 @@
12 12
     }
13 13
 }
14 14
 
15
+.ali-SummarySequenceItem-JupyterVirtualClassroom {
16
+    .ali-SummarySequenceItem-title {
17
+        border-color: $jupyterColor;
18
+        &::before {
19
+            border-bottom-color: $jupyterColor;
20
+        }
21
+    }
22
+    
23
+}
24
+
15 25
 // bloque d'édition
16 26
 .ali-SequenceJupyterClassroom.active + .ali-EditorSequenceContentEdit > .ali-EditorContentRightPanelContent-form {
17 27
     border-color: $sequence-virtual-color;

+ 1
- 0
Resources/public/bundles/logiprophoenixjupyter/Css/jupyter.6b70abff.css View File

@@ -0,0 +1 @@
1
+.ali-EditorSequenceCreate .ali-EditorJupyterCreate{color:#f37726;border-color:#f37726}.ali-EditorSequenceCreate .ali-EditorJupyterCreate .ali-EditorSequenceCreateItem-icone{background:#f37726}.ali-SummarySequenceItem-JupyterVirtualClassroom .ali-SummarySequenceItem-title{border-color:#f37726}.ali-SummarySequenceItem-JupyterVirtualClassroom .ali-SummarySequenceItem-title:before{border-bottom-color:#f37726}.ali-SequenceJupyterClassroom.active,.ali-SequenceJupyterClassroom.active+.ali-EditorSequenceContentEdit>.ali-EditorContentRightPanelContent-form{border-color:#f37726}.ali-SequenceJupyterClassroom:before{background:linear-gradient(-135deg,#f37726 50%,transparent 0)}.ali-SequenceJupyterClassroom .ali-EditorSequenceItemLogo{background:rgba(243,119,38,.2)}.ali-SequenceJupyterClassroom .ali-EditorSequenceItem-order,.ali-SequenceJupyterClassroom .ali-EditorSequenceItem-tag,.ali-SequenceJupyterClassroom .ali-EditorSequenceItemLogo-duration{background:#f37726}.ali-SequenceJupyterClassroom .ali-EditorSequenceItem-date,.ali-SequenceJupyterClassroom .ali-EditorSequenceItemLogo-label{color:#f37726}

+ 1
- 0
Resources/public/bundles/logiprophoenixjupyter/Css/jupyter.e5db77e9.js View File

@@ -0,0 +1 @@
1
+webpackJsonp([6],{"4vIL":function(n,c,o){}},["4vIL"]);

+ 0
- 1
Resources/public/bundles/logiprophoenixjupyter/Css/learning-space.15a9cf9b.js View File

@@ -1 +0,0 @@
1
-webpackJsonp([6],{ahdg:function(a,n,c){}},["ahdg"]);

+ 1
- 0
Resources/public/bundles/logiprophoenixjupyter/Css/learning-space.cdc1320d.js View File

@@ -0,0 +1 @@
1
+webpackJsonp([5],{ahdg:function(a,n,c){}},["ahdg"]);

+ 0
- 1
Resources/public/bundles/logiprophoenixjupyter/Css/test_css.20e6b139.css View File

@@ -1 +0,0 @@
1
-.ali-EditorSequenceCreate .ali-EditorJupyterCreate{color:#f37726;border-color:#f37726}.ali-EditorSequenceCreate .ali-EditorJupyterCreate .ali-EditorSequenceCreateItem-icone{background:#f37726}.ali-SequenceJupyterClassroom.active,.ali-SequenceJupyterClassroom.active+.ali-EditorSequenceContentEdit>.ali-EditorContentRightPanelContent-form{border-color:#f37726}.ali-SequenceJupyterClassroom:before{background:linear-gradient(-135deg,#f37726 50%,transparent 0)}.ali-SequenceJupyterClassroom .ali-EditorSequenceItemLogo{background:rgba(243,119,38,.2)}.ali-SequenceJupyterClassroom .ali-EditorSequenceItem-order,.ali-SequenceJupyterClassroom .ali-EditorSequenceItem-tag,.ali-SequenceJupyterClassroom .ali-EditorSequenceItemLogo-duration{background:#f37726}.ali-SequenceJupyterClassroom .ali-EditorSequenceItem-date,.ali-SequenceJupyterClassroom .ali-EditorSequenceItemLogo-label{color:#f37726}

+ 0
- 1
Resources/public/bundles/logiprophoenixjupyter/Css/test_css.70a7ac0c.js View File

@@ -1 +0,0 @@
1
-webpackJsonp([5],{B5qU:function(n,c,o){}},["B5qU"]);

Resources/public/bundles/logiprophoenixjupyter/Css/variables.7e895581.js → Resources/public/bundles/logiprophoenixjupyter/Css/variables.5bfc55bb.js View File


+ 23
- 0
Resources/public/bundles/logiprophoenixjupyter/images/icon-jupyter-min.3800eca9.svg View File

@@ -0,0 +1,23 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="33" height="33" viewBox="0 0 33 33">
2
+  <g id="JupyterIconMin" transform="translate(2 2)">
3
+    <g id="Ellipse_180" data-name="Ellipse 180" fill="#f37726">
4
+      <path d="M 14.5 30 C 10.35980033874512 30 6.467410087585449 28.38772010803223 3.53983998298645 25.46015930175781 C 0.612280011177063 22.53259086608887 -1 18.64019966125488 -1 14.5 C -1 10.35980033874512 0.612280011177063 6.467410087585449 3.53983998298645 3.53983998298645 C 6.467410087585449 0.612280011177063 10.35980033874512 -1 14.5 -1 C 18.64019966125488 -1 22.53259086608887 0.612280011177063 25.46015930175781 3.53983998298645 C 28.38772010803223 6.467410087585449 30 10.35980033874512 30 14.5 C 30 18.64019966125488 28.38772010803223 22.53259086608887 25.46015930175781 25.46015930175781 C 22.53259086608887 28.38772010803223 18.64019966125488 30 14.5 30 Z" stroke="none"/>
5
+      <path d="M 14.5 0 C 6.491870880126953 0 0 6.491870880126953 0 14.5 C 0 22.50812911987305 6.491870880126953 29 14.5 29 C 22.50812911987305 29 29 22.50812911987305 29 14.5 C 29 6.491870880126953 22.50812911987305 0 14.5 0 M 14.5 -2 C 16.72661018371582 -2 18.88766860961914 -1.563470840454102 20.92316055297852 -0.7025299072265625 C 22.88821029663086 0.1286201477050781 24.65258026123047 1.318050384521484 26.16725921630859 2.832740783691406 C 27.68194961547852 4.347419738769531 28.87137985229492 6.111789703369141 29.70252990722656 8.076839447021484 C 30.5634708404541 10.11232948303223 31 12.27338981628418 31 14.5 C 31 16.72661018371582 30.5634708404541 18.88766860961914 29.70252990722656 20.92316055297852 C 28.87137985229492 22.88821029663086 27.68194961547852 24.65258026123047 26.16725921630859 26.16725921630859 C 24.65258026123047 27.68194961547852 22.88821029663086 28.87137985229492 20.92316055297852 29.70252990722656 C 18.88766860961914 30.5634708404541 16.72661018371582 31 14.5 31 C 12.27338981628418 31 10.11232948303223 30.5634708404541 8.076839447021484 29.70252990722656 C 6.111789703369141 28.87137985229492 4.347419738769531 27.68194961547852 2.832740783691406 26.16725921630859 C 1.318050384521484 24.65258026123047 0.1286201477050781 22.88821029663086 -0.7025299072265625 20.92316055297852 C -1.563470840454102 18.88766860961914 -2 16.72661018371582 -2 14.5 C -2 12.27338981628418 -1.563470840454102 10.11232948303223 -0.7025299072265625 8.076839447021484 C 0.1286201477050781 6.111789703369141 1.318050384521484 4.347419738769531 2.832740783691406 2.832740783691406 C 4.347419738769531 1.318050384521484 6.111789703369141 0.1286201477050781 8.076839447021484 -0.7025299072265625 C 10.11232948303223 -1.563470840454102 12.27338981628418 -2 14.5 -2 Z" stroke="none" fill="#fff"/>
6
+    </g>
7
+    <g id="path" transform="translate(3.96 18.187)">
8
+      <g id="path17_fill" data-name="path17 fill" transform="translate(0 0)">
9
+        <path id="Tracé_1375" data-name="Tracé 1375" d="M10.464,7.287A11.288,11.288,0,0,1,0,0,11.156,11.156,0,0,0,4.088,5.286a11.156,11.156,0,0,0,6.376,2,11.157,11.157,0,0,0,6.376-2A11.157,11.157,0,0,0,20.928,0,11.332,11.332,0,0,1,10.464,7.287Z" transform="translate(0 0)" fill="rgba(255,255,255,0)" stroke="#fff" stroke-linejoin="round" stroke-width="2"/>
10
+      </g>
11
+    </g>
12
+    <g id="path-2" data-name="path" transform="translate(3.96 3.417)">
13
+      <g id="path18_fill" data-name="path18 fill" transform="translate(0 0)">
14
+        <path id="Tracé_1376" data-name="Tracé 1376" d="M10.464,0A11.235,11.235,0,0,1,20.928,7.286,11.156,11.156,0,0,0,0,7.286,11.337,11.337,0,0,1,10.464,0Z" transform="translate(0 0.001)" fill="rgba(255,255,255,0)" stroke="#fff" stroke-linejoin="round" stroke-width="2"/>
15
+      </g>
16
+    </g>
17
+    <g id="path-3" data-name="path" transform="translate(11 7.587)">
18
+      <g id="path9_fill" data-name="path9 fill" transform="translate(0)">
19
+        <path id="Tracé_1367" data-name="Tracé 1367" d="M2.881,6.8c0,2.22-.206,2.942-.735,3.475A3.507,3.507,0,0,1,0,10.986l.141,2.568A7.226,7.226,0,0,0,4.557,12.2a4.885,4.885,0,0,0,1.1-1.789,4.409,4.409,0,0,0,.2-2.016V0H2.881Z" transform="translate(0)" fill="#fff"/>
20
+      </g>
21
+    </g>
22
+  </g>
23
+</svg>

+ 6
- 5
Resources/public/bundles/logiprophoenixjupyter/manifest.json View File

@@ -1,16 +1,17 @@
1 1
 {
2
-  "bundles/logiprophoenixjupyter/share.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/share.edf0e6b6.js",
2
+  "bundles/logiprophoenixjupyter/share.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/share.79f7b026.js",
3 3
   "bundles/logiprophoenixjupyter/Js/learning-space.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Js/learning-space.0b5be2a8.js",
4 4
   "bundles/logiprophoenixjupyter/Js/learning-space-loader.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Js/learning-space-loader.437b8cec.js",
5 5
   "bundles/logiprophoenixjupyter/Js/back-office.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Js/back-office.1cee347c.js",
6
-  "bundles/logiprophoenixjupyter/Css/variables.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/variables.7e895581.js",
6
+  "bundles/logiprophoenixjupyter/Css/variables.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/variables.5bfc55bb.js",
7 7
   "bundles/logiprophoenixjupyter/Css/variables.css": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/variables.d41d8cd9.css",
8
-  "bundles/logiprophoenixjupyter/Css/test_css.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/test_css.70a7ac0c.js",
9
-  "bundles/logiprophoenixjupyter/Css/test_css.css": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/test_css.20e6b139.css",
10
-  "bundles/logiprophoenixjupyter/Css/learning-space.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/learning-space.15a9cf9b.js",
8
+  "bundles/logiprophoenixjupyter/Css/learning-space.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/learning-space.cdc1320d.js",
11 9
   "bundles/logiprophoenixjupyter/Css/learning-space.css": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/learning-space.e7d60e03.css",
10
+  "bundles/logiprophoenixjupyter/Css/jupyter.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/jupyter.e5db77e9.js",
11
+  "bundles/logiprophoenixjupyter/Css/jupyter.css": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/Css/jupyter.6b70abff.css",
12 12
   "bundles/logiprophoenixjupyter/manifest.js": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/manifest.d41d8cd9.js",
13 13
   "bundles/logiprophoenixjupyter/images/icon-jupyter.svg": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/icon-jupyter.3e9f76c8.svg",
14 14
   "bundles/logiprophoenixjupyter/images/icon-ls-jupyter.svg": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/icon-ls-jupyter.3e9f76c8.svg",
15
+  "bundles/logiprophoenixjupyter/images/icon-jupyter-min.svg": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/icon-jupyter-min.3800eca9.svg",
15 16
   "bundles/logiprophoenixjupyter/images/ico-reset.svg": "/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/ico-reset.13dc9615.svg"
16 17
 }

+ 1
- 0
Resources/public/bundles/logiprophoenixjupyter/share.79f7b026.js View File

@@ -0,0 +1 @@
1
+webpackJsonp([0],{"/KNC":function(e,o){e.exports="/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/icon-jupyter.3e9f76c8.svg"},0:function(e,o,p){e.exports=p("JNT0")},JNT0:function(e,o,p){p("/KNC"),p("qoeG"),p("JYw+"),p("ssSV")},"JYw+":function(e,o){e.exports="/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/ico-reset.13dc9615.svg"},qoeG:function(e,o){e.exports="/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/icon-ls-jupyter.3e9f76c8.svg"},ssSV:function(e,o){e.exports="/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/icon-jupyter-min.3800eca9.svg"}},[0]);

+ 0
- 1
Resources/public/bundles/logiprophoenixjupyter/share.edf0e6b6.js View File

@@ -1 +0,0 @@
1
-webpackJsonp([0],{"/KNC":function(e,o){e.exports="/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/icon-jupyter.3e9f76c8.svg"},0:function(e,o,p){e.exports=p("JNT0")},JNT0:function(e,o,p){p("/KNC"),p("qoeG"),p("JYw+")},"JYw+":function(e,o){e.exports="/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/ico-reset.13dc9615.svg"},qoeG:function(e,o){e.exports="/bundles/logiprophoenixjupyter/bundles/logiprophoenixjupyter/images/icon-ls-jupyter.3e9f76c8.svg"}},[0]);

+ 249
- 287
Services/PhoenixServices.php View File

@@ -30,67 +30,60 @@ class PhoenixServices extends Services
30 30
 	private $isAvalaible;
31 31
 	private $layoutPath = '@LogiproPhoenixJupyter/back-office/';
32 32
 
33
-	public function __construct
34
-	(
33
+	public function __construct(
35 34
 		FormFactoryInterface $formFactory,
36 35
 		EntityManagerInterface $manager,
37 36
 		RouterInterface $router,
38 37
 		ApiLayerService $layer,
39 38
 		NotebookUploader $uploader
40
-	)
41
-	{
42
-		parent::__construct($formFactory,$manager,$router);
39
+	) {
40
+		parent::__construct($formFactory, $manager, $router);
43 41
 
44 42
 		$this->layer = $layer;
45 43
 		$this->uploader = $uploader;
46 44
 	}
47 45
 
48
-    /**
49
-     * retourne le chemin de la classe de l'entité du bundle
50
-     * @return string
51
-     */
52
-    public function getEntityClass() : string
53
-    {
54
-        return JupyterVirtualClassroom::class;
46
+	/**
47
+	 * retourne le chemin de la classe de l'entité du bundle
48
+	 * @return string
49
+	 */
50
+	public function getEntityClass(): string
51
+	{
52
+		return JupyterVirtualClassroom::class;
55 53
 	}
56
-	
54
+
57 55
 	public function serviceIsAvalaible()
58 56
 	{
59
-		if (is_null($this->isAvalaible))
60
-		{
57
+		if (is_null($this->isAvalaible)) {
61 58
 			$this->isAvalaible = $this->layer->serviceIsAvalaible();
62 59
 		}
63 60
 		return $this->isAvalaible;
64 61
 	}
65 62
 
66
-    protected function getApiService()
67
-    {
68
-		if (!$this->isAvalaible)
69
-		{
63
+	protected function getApiService()
64
+	{
65
+		if (!$this->isAvalaible) {
70 66
 			$this->isAvalaible = $this->layer->serviceIsAvalaible();
71 67
 		}
72
-		
73
-		if ($this->isAvalaible)
74
-		{
68
+
69
+		if ($this->isAvalaible) {
75 70
 			return $this->layer;
76
-		}
77
-		else
78
-		{
71
+		} else {
79 72
 			throw new \Exception('Service Jupyter indisponible');
80 73
 		}
81 74
 		return null;
82
-    }
83
-
84
-    /**
85
-     * créé le serveur distant jupyter et persist le token si créé
86
-     *
87
-     * @param JupyterVirtualClassroom $jupyter
88
-     * @param string $fromurl
89
-     * @param string $notebookContent
90
-     * 
91
-     * @return string
92
-     */
93
-    private function createTrainerJupyterServer(JupyterVirtualClassroom $jupyter,$fromurl = null,$notebookContent = null,$useUrl = true) : string
75
+	}
76
+
77
+	/**
78
+	 * créé le serveur distant jupyter et persist le token si créé
79
+	 *
80
+	 * @param JupyterVirtualClassroom $jupyter
81
+	 * @param string $fromurl
82
+	 * @param string $notebookContent
83
+	 * 
84
+	 * @return string
85
+	 */
86
+	private function createTrainerJupyterServer(JupyterVirtualClassroom $jupyter, $fromurl = null, $notebookContent = null, $useUrl = true): string
94 87
 	{
95 88
 		ignore_user_abort(true);
96 89
 
@@ -98,25 +91,23 @@ class PhoenixServices extends Services
98 91
 		$trainer = $jupyter->getTrainer();
99 92
 		$repository = $this->getRepository(JupyterToken::class);
100 93
 		$token = $repository->findOneBy(array('person' => $trainer));
101
-		if (is_null($token))
102
-		{
94
+		if (is_null($token)) {
103 95
 			$token = new JupyterToken();
104 96
 			$token->setPerson($trainer);
105 97
 		}
106 98
 		// test si l'utilisateur a déja un token
107 99
 		$manager = $this->getManager();
108 100
 		$layer = $this->getApiService();
109
-		$url = $layer->createTrainerServerIfNoneAndSetContent($jupyter,$token,$fromurl,$notebookContent,$useUrl);
101
+		$url = $layer->createTrainerServerIfNoneAndSetContent($jupyter, $token, $fromurl, $notebookContent, $useUrl);
110 102
 
111 103
 		// persiste l'entité créé
112
-		if ($token && !$token->getTokenId())
113
-		{
104
+		if ($token && !$token->getTokenId()) {
114 105
 			$manager->persist($token);
115
-        }
116
-        return $url;
117
-    }
106
+		}
107
+		return $url;
108
+	}
118 109
 
119
-    /**
110
+	/**
120 111
 	 * retourne le token d'un utilisateur
121 112
 	 * 
122 113
 	 * @param Person $person
@@ -129,18 +120,16 @@ class PhoenixServices extends Services
129 120
 	}
130 121
 
131 122
 	/**
132
-     * demarre le serveur
133
-     * 
123
+	 * demarre le serveur
124
+	 * 
134 125
 	 * @return array: isStarted: dit si le serveur était déja démarré, result: dit si le serveur a été démarré
135 126
 	 */
136 127
 	protected function startServer(Person $person)
137 128
 	{
138 129
 		$layer = $this->getApiService();
139
-		if ($layer)
140
-		{
130
+		if ($layer) {
141 131
 			$token = $this->getToken($person);
142
-			if ($token)
143
-			{
132
+			if ($token) {
144 133
 				$response = $layer->startServer($token);
145 134
 				return $response;
146 135
 			}
@@ -149,13 +138,13 @@ class PhoenixServices extends Services
149 138
 	}
150 139
 
151 140
 
152
-    /**
153
-     * retourne les informations du formateur à partir de la classe
154
-     *
155
-     * @param JupyterVirtualClassroom $sequenceItem
156
-     * @return Array
157
-     */
158
-    protected function getTrainerDatasBySequenceItem(JupyterVirtualClassroom $sequenceItem) : array
141
+	/**
142
+	 * retourne les informations du formateur à partir de la classe
143
+	 *
144
+	 * @param JupyterVirtualClassroom $sequenceItem
145
+	 * @return Array
146
+	 */
147
+	protected function getTrainerDatasBySequenceItem(JupyterVirtualClassroom $sequenceItem): array
159 148
 	{
160 149
 		$idTrainer = 0;
161 150
 		$initials = '';
@@ -165,17 +154,16 @@ class PhoenixServices extends Services
165 154
 		$avatar = '';
166 155
 		$visibleInformation = '';
167 156
 
168
-        $trainer = $sequenceItem->getTrainer();
169
-        
170
-        // test si le formateu est présent
171
-		if ($trainer) 
172
-		{
157
+		$trainer = $sequenceItem->getTrainer();
158
+
159
+		// test si le formateu est présent
160
+		if ($trainer) {
173 161
 			$idTrainer = $trainer->getPersonId();
174 162
 			$initials = $trainer->getInitials();
175 163
 			$fullName = $trainer->getFullName();
176 164
 			$email = $trainer->getEmail();
177 165
 			$telephone = $trainer->getTelephone();
178
-			$avatar = "";//$this->renderString("{{ phx_get_avatar(phx_uploader_asset(person,'imageFile'), initials, 'sm')|raw }}" , array('person' => $trainer, 'initials' => $trainer->getInitials()));
166
+			$avatar = ""; //$this->renderString("{{ phx_get_avatar(phx_uploader_asset(person,'imageFile'), initials, 'sm')|raw }}" , array('person' => $trainer, 'initials' => $trainer->getInitials()));
179 167
 			$visibleInformation = $trainer->getVisibleInformation();
180 168
 		}
181 169
 
@@ -191,80 +179,80 @@ class PhoenixServices extends Services
191 179
 	}
192 180
 
193 181
 
194
-    /**
195
-     * retourne le bouton pour ajouter le JupyterVirtualClassroom au parcours
196
-     * 
197
-     * @return ButtonLayer
198
-     */
199
-    public function getButton() : ButtonLayer
200
-    {
201
-        $button = new ButtonLayer();
202
-
203
-        $button->setImage('icon-jupyter.svg');
204
-        $button->setText('Jupyter');
205
-        $button->setClass('ali-EditorJupyterCreate');
206
-        $button->setHelp('Notebook Jupyter');
207
-
208
-        return $button;
209
-    }
210
-
211
-    /**
212
-     * retourne le code html de la modal pour ajouter un JupyterVirtualClassroom au aprcours
213
-     * 
214
-     * @return ModalLayer
215
-     */
216
-    public function getModalAdd() : ModalLayer
217
-    {
218
-        $modal  = new ModalLayer();
219
-		
182
+	/**
183
+	 * retourne le bouton pour ajouter le JupyterVirtualClassroom au parcours
184
+	 * 
185
+	 * @return ButtonLayer
186
+	 */
187
+	public function getButton(): ButtonLayer
188
+	{
189
+		$button = new ButtonLayer();
190
+
191
+		$button->setImage('icon-jupyter.svg');
192
+		$button->setText('Jupyter');
193
+		$button->setClass('ali-EditorJupyterCreate');
194
+		$button->setHelp('Notebook Jupyter');
195
+
196
+		return $button;
197
+	}
198
+
199
+	/**
200
+	 * retourne le code html de la modal pour ajouter un JupyterVirtualClassroom au aprcours
201
+	 * 
202
+	 * @return ModalLayer
203
+	 */
204
+	public function getModalAdd(): ModalLayer
205
+	{
206
+		$modal  = new ModalLayer();
207
+
220 208
 		$jupyter = new JupyterVirtualClassroom();
221
-        $form = $this->createForm(JupyterCreateType::class, $jupyter);
209
+		$form = $this->createForm(JupyterCreateType::class, $jupyter);
222 210
 
223
-        $modal->setTitle('Créer une activité Jupyter');
224
-		$modal->setCss('test_css.css');
211
+		$modal->setTitle('Créer une activité Jupyter');
212
+		$modal->setCss('jupyter.css');
225 213
 		$modal->setScript('back-office.js');
226
-		
227
-        $modal->setForm($form->createView());
228
-        $modal->setLayout($this->layoutPath . 'formCreate.html.twig');
229
-
230
-        return $modal;
231
-    }
232
-
233
-    /**
234
-     * valide le formulaire du ModalLayer et retourne l'identifiant du nouveau JupyterVirtualClassroom
235
-     * 
236
-     * @param Request $request
237
-     * @param Sequence $sequence
238
-     * @param int $order
239
-     * 
240
-     * @return int
241
-     */
242
-    public function validateModalAdd(Request $request,$sequence,$order)
243
-    {
244
-        $jupyter = new JupyterVirtualClassroom();
214
+
215
+		$modal->setForm($form->createView());
216
+		$modal->setLayout($this->layoutPath . 'formCreate.html.twig');
217
+
218
+		return $modal;
219
+	}
220
+
221
+	public function getBackOfficeCss()
222
+	{
223
+		return 'bundles/logiprophoenixjupyter/Css/jupyter.css';
224
+	}
225
+
226
+	/**
227
+	 * valide le formulaire du ModalLayer et retourne l'identifiant du nouveau JupyterVirtualClassroom
228
+	 * 
229
+	 * @param Request $request
230
+	 * @param Sequence $sequence
231
+	 * @param int $order
232
+	 * 
233
+	 * @return int
234
+	 */
235
+	public function validateModalAdd(Request $request, $sequence, $order)
236
+	{
237
+		$jupyter = new JupyterVirtualClassroom();
245 238
 		$jupyter->setSequence($sequence);
246 239
 
247 240
 		$form = $this->createForm(JupyterCreateType::class, $jupyter);
248 241
 
249 242
 		// Traitement du POST
250
-		if ($request->isMethod('POST'))
251
-		{
243
+		if ($request->isMethod('POST')) {
252 244
 			// envoi post non ajax => 404
253
-			if (!$request->isXmlHttpRequest())
254
-			{
245
+			if (!$request->isXmlHttpRequest()) {
255 246
 				throw $this->createNotFoundException();
256 247
 			}
257 248
 
258 249
 			$form->handleRequest($request);
259
-			if ($form->isSubmitted())
260
-			{
261
-				if ($form->isValid())
262
-				{
250
+			if ($form->isSubmitted()) {
251
+				if ($form->isValid()) {
263 252
 					// créé la classe distante
264 253
 					$repository = $this->getRepository(Trainer::class);
265 254
 					$trainer = $jupyter->getTrainer();
266
-					if ($trainer)
267
-					{
255
+					if ($trainer) {
268 256
 						$jupyter->setTrainer($trainer);
269 257
 						$this->createTrainerJupyterServer($jupyter);
270 258
 					}
@@ -276,117 +264,110 @@ class PhoenixServices extends Services
276 264
 					$manager->flush();
277 265
 
278 266
 					return $jupyter->getSequenceItemId();
279
-				}
280
-				else
281
-				{
267
+				} else {
282 268
 					throw new \InvalidArgumentException($form->getErrors(true));
283 269
 				}
284
-			}
285
-			else
286
-			{
270
+			} else {
287 271
 				throw new \InvalidArgumentException($form->getErrors(true));
288 272
 			}
289 273
 		}
290 274
 		return null;
291
-    }
292
-
293
-    /**
294
-     * retourne les variables necessaire pour l'affichage du bloc au niveau du parcours
295
-     * 
296
-     * @return array
297
-     */
298
-    public function getBlocVariables($item)
299
-    {
300
-        return array(
301
-            'sequenceItemClass' => 'ali-SequenceJupyterClassroom',
302
-            'label' => 'Jupyter',
303
-            'imageClass' => 'ali-EditorJupyterEdit',
304
-            'image' => "bundles/logiprophoenixjupyter/images/icon-jupyter.svg",
305
-            'description' => 'toto',
306
-            'bottom_layout' => '@LogiproPhoenixJupyter/back-office/blocBottom.html.twig'
307
-        );
308
-    }
309
-
310
-    public function getLearningSpaceBlocVariables($item)
311
-    {
312
-        return array(
313
-            'middle_layout' => '@LogiproPhoenixJupyter/learning_space/blocMiddle.html.twig',
314
-            'bottom_layout' => '@LogiproPhoenixJupyter/learning_space/blocBottom.html.twig',
315
-            'hide_trainer' => true,
316
-            'image' => "bundles/logiprophoenixjupyter/images/icon-ls-jupyter.svg",
317
-            'type' => ($item->getIsAssesment())?'JupyterEval':'Jupyter',
318
-            'type_name' => ($item->getIsAssesment())?'Évaluation':'Jupyter',
319
-            'notebookname' => basename($item->getUrl()),
320
-        );
321
-    }
322
-
323
-    public function getLearningSpaceScript()
324
-    {
325
-        return 'bundles/logiprophoenixjupyter/Js/learning-space.js';
326
-    }
327
-
328
-    public function getLearningSpaceCss()
329
-    {
330
-        return 'bundles/logiprophoenixjupyter/Css/learning-space.css';
331
-    }
332
-
333
-
334
-    /**
335
-     * retourne le FormLayer pour l'édition du JupyterVirtualClassroom
336
-     * 
337
-     * @param JupyterVirtualClassroom $jupyterVirtualClassroom
338
-     * 
339
-     * @return FormLayer
340
-     */
341
-    public function getHtmlEdit(JupyterVirtualClassroom $jupyterVirtualClassroom) : FormLayer
342
-    {
343
-        $formLayer  = new FormLayer();
275
+	}
276
+
277
+	/**
278
+	 * retourne les variables necessaire pour l'affichage du bloc au niveau du parcours
279
+	 * 
280
+	 * @return array
281
+	 */
282
+	public function getBlocVariables($item)
283
+	{
284
+		return array(
285
+			'sequenceItemClass' => 'ali-SequenceJupyterClassroom',
286
+			'label' => 'Jupyter',
287
+			'imageClass' => 'ali-EditorJupyterEdit',
288
+			'image' => "bundles/logiprophoenixjupyter/images/icon-jupyter.svg",
289
+			'description' => 'toto',
290
+			'bottom_layout' => '@LogiproPhoenixJupyter/back-office/blocBottom.html.twig'
291
+		);
292
+	}
293
+
294
+	public function getLearningSpaceBlocVariables($item)
295
+	{
296
+		return array(
297
+			'middle_layout' => '@LogiproPhoenixJupyter/learning_space/blocMiddle.html.twig',
298
+			'bottom_layout' => '@LogiproPhoenixJupyter/learning_space/blocBottom.html.twig',
299
+			'hide_trainer' => true,
300
+			'image' => "bundles/logiprophoenixjupyter/images/icon-ls-jupyter.svg",
301
+			'type' => ($item->getIsAssesment()) ? 'JupyterEval' : 'Jupyter',
302
+			'type_name' => ($item->getIsAssesment()) ? 'Évaluation' : 'Jupyter',
303
+			'notebookname' => basename($item->getUrl()),
304
+		);
305
+	}
306
+
307
+	public function getLearningSpaceScript()
308
+	{
309
+		return 'bundles/logiprophoenixjupyter/Js/learning-space.js';
310
+	}
311
+
312
+	public function getLearningSpaceCss()
313
+	{
314
+		return 'bundles/logiprophoenixjupyter/Css/learning-space.css';
315
+	}
316
+
317
+
318
+	/**
319
+	 * retourne le FormLayer pour l'édition du JupyterVirtualClassroom
320
+	 * 
321
+	 * @param JupyterVirtualClassroom $jupyterVirtualClassroom
322
+	 * 
323
+	 * @return FormLayer
324
+	 */
325
+	public function getHtmlEdit(JupyterVirtualClassroom $jupyterVirtualClassroom): FormLayer
326
+	{
327
+		$formLayer  = new FormLayer();
344 328
 
345 329
 		$options['search_action'] = $this->generateUrl('nbo_user_search_trainer');
346 330
 		$options['replacement_value'] = $this->getTrainerDatasBySequenceItem($jupyterVirtualClassroom);
347 331
 
348
-		$form = $form = $this->createForm(JupyterUpdateType::class, $jupyterVirtualClassroom,$options);
332
+		$form = $form = $this->createForm(JupyterUpdateType::class, $jupyterVirtualClassroom, $options);
349 333
 
350 334
 		$formLayer->setForm($form);
351 335
 		$formLayer->setLayout($this->layoutPath . 'formUpdate.html.twig');
352 336
 
353
-        return $formLayer;
354
-    }
337
+		return $formLayer;
338
+	}
355 339
 
356
-    public function getRoutes()
357
-    {
358
-        return '@LogiproPhoenixJupyterBundle/Resources/config/routes.yaml';
359
-    }
340
+	public function getRoutes()
341
+	{
342
+		return '@LogiproPhoenixJupyterBundle/Resources/config/routes.yaml';
343
+	}
360 344
 
361
-    public function preFlush($request,$form,$sequenceItem)
362
-    {
345
+	public function preFlush($request, $form, $sequenceItem)
346
+	{
363 347
 		$personId = $form->get('person_id')->getData();
364
-        
365
-        // met en place le formateur
348
+
349
+		// met en place le formateur
366 350
 		$trainerRepository = $this->getRepository(Trainer::class);
367 351
 		$trainer = $trainerRepository->find($personId);
368
-		if ($trainer)
369
-		{
352
+		if ($trainer) {
370 353
 			$sequenceItem->setTrainer($trainer);
371
-		}
372
-		else {
354
+		} else {
373 355
 			$sequenceItem->removeTrainer();
374 356
 		}
375 357
 
376
-        // récupére kes informations de l'ancien formateur
358
+		// récupére kes informations de l'ancien formateur
377 359
 		$oldEntityData = $this->getManager()->getUnitOfWork()->getOriginalEntityData($sequenceItem);
378 360
 		$oldTrainer = $oldEntityData['trainer'];
379 361
 		$oldTitle = $oldEntityData['title'];
380 362
 
381
-        // test s'il y a un upload
363
+		// test s'il y a un upload
382 364
 		$upload = null;
383 365
 		$uploadedFile = $form['notebook']->getData();
384
-		if ($uploadedFile)
385
-		{
366
+		if ($uploadedFile) {
386 367
 			$upload = $this->uploader->upload($uploadedFile);
387 368
 		}
388
-		
389
-		
369
+
370
+
390 371
 		// calcul si le formateur a changé
391 372
 		$currentTrainer = $sequenceItem->getTrainer();
392 373
 		$trainerChanged = $oldTrainer != $currentTrainer;
@@ -398,91 +379,79 @@ class PhoenixServices extends Services
398 379
 		$mustStopServer = array();
399 380
 
400 381
 		// si le titre change ou si le formateur change ou si l'upload est rempli
401
-		if ($upload || $trainerChanged || $titleChanged)
402
-		{
382
+		if ($upload || $trainerChanged || $titleChanged) {
403 383
 			// calcul le contenu du notebook
404 384
 			$content = null;
405
-			if ($upload)
406
-			{
385
+			if ($upload) {
407 386
 				$content = $upload;
408 387
 			}
409 388
 			// on tente de récupérer le contenu du notebook de l'ancien formateur
410
-			elseif ($oldTrainer)
411
-			{
389
+			elseif ($oldTrainer) {
412 390
 				$response = $this->startServer($oldTrainer);
413
-				if (!$response['isStarted'])
414
-				{
391
+				if (!$response['isStarted']) {
415 392
 					$mustStopServer[] = $oldTrainer;
416 393
 				}
417 394
 			}
418 395
 
419 396
 			// si l'item a un formateur
420
-			if ($currentTrainer)
421
-			{
397
+			if ($currentTrainer) {
422 398
 				$fromUrl = null;
423
-				if ($oldTrainer)
424
-				{
399
+				if ($oldTrainer) {
425 400
 					$fromUrl = $oldEntityData['url'];
426 401
 				}
427
-				
402
+
428 403
 				// met en place le compte et le contenu du notebook
429
-				$url = $this->createTrainerJupyterServer($sequenceItem,$fromUrl,$content,false);
404
+				$url = $this->createTrainerJupyterServer($sequenceItem, $fromUrl, $content, false);
430 405
 
431 406
 				// calcul le nouvel url si le formateur a changé et/ou si le titre a changé
432 407
 				$sequenceItem->setUrl($url);
433 408
 			}
434 409
 			// il y avait un formateur et on l'a supprimé, donc le formateur n'a plu le notebook
435
-			elseif ($oldTrainer)
436
-			{
410
+			elseif ($oldTrainer) {
437 411
 				$layer = $this->getApiService();
438 412
 				$$oldToken = $this->getToken($oldTrainer);
439
-				if ($$oldToken)
440
-				{
413
+				if ($$oldToken) {
441 414
 					$oldSequenceItem = new JupyterVirtualClassroom();
442 415
 					$oldSequenceItem->setUrl($oldEntityData['url']);
443 416
 					$oldSequenceItem->setSequence($sequenceItem->getSequence());
444
-					$layer->deleteNotebook($$oldToken,$oldSequenceItem);
417
+					$layer->deleteNotebook($$oldToken, $oldSequenceItem);
445 418
 				}
446 419
 			}
447 420
 		}
448
-		foreach ($mustStopServer as $token)
449
-		{
421
+		foreach ($mustStopServer as $token) {
450 422
 			// fixme a dev
451 423
 			//$layer->stopServer($token);
452 424
 		}
453
-    }
425
+	}
454 426
 
455
-    public function getManifestPath()
456
-    {
457
-        return 'vendor/logipro/PhoenixJupyterBundle/Resources/public/bundles/logiprophoenixjupyter/manifest.json';
458
-    }
427
+	public function getManifestPath()
428
+	{
429
+		return 'vendor/logipro/PhoenixJupyterBundle/Resources/public/bundles/logiprophoenixjupyter/manifest.json';
430
+	}
459 431
 
460 432
 
461
-    public function startTrainerServer(JupyterVirtualClassroom $classRoom) : string
462
-    {
433
+	public function startTrainerServer(JupyterVirtualClassroom $classRoom): string
434
+	{
463 435
 		// récupère le token du formateur
464 436
 		$trainer = $classRoom->getTrainer();
465 437
 		$jupyterToken = null;
466
-		if ($trainer)
467
-		{
438
+		if ($trainer) {
468 439
 			$jupyterToken = $this->getToken($trainer);
469 440
 		}
470
-		
441
+
471 442
 
472 443
 		// si pas de token, on tente de créé le serveur
473 444
 		$tokenExist = !is_null($jupyterToken);
474
-		if (!$tokenExist)
475
-		{
445
+		if (!$tokenExist) {
476 446
 			$jupyterToken = $this->createTrainerJupyterServer($classRoom);
477 447
 			$manager->flush();
478
-        }
479
-        
480
-        // demarre le serveur du formateur
448
+		}
449
+
450
+		// demarre le serveur du formateur
481 451
 		$this->startServer($classRoom->getTrainer());
482 452
 
483
-        // redirige sur jupyter
484
-		if ($jupyterToken)
485
-		{
453
+		// redirige sur jupyter
454
+		if ($jupyterToken) {
486 455
 			// calcul l'url d'accès au notebook
487 456
 			$apiService = $this->getApiService();
488 457
 			$classroomUrl = $apiService->getFolderUrlByNotebookUrl($classRoom->getUrl());
@@ -491,24 +460,22 @@ class PhoenixServices extends Services
491 460
 			$endUrl = $classroomUrl . '?token=' . $jupyterToken->getToken();
492 461
 
493 462
 			// ajoute le protocole
494
-			$scheme = parse_url ($_SERVER['JUPYTER_API_URL'],PHP_URL_SCHEME);
495
-			if (strpos('http',$endUrl) === false)
496
-			{
463
+			$scheme = parse_url($_SERVER['JUPYTER_API_URL'], PHP_URL_SCHEME);
464
+			if (strpos('http', $endUrl) === false) {
497 465
 				$endUrl = $scheme . '://' . $endUrl;
498
-            }
499
-            return $endUrl;
466
+			}
467
+			return $endUrl;
500 468
 		}
501
-        return "";
469
+		return "";
502 470
 	}
503 471
 
504
-	private function createStudentServer(Person $person,JupyterVirtualClassroom $sequenceItem) : string
472
+	private function createStudentServer(Person $person, JupyterVirtualClassroom $sequenceItem): string
505 473
 	{
506 474
 		$personToken = $this->getToken($person);
507 475
 		$trainerToken = $this->getToken($sequenceItem->getTrainer());
508 476
 
509 477
 		// créé le token apprenant s'il n'en a pas
510
-		if (!$personToken)
511
-		{
478
+		if (!$personToken) {
512 479
 			$personToken = new jupyterToken();
513 480
 			$personToken->setPerson($person);
514 481
 		}
@@ -523,32 +490,29 @@ class PhoenixServices extends Services
523 490
 		}
524 491
 		else
525 492
 		{*/
526
-			// cours classique
527
-			$url = $layer->createStudentServerIfNoneAndSetContent($sequenceItem,$trainerToken,$personToken,true);
493
+		// cours classique
494
+		$url = $layer->createStudentServerIfNoneAndSetContent($sequenceItem, $trainerToken, $personToken, true);
528 495
 		//}
529 496
 
530 497
 		// persist le token s'il vient d'être créé
531 498
 		$manager = $this->getManager();
532
-		if (!$personToken->getTokenId())
533
-		{
499
+		if (!$personToken->getTokenId()) {
534 500
 			$manager->persist($personToken);
535 501
 		}
536 502
 
537 503
 		return $url;
538
-
539 504
 	}
540
-	
541
-	public function startStudentServer(JupyterVirtualClassroom $sequenceItem,Person $person) : string
505
+
506
+	public function startStudentServer(JupyterVirtualClassroom $sequenceItem, Person $person): string
542 507
 	{
543 508
 		// recherche l'inscription dans la classe jupyter
544 509
 		$jupyterClassroomRegistrationRepository = $this->getRepository(JupyterClassroomRegistration::class);
545 510
 
546 511
 		// recherche l'url pour l'apprenant de l'inscription
547
-		$jupyterClassroomRegistration = $jupyterClassroomRegistrationRepository->getLastClassroomRegistration($sequenceItem,$person);
512
+		$jupyterClassroomRegistration = $jupyterClassroomRegistrationRepository->getLastClassroomRegistration($sequenceItem, $person);
548 513
 		$registrationExist = !is_null($jupyterClassroomRegistration);
549 514
 
550
-		if (!$registrationExist)
551
-		{
515
+		if (!$registrationExist) {
552 516
 			// créé une nouvelle ClassroomRegistration pour cet apprenant
553 517
 			$jupyterClassroomRegistration = new JupyterClassroomRegistration();
554 518
 			$jupyterClassroomRegistration->setPerson($person);
@@ -557,12 +521,11 @@ class PhoenixServices extends Services
557 521
 			// récupère le contenu de la classe du formateur
558 522
 			$trainer = $sequenceItem->getTrainer();
559 523
 			$trainerToken = $this->getToken($trainer);
560
-			if (!$trainerToken)
561
-			{
524
+			if (!$trainerToken) {
562 525
 				throw new \Exception();
563 526
 			}
564 527
 
565
-			$url = $this->createStudentServer($person,$sequenceItem);
528
+			$url = $this->createStudentServer($person, $sequenceItem);
566 529
 
567 530
 			// met en place l'url de la ClassroomRegistration
568 531
 			$jupyterClassroomRegistration->setUrl($url);
@@ -575,28 +538,25 @@ class PhoenixServices extends Services
575 538
 
576 539
 		// demarre le serveur de l'apprenant
577 540
 		$response = $this->startServer($person);
578
-		
541
+
579 542
 		// récupère le token de l'apprenant
580 543
 		$personToken = $this->getToken($person);
581 544
 
582 545
 		// redirige sur jupyter
583 546
 		$classroomRegistrationUrl = $jupyterClassroomRegistration->getUrl();
584 547
 		$endUrl = $classroomRegistrationUrl . '?token=' . $personToken->getToken();
585
-		
548
+
586 549
 		// test si le notebook existe encore
587
-		if ($registrationExist)
588
-		{
550
+		if ($registrationExist) {
589 551
 			// s'il n'existe pas => on redirige l'utilisateur sur le dossier
590 552
 			$layer = $this->getApiService();
591
-			if (!$layer->notebookExist($personToken,$classroomRegistrationUrl))
592
-			{
553
+			if (!$layer->notebookExist($personToken, $classroomRegistrationUrl)) {
593 554
 				$endUrl = $layer->getFolderUrlByNotebookUrl($classroomRegistrationUrl);
594 555
 			}
595 556
 		}
596 557
 
597
-		$scheme = parse_url ($_SERVER['JUPYTER_API_URL'],PHP_URL_SCHEME);
598
-		if (strpos('http',$endUrl) === false)
599
-		{
558
+		$scheme = parse_url($_SERVER['JUPYTER_API_URL'], PHP_URL_SCHEME);
559
+		if (strpos('http', $endUrl) === false) {
600 560
 			$endUrl = $scheme . '://' . $endUrl;
601 561
 		}
602 562
 
@@ -611,7 +571,7 @@ class PhoenixServices extends Services
611 571
 	 * @param JupyterVirtualClassroom $sequenceItem
612 572
 	 * @return void
613 573
 	 */
614
-	public function sendStudentNotebookAndGetScore(JupyterVirtualClassroom $sequenceItem,Person $person)
574
+	public function sendStudentNotebookAndGetScore(JupyterVirtualClassroom $sequenceItem, Person $person)
615 575
 	{
616 576
 		$personToken = $this->getToken($person);
617 577
 
@@ -620,14 +580,13 @@ class PhoenixServices extends Services
620 580
 		// créé le serveur de l'apprenant + met en place son cours
621 581
 		$layer = $this->getApiService();
622 582
 		// met en place le score automatiquement
623
-		$data = $layer->sendStudentNotebook($trainerToken,$personToken,$sequenceItem);
583
+		$data = $layer->sendStudentNotebook($trainerToken, $personToken, $sequenceItem);
624 584
 
625 585
 		$jupyterClassroomRegistrationRepository = $this->getRepository(JupyterClassroomRegistration::class);
626 586
 
627 587
 		// recherche l'url pour l'apprenant de l'inscription
628
-		$jupyterClassroomRegistration = $jupyterClassroomRegistrationRepository->getLastClassroomRegistration($sequenceItem,$person);
629
-		if ($jupyterClassroomRegistration)
630
-		{
588
+		$jupyterClassroomRegistration = $jupyterClassroomRegistrationRepository->getLastClassroomRegistration($sequenceItem, $person);
589
+		if ($jupyterClassroomRegistration) {
631 590
 			// création de la soumission
632 591
 			$manager = $this->getManager();
633 592
 
@@ -639,7 +598,7 @@ class PhoenixServices extends Services
639 598
 		}
640 599
 
641 600
 		// supprime le notebook
642
-		$layer->deleteNotebook($personToken,$sequenceItem);
601
+		$layer->deleteNotebook($personToken, $sequenceItem);
643 602
 		$jupyterClassroomRegistration->setUrl(null);
644 603
 
645 604
 		$manager->flush();
@@ -647,23 +606,26 @@ class PhoenixServices extends Services
647 606
 		return $submission->getScoreFormat();
648 607
 	}
649 608
 
650
-	public function resetNotebook(JupyterVirtualClassroom $sequenceItem,Person $person) : bool
609
+	public function resetNotebook(JupyterVirtualClassroom $sequenceItem, Person $person): bool
651 610
 	{
652 611
 		$layer = $this->getApiService();
653
-		
612
+
654 613
 		$personToken = $this->getToken($person);
655
-		
614
+
656 615
 		$trainerToken = $this->getToken($sequenceItem->getTrainer());
657 616
 
658 617
 		// recherche l'url pour l'apprenant de l'inscription
659 618
 		$jupyterClassroomRegistrationRepository = $this->getRepository(JupyterClassroomRegistration::class);
660
-		$jupyterClassroomRegistration = $jupyterClassroomRegistrationRepository->getLastClassroomRegistration($sequenceItem,$person);
661
-		if (!$jupyterClassroomRegistration)
662
-		{
619
+		$jupyterClassroomRegistration = $jupyterClassroomRegistrationRepository->getLastClassroomRegistration($sequenceItem, $person);
620
+		if (!$jupyterClassroomRegistration) {
663 621
 			return false;
664 622
 		}
665 623
 
666
-		return $layer->resetNotebook($trainerToken,$personToken,$sequenceItem->getUrl(),$jupyterClassroomRegistration->getUrl());
624
+		return $layer->resetNotebook($trainerToken, $personToken, $sequenceItem->getUrl(), $jupyterClassroomRegistration->getUrl());
625
+	}
626
+
627
+	public function getIconMin()
628
+	{
629
+		return 'bundles/logiprophoenixjupyter/images/icon-jupyter-min.svg';
667 630
 	}
668
-    
669 631
 }

+ 0
- 0
composer.json View File


Loading…
Cancel
Save