Fixing exercise breadcrumbs

skala
Julio Montoya 14 years ago
parent fc303528d7
commit d59f5f61c8
  1. 8
      main/exercice/admin.php
  2. 21
      main/exercice/exercice.php
  3. 2
      main/exercice/exercice_submit.php
  4. 4
      main/exercice/exercise.class.php
  5. 6
      main/exercice/exercise_admin.php
  6. 5
      main/exercice/question_pool.php

@ -257,8 +257,12 @@ if (!empty($gradebook) && $gradebook=='view') {
);
}
$interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[]=array("url" => "admin.php?exerciseId=".$objExercise->id,"name" => $objExercise->exercise);
$interbreadcrumb[] = array("url" => "exercice.php","name" => get_lang('Exercices'));
if (isset($_GET['newQuestion']) || isset($_GET['editQuestion']) ) {
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => cut($objExercise->exercise, EXERCISE_MAX_NAME_BREADCRUMB));
} else {
$interbreadcrumb[] = array("url" => "#", "name" => cut($objExercise->exercise, EXERCISE_MAX_NAME_BREADCRUMB));
}
// shows a link to go back to the question pool
if(!$exerciseId && $nameTools != get_lang('ExerciseManagement')){

@ -294,7 +294,14 @@ if ($show != 'result') {
} else {
if ($is_allowedToEdit || $is_tutor) {
$nameTools = get_lang('StudentScore');
$interbreadcrumb[] = array ("url" => "exercice.php?gradebook=$gradebook","name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercice.php?gradebook=$gradebook","name" => get_lang('Exercices'));
$objExerciseTmp = new Exercise();
if ($objExerciseTmp->read($exerciseId)) {
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exerciseId, "name" => cut($objExerciseTmp->exercise, EXERCISE_MAX_NAME_BREADCRUMB));
}
} else {
$nameTools = get_lang('YourScore');
$interbreadcrumb[] = array ("url" => "exercice.php?gradebook=$gradebook","name" => get_lang('Exercices'));
@ -302,7 +309,7 @@ if ($show != 'result') {
}
// need functions of statsutils lib to display previous exercices scores
require_once (api_get_path(LIBRARY_PATH) . 'statsUtils.lib.inc.php');
require_once api_get_path(LIBRARY_PATH) . 'statsUtils.lib.inc.php';
if ($is_allowedToEdit && !empty ($choice) && $choice == 'exportqti2') {
require_once 'export/qti2/qti2_export.php';
@ -347,7 +354,7 @@ if (!empty ($_POST['export_report']) && $_POST['export_report'] == 'export_repor
if (!$is_allowedToEdit and !$is_tutor) {
$user_id = api_get_user_id();
}
require_once ('exercise_result.class.php');
require_once 'exercise_result.class.php';
switch ($_POST['export_format']) {
case 'xls' :
$export = new ExerciseResult();
@ -388,7 +395,7 @@ HotPotGCt($documentPath, 1, api_get_user_id() );
// only for administrator
if ($is_allowedToEdit) {
if (!empty ($choice)) {
if (!empty($choice)) {
// construction of Exercise
$objExerciseTmp = new Exercise();
@ -443,8 +450,8 @@ if ($is_allowedToEdit) {
Security::clear_token();
}
if (!empty ($hpchoice)) {
switch ($hpchoice) {
if (!empty($hpchoice)) {
switch($hpchoice) {
case 'delete' : // deletes an exercise
$imgparams = array ();
$imgcount = 0;
@ -784,7 +791,7 @@ if ($show == 'test') {
}
//Showing exercise title
$row['title']= text_filter($row['title']);
$row['title'] = text_filter($row['title']);
//echo Display::tag('h1',$row['title']);
if ($session_id == $row['session_id']) {

@ -444,7 +444,7 @@ if (!empty ($gradebook) && $gradebook == 'view') {
}
$interbreadcrumb[] = array ("url" => "exercice.php?gradebook=$gradebook", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array ("url" => "#","name" => $objExercise->selectTitle());
$interbreadcrumb[] = array ("url" => "#","name" => cut($objExercise->selectTitle(), EXERCISE_MAX_NAME_BREADCRUMB));
if ($origin != 'learnpath') { //so we are not in learnpath tool
//$htmlHeadXtra[] = $objExercise->show_lp_javascript();

@ -16,6 +16,8 @@ define('EXERCISE_FEEDBACK_TYPE_END', 0);
define('EXERCISE_FEEDBACK_TYPE_DIRECT', 1);
define('EXERCISE_FEEDBACK_TYPE_EXAM', 2);
define('EXERCISE_MAX_NAME_BREADCRUMB', 60);
$debug = 0; //All exercise scripts should depend in this debug variable
require_once dirname(__FILE__).'/../inc/lib/exercise_show_functions.lib.php';
@ -855,7 +857,7 @@ class Exercise {
}
$form->addElement('header', '', $form_title);
// title
$form->addElement('text', 'exerciseTitle', get_lang('ExerciseName'),'class="input_titles" id="exercise_title"');
$form->addElement('text', 'exerciseTitle', get_lang('ExerciseName'), ' size="60" id="exercise_title"');
//$form->applyFilter('exerciseTitle','html_filter');
$form->addElement('html','<div class="row">

@ -178,8 +178,10 @@ if ($form->validate()) {
if (!empty($gradebook) && $gradebook=='view') {
$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'],'name' => get_lang('ToolGradebook'));
}
$nameTools=get_lang('ExerciseManagement');
$interbreadcrumb[] = array ("url"=>'exercice.php', 'name'=> get_lang('Exercices'));
$nameTools = get_lang('ExerciseManagement');
$interbreadcrumb[] = array("url"=>'exercice.php', 'name'=> get_lang('Exercices'));
$interbreadcrumb[] = array("url"=>"admin.php?exerciseId=".$objExercise->id, "name" => cut($objExercise->exercise, EXERCISE_MAX_NAME_BREADCRUMB));
Display::display_header($nameTools,get_lang('Exercise'));
echo '<div class="actions">';

@ -75,9 +75,8 @@ if(!($objExcercise instanceOf Exercise) && !empty($fromExercise)) {
}
$nameTools = get_lang('QuestionPool');
$interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[]=array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->exercise);
$interbreadcrumb[] = array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => cut($objExercise->exercise, EXERCISE_MAX_NAME_BREADCRUMB));
if ($is_allowedToEdit) {

Loading…
Cancel
Save