Skip to content

Commit 4a95a58

Browse files
author
laurent.abbal
committed
fix
1 parent 078e142 commit 4a95a58

6 files changed

+57
-4
lines changed

resources/views/copies/inc-copie-correction-afficher-js.blade.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ function estDivExclu(element) {
226226
227227
@foreach($copie_cells AS $copie_cell)
228228
@if ($copie_cell->cell_type == 'code')
229+
229230
editor_code_eleve[{{ $loop->iteration }}] = ace.edit('code_editor_eleve_' + {{ $loop->iteration }}, {
230231
theme: "ace/theme/puzzle_code",
231232
mode: "ace/mode/python",
@@ -249,7 +250,7 @@ function estDivExclu(element) {
249250
tabSize: 4
250251
});
251252
editor_code_eleve[{{ $loop->iteration }}].container.style.lineHeight = 1.5;
252-
editor_code_eleve[{{ $loop->iteration }}].setValue({!! json_encode($copie_cell->source[0]) ?? '' !!}, -1);
253+
editor_code_eleve[{{ $loop->iteration }}].setValue({!! json_encode($copie_cell->source[0] ?? '') !!}, -1);
253254
254255
editor_code_enseignant[{{ $loop->iteration }}] = ace.edit('code_editor_enseignant_' + {{ $loop->iteration }}, {
255256
theme: "ace/theme/puzzle_code",
@@ -276,7 +277,8 @@ function estDivExclu(element) {
276277
@if ($copie->correction_enseignant != null)
277278
editor_code_enseignant[{{ $loop->iteration }}].setValue({!! json_encode($copie_cell->source[1]) ?? '' !!}, -1);
278279
@elseif ($sujet->type == "exo")
279-
editor_code_enseignant[{{ $loop->iteration }}].setValue({!! json_encode($sujet_json->code->{$loop->iteration}->code_enseignant) ?? '' !!}, -1);
280+
// enseignant
281+
editor_code_enseignant[{{ $loop->iteration }}].setValue({!! json_encode($sujet_json->code->{$loop->iteration}->code_enseignant ?? '') !!}, -1);
280282
@endif
281283
282284
@endif

resources/views/copies/inc-copie-correction-afficher.blade.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@
1818
<div id="programme_titre_{{ $loop->iteration }}" class="font-weight-bold text-monospace">PROGRAMME</div>
1919
@endif
2020
@endif
21-
<div class="cellule_content mb-2 p-3">
21+
<div class="cellule_content mb-2 p-3">
22+
23+
<!-- Code élève -->
2224
<div class="text-monospace small text-muted"><kbd>1</kbd> Code élève <i class="text-muted small">en lecture seule</i></div>
2325
<div id="code_editor_eleve_{{ $loop->iteration }}" class="mt-1 mb-2 code-editor"></div>
26+
27+
<!-- Code enseignant -->
2428
<div class="text-monospace small text-muted"><kbd>2</kbd> Code enseignant</div>
2529
<div id="code_editor_enseignant_{{ $loop->iteration }}" class="mt-1 mb-2 code-editor"></div>
30+
31+
<!-- Console -->
2632
<div class="row no-gutters">
2733
<div class="col-auto mr-2">
2834
<div class="form-check d-block text-right pl-0">

resources/views/devoirs/devoir-console.blade.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@
3535
</div>
3636

3737
<div class="col-md-10 pl-4 pr-4">
38+
39+
<h1 class="text-center">DEVOIR</h1>
40+
3841
<div class="row">
42+
3943
<div class="col-md-12 text-monospace p-2 pl-3 pr-3 mb-3" style="border:dashed 2px #e3342f;border-radius:8px;">
40-
44+
4145
@if(isset($_GET['i']) AND !Auth::check())
4246
<div class="text-monospace text-danger text-center font-weight-bold m-2">SAUVEGARDEZ LES INFORMATIONS CI-DESSOUS AVANT DE QUITTER CETTE PAGE</div>
4347
@endif

resources/views/devoirs/devoir-corriger.blade.php

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
$page_devoir_corriger = true;
23
$devoir = App\Models\Devoir::find(Crypt::decryptString($devoir_id));
34
if (!$devoir) {
45
echo "<pre>Ce devoir n'existe pas</pre>";
@@ -64,6 +65,9 @@
6465
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
6566
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css">
6667
<script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
68+
69+
70+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
6771

6872
<style>
6973
html,body {

resources/views/sujets/inc-sujet-afficher.blade.php

+35
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,41 @@
3737
@endforeach
3838
@endif
3939

40+
@if (isset($page_devoir_corriger))
41+
@foreach($sujet_json->code AS $code)
42+
@if(count((array) $sujet_json->code) > 1)
43+
<div class="text-monospace mt-3 small">PROGRAMME {{ $loop->iteration }}</div>
44+
@else
45+
<div class="text-monospace mt-3 small">PROGRAMME</div>
46+
@endif
47+
<div class="p-3" style="border:solid #ced4da 1px;border-radius:4px;background-color:#F3F5F7;">
48+
<!-- CODE ELEVE -->
49+
<div class="mb-1 text-monospace small">{{strtoupper(__("code ÉlÈve"))}}</div>
50+
<div class="highlight-me"><pre><code class="language-python rounded">{{ $code->code_eleve}} def fonc():</code></pre></div>
51+
<!-- /CODE ELEVE -->
52+
53+
<!-- CODE ENSEIGNANT -->
54+
<div class="mt-4 text-monospace small">{{strtoupper(__("code enseignant"))}}</div>
55+
<div class="highlight-me"><pre><code class="language-python rounded">{{ $code->code_enseignant }}</code></pre></div>
56+
<!-- /CODE ENSEIGNANT -->
57+
58+
<!-- SOLUTION -->
59+
<div class="mt-4 text-monospace small">{{strtoupper(__('solution possible'))}}</div>
60+
<div class="highlight-me"><pre><code class="language-python rounded">{{ $code->code_solution }}</code></pre></div>
61+
<!-- /SOLUTION -->
62+
</div>
63+
@endforeach
64+
@endif
65+
66+
<!-- Inclure Highlight.js -->
67+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
68+
<script>
69+
// Cibler uniquement les div avec la classe "highlight-me"
70+
document.querySelectorAll('.highlight-me pre code').forEach((block) => {
71+
hljs.highlightElement(block);
72+
});
73+
</script>
74+
4075
{{-- ============== --}}
4176
{{-- ==== /EXO ==== --}}
4277
{{-- ============== --}}

resources/views/sujets/sujet-console.blade.php

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848

4949
<div class="col-md-10">
5050

51+
<h1 class="text-center">SUJET</h1>
52+
5153
@if($sujet->user_id == 0 OR !Auth::check())
5254
<div class="row ml-1 mr-1">
5355
<div class="col-md-10 offset-md-1 text-monospace p-2 pl-5 pr-5 mb-3" style="border:dashed 2px #e3342f;border-radius:8px;">

0 commit comments

Comments
 (0)