} else {
    $interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises'));
    $objExerciseTmp = new Exercise();
    if ($objExerciseTmp->read($exercise_id)) {
        $nameTools = get_lang('Results') . ': ' . $objExerciseTmp->name;
    }
}
Display::display_header($nameTools);
// Clean all results for this test before the selected date
if (($is_allowedToEdit || $is_tutor || api_is_coach()) && isset($_GET['delete_before_date']) && $locked == false) {
    // ask for the date
    $check = Security::check_token('get');
    if ($check) {
        $objExerciseTmp = new Exercise();
        if ($objExerciseTmp->read($exercise_id)) {
            $count = $objExerciseTmp->clean_results(true, $_GET['delete_before_date'] . ' 23:59:59');
            Display::display_confirmation_message(sprintf(get_lang('XResultsCleaned'), $count));
        }
    }
}
// Security token to protect deletion
$token = Security::get_token();
$actions = Display::div($actions, array('class' => 'actions'));
$extra = '<script>
    $(document).ready(function() {
        $( "#dialog:ui-dialog" ).dialog( "destroy" );
        $( "#dialog-confirm" ).dialog({
                autoOpen: false,
                show: "blind",
                resizable: false,
                height:300,
Esempio n. 2
0
             case 'disable_results':
                 //disable the results for the learners
                 $objExerciseTmp->disable_results();
                 $objExerciseTmp->save();
                 Display::display_confirmation_message(get_lang('ResultsDisabled'));
                 break;
             case 'enable_results':
                 //disable the results for the learners
                 $objExerciseTmp->enable_results();
                 $objExerciseTmp->save();
                 Display::display_confirmation_message(get_lang('ResultsEnabled'));
                 break;
             case 'clean_results':
                 //clean student results
                 if ($exercise_action_locked == false) {
                     $quantity_results_deleted = $objExerciseTmp->clean_results();
                     Display::display_confirmation_message(sprintf(get_lang('XResultsCleaned'), $quantity_results_deleted));
                 }
                 break;
             case 'copy_exercise':
                 $objExerciseTmp->copy_exercise();
                 Display::display_confirmation_message(get_lang('ExerciseCopied'));
                 break;
             case 'set_autolaunch':
                 $objExerciseTmp->set_autolaunch();
                 Display::display_confirmation_message(get_lang('ItemUpdated'));
                 break;
         }
     }
 }
 // destruction of Exercise