Merge branch 'master' of https://codefirst.iut.uca.fr/git/nathan.boileau/Scripted
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
commit
c43c1c6d74
@ -0,0 +1,2 @@
|
|||||||
|
php_flag display_errors on
|
||||||
|
php_value error_reporting E_ALL
|
@ -0,0 +1,3 @@
|
|||||||
|
display_errors = On
|
||||||
|
log_errors = Off
|
||||||
|
error_reporting = E_ALL & E_NOTICE & E_DEPRECATED & E_STRICT & E_WARNING
|
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
Class Nettoyage{
|
||||||
|
public function clean($input)
|
||||||
|
{
|
||||||
|
// Supprime les espaces en début et fin de chaîne
|
||||||
|
$output = trim($input);
|
||||||
|
|
||||||
|
// Supprime les balises HTML
|
||||||
|
$output = strip_tags($output);
|
||||||
|
|
||||||
|
// Supprime les caractères spéciaux
|
||||||
|
// $output = htmlspecialchars($output);
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
public function cleanEmail($input){
|
||||||
|
$output = $this->clean($input);
|
||||||
|
$output = filter_var($output, FILTER_SANITIZE_EMAIL);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function cleanInt($input){
|
||||||
|
$output = $this->clean($input);
|
||||||
|
$output = filter_var($output, FILTER_SANITIZE_NUMBER_INT);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 4.6 MiB After Width: | Height: | Size: 4.3 MiB |
After Width: | Height: | Size: 296 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
//~ Function that test the user code
|
||||||
|
|
||||||
|
async function submit(){
|
||||||
|
var test = editor.getValue()+`\n
|
||||||
|
import random as r
|
||||||
|
def double_elementVerif(list):
|
||||||
|
return [i*2 for i in list]
|
||||||
|
|
||||||
|
def testDoubleElement(x):
|
||||||
|
l=[1,2,3,2,1]
|
||||||
|
if(double_element(l) != [2,4,6,4,2]):
|
||||||
|
return False
|
||||||
|
l=[9,5,7,7,9]
|
||||||
|
if(double_element(l) != [18,10,14,14,18]):
|
||||||
|
return False
|
||||||
|
l=[]
|
||||||
|
for i in range(x):
|
||||||
|
for j in range(r.randint(1,10)):
|
||||||
|
l.append(r.randint(0,9))
|
||||||
|
if(double_elementVerif(l)!=double_element(l)):
|
||||||
|
return False
|
||||||
|
l=[]
|
||||||
|
return True
|
||||||
|
|
||||||
|
print(testDoubleElement(5))
|
||||||
|
`;
|
||||||
|
exec("print ('True')", "code");
|
||||||
|
exec(test, "solution");
|
||||||
|
result.innerHTML = "Test en cours...";
|
||||||
|
await new Promise(r => setTimeout(r, 1500));
|
||||||
|
check();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,189 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Double Element</title>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
|
||||||
|
integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
/>
|
||||||
|
<script
|
||||||
|
src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
|
||||||
|
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
></script>
|
||||||
|
<script
|
||||||
|
src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
|
||||||
|
integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
></script>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://fonts.googleapis.com/icon?family=Material+Icons"
|
||||||
|
/>
|
||||||
|
<link rel="stylesheet" href="View/src/CSS/Enigme.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container-fluid px-5">
|
||||||
|
<!-- First Row -->
|
||||||
|
<div class="row py-4">
|
||||||
|
<div class="col-9 d-flex align-items-center px-0">
|
||||||
|
<a
|
||||||
|
class="material-icons pl-0"
|
||||||
|
id="home"
|
||||||
|
href="index.php?action=goToHome"
|
||||||
|
style="font-size: 40px; color: white"
|
||||||
|
>home</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
style="background-color: transparent; border: none"
|
||||||
|
onclick="displayHelp()"
|
||||||
|
class="col-3 d-flex align-items-center"
|
||||||
|
>
|
||||||
|
<div class="col-10 text-right px-3">
|
||||||
|
<p style="font-size: 14px; color: white"><b>Besoin d'aide ?</b></p>
|
||||||
|
</div>
|
||||||
|
<div class="col-2 text-right">
|
||||||
|
<img
|
||||||
|
src="View/assets/img/Foxy.png"
|
||||||
|
alt="Logo"
|
||||||
|
class="rounded-circle moving-fox"
|
||||||
|
style="border: 1px solid #44fff6; width: 60px; height: 60px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<!-- End First Row -->
|
||||||
|
|
||||||
|
<!-- Second Row -->
|
||||||
|
<div class="row">
|
||||||
|
<!-- First Column -->
|
||||||
|
<div
|
||||||
|
class="col-3 rounded p-3"
|
||||||
|
style="background-color: #222831; min-height: 80vh; height: auto"
|
||||||
|
>
|
||||||
|
<h2 class="text-left py-3" style="color: #44fff6; font-weight: 500">
|
||||||
|
Double element
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
Écrivez une fonction <b style="color : violet">double_element</b> qui prend en entrée une <b style="color: yellow;">liste de nombres</b>
|
||||||
|
et renvoie une <b style="color: yellow;">liste</b>
|
||||||
|
contenant tous les éléments de la liste d'entrée, dans le même ordre, mais en doublant chaque élément.
|
||||||
|
</p>
|
||||||
|
<h3 class="text-left pb-3 pt-5" style="color: #44fff6">Rappel</h3>
|
||||||
|
<p>
|
||||||
|
AAA
|
||||||
|
</p>
|
||||||
|
<h3 class="text-left pb-3 pt-5" style="color: #44fff6">Exemple</h3>
|
||||||
|
<p><b>Entrée</b> : [1,2,3]</p>
|
||||||
|
<p><b>Sortie</b> : [2,4,6]</p>
|
||||||
|
<h3
|
||||||
|
class="text-left pb-3 pt-5 help"
|
||||||
|
style="color: #44fff6; display: none"
|
||||||
|
>
|
||||||
|
Aide
|
||||||
|
</h3>
|
||||||
|
<p style="display: none" class="help">
|
||||||
|
AAA
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<!-- End First Column -->
|
||||||
|
|
||||||
|
<!-- Second Column -->
|
||||||
|
<div class="col-5 pr-0">
|
||||||
|
<div class="ace rounded" id="editor">def double_element(list):
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- End Second Column -->
|
||||||
|
|
||||||
|
<!-- Third Column -->
|
||||||
|
<div class="col-4">
|
||||||
|
<textarea
|
||||||
|
id="console"
|
||||||
|
readonly
|
||||||
|
style="width: 100%; min-height: 65vh; height: auto"
|
||||||
|
class="p-3 rounded"
|
||||||
|
></textarea>
|
||||||
|
|
||||||
|
<div class="row pt-5 text-center" style="cursor: pointer">
|
||||||
|
<div class="col-6">
|
||||||
|
<a onclick="run_init()" class="btn">
|
||||||
|
<span>Run</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<button
|
||||||
|
onclick="submit()"
|
||||||
|
class="btn"
|
||||||
|
data-toggle="modal"
|
||||||
|
data-target="#modal"
|
||||||
|
>
|
||||||
|
<span>Submit</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- End Third Column -->
|
||||||
|
</div>
|
||||||
|
<!-- End Second Row -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal -->
|
||||||
|
<div
|
||||||
|
class="modal fade"
|
||||||
|
id="modal"
|
||||||
|
tabindex="-1"
|
||||||
|
role="dialog"
|
||||||
|
aria-labelledby="exampleModalCenterTitle"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h2
|
||||||
|
class="modal-title"
|
||||||
|
id="exampleModalLongTitle"
|
||||||
|
style="color: black"
|
||||||
|
>
|
||||||
|
Results
|
||||||
|
</h2>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="close"
|
||||||
|
data-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
|
>
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<h5 id="result" style="color: black"></h5>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<a href="index.php?action=goToHome" class="btn" style="display: none" id="next">
|
||||||
|
<span>NEXT</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- End Modal -->
|
||||||
|
|
||||||
|
<script
|
||||||
|
src="https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js"
|
||||||
|
type="text/javascript"
|
||||||
|
charset="utf-8"
|
||||||
|
></script>
|
||||||
|
<script
|
||||||
|
src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js"
|
||||||
|
type="text/javascript"
|
||||||
|
charset="utf-8"
|
||||||
|
></script>
|
||||||
|
<script src="View/src/JS/base.js"></script>
|
||||||
|
<script src="View/src/JS/DoubleElement.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^5.2.2",
|
"bootstrap": "^5.2.2",
|
||||||
"bootstrap-icons": "^1.10.2"
|
"bootstrap-icons": "^1.10.2",
|
||||||
|
"events": "^3.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue