Merge branch 'master' of https://codefirst.iut.uca.fr/git/nathan.boileau/Scripted
continuous-integration/drone/push Build is passing Details

ServeurDeTest
Johan LACHENAL 2 years ago
commit 8e9610613c

@ -27,27 +27,6 @@ class AdminController extends UserController
case "goToTest":
$this->goToTest();
break;
case "goToChouette":
$this->goToChouette();
break;
case "goToCesarEncrypt":
$this->goToCesarEncrypt();
break;
case "goToCesarDecrypt":
$this->goToCesarDecrypt();
break;
case "goToChuckNorris":
$this->goToChuckNorris();
break;
case "goToHanoi":
$this->goToHanoi();
break;
case "goToTrianglePascal":
$this->goToTrianglePascal();
break;
case "goToDoubleElement":
$this->goToDoubleElement();
break;
case "goToNext":
$this->goToNext();
break;

@ -84,6 +84,15 @@ async function submit(){
{
$old = $this->enigme_gateway->findById($id)[0];
$ordre = $old->getOrdre();
$nom = trim($nom);
$enonce = trim($enonce);
$aide = trim($aide);
$rappel = trim($rappel);
$exemple = trim($exemple);
$test = trim($test);
echo $test;
$solution = trim($solution);
$prompt = trim($prompt);
$enigme = new Enigme($id,$nom, $enonce, $aide, $rappel, $exemple, $solution, $test, $ordre, 0, 0, $prompt);
$this->enigme_gateway->update($enigme);
$js = fopen("View/src/JS/$nom.js", "w");

@ -0,0 +1,13 @@
//~ Function that test the user code
async function submit(){
var test = editor.getValue()+`\n
ba
R
`;
exec("print ('True')", "code");
exec(test, "solution");
result.innerHTML = "Test en cours...";
await new Promise(r => setTimeout(r, 1500));
check();
}

@ -64,14 +64,12 @@
<div class="mb-3">
<label for="" class="form-label">Test</label>
<textarea class="form-control" name="test" id="test" rows="3" required></textarea>
<!-- <div class="ace rounded" id="editor" name="test"></div> -->
</div>
</div>
<div class="col">
<div class="mb-3">
<label for="" class="form-label">Prompt, ce qu'il sera écrit par défaut dans l'éditeur</label>
<textarea class="form-control" name="prompt" id="prompt" rows="3" required></textarea>
<!-- <div class="ace rounded" id="editor" name="test"></div> -->
</div>
</div>
<button class="left" type="submit">

Loading…
Cancel
Save