parent
646fc2c0aa
commit
f76b96ecb9
@ -1,12 +0,0 @@
|
||||
//~ Function that test the user code
|
||||
|
||||
async function submit(){
|
||||
var test = editor.getValue();
|
||||
exec("print('Hello World !')", "code");
|
||||
exec(test, "solution");
|
||||
result.innerHTML = "Test en cours...";
|
||||
await new Promise(r => setTimeout(r, 1500));
|
||||
check();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
//~ Function that test the user code
|
||||
|
||||
async function submit(){
|
||||
var test = editor.getValue()+`\n
|
||||
import random as r
|
||||
|
||||
def multiVerif(a,b):
|
||||
return a+b
|
||||
|
||||
def multiTest(x):
|
||||
multi(1,1)
|
||||
for i in range(x):
|
||||
a=r.randint(0,100)
|
||||
b=r.randint(0,100)
|
||||
if(multi(a,b) != multiVerif(a,b)):
|
||||
return False
|
||||
return True
|
||||
|
||||
print(multiTest(5))
|
||||
|
||||
`;
|
||||
exec("print('True')", "code");
|
||||
exec(test, "solution");
|
||||
result.innerHTML = "Test en cours...";
|
||||
await new Promise(r => setTimeout(r, 1500));
|
||||
check();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
//~ Function that test the user code
|
||||
|
||||
async function submit(){
|
||||
var test = editor.getValue()+`\n
|
||||
import random as r
|
||||
|
||||
def triVerif(a,b):
|
||||
s = ""
|
||||
i = 0
|
||||
while len(s)<len(a+b):
|
||||
if(len(a)>i):
|
||||
s += a[i]
|
||||
if(len(b)>i):
|
||||
s += b[i]
|
||||
i += 1
|
||||
return s
|
||||
|
||||
def triTest(x):
|
||||
tri(a,b)
|
||||
a = "Hlowrd"
|
||||
b = "el ol"
|
||||
if(triVerif(a,b)!=tri(a,b)):
|
||||
return False
|
||||
return True
|
||||
|
||||
print(triTest(5))
|
||||
`;
|
||||
exec("print('True')", "code");
|
||||
exec(test, "solution");
|
||||
result.innerHTML = "Test en cours...";
|
||||
await new Promise(r => setTimeout(r, 1500));
|
||||
check();
|
||||
}
|
||||
|
||||
|
@ -1,10 +0,0 @@
|
||||
async function submit(){
|
||||
var test = editor.getValue();
|
||||
exec("print([1,'Oui'])", "code");
|
||||
exec(test, "solution");
|
||||
result.innerHTML = "Test en cours...";
|
||||
await new Promise(r => setTimeout(r, 1500));
|
||||
check();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue