Skip to content

Commit

Permalink
~
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent.abbal committed Nov 3, 2024
1 parent e1731f1 commit 078e142
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 46 deletions.
5 changes: 3 additions & 2 deletions resources/views/devoirs-v1/devoir-console.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
$devoir = App\Models\Devoir::where('jeton_secret', $jeton_secret)->first();
//$devoir = App\Models\Devoir::where('jeton_secret', $jeton_secret)->first();
$devoir = App\Models\Devoir::find(Crypt::decryptString($devoir_id));
if (!$devoir) {
echo "<pre>Ce devoir n'existe pas</pre>";
exit();
Expand Down Expand Up @@ -123,7 +124,7 @@

<div class="row mt-3">
<div class="col-md-4 offset-4 text-center">
<a class="btn btn-dark btn-sm d-block" href="/devoir-imprimer/{{$jeton_secret}}" role="button"><i class="fa-solid fa-print mr-2"></i> imprimer les comptes-rendus</a>
<a class="btn btn-dark btn-sm d-block" href="/devoir-imprimer/{{ Crypt::encryptString($devoir->id) }}" role="button"><i class="fa-solid fa-print mr-2"></i> imprimer les comptes-rendus</a>
<div class="text-muted small mt-1">pour les annoter si nécessaire et les distribuer aux élèves</div>
</div>
</div>
Expand Down
50 changes: 9 additions & 41 deletions resources/views/devoirs-v1/devoir-imprimer.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php
$devoir = App\Models\Devoir::where('jeton_secret', $jeton_secret)->first();
//$devoir = App\Models\Devoir::where('jeton_secret', $jeton_secret)->first();
$devoir = App\Models\Devoir::find(Crypt::decryptString($devoir_id));
if (!$devoir){
echo "<pre>Cet entraînement n'existe pas</pre>";
exit();
}
$devoir_eleves = App\Models\Devoir_eleve::where('jeton_devoir', $devoir->jeton)->orderBy('pseudo')->get();
$devoir_eleves = App\Models\Copie::where('jeton_devoir', $devoir->jeton)->orderBy('pseudo')->get();
?>
<!doctype html>
<html lang="fr">
Expand Down Expand Up @@ -44,13 +45,13 @@
</style>
<title>ENTRAÎNEMENT / DEVOIR | {{$devoir->jeton}} | IMPRIMER</title>
</head>
<body class="no-mathjax">
<body>

<div id="header" class="container pt-3">
<div class="row pt-3">
<div class="col-md-2">
<div class="text-right mb-3">
<a class="btn btn-light btn-sm" href="/devoir-console/{{strtoupper($jeton_secret)}}" role="button"><i class="fas fa-arrow-left"></i></a>
<a class="btn btn-light btn-sm" href="/devoir-console/{{ $devoir->jeton_secret }}" role="button"><i class="fas fa-arrow-left"></i></a>
</div>
</div>
<div class="col-md-8">
Expand All @@ -67,18 +68,7 @@

<!-- CONSIGNES -->
<div class="text-monospace mt-3">{{strtoupper(__('consignes'))}}</div>
<div class="mathjax" style="padding:10px 15px 0px 15px;border-radius:4px;border:solid 1px gray;background-color:white;">
<?php
include('lib/parsedownmath/ParsedownMath.php');
$Parsedown = new ParsedownMath([
'math' => [
'enabled' => true, // Write true to enable the module
'matchSingleDollar' => true // default false
]
]);
echo $Parsedown->text($devoir->consignes_eleve);
?>
</div>
<div class="markdown_content" style="padding:10px 15px 0px 15px;border-radius:4px;border:solid 1px gray;background-color:white;">{{ $devoir->consignes_eleve }}</div>
<!-- CONSIGNES -->

<!-- SOLUTION -->
Expand Down Expand Up @@ -113,17 +103,7 @@

<!-- CONSIGNES -->
<div class="text-monospace mt-3">{{strtoupper(__('consignes'))}}</div>
<div class="mathjax" style="padding:12px 15px 0px 15px;border-radius:4px;border:solid 1px gray;background-color:white;">
<?php
$Parsedown = new ParsedownMath([
'math' => [
'enabled' => true, // Write true to enable the module
'matchSingleDollar' => true // default false
]
]);
echo $Parsedown->text($devoir->consignes_eleve);
?>
</div>
<div class="markdown_content" style="padding:12px 15px 0px 15px;border-radius:4px;border:solid 1px gray;background-color:white;">{{ $devoir->consignes_eleve }}</div>
<!-- CONSIGNES -->

<!-- CODE ELEVE -->
Expand Down Expand Up @@ -152,21 +132,9 @@
{{-- /PRINT --}}

@include('inc-bottom-js')
@include('markdown/inc-markdown-afficher-js')

<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
},
options: {
ignoreHtmlClass: "no-mathjax",
processHtmlClass: "mathjax"
}
};
</script>
<script type="text/javascript" id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>



<script src="{{ asset('js/ace/ace.js') }}" type="text/javascript" charset="utf-8"></script>
Expand Down
13 changes: 10 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,21 @@
$devoir = App\Models\Devoir::where('jeton_secret', $jeton_secret)->first();
if ($devoir->sujet_id == NULL){
return view('devoirs-v1/devoir-console')->with('jeton_secret', $jeton_secret);
}else{
} else {
return view('devoirs/devoir-console')->with('jeton_secret', $jeton_secret);
}
})->name('devoir-console');

Route::get('/devoir-supervision/{devoir_id}', function ($devoir_id){return view('devoirs/devoir-supervision')->with('devoir_id', $devoir_id);})->name('devoir-supervision');
Route::get('/devoir-imprimer/{devoir_id}', function ($devoir_id){return view('devoirs/devoir-imprimer')->with('devoir_id', $devoir_id);})->name('devoir-imprimer');
Route::get('/devoir-imprimer/{devoir_id}', function ($devoir_id){
$devoir = App\Models\Devoir::find(Crypt::decryptString($devoir_id));
if ($devoir->sujet_id == NULL){
return view('devoirs-v1/devoir-imprimer')->with('devoir_id', $devoir_id);
} else {
return view('devoirs/devoir-imprimer')->with('devoir_id', $devoir_id);
}
})->name('devoir-imprimer');

Route::get('/devoir-supervision/{devoir_id}', function ($devoir_id){return view('devoirs/devoir-supervision')->with('devoir_id', $devoir_id);})->name('devoir-supervision');
Route::get('/devoir-creer', [App\Http\Controllers\DevoirController::class, 'redirect']);
Route::get('/devoir-creer/{sujet_id}', function ($sujet_id) {return view('devoirs/devoir-creer')->with('sujet_id', $sujet_id);});
Route::get('/devoir-modifier/{devoir_id}', function ($devoir_id) {return view('devoirs/devoir-creer')->with('devoir_id', $devoir_id);});
Expand Down

0 comments on commit 078e142

Please sign in to comment.