Skip to content

Commit f195b9a

Browse files
committed
REV09
1 parent 66be2af commit f195b9a

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DDP 2 Script Checker
22

3-
> **LAST REVISION**: `REV08 Tue 12 Apr 2022 12:53:45 WIB`
3+
> **LAST REVISION**: `REV09 Tue 12 Apr 2022 14:03:32 WIB`
44
55
Sebuah kumpulan skrip otomatis untuk membantu pekerjaan asisten dosen Dasar-Dasar Pemrograman 2 (DDP 2) dalam melakukan:
66
- Pengecekan perbedaan uji kasus untuk lab dan tugas pemrograman mahasiswa.
@@ -12,6 +12,9 @@ Program Git wajib terinstal sebelum menjalankan skrip ini. Versi _batch script_
1212
1313
## CHANGELOG
1414

15+
### REV09
16+
- Membuat skrip baru (_batch script_) untuk membantu penilaian lab dengan uji kasus berbasis teks (_text-based testcases_).
17+
1518
### REV08
1619
- Membuat skrip baru (_shell script_) untuk membantu penilaian lab dengan uji kasus berbasis teks (_text-based testcases_).
1720

lab/script.bat

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
@echo off
2+
setlocal enableextensions enabledelayedexpansion
3+
rem Copyright (C) 2022 Muhammad Athallah
4+
5+
rem This free document is distributed in the hope that it will be
6+
rem useful, but WITHOUT ANY WARRANTY; without even the implied
7+
rem warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8+
9+
rem REV09 Tue 12 Apr 2022 14:03:32 WIB
10+
rem START Tue 12 Apr 2022 13:47:15 WIB
11+
12+
echo Pastikan file uji kasus berada di folder tc pada parent directory bersama dengan folder kode mahasiswa dan skrip ini.
13+
14+
set /p ASDOSCODE=Masukkan kode asisten dosen kamu:
15+
set /p MAINCLASS=Masukkan nama file main class:
16+
17+
rem Count testcase file
18+
set /a TESTCASEAMTRAW=0
19+
for /r tc %%X in (*.txt) do set /a TESTCASEAMTRAW+=1
20+
set /a TESTCASEAMT=!TESTCASEAMTRAW!/2
21+
22+
rem Get current directory
23+
set PWD=%cd%
24+
25+
rem For loop each student's directory
26+
for /d %%i in (%PWD%\%ASDOSCODE%*\) do (
27+
echo Grading %%i...
28+
cd "%%i"
29+
30+
echo Compiling files...
31+
javac *.java
32+
33+
rem Make folder
34+
if not exist "out\" mkdir out
35+
if not exist "report\" mkdir report
36+
37+
for /l %%j in (1, 1, %TESTCASEAMT%) do (
38+
echo Checking test case #%%j...
39+
type ..\tc\in%%j.txt | java %MAINCLASS% > out\out%%j.txt
40+
fc /w out\out%%j.txt ..\tc\out%%j.txt
41+
fc /w out\out%%j.txt ..\tc\out%%j.txt > report\testcase$i.txt
42+
)
43+
44+
echo Done grading %%i.
45+
echo.
46+
47+
cd ..
48+
)
49+
echo Press any key to continue . . .
50+
pause
51+
echo.

0 commit comments

Comments
 (0)