private void createSubmissionsFileList() throws jplag.ExitException { submissions = new Vector<Submission>(); File f = null; if (options.root_dir != null) { f = new File(options.root_dir); if (!f.isDirectory()) { throw new jplag.ExitException(options.root_dir + " is not a directory!"); } } for (String file : options.fileList){ submissions.addElement(new Submission(file, f, this, get_language())); } }
public Program(Options options) throws jplag.ExitException { this.options = options; this.options.initializeSecondStep(this); if (this.options.language == null) throw new ExitException("Language not initialized!", ExitException.BAD_LANGUAGE_ERROR); msg = new Messages(this.options.getCountryTag()); if (this.options.getCountryTag().equals("de")) { dateFormat = new SimpleDateFormat("dd.MM.yyyy"); dateTimeFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss 'GMT'"); } else { dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss 'GMT'"); } dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); dateTimeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); report = new Report(this, get_language()); }
: new File(subm_dir, options.sub_dir)); if (file_dir != null && file_dir.isDirectory()) submissions.addElement(new Submission(subm_dir.getName(), file_dir, options.read_subdirs, this, this.get_language())); // -s else if (options.sub_dir == null) { throw new jplag.ExitException(options.root_dir + " is not a directory!");
continue; submissions.addElement(new Submission(name, f, this, get_language())); continue; if (file_dir.isDirectory()) { if (options.basecode.equals(subm_dir.getName())) { basecodeSubmission = new Submission(subm_dir.getName(), file_dir, options.read_subdirs, this, get_language()); } else { submissions.addElement(new Submission(subm_dir.getName(), file_dir, options.read_subdirs, this, get_language())); // -s
Language language = program.get_language(); for (int j=0; j<thLength; j++) if (results[j] != null)
matchnr+"-1.html#"+i+"',3)\" NAME=\""+i+"\">"); f.print(new String(startA.file.getBytes())); if (program.get_language().usesIndex()) f.print("("+startA.getIndex()+"-"+endeA.getIndex()+")"); else matchnr+"-1.html#"+i+"',3)\" NAME=\""+i+"\">"); f.print(startB.file); if (program.get_language().usesIndex()) f.print("("+startB.getIndex()+"-"+endeB.getIndex()); else
return null; int noOfWords =program.get_language().noOfTokens(); int[] tokenFrequency = new int[noOfWords + 1];
str += " source = " + sp + (get_original_dir() != null ? toUTF8(get_original_dir()) : "") + sp; str += " n_of_programs = " + sp + submissions.size() + sp; str += " errors = " + sp + get_language().errorsCount() + sp; str += " path_to_files = " + sp + toUTF8((options.sub_dir != null) ? options.sub_dir : "") + sp; str += " basecode_dir = " + sp + toUTF8((options.basecode != null) ? options.basecode : "") + sp;
if (this.program.get_language() instanceof jplag.text.Language) { f.println("<TD ALIGN=left BGCOLOR=#c0c0ff>" + ThemeGenerator.generateThemes(sortedSubmissions,