$nwm = 0;
$simil = array();
//Preprocess current VPL instance
@set_time_limit($time_limit);
$activity_load_box = new vpl_progress_bar(s($vpl->get_printable_name()));
//debugging("Adding activity files", DEBUG_DEVELOPER);
vpl_similarity::scan_activity($simil, $vpl, $filesselected, $activity_load_box);
//debugging("Files to check ".count($simil), DEBUG_DEVELOPER);
$il = count($simil);
//Preprocess other VPL instance
if (isset($fromform->scanactivity) && $fromform->scanactivity > 0) {
    @set_time_limit($time_limit);
    $othervpl = new mod_vpl($fromform->scanactivity);
    $other_activity_load_box = new vpl_progress_bar(s($othervpl->get_printable_name()));
    //debugging("Adding other activity files", DEBUG_DEVELOPER);
    vpl_similarity::scan_activity($simil, $othervpl, $filesselected, $other_activity_load_box);
    //debugging("Files to check ".count($simil), DEBUG_DEVELOPER);
}
//Preprocess files in a ZIP file
$name = $form->get_new_filename('scanzipfile0');
$data = $form->get_file_content('scanzipfile0');
if ($data !== false && $name !== false) {
    @set_time_limit($time_limit);
    $zip_load_box0 = new vpl_progress_bar(s($name));
    //debugging("Adding files in zip file", DEBUG_DEVELOPER);
    vpl_similarity::scan_zip($simil, $name, $data, $vpl, $filesselected, $zip_load_box0);
    //debugging("Files to check ".count($simil), DEBUG_DEVELOPER);
}
/* remove when 1.9 => 2.x
//Preprocess files in a ZIP file
$name = $form->get_new_filename('scanzipfile1');
Example #2
0
        $table->head = $head;
        $table->align = $align;
        $table->size = $size;
        $usernumber = 0;
        foreach ($selected as $case) {
            $table->data[] = array(++$usernumber, $case->first->show_info(), $case->get_link(), $case->second->show_info(), $case->get_cluster());
        }
        echo html_writer::table($table);
        $activity_load_box->hide();
        $search_progression->hide();
    }
}
@set_time_limit($time_limit);
$simil = array();
$activity_load_box = new vpl_progress_bar(s($vpl->get_printable_name()) . ":" . s($filename));
vpl_similarity::scan_activity($simil, $vpl, $filesselected, $activity_load_box, false);
//TODO Find and put first user file
$l = count($simil);
$others = 0;
for ($i = 0; $i < $l; $i++) {
    if ($simil[$i]->from->userid == $userid) {
        $obj = $simil[$others];
        $simil[$others] = $simil[$i];
        $simil[$i] = $obj;
        $others++;
    }
}
if ($others > 0) {
    $search_progression = new vpl_progress_bar(get_string('similarity', VPL));
    $selected = vpl_similarity::get_selected($simil, 2 * $others, $others, $search_progression);
    $table = new html_table();