python
This commit is contained in:
parent
b9a1ac2de1
commit
7f3d490fa7
|
|
@ -138,8 +138,9 @@ class ExercisePythonController extends Controller
|
||||||
// file name (nama file)
|
// file name (nama file)
|
||||||
$fileName = uniqid().'_'.strtotime("now");
|
$fileName = uniqid().'_'.strtotime("now");
|
||||||
|
|
||||||
// lokasi penyimpanan
|
// // lokasi penyimpanan
|
||||||
$filePath = "python-resources/unittest/jawaban/". $fileName . '.py';
|
$filePath = "python-resources/unittest/jawaban/". $fileName . '.py';
|
||||||
|
|
||||||
|
|
||||||
// file terbuat
|
// file terbuat
|
||||||
$programFile = fopen($filePath, "w");
|
$programFile = fopen($filePath, "w");
|
||||||
|
|
@ -161,10 +162,9 @@ class ExercisePythonController extends Controller
|
||||||
$packageDirectory = "jawaban.". $fileName;
|
$packageDirectory = "jawaban.". $fileName;
|
||||||
$fileUnittest = $dt_percobaan->filetest;
|
$fileUnittest = $dt_percobaan->filetest;
|
||||||
|
|
||||||
$unittest = "python-resources/unittest/". $fileUnittest;
|
$unittest = "C:\\xampp\\htdocs\\iCLOP\\public\\python-resources\\unittest\\". $fileUnittest;
|
||||||
|
|
||||||
$output = shell_exec("C:\Users\A.S.H\AppData\Local\Programs\Python\Python310\python.exe".$unittest." ".$packageDirectory." ".$fileName." --verbose 2>&1");
|
|
||||||
|
|
||||||
|
$output = shell_exec("C:\Users\Rania\AppData\Local\Programs\Python\Python310\python.exe ".$unittest." ".$packageDirectory." ".$fileName." --verbose 2>&1");
|
||||||
|
|
||||||
$validation_detail = "";
|
$validation_detail = "";
|
||||||
$status = "";
|
$status = "";
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2",
|
"php": "^7.2",
|
||||||
"fideloper/proxy": "^4.0",
|
"fideloper/proxy": "^4.0",
|
||||||
|
"ace_builds":"^4.0",
|
||||||
"laravel/framework": "^6.2",
|
"laravel/framework": "^6.2",
|
||||||
"laravel/tinker": "^2.0",
|
"laravel/tinker": "^2.0",
|
||||||
"laravelcollective/html": "^6.0",
|
"laravelcollective/html": "^6.0",
|
||||||
|
|
|
||||||
17
public/js/ace/ace.js
vendored
Normal file
17
public/js/ace/ace.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/python-resources/unittest/.idea/.name
Normal file
1
public/python-resources/unittest/.idea/.name
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
bab1_percobaan1.py
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (unittest)" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (unittest)" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module type="PYTHON_MODULE" version="4">
|
<module type="PYTHON_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$">
|
||||||
<orderEntry type="inheritedJdk" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="jdk" jdkName="Python 3.10 (unittest)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
|
@ -8,8 +8,8 @@ path_answer = sys.argv[1]
|
||||||
filename = sys.argv[2]
|
filename = sys.argv[2]
|
||||||
pc = importlib.import_module(path_answer, ".")
|
pc = importlib.import_module(path_answer, ".")
|
||||||
|
|
||||||
# pc = importlib.import_module("jawaban.62cfe7f907217_1657792505")
|
# pc = importlib.import_module("jawaban.62f0a0e7b701b_1659936999")
|
||||||
# filename = '62cfe7f907217_1657792505'
|
# filename = '62f0a0e7b701b_1659936999'
|
||||||
|
|
||||||
# cmd = subprocess.run([sys.executable, f"%s/jawaban/{filename}.py" % (Path(__file__).parent.absolute())], capture_output=True)
|
# cmd = subprocess.run([sys.executable, f"%s/jawaban/{filename}.py" % (Path(__file__).parent.absolute())], capture_output=True)
|
||||||
cmd = subprocess.run([sys.executable, f"%s/jawaban/{filename}.py" % (Path(__file__).parent.absolute())], capture_output=True)
|
cmd = subprocess.run([sys.executable, f"%s/jawaban/{filename}.py" % (Path(__file__).parent.absolute())], capture_output=True)
|
||||||
|
|
|
||||||
BIN
public/python-resources/unittest/doa.jpg
Normal file
BIN
public/python-resources/unittest/doa.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print('tes')
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("test")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("test")
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("test")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("test")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("test")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("test")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("test")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("test")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
test
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
jumlah = 10
|
||||||
|
pesanan = "Komputer"
|
||||||
|
print(jumlah)
|
||||||
|
print(pesanan)
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print(
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("Hola")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("Hola")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("Indonesia")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("Indonesia")
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
jumlah = 10
|
||||||
|
pesanan = "komputer"
|
||||||
|
print(jumlah)
|
||||||
|
print(pesanan)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
jumlah = 10
|
||||||
|
pesanan = "komputer"
|
||||||
|
print(jumlah)
|
||||||
|
print(pesanan)
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
jumlah = 10
|
||||||
|
pesanan = "Komputer"
|
||||||
|
print(jumlah)
|
||||||
|
print(pesanan)
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Tuliskan variabel dibawah ini
|
||||||
|
umur = 23
|
||||||
|
|
||||||
|
def konversi(umur):
|
||||||
|
#Tuliskan kode program dibawah ini
|
||||||
|
return str(umur)
|
||||||
|
|
||||||
|
print(konversi(umur))
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Tuliskan variabel dibawah ini
|
||||||
|
umur = 23
|
||||||
|
|
||||||
|
def konversi(umur):
|
||||||
|
#Tuliskan kode program dibawah ini
|
||||||
|
return str(umur)
|
||||||
|
|
||||||
|
print(konversi(umur))
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Tuliskan variabel dibawah ini
|
||||||
|
umur = 23
|
||||||
|
|
||||||
|
def konversi(umur):
|
||||||
|
#Tuliskan kode program dibawah ini
|
||||||
|
str(umur)
|
||||||
|
|
||||||
|
print(konversi(umur))
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Tuliskan variabel dibawah ini
|
||||||
|
umur = 23
|
||||||
|
|
||||||
|
def konversi(umur):
|
||||||
|
#Tuliskan kode program dibawah ini
|
||||||
|
str(umur)
|
||||||
|
|
||||||
|
print(type(konversi(umur)))
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Tuliskan variabel dibawah ini
|
||||||
|
umur = 23
|
||||||
|
|
||||||
|
def konversi(umur):
|
||||||
|
#Tuliskan kode program dibawah ini
|
||||||
|
return str(umur)
|
||||||
|
|
||||||
|
print(type(konversi(umur)))
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("indonesia")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print("Indonesia")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print ("Hello")
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Tuliskan kode program dibawah ini
|
||||||
|
print ("Hello")
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0
public/python-resources/unittest/requirements.txt
Normal file
0
public/python-resources/unittest/requirements.txt
Normal file
|
|
@ -4,7 +4,7 @@
|
||||||
@section('script')
|
@section('script')
|
||||||
|
|
||||||
<!-- Code Ace Library For Python -->
|
<!-- Code Ace Library For Python -->
|
||||||
<script src="{{URL::to('/js/ace/ace/ace.js')}}"></script>
|
<!-- <script src={{ asset('js/ace/ace.js') }}></script> -->
|
||||||
|
|
||||||
<!-- Code Ace Library For Python -->
|
<!-- Code Ace Library For Python -->
|
||||||
@endsection
|
@endsection
|
||||||
|
|
@ -578,7 +578,7 @@
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
<script src={{ asset('js/ace/ace.js') }}></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user