Quantcast
Channel: Assignment
Viewing all articles
Browse latest Browse all 9462

Packet Tracer PKA automated testing

$
0
0
by Sergiu Lazarescu.  

Hello,
I've been practicing for my CCNA exam for quite a while and one of the most useful tools that I use almost every day is the Cisco Packet Tracer. Now, I'd like to help other students in their learning process by creating a Moodle Website where they can get PKA files, complete them in Packet Tracer, then upload them back to the website where the assignments are graded.

I have a Java code that will grade the uploaded PKA file, but I have to run that code every time a new PKA file is uploaded.


import apiipc.generated.system.*;
import java.io.File;
import pse.pt.PacketTracer;

class Grade
{
public static void main(String args[])
throws Exception
{
File file;
PacketTracer packettracer;
if (args.length != 1) {
System.err.println("You need to specify a pka file to grade");
System.exit(1);
}
file = new File(args[0]);
packettracer = new PacketTracer("localhost", 39000, true);
packettracer.launch();
packettracer.connect();
packettracer.fileOpen(file.getCanonicalPath());

ActivityFile activityfile = packettracer.getActivityFile();
Double s = activityfile.getPercentageComplete();

System.out.println((new StringBuilder()).append(s).append("\t").append(args[0]).toString());

packettracer.shutDown();
}
}


This is how the Java code looks. What's the best way to do this ? Should I create a Assignment Feedback module to do this ? Do you have any suggestions ?


Thanks in advance,

Sergiu Lazarescu


Viewing all articles
Browse latest Browse all 9462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>