Esempio n. 1
0
                $errObj = new ADA_Error($next_exercise_id, translateFN('Errore nel caricamento del prossimo esercizio'));
            } else {
                if ($next_exercise_id) {
                    $dataHa['exercise'] .= "<a href=\"{$http_root_dir}/browsing/exercise.php?id_node={$next_exercise_id}\">";
                    $dataHa['exercise'] .= translateFN('Prossimo esercizio') . '</a>';
                }
            }
        }
        break;
    case 'view':
    default:
        $exercise = ExerciseDAO::getExercise($id_node);
        if ($user_level < $exercise->getExerciseLevel()) {
            $form = translateFN("Esercizio di livello superiore al tuo");
        } else {
            $viewer = ExerciseViewerFactory::create($exercise->getExerciseFamily());
            $action = 'exercise.php';
            $form = $viewer->getViewingForm($userObj, $exercise, $sess_id_course_instance, $action);
            // vito 26 gennaio 2009
            if (($id = ExerciseDAO::getNextExerciseId($exercise, $sess_id_user)) != NULL) {
                $next_exercise_menu_link = CDOMElement::create('a');
                $next_exercise_menu_link->setAttribute('href', "{$http_root_dir}/browsing/exercise.php?id_node={$id}");
                $next_exercise_menu_link->addCHild(new CText(translateFN('Prossimo esercizio')));
                $dataHa['go_back'] .= $next_exercise_menu_link->getHtml();
            }
        }
        $dataHa['exercise'] = $form;
        $node_title = $exercise->getTitle();
        $icon = CourseViewer::getCSSClassNameForExerciseType($exercise->getExerciseFamily());
        break;
}
Esempio n. 2
0
             // per l'inserimento dell'esercizio.
             $_SESSION['add_exercise']['parent_node'] = $_POST['parent_node'];
             $_SESSION['add_exercise']['exercise_title'] = $_POST['exercise_title'];
             $_SESSION['add_exercise']['exercise_family'] = $_POST['exercise_family'];
             $_SESSION['add_exercise']['exercise_interaction'] = $_POST['exercise_interaction'];
             $_SESSION['add_exercise']['test_mode'] = $_POST['test_mode'];
             $_SESSION['add_exercise']['test_simplification'] = $_POST['test_simplification'];
             $_SESSION['add_exercise']['test_barrier'] = $_POST['test_barrier'];
             header('location: add_exercise.php?step=2');
             break;
         }
     }
     break;
 case 2:
     $tipo_esercizio = (int) $_SESSION['add_exercise']['exercise_family'];
     $viewer = ExerciseViewerFactory::create($tipo_esercizio);
     $exercise_data = $_SESSION['add_exercise'];
     //if ( !$viewer->checkAuthorInput($_POST, &$exercise_data) )
     if (!$viewer->checkAuthorInput($_POST, $exercise_data)) {
         $_SESSION['add_exercise'] = $exercise_data;
         header("Location: add_exercise.php?step=2");
         exit;
     } else {
         $_SESSION['add_exercise'] = $exercise_data;
         if (!isset($_POST['finito']) || isset($_POST['finito']) && $_POST['finito']) {
             header("Location: add_exercise.php?step=3");
             exit;
         } else {
             if (isset($_POST['finito']) && !$_POST['finito']) {
                 header("location: add_exercise.php?step=2");
                 exit;