diff --git a/app/Http/Controllers/python/ExercisePythonController.php b/app/Http/Controllers/python/ExercisePythonController.php index c23a72b..9cb8a0e 100644 --- a/app/Http/Controllers/python/ExercisePythonController.php +++ b/app/Http/Controllers/python/ExercisePythonController.php @@ -156,6 +156,8 @@ class ExercisePythonController extends Controller // 0 -> tidak ada error ([1] = status) // 0 -> tidak error + + if ( $cek_error[1] == 0 ) { //ambil direktory @@ -164,10 +166,13 @@ class ExercisePythonController extends Controller $unittest = "C:\\xampp\\htdocs\\iCLOP\\public\\python-resources\\unittest\\". $fileUnittest; - $output = shell_exec("C:\Users\Rania\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 = ""; $status = ""; + + // split output $dataTest = explode("Error", $output); @@ -312,14 +317,13 @@ class ExercisePythonController extends Controller 'userid' => Auth::id() ); $jmlPercobaanSubmit = DB::table("python_students_submit")->where( $where )->count(); - + echo json_encode(['status' => $statusSintax, 'data' => $statusPassed, 'jml' => $jmlPercobaanSubmit]); } else { echo json_encode(['status' => $statusSintax, 'statusPercobaan' => false, 'data' => $cek_error[0]]); } - } diff --git a/public/python-resources/unittest/jawaban/633d55a44be03_1664964004.py b/public/python-resources/unittest/jawaban/633d55a44be03_1664964004.py new file mode 100644 index 0000000..1962fd6 --- /dev/null +++ b/public/python-resources/unittest/jawaban/633d55a44be03_1664964004.py @@ -0,0 +1,5 @@ +# Tuliskan kode program dibawah ini +jumlah = 10 +pesanan = "komputer" +print(jumlah) +print(pesanan) \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/633d56219a435_1664964129.py b/public/python-resources/unittest/jawaban/633d56219a435_1664964129.py new file mode 100644 index 0000000..585acb3 --- /dev/null +++ b/public/python-resources/unittest/jawaban/633d56219a435_1664964129.py @@ -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)) \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/633d5a13c0e93_1664965139.py b/public/python-resources/unittest/jawaban/633d5a13c0e93_1664965139.py new file mode 100644 index 0000000..ed4f409 --- /dev/null +++ b/public/python-resources/unittest/jawaban/633d5a13c0e93_1664965139.py @@ -0,0 +1,4 @@ +# Tuliskan kode program dibawah ini +buah = "Mangga" +jumlah = 6 +berat = 1.6 \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/633d5bc4aa194_1664965572.py b/public/python-resources/unittest/jawaban/633d5bc4aa194_1664965572.py new file mode 100644 index 0000000..5218c52 --- /dev/null +++ b/public/python-resources/unittest/jawaban/633d5bc4aa194_1664965572.py @@ -0,0 +1,7 @@ +# Tuliskan variabel dibawah ini +nama = "Qorinda " +lengkap = "Yulvarisma" + +def hasil(nama, lengkap): + #Tuliskan kode program dibawah ini + return nama+lengkap \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/633d61f939efd_1664967161.py b/public/python-resources/unittest/jawaban/633d61f939efd_1664967161.py new file mode 100644 index 0000000..c659397 --- /dev/null +++ b/public/python-resources/unittest/jawaban/633d61f939efd_1664967161.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print ("indo") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/63410a4fb394a_1665206863.py b/public/python-resources/unittest/jawaban/63410a4fb394a_1665206863.py new file mode 100644 index 0000000..137e3ef --- /dev/null +++ b/public/python-resources/unittest/jawaban/63410a4fb394a_1665206863.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print("indo") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/63410d64cdcd6_1665207652.py b/public/python-resources/unittest/jawaban/63410d64cdcd6_1665207652.py new file mode 100644 index 0000000..2042673 --- /dev/null +++ b/public/python-resources/unittest/jawaban/63410d64cdcd6_1665207652.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print("ok") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/63410db7c1c9d_1665207735.py b/public/python-resources/unittest/jawaban/63410db7c1c9d_1665207735.py new file mode 100644 index 0000000..2042673 --- /dev/null +++ b/public/python-resources/unittest/jawaban/63410db7c1c9d_1665207735.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print("ok") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/63410ddcd06da_1665207772.py b/public/python-resources/unittest/jawaban/63410ddcd06da_1665207772.py new file mode 100644 index 0000000..2042673 --- /dev/null +++ b/public/python-resources/unittest/jawaban/63410ddcd06da_1665207772.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print("ok") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/63410e19eda05_1665207833.py b/public/python-resources/unittest/jawaban/63410e19eda05_1665207833.py new file mode 100644 index 0000000..2042673 --- /dev/null +++ b/public/python-resources/unittest/jawaban/63410e19eda05_1665207833.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print("ok") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/63410ead7bcf4_1665207981.py b/public/python-resources/unittest/jawaban/63410ead7bcf4_1665207981.py new file mode 100644 index 0000000..2042673 --- /dev/null +++ b/public/python-resources/unittest/jawaban/63410ead7bcf4_1665207981.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print("ok") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/63410f023d5a9_1665208066.py b/public/python-resources/unittest/jawaban/63410f023d5a9_1665208066.py new file mode 100644 index 0000000..2042673 --- /dev/null +++ b/public/python-resources/unittest/jawaban/63410f023d5a9_1665208066.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print("ok") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/63410f41bb7a2_1665208129.py b/public/python-resources/unittest/jawaban/63410f41bb7a2_1665208129.py new file mode 100644 index 0000000..3ac6ce5 --- /dev/null +++ b/public/python-resources/unittest/jawaban/63410f41bb7a2_1665208129.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print("Hola") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/63410f4d6b355_1665208141.py b/public/python-resources/unittest/jawaban/63410f4d6b355_1665208141.py new file mode 100644 index 0000000..757efff --- /dev/null +++ b/public/python-resources/unittest/jawaban/63410f4d6b355_1665208141.py @@ -0,0 +1,2 @@ +# Tuliskan kode program dibawah ini +print("Indonesia") \ No newline at end of file diff --git a/public/python-resources/unittest/jawaban/__pycache__/63410f023d5a9_1665208066.cpython-310.pyc b/public/python-resources/unittest/jawaban/__pycache__/63410f023d5a9_1665208066.cpython-310.pyc new file mode 100644 index 0000000..a486f8b Binary files /dev/null and b/public/python-resources/unittest/jawaban/__pycache__/63410f023d5a9_1665208066.cpython-310.pyc differ diff --git a/public/python-resources/unittest/jawaban/__pycache__/63410f41bb7a2_1665208129.cpython-310.pyc b/public/python-resources/unittest/jawaban/__pycache__/63410f41bb7a2_1665208129.cpython-310.pyc new file mode 100644 index 0000000..191f262 Binary files /dev/null and b/public/python-resources/unittest/jawaban/__pycache__/63410f41bb7a2_1665208129.cpython-310.pyc differ diff --git a/public/python-resources/unittest/jawaban/__pycache__/63410f4d6b355_1665208141.cpython-310.pyc b/public/python-resources/unittest/jawaban/__pycache__/63410f4d6b355_1665208141.cpython-310.pyc new file mode 100644 index 0000000..c049af3 Binary files /dev/null and b/public/python-resources/unittest/jawaban/__pycache__/63410f4d6b355_1665208141.cpython-310.pyc differ diff --git a/resources/views/student/pythoncourse/python_task/uipengerjaan.blade.php b/resources/views/student/pythoncourse/python_task/uipengerjaan.blade.php index c85de49..8460698 100644 --- a/resources/views/student/pythoncourse/python_task/uipengerjaan.blade.php +++ b/resources/views/student/pythoncourse/python_task/uipengerjaan.blade.php @@ -757,10 +757,6 @@ dataType: "json", success: function (response) { - - - - if (response.status == true) {