Using EXERCISE_MAX_NAME_SIZE in order to avoid big exercise titles ..

skala
Julio Montoya 15 years ago
parent abb8f9df62
commit c7bf5676d9
  1. 4
      main/exercice/admin.php
  2. 14
      main/exercice/exercice.php
  3. 3
      main/exercice/exercise.class.php
  4. 2
      main/exercice/exercise_admin.php
  5. 2
      main/exercice/exercise_submit.php
  6. 2
      main/exercice/question_create.php
  7. 2
      main/exercice/question_pool.php

@ -259,9 +259,9 @@ if (!empty($gradebook) && $gradebook=='view') {
$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));
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
} else {
$interbreadcrumb[] = array("url" => "#", "name" => cut($objExercise->exercise, EXERCISE_MAX_NAME_BREADCRUMB));
$interbreadcrumb[] = array("url" => "#", "name" => $objExercise->name);
}
// shows a link to go back to the question pool

@ -297,7 +297,7 @@ if ($show != 'result') {
$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));
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exerciseId, "name" => $objExerciseTmp->name);
}
} else {
$nameTools = get_lang('YourScore');
@ -792,9 +792,8 @@ if ($show == 'test') {
$lp_blocked = Display::tag('font', '<i>'.get_lang('AddedToALP').'</i>', array('style'=>'color:grey'));
}
//Showing exercise title
$row['title'] = text_filter($row['title']);
//echo Display::tag('h1',$row['title']);
//Showing exercise title
$row['title'] = text_filter(cut($row['title'], EXERCISE_MAX_NAME_SIZE));
if ($session_id == $row['session_id']) {
//Settings
@ -861,7 +860,7 @@ if ($show == 'test') {
} else {
// --- Student only
$row['title'] = text_filter($row['title']);
$row['title'] = text_filter(cut($row['title'], EXERCISE_MAX_NAME_SIZE));
// if time is actived show link to exercise
if ($time_limits) {
@ -966,8 +965,7 @@ if ($show == 'test') {
if (empty($num)) {
$num = '';
}
}
$item .= Display::tag('td', $attempt_text);
//See results
@ -1010,7 +1008,7 @@ if ($show == 'test') {
$nbrActiveTests = 0;
if (is_array($attribute['path'])) {
while (list ($key, $path) = each($attribute['path'])) {
while (list($key, $path) = each($attribute['path'])) {
$item = '';
list ($a, $vis) = each($attribute['visibility']);
if (strcmp($vis, "1") == 0) {

@ -16,7 +16,7 @@ define('EXERCISE_FEEDBACK_TYPE_END', 0);
define('EXERCISE_FEEDBACK_TYPE_DIRECT', 1);
define('EXERCISE_FEEDBACK_TYPE_EXAM', 2);
define('EXERCISE_MAX_NAME_BREADCRUMB', 60);
define('EXERCISE_MAX_NAME_SIZE', 80);
$debug = 0; //All exercise scripts should depend in this debug variable
@ -98,6 +98,7 @@ class Exercise {
if ($object=Database::fetch_object($result)) {
$this->id = $id;
$this->exercise = $object->title;
$this->name = cut($object->title, EXERCISE_MAX_NAME_SIZE);
$this->description = $object->description;
$this->sound = $object->sound;
$this->type = $object->type;

@ -180,7 +180,7 @@ if ($form->validate()) {
}
$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));
$interbreadcrumb[] = array("url"=>"admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
Display::display_header($nameTools,get_lang('Exercise'));

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

@ -43,7 +43,7 @@ $sql = "SELECT id,title,type,description, results_disabled FROM $tbl_exercices W
$result = Database::query($sql);
$exercises['-'] = '-'.get_lang('SelectExercice').'-';
while ($row = Database :: fetch_array($result)) {
$exercises[$row['id']] = cut($row['title'], EXERCISE_MAX_NAME_BREADCRUMB);
$exercises[$row['id']] = cut($row['title'], EXERCISE_MAX_NAME_SIZE);
}
$form->addElement('select', 'exercice', get_lang('Exercice'), $exercises);

@ -76,7 +76,7 @@ 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" => cut($objExercise->exercise, EXERCISE_MAX_NAME_BREADCRUMB));
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
if ($is_allowedToEdit) {

Loading…
Cancel
Save