F- AEP Client (Assignment Evaluation Program)
AEP is a client program both for ASEP Server and Oracle database server. Instructors and assistants use this program to evaluate the submitted assignments, grade them and attach feedback files if required.
What does AEP do?
In order to use AEP Client program the users must log on to the system. Since there are two different user types (assistants, instructors) for this program, users must specify their category. The other requirements are same as the ASP Client login process. When the OK button is pressed first the given ASEP Server IP is checked and then user login and password is sent as a query to the database server to be validated. If they are confirmed the user logs in to the system. Figure 17 shows an example snap shot of the logging process.
When the user enter the program he/she sees a GUI as in figure 18. The courses and corresponding assignments are listed in choice boxes. The user can see the number of submitted or evaluated assignment files easily. Figure 19 shows the evaluation part of the program. Through a very simple interface the users are able to see which students submitted their assignments, which ones evaluated or which ones are to be evaluated. When the Evaluate button is pressed the assignment viewer form becomes visible as it seen in figure 20.
To view an assignment file, first of all the user
must browse the viewer program. When he/she presses the View File
button the AEP program first receives the assignment file from the ASEP
Server then runs the external viewer program and opens the assignment file.
After viewing the assignment file, the user can evaluate the assignment,
assign a grade, and also can attach a feedback file.
Here is the code that implements the operation of
viewing an assignment file.
try {
pm.setShowLabel(true);
Socket client;
InputStream inS;
OutputStream outS;
DataOutputStream DoutS;
DataInputStream DinS;
byte[] dataBuffer =
new byte[1024];
statusBar1.setText("Please
wait. Connecting to ASEP Server");
// CONNECT TO THE ASEP
SERVER
client=new Socket(InetAddress.getByName(serverIP),5000);
statusBar1.setText("Connected
to ASEP Server");
outS=client.getOutputStream();
DoutS=new DataOutputStream(outS);
inS=client.getInputStream();
DinS=new DataInputStream(inS);
String dir="Courses";
// MAKE A LOCAL DIRECTORY
TO STORE THE RECEIVED FILE
File newDirectory=new
File(dir);
if (!newDirectory.exists()){
newDirectory.mkdir();
}
newDirectory=new File(dir
+ "\\" + courseName);
if (!newDirectory.exists()){
newDirectory.mkdir();
}
newDirectory=new File(dir
+ "\\"+courseName +"\\"+assignmentType);
if (!newDirectory.exists())
newDirectory.mkdir();
assignmentFileName=studentLogin+"."+assignmentFileFormat;
// OPEN A NEW DISK FILE
OutputStream outFile=
new FileOutputStream("Courses\\"+courseName+
"\\"+assignmentType+"\\"
+ assignmentFileName);
statusBar1.setText("Receiving
the assignment file...");
// SEND THE ESSENTIAL
DATA TO GET ASSIGNMENT FILE FROM THE ASEP SERVER
DoutS.writeUTF("AEP
ASSIGNMENT");
DoutS.writeUTF(userLogin);
DoutS.writeUTF(courseName);
DoutS.writeUTF(assignmentType);
DoutS.writeUTF(assignmentFileFormat);
DoutS.writeUTF(studentLogin);
fileSize=DinS.readLong();
pm.setShowLabel(true);
pm.setValue(0);
long readB=0;
double gone;
// READ THE INPUT FILE
while ( readB != fileSize
) {
int t=inS.read(dataBuffer);
outFile.write(dataBuffer,0,t);
readB= readB + t;
gone=readB/(double)fileSize;
gone=gone*100;
pm.setValue((int)gone);
}
outFile.flush();
outFile.close();
pm.setValue(0);
pm.setShowLabel(false);
statusBar1.setText("Assignment
file is received. Now viewer program opens it...");
// SEND THE ACKNOWLEDGEMENT
DATA TO FINISH THE JOB
DoutS.writeUTF("THE
END");
DoutS.flush();
try{
// GET THE RUNTIME ENVIRONMENT
Runtime rt=Runtime.getRuntime();
// START THE EXTERNAL
VIEWER PROGRAM TO VIEW THE ASSIGNMENT FILE
Process p=rt.exec(viewerProgramName+"
courses\\"+courseName+"\\"+assignmentType+"\\"+assignmentFileName);
viewerFileFormat=assignmentFileFormat;
}
catch(IOException ex2){
viewerFileFormat="";
statusBar1.setText(ex2.toString());
System.out.println(ex2.toString());
}
}
catch(IOException ex){
statusBar1.setText(ex.toString());
System.out.println(ex.toString());
}