aportugal 15 years ago
parent
commit
c04a4e8a57
37 changed files with 425 additions and 1295 deletions
  1. 3 3
      main/admin/settings.php
  2. 1 1
      main/document/edit_document.php
  3. 2 1
      main/document/slideshow.php
  4. 0 1121
      main/exercice/exercice_submit.php
  5. 2 2
      main/exercice/exercise.lib.php
  6. 1 1
      main/forum/newthread.php
  7. 1 1
      main/forum/reply.php
  8. BIN
      main/img/message_reply_forum.png
  9. 33 15
      main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_automatic.js
  10. 1 0
      main/inc/lib/fckeditor/fcktemplates.xml.php
  11. 32 15
      main/inc/lib/javascript/glossary.js
  12. 67 0
      main/inc/lib/javascript/jquery.highlight.js
  13. 0 2
      main/install/dokeos_main.sql
  14. 0 1
      main/lang/bulgarian/admin.inc.php
  15. 1 0
      main/lang/bulgarian/trad4all.inc.php
  16. 0 1
      main/lang/catalan/admin.inc.php
  17. 1 0
      main/lang/catalan/trad4all.inc.php
  18. 0 1
      main/lang/english/admin.inc.php
  19. 1 0
      main/lang/english/exercice.inc.php
  20. 2 0
      main/lang/english/glossary.inc.php
  21. 1 0
      main/lang/english/trad4all.inc.php
  22. 1 0
      main/lang/english/userInfo.inc.php
  23. 0 1
      main/lang/italian/admin.inc.php
  24. 1 0
      main/lang/italian/trad4all.inc.php
  25. 0 1
      main/lang/portuguese/admin.inc.php
  26. 113 12
      main/lang/portuguese/reservation.inc.php
  27. 41 41
      main/lang/portuguese/resourcelinker.inc.php
  28. 32 32
      main/lang/portuguese/scorm.inc.php
  29. 1 0
      main/lang/portuguese/trad4all.inc.php
  30. 4 5
      main/lang/spanish/admin.inc.php
  31. 2 1
      main/lang/spanish/exercice.inc.php
  32. 2 0
      main/lang/spanish/glossary.inc.php
  33. 1 0
      main/lang/spanish/trad4all.inc.php
  34. 1 0
      main/lang/spanish/userInfo.inc.php
  35. 15 15
      main/tracking/courseLog.php
  36. 61 21
      main/user/subscribe_user.php
  37. 1 1
      main/user/user.php

+ 3 - 3
main/admin/settings.php

@@ -357,7 +357,7 @@ Display :: display_header($tool_name);
 // displaying the message that the settings have been stored
 if (!empty($_GET['action']) && $_GET['action'] == "stored")
 {
-	Display :: display_normal_message(get_lang('SettingsStored'));
+	Display :: display_confirmation_message(get_lang('SettingsStored'));
 }
 
 // the action images
@@ -467,7 +467,7 @@ function handle_plugins()
 		$category = $_GET['category'];
 		event_system(LOG_CONFIGURATION_SETTINGS_CHANGE, LOG_CONFIGURATION_SETTINGS_CATEGORY, $category, $time, $user_id);
 
-		Display :: display_normal_message(get_lang('SettingsStored'));
+		Display :: display_confirmation_message(get_lang('SettingsStored'));
 	}
 
 	echo get_lang('AvailablePlugins')."<br/><br/>";
@@ -928,7 +928,7 @@ function handle_search() {
                 $result = api_set_setting($key,$value,null,null);
         }
 
-        Display :: display_normal_message($SettingsStored);
+        Display :: display_confirmation_message($SettingsStored);
     } else {
         echo '<div id="search-options-form">';
         $form->display();

+ 1 - 1
main/document/edit_document.php

@@ -599,7 +599,7 @@ if(isset($msgError))
 
 if( isset($info_message))
 {
-	Display::display_normal_message($info_message); //main API
+	Display::display_confirmation_message($info_message); //main API
 }
 
 

+ 2 - 1
main/document/slideshow.php

@@ -286,7 +286,8 @@ if ($slide_id !== "all") {
 			echo '<tr>';
 			echo '<td align="center">';
 		
-			echo '<a href="edit_document.php?'.api_get_cidreq().'&curdirpath='.$pathurl.'&amp;file='.urlencode($path).$image_files_only[$slide].'"><img src="../img/edit.gif" border="0" title="'.get_lang('Modify').'" alt="'.get_lang('Modify').'" /></a><br />';
+		
+			echo '<a href="edit_document.php?'.api_get_cidreq().'&curdirpath='.$pathurl.'&amp;file='.urlencode($path).'/'.$image_files_only[$slide].'"><img src="../img/edit.gif" border="0" title="'.get_lang('Modify').'" alt="'.get_lang('Modify').'" /></a><br />';
 		
 			list($width, $high) = getimagesize($image);
 			echo $width.' x '.$high.' <br />';

+ 0 - 1121
main/exercice/exercice_submit.php

@@ -1,1121 +0,0 @@
-<?php
-// $Id: exercice_submit.php 22201 2009-07-17 19:57:03Z cfasanando $
-
-/*
-==============================================================================
-	Dokeos - elearning and course management software
-
-	Copyright (c) 2004-2008 Dokeos SPRL
-	Copyright (c) 2003 Ghent University (UGent)
-	Copyright (c) 2001 Universite catholique de Louvain (UCL)
-	Copyright (c) various contributors
-
-	For a full list of contributors, see "credits.txt".
-	The full license can be read in "license.txt".
-
-	This program is free software; you can redistribute it and/or
-	modify it under the terms of the GNU General Public License
-	as published by the Free Software Foundation; either version 2
-	of the License, or (at your option) any later version.
-
-	See the GNU General Public License for more details.
-
-	Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
-	Mail: info@dokeos.com
-==============================================================================
-*/
-
-/**
-*	Exercise submission
-* 	This script allows to run an exercise. According to the exercise type, questions
-* 	can be on an unique page, or one per page with a Next button.
-*
-* 	One exercise may contain different types of answers (unique or multiple selection,
-* 	matching, fill in blanks, free answer, hot-spot).
-*
-* 	Questions are selected randomly or not.
-*
-* 	When the user has answered all questions and clicks on the button "Ok",
-* 	it goes to exercise_result.php
-*
-* 	Notice : This script is also used to show a question before modifying it by
-* 	the administrator
-*	@package dokeos.exercise
-* 	@author Olivier Brouckaert
-* 	@author Julio Montoya multiple fill in blank option added
-* 	@version $Id: exercice_submit.php 22201 2009-07-17 19:57:03Z cfasanando $
-*/
-
-require_once 'exercise.class.php';
-require_once 'question.class.php';
-require_once 'answer.class.php';
-require_once 'exercise.lib.php';
-
-// debug var. Set to 0 to hide all debug display. Set to 1 to display debug messages.
-$debug = 0;
-/*
-// answer types
-define('UNIQUE_ANSWER',		1);
-define('MULTIPLE_ANSWER',	2);
-define('FILL_IN_BLANKS',	3);
-define('MATCHING',			4);
-define('FREE_ANSWER', 		5);
-define('HOT_SPOT', 			6);
-define('HOT_SPOT_ORDER', 	7);
-*/
-// name of the language file that needs to be included
-$language_file = 'exercice';
-
-require_once '../inc/global.inc.php';
-$this_section = SECTION_COURSES;
-if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
-  $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
-  $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/glossary.js" type="text/javascript" language="javascript"></script>'; //Glossary
- }
-/* ------------	ACCESS RIGHTS ------------ */
-// notice for unauthorized people.
-api_protect_course_script(true);
-
-require_once api_get_path(LIBRARY_PATH) . 'text.lib.php';
-
-$is_allowedToEdit = api_is_allowed_to_edit(null,true);
-
-$_configuration['live_exercise_tracking'] = true;
-$stat_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
-$exercice_attemp_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
-
-$TBL_EXERCICE_QUESTION = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);
-$TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST);
-$TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION);
-$TBL_REPONSES = Database :: get_course_table(TABLE_QUIZ_ANSWER);
-
-// general parameters passed via POST/GET
-
-if (empty ($origin)) {
-	$origin = $_REQUEST['origin'];
-}
-if (empty ($learnpath_id)) {
-	$learnpath_id = Security::remove_XSS($_REQUEST['learnpath_id']);
-}
-if (empty ($learnpath_item_id)) {
-	$learnpath_item_id = Security::remove_XSS($_REQUEST['learnpath_item_id']);
-}
-if (empty ($formSent)) {
-	$formSent = $_REQUEST['formSent'];
-}
-if (empty ($exerciseResult)) {
-	$exerciseResult = $_REQUEST['exerciseResult'];
-}
-if (empty ($exerciseResultCoordinates)) {
-	$exerciseResultCoordinates = $_REQUEST['exerciseResultCoordinates'];
-}
-if (empty ($exerciseType)) {
-	$exerciseType = $_REQUEST['exerciseType'];
-}
-if (empty ($exerciseId)) {
-	$exerciseId = Database::escape_string(intval($_REQUEST['exerciseId']));
-}
-if (empty ($choice)) {
-	$choice = $_REQUEST['choice'];
-}
-if (empty ($_REQUEST['choice'])) {
-	$choice = $_REQUEST['choice2'];
-}
-if (empty ($questionNum)) {
-	$questionNum = Database :: escape_string($_REQUEST['questionNum']);
-}
-if (empty ($nbrQuestions)) {
-	$nbrQuestions = Database :: escape_string($_REQUEST['nbrQuestions']);
-}
-if (empty ($buttonCancel)) {
-	$buttonCancel = $_REQUEST['buttonCancel'];
-}
-$error = '';
-if (!isset ($exerciseType)) {
-	$exe_start_date = time();
-	$_SESSION['exercice_start_date'] = $exe_start_date;
-}
-// if the user has clicked on the "Cancel" button
-if ($buttonCancel) {
-	// returns to the exercise list
-	header("Location: exercice.php?origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id");
-	exit ();
-}
-
-if ($origin == 'learnpath' && isset ($_GET['not_multiple_attempt']) && $_GET['not_multiple_attempt'] == strval(intval($_GET['not_multiple_attempt']))) {
-	$not_multiple_attempt = (int) $_GET['not_multiple_attempt'];
-	if ($not_multiple_attempt === 1) {
-		require_once '../inc/reduced_header.inc.php';
-		echo '<div style="height:10px">&nbsp;</div>';
-		Display :: display_warning_message(get_lang('ReachedOneAttempt'));
-		exit;
-	}
-}
-
-if ($origin == 'builder') {
-	/*******************************/
-	/* Clears the exercise session */
-	/*******************************/
-	if (isset ($_SESSION['objExercise'])) {
-		api_session_unregister('objExercise');
-		unset ($objExercise);
-	}
-	if (isset ($_SESSION['objQuestion'])) {
-		api_session_unregister('objQuestion');
-		unset ($objQuestion);
-	}
-	if (isset ($_SESSION['objAnswer'])) {
-		api_session_unregister('objAnswer');
-		unset ($objAnswer);
-	}
-	if (isset ($_SESSION['questionList'])) {
-		api_session_unregister('questionList');
-		unset ($questionList);
-	}
-	if (isset ($_SESSION['newquestionList'])) {
-		api_session_unregister('newquestionList');
-		unset ($newquestionList);
-	}
-	if (isset ($_SESSION['exerciseResult'])) {
-		api_session_unregister('exerciseResult');
-		unset ($exerciseResult);
-	}
-	if (isset ($_SESSION['exerciseResultCoordinates'])) {
-		api_session_unregister('exerciseResultCoordinates');
-		unset ($exerciseResultCoordinates);
-	}
-}
-
-$safe_lp_id = ($learnpath_id == '') ? 0 : (int) $learnpath_id;
-$safe_lp_item_id = ($learnpath_item_id == '') ? 0 : (int) $learnpath_item_id;
-$condition = ' WHERE ' .
-	'exe_exo_id = ' . "'" . $exerciseId . "'" . ' AND ' .
-	'exe_user_id = ' . "'" . api_get_user_id() . "'" . ' AND ' .
-	'exe_cours_id = ' . "'" . $_course['id'] . "'" . ' AND ' .
-	'status = ' . "'incomplete'" . ' AND ' .
-	'orig_lp_id = ' . "'" . $safe_lp_id . "'" . ' AND ' .
-	'orig_lp_item_id = ' . "'" . $safe_lp_item_id . "'" . ' AND ' .
-	'session_id = ' . "'" . (int) $_SESSION['id_session'] . "'";
-
-$TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST);
-$result = Database::query("SELECT type,feedback_type FROM $TBL_EXERCICES WHERE id=$exerciseId", __FILE__, __LINE__);
-$exercise_row = Database :: fetch_array($result);
-$exerciseType = $exercise_row['type'];
-$exerciseFeedbackType = $exercise_row['feedback_type'];
-
-if ($_configuration['live_exercise_tracking'] == true && $exerciseType == 2 && $exerciseFeedbackType != 1) {
-	$query = 'SELECT * FROM ' . $stat_table . $condition;
-	$result_select = Database::query($query, __FILE__, __LINE__);
-	if (Database :: num_rows($result_select) > 0) {
-		$getIncomplete = Database :: fetch_array($result_select);
-		$exe_id = $getIncomplete['exe_id'];
-		if ($_SERVER['REQUEST_METHOD'] != 'POST') {
-			define('QUESTION_LIST_ALREADY_LOGGED', 1);
-			$recorded['questionList'] = explode(',', $getIncomplete['data_tracking']);
-			$query = 'SELECT * FROM ' . $exercice_attemp_table . ' WHERE exe_id = ' . $getIncomplete['exe_id'] . ' ORDER BY tms ASC';
-			$result = Database::query($query, __FILE__, __LINE__);
-			while ($row = Database :: fetch_array($result)) {
-				$recorded['exerciseResult'][$row['question_id']] = 1;
-			}
-			$exerciseResult = $_SESSION['exerciseResult'] = $recorded['exerciseResult'];
-			$exerciseType = 2;
-			$questionNum = count($recorded['exerciseResult']);
-			$questionNum++;
-			$questionList = $_SESSION['questionList'] = $recorded['questionList'];
-		}
-	} else {
-		$table_recorded_not_exist = true;
-	}
-}
-
-// if the user has submitted the form
-if ($formSent) {
-	if ($debug > 0) {
-		echo str_repeat('&nbsp;', 0) . '$formSent was set' . "<br />\n";
-	}
-
-	// initializing
-	if (!is_array($exerciseResult)) {
-		$exerciseResult = array ();
-		$exerciseResultCoordinates = array ();
-	}
-
-	// if the user has answered at least one question
-	if (is_array($choice)) {
-		if ($debug > 0) {
-			echo str_repeat('&nbsp;', 0) . '$choice is an array' . "<br />\n";
-		}
-
-		if ($exerciseType == 1)
-		{
-			// $exerciseResult receives the content of the form.
-			// Each choice of the student is stored into the array $choice
-			$exerciseResult = $choice;
-
-			// Also store hotspot spots in the session ($exerciseResultCoordinates
-			// will be stored in the session at the end of this script)
-			// The results will be stored by exercise_result.php if we are in
-			// an exercise of type 1 (=all on one page)
-			if (isset ($_POST['hotspot'])) {
-				$exerciseResultCoordinates = $_POST['hotspot'];
-			}
-
-		} else {
-			// gets the question ID from $choice. It is the key of the array
-			list ($key) = array_keys($choice);
-
-			// if the user didn't already answer this question
-			if (!isset ($exerciseResult[$key])) {
-				// stores the user answer into the array
-				$exerciseResult[$key] = $choice[$key];
-
-				//saving each question
-				if ($_configuration['live_exercise_tracking'] == true && $exerciseType == 2 && $exerciseFeedbackType != 1) {
-
-					$nro_question = $questionNum; // - 1;
-
-					//START of saving and qualifying each question submitted
-					//------------------------------------------------------------------------------------------
-					//
-					define('ENABLED_LIVE_EXERCISE_TRACKING', 1);
-					require_once 'question.class.php';
-					require_once 'answer.class.php';
-					$counter = 0;
-					$main_course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
-					$table_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER);
-					//foreach($questionList as $questionId)
-					if (true) {
-						$exeId = $exe_id;
-						$questionId = $key;
-						$counter++;
-						// gets the student choice for this question
-						$choice = $exerciseResult[$questionId];
-
-						// creates a temporary Question object
-						$objQuestionTmp = Question :: read($questionId);
-
-						$questionName = $objQuestionTmp->selectTitle();
-						$questionDescription = $objQuestionTmp->selectDescription();
-						$questionWeighting = $objQuestionTmp->selectWeighting();
-						$answerType = $objQuestionTmp->selectType();
-						$quesId = $objQuestionTmp->selectId(); //added by priya saini
-
-						// destruction of the Question object
-						unset ($objQuestionTmp);
-
-						if (isset ($_POST['hotspot']) && isset($_POST['hotspot'][$key])) {
-							$exerciseResultCoordinates[$key] = $_POST['hotspot'][$key];
-						}
-
-						// construction of the Answer object
-						$objAnswerTmp = new Answer($questionId);
-						$nbrAnswers = $objAnswerTmp->selectNbrAnswers();
-						$questionScore = 0;
-						if ($answerType == FREE_ANSWER) {
-							$nbrAnswers = 1;
-						}
-
-						for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
-							$answer = $objAnswerTmp->selectAnswer($answerId);
-							$answerComment = $objAnswerTmp->selectComment($answerId);
-							$answerCorrect = $objAnswerTmp->isCorrect($answerId);
-							$answerWeighting = $objAnswerTmp->selectWeighting($answerId);
-
-							switch ($answerType) {
-								// for unique answer
-								case UNIQUE_ANSWER :
-									$studentChoice = ($choice == $answerId) ? 1 : 0;
-
-									if ($studentChoice) {
-										$questionScore += $answerWeighting;
-										$totalScore += $answerWeighting;
-									}
-
-									break;
-									// for multiple answers
-								case MULTIPLE_ANSWER :
-
-									$studentChoice = $choice[$answerId];
-
-									if ($studentChoice) {
-										$questionScore += $answerWeighting;
-										$totalScore += $answerWeighting;
-									}
-
-									break;
-									// for fill in the blanks
-								case FILL_IN_BLANKS :
-
-									// the question is encoded like this
-									// [A] B [C] D [E] F::10,10,10@1
-									// number 1 before the "@" means that is a switchable fill in blank question
-									// [A] B [C] D [E] F::10,10,10@ or  [A] B [C] D [E] F::10,10,10
-									// means that is a normal fill blank question
-
-									// first we explode the "::"
-									$pre_array = explode('::', $answer);
-
-									// is switchable fill blank or not
-									$last = count($pre_array) - 1;
-									$is_set_switchable = explode('@', $pre_array[$last]);
-
-									$switchable_answer_set = false;
-									if (isset ($is_set_switchable[1]) && $is_set_switchable[1] == 1) {
-										$switchable_answer_set = true;
-									}
-
-									$answer = '';
-									for ($k = 0; $k < $last; $k++) {
-										$answer .= $pre_array[$k];
-									}
-
-									// splits weightings that are joined with a comma
-									$answerWeighting = explode(',', $is_set_switchable[0]);
-
-									// we save the answer because it will be modified
-									$temp = $answer;
-
-									// TeX parsing
-									// 1. find everything between the [tex] and [/tex] tags
-									$startlocations = strpos($temp, '[tex]');
-									$endlocations = strpos($temp, '[/tex]');
-
-									if ($startlocations !== false && $endlocations !== false) {
-										$texstring = substr($temp, $startlocations, $endlocations - $startlocations +6);
-										// 2. replace this by {texcode}
-										$temp = str_replace($texstring, '{texcode}', $temp);
-									}
-
-									$answer = '';
-									$j = 0;
-
-									//initialise answer tags
-									$user_tags = array ();
-									$correct_tags = array ();
-									$real_text = array ();
-									// the loop will stop at the end of the text
-									while (1) {
-										// quits the loop if there are no more blanks (detect '[')
-										if (($pos = strpos($temp, '[')) === false) {
-											// adds the end of the text
-											$answer = $temp;
-											// TeX parsing - replacement of texcode tags
-											$texstring = api_parse_tex($texstring);
-											$answer = str_replace("{texcode}", $texstring, $answer);
-											$real_text[] = $answer;
-											break; //no more "blanks", quit the loop
-										}
-										// adds the piece of text that is before the blank
-										//and ends with '[' into a general storage array
-										$real_text[] = substr($temp, 0, $pos +1);
-										$answer .= substr($temp, 0, $pos +1);
-										//take the string remaining (after the last "[" we found)
-										$temp = substr($temp, $pos +1);
-										// quit the loop if there are no more blanks, and update $pos to the position of next ']'
-										if (($pos = strpos($temp, ']')) === false) {
-											// adds the end of the text
-											$answer .= $temp;
-											break;
-										}
-										$choice[$j] = trim($choice[$j]);
-										$user_tags[] = strtolower($choice[$j]);
-										//put the contents of the [] answer tag into correct_tags[]
-										$correct_tags[] = strtolower(substr($temp, 0, $pos));
-										$j++;
-										$temp = substr($temp, $pos +1);
-										//$answer .= ']';
-									}
-
-									$answer = '';
-									$real_correct_tags = $correct_tags;
-									$chosen_list = array ();
-
-									for ($i = 0; $i < count($real_correct_tags); $i++) {
-										if ($i == 0) {
-											$answer .= $real_text[0];
-										}
-
-										if (!$switchable_answer_set) {
-											if ($correct_tags[$i] == $user_tags[$i]) {
-												// gives the related weighting to the student
-												$questionScore += $answerWeighting[$i];
-												// increments total score
-												$totalScore += $answerWeighting[$i];
-												// adds the word in green at the end of the string
-												$answer .= $correct_tags[$i];
-											}
-											// else if the word entered by the student IS NOT the same as the one defined by the professor
-											elseif (!empty ($user_tags[$i])) {
-												// adds the word in red at the end of the string, and strikes it
-												$answer .= '<font color="red"><s>' . $user_tags[$i] . '</s></font>';
-											} else {
-												// adds a tabulation if no word has been typed by the student
-												$answer .= '&nbsp;&nbsp;&nbsp;';
-											}
-										} else {
-											// switchable fill in the blanks
-											if (in_array($user_tags[$i], $correct_tags)) {
-												$chosen_list[] = $user_tags[$i];
-												$correct_tags = array_diff($correct_tags, $chosen_list);
-
-												// gives the related weighting to the student
-												$questionScore += $answerWeighting[$i];
-												// increments total score
-												$totalScore += $answerWeighting[$i];
-												// adds the word in green at the end of the string
-												$answer .= $user_tags[$i];
-											}
-											elseif (!empty ($user_tags[$i])) {
-												// else if the word entered by the student IS NOT the same as the one defined by the professor
-												// adds the word in red at the end of the string, and strikes it
-												$answer .= '<font color="red"><s>' . $user_tags[$i] . '</s></font>';
-											} else {
-												// adds a tabulation if no word has been typed by the student
-												$answer .= '&nbsp;&nbsp;&nbsp;';
-											}
-										}
-										// adds the correct word, followed by ] to close the blank
-										$answer .= ' / <font color="green"><b>' . $real_correct_tags[$i] . '</b></font>]';
-										if (isset ($real_text[$i +1])) {
-											$answer .= $real_text[$i +1];
-										}
-									}
-
-									break;
-									// for free answer
-								case FREE_ANSWER :
-									$studentChoice = $choice;
-
-									if ($studentChoice) {
-										//Score is at -1 because the question has'nt been corected
-										$questionScore = -1;
-										$totalScore += 0;
-									}
-									break;
-									// for matching
-								case MATCHING :
-									if ($answerCorrect) {
-										if ($answerCorrect == $choice[$answerId]) {
-											$questionScore += $answerWeighting;
-											$totalScore += $answerWeighting;
-											$choice[$answerId] = $matching[$choice[$answerId]];
-										}
-										elseif (!$choice[$answerId]) {
-											$choice[$answerId] = '&nbsp;&nbsp;&nbsp;';
-										} else {
-											$choice[$answerId] = '<font color="red"><s>' . $matching[$choice[$answerId]] . '</s></font>';
-										}
-									} else {
-										$matching[$answerId] = $answer;
-									}
-									break;
-									// for hotspot with no order
-								case HOT_SPOT :
-									$studentChoice = $choice[$answerId];
-
-									if ($studentChoice) {
-										$questionScore += $answerWeighting;
-										$totalScore += $answerWeighting;
-									}
-									break;
-									// for hotspot with fixed order
-								case HOT_SPOT_ORDER :
-									$studentChoice = $choice['order'][$answerId];
-
-									if ($studentChoice == $answerId) {
-										$questionScore += $answerWeighting;
-										$totalScore += $answerWeighting;
-										$studentChoice = true;
-									} else {
-										$studentChoice = false;
-									}
-									break;
-							} // end switch Answertype
-						} // end for that loops over all answers of the current question
-						// destruction of Answer
-						unset ($objAnswerTmp);
-
-						$i++;
-
-						$totalWeighting += $questionWeighting;
-						//added by priya saini
-						// Store results directly in the database
-						// For all in one page exercises, the results will be
-						// stored by exercise_results.php (using the session)
-						if ($_configuration['tracking_enabled']) {
-							if (empty ($choice)) {
-								$choice = 0;
-							}
-							if ($answerType == MULTIPLE_ANSWER) {
-								if ($choice != 0) {
-									$reply = array_keys($choice);
-
-									for ($i = 0; $i < sizeof($reply); $i++) {
-										$ans = $reply[$i];
-
-										exercise_attempt($questionScore, $ans, $quesId, $exeId, $i);
-									}
-								} else {
-									exercise_attempt($questionScore, 0, $quesId, $exeId, 0);
-								}
-							}
-							elseif ($answerType == MATCHING) {
-								$j = sizeof($matching) + 1;
-
-								for ($i = 0; $i < sizeof($choice); $i++, $j++) {
-									$val = $choice[$j];
-									if (preg_match_all('#<font color="red"><s>([0-9a-z ]*)</s></font>#', $val, $arr1)) {
-										$val = $arr1[1][0];
-									}
-									$val = $val;
-									$val = strip_tags($val);
-									$sql = "select position from $table_ans where question_id='" . Database :: escape_string($questionId) . "' and answer='" . Database :: escape_string($val) . "' AND correct=0";
-									$res = Database::query($sql, __FILE__, __LINE__);
-									if (Database :: num_rows($res) > 0) {
-										$answer = Database :: result($res, 0, "position");
-									} else {
-										$answer = '';
-									}
-									exercise_attempt($questionScore, $answer, $quesId, $exeId, $j);
-
-								}
-							} elseif ($answerType == FREE_ANSWER) {
-								$answer = $choice;
-								exercise_attempt($questionScore, $answer, $quesId, $exeId, 0);
-							} elseif ($answerType == UNIQUE_ANSWER) {
-								$answer = $choice;
-								exercise_attempt($questionScore, $answer, $quesId, $exeId, 0);
-							} elseif ($answerType == HOT_SPOT) {
-								exercise_attempt($questionScore, $answer, $quesId, $exeId, 0);
-								if (is_array($exerciseResultCoordinates[$key])) {
-									foreach($exerciseResultCoordinates[$key] as $idx => $val) {
-										exercise_attempt_hotspot($exeId,$quesId,$idx,$choice[$idx],$val);
-									}
-								}
-							} else {
-								exercise_attempt($questionScore, $answer, $quesId, $exeId, 0);
-							}
-						}
-					}
-					// end huge foreach() block that loops over all questions
-
-					//at loops over all questions
-					if (isset($exe_id)) {
-						$sql_update = 'UPDATE ' . $stat_table . ' SET exe_result = exe_result + ' . (int) $totalScore . ',exe_weighting = exe_weighting + ' . (int) $totalWeighting . ' WHERE exe_id = ' . Database::escape_string($exe_id);
-						Database::query($sql_update, __FILE__, __LINE__);
-					}
-					//END of saving and qualifying
-					//------------------------------------------------------------------------------------------
-					//
-				}
-			}
-		}
-		if ($debug > 0) {
-			echo str_repeat('&nbsp;', 0) . '$choice is an array - end' . "<br />\n";
-		}
-	}
-
-	// the script "exercise_result.php" will take the variable $exerciseResult from the session
-	api_session_register('exerciseResult');
-	api_session_register('exerciseResultCoordinates');
-	define('ALL_ON_ONE_PAGE',1);
-	define('ONE_PER_PAGE',2);
-	// if all questions on one page OR if it is the last question (only for an exercise with one question per page)
-	if ($exerciseType == ALL_ON_ONE_PAGE || $questionNum >= $nbrQuestions) {
-		if ($debug > 0) {
-			echo str_repeat('&nbsp;', 0) . 'Redirecting to exercise_result.php - Remove debug option to let this happen' . "<br />\n";
-		}
-		if ( api_is_allowed_to_session_edit() ) {
-			// goes to the script that will show the result of the exercise
-			if ($exerciseType == ALL_ON_ONE_PAGE) {
-				header("Location: exercise_result.php?id=$exe_id&exerciseType=$exerciseType&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id");
-			} else {
-				if ($exe_id != '') {
-					//clean incomplete
-					$update_query = 'UPDATE ' . $stat_table . ' SET ' . "status = '', data_tracking='', exe_date = '" . date('Y-m-d H:i:s') . "'" . ' WHERE exe_id = ' . Database::escape_string($exe_id);
-					Database::query($update_query, __FILE__, __LINE__);
-				}
-				header("Location: exercise_show.php?id=$exe_id&exerciseType=$exerciseType&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id");
-			}
-			exit ();
-		} else {
-			header("Location: exercice_submit.php?exerciseId=$exerciseId");
-			exit;
-		}
-	}
-	if ($debug > 0) {
-		echo str_repeat('&nbsp;', 0) . '$formSent was set - end' . "<br />\n";
-	}
-}
-
-// if the object is not in the session
-
-//why destroying the exercise when a LP is loaded ?
-//if (!isset($_SESSION['objExercise']) || $origin == 'learnpath' || $_SESSION['objExercise']->id != $_REQUEST['exerciseId']) {
-if (!isset ($_SESSION['objExercise']) || $_SESSION['objExercise']->id != $_REQUEST['exerciseId']) {
-	if ($debug > 0) {
-		echo str_repeat('&nbsp;', 0) . '$_SESSION[objExercise] was unset' . "<br />\n";
-	}
-	// construction of Exercise
-	$objExercise = new Exercise();
-	unset ($_SESSION['questionList']);
-
-	// if the specified exercise doesn't exist or is disabled
-	if (!$objExercise->read($exerciseId) || (!$objExercise->selectStatus() && !$is_allowedToEdit && ($origin != 'learnpath'))) {
-		unset ($objExercise);
-		$error = get_lang('ExerciseNotFound');
-		//die(get_lang('ExerciseNotFound'));
-	} else {
-		// saves the object into the session
-		api_session_register('objExercise');
-		if ($debug > 0) {
-			echo str_repeat('&nbsp;', 0) . '$_SESSION[objExercise] was unset - set now - end' . "<br />\n";
-		}
-	}
-}
-
-if (!isset ($objExcercise) && isset ($_SESSION['objExercise'])) {
-	$objExercise = $_SESSION['objExercise'];
-}
-if (!is_object($objExercise)) {
-	header('Location: exercice.php');
-	exit ();
-}
-$Exe_starttime = $objExercise->start_time;
-$Exe_endtime = $objExercise->end_time;
-$quizID = $objExercise->selectId();
-$exerciseAttempts = $objExercise->selectAttempts();
-$exerciseTitle = $objExercise->selectTitle();
-$exerciseDescription = $objExercise->selectDescription();
-$exerciseDescription = $exerciseDescription;
-$exerciseSound = $objExercise->selectSound();
-$randomQuestions = $objExercise->isRandom();
-$exerciseType = $objExercise->selectType();
-$table_quiz_test = Database :: get_course_table(TABLE_QUIZ_TEST);
-//if (!isset($_SESSION['questionList']) || $origin == 'learnpath') {
-//in LP's is enabled the "remember question" feature?
-$my_exe_id = Security :: remove_XSS($_GET['exerciseId']);
-if (!isset ($_SESSION['questionList'])) {
-	if ($debug > 0) {
-		echo str_repeat('&nbsp;', 0) . '$_SESSION[questionList] was unset' . "<br />\n";
-	}
-	// selects the list of question ID
-	$my_question_list = array ();
-	$questionList = ($randomQuestions ? $objExercise->selectRandomList() : $objExercise->selectQuestionList());
-	// saves the question list into the session
-	$sql = 'SELECT random FROM ' . $table_quiz_test . ' WHERE id="' . Database :: escape_string($my_exe_id) . '";';
-	$rs = Database::query($sql, __FILE__, __LINE__);
-	$row_number = Database :: fetch_array($rs);
-	$z = 0;
-
-	if ($row_number['random'] <> 0) {
-		foreach ($questionList as $infoquestionList) {
-			if ($z < $row_number['random']) {
-				$my_question_list[$z] = $infoquestionList;
-			} else {
-				break;
-			}
-			$z++;
-		}
-		// $questionList=array();
-		$questionList = $my_question_list;
-	}
-	api_session_register('questionList');
-	if ($debug > 0) {
-		echo str_repeat('&nbsp;', 0) . '$_SESSION[questionList] was unset - set now - end' . "<br />\n";
-	}
-}
-if (!isset ($objExcercise) && isset ($_SESSION['objExercise'])) {
-	$questionList = $_SESSION['questionList'];
-}
-
-$quizStartTime = time();
-api_session_register('quizStartTime');
-$nbrQuestions = sizeof($questionList);
-// if questionNum comes from POST and not from GET
-if (!$questionNum || $_POST['questionNum']) {
-	// only used for sequential exercises (see $exerciseType)
-	if (!$questionNum) {
-		$questionNum = 1;
-	} else {
-		$questionNum++;
-	}
-}
-
-if (!empty ($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
-	$_SESSION['gradebook'] = Security :: remove_XSS($_GET['gradebook']);
-	$gradebook = $_SESSION['gradebook'];
-}
-elseif (empty ($_GET['gradebook'])) {
-	unset ($_SESSION['gradebook']);
-	$gradebook = '';
-}
-
-if (!empty ($gradebook) && $gradebook == 'view') {
-	$interbreadcrumb[] = array (
-		'url' => '../gradebook/' . $_SESSION['gradebook_dest'],
-		'name' => get_lang('Gradebook')
-	);
-}
-//$nameTools=get_lang('Exercice');
-
-$interbreadcrumb[] = array (
-	"url" => "exercice.php?gradebook=$gradebook",
-	"name" => get_lang('Exercices')
-);
-$interbreadcrumb[] = array (
-	"url" => api_get_self()."?gradebook=$gradebook",
-	"name" => $exerciseTitle
-);
-
-if ($origin != 'learnpath') { //so we are not in learnpath tool
-
-	$htmlHeadXtra[] = "<script type=\"text/javascript\" src=\"../plugin/hotspot/JavaScriptFlashGateway.js\"></script>
-						<script src=\"../plugin/hotspot/hotspot.js\" type=\"text/javascript\"></script>
-						<script language=\"JavaScript\" type=\"text/javascript\">
-						<!--
-						// -----------------------------------------------------------------------------
-						// Globals
-						// Major version of Flash required
-						var requiredMajorVersion = 7;
-						// Minor version of Flash required
-						var requiredMinorVersion = 0;
-						// Minor version of Flash required
-						var requiredRevision = 0;
-						// the version of javascript supported
-						var jsVersion = 1.0;
-						// -----------------------------------------------------------------------------
-						// -->
-						</script>
-						<script language=\"VBScript\" type=\"text/vbscript\">
-						<!-- // Visual basic helper required to detect Flash Player ActiveX control version information
-						Function VBGetSwfVer(i)
-						  on error resume next
-						  Dim swControl, swVersion
-						  swVersion = 0
-
-						  set swControl = CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" + CStr(i))
-						  if (IsObject(swControl)) then
-						    swVersion = swControl.GetVariable(\"\$version\")
-						  end if
-						  VBGetSwfVer = swVersion
-						End Function
-						// -->
-						</script>
-
-						<script language=\"JavaScript1.1\" type=\"text/javascript\">
-						<!-- // Detect Client Browser type
-						var isIE  = (navigator.appVersion.indexOf(\"MSIE\") != -1) ? true : false;
-						var isWin = (navigator.appVersion.toLowerCase().indexOf(\"win\") != -1) ? true : false;
-						var isOpera = (navigator.userAgent.indexOf(\"Opera\") != -1) ? true : false;
-						jsVersion = 1.1;
-						// JavaScript helper required to detect Flash Player PlugIn version information
-						function JSGetSwfVer(i){
-							// NS/Opera version >= 3 check for Flash plugin in plugin array
-							if (navigator.plugins != null && navigator.plugins.length > 0) {
-								if (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {
-									var swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";
-						      		var flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;
-									descArray = flashDescription.split(\" \");
-									tempArrayMajor = descArray[2].split(\".\");
-									versionMajor = tempArrayMajor[0];
-									versionMinor = tempArrayMajor[1];
-									if ( descArray[3] != \"\" ) {
-										tempArrayMinor = descArray[3].split(\"r\");
-									} else {
-										tempArrayMinor = descArray[4].split(\"r\");
-									}
-						      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
-						            flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;
-						      	} else {
-									flashVer = -1;
-								}
-							}
-							// MSN/WebTV 2.6 supports Flash 4
-							else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;
-							// WebTV 2.5 supports Flash 3
-							else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;
-							// older WebTV supports Flash 2
-							else if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;
-							// Can't detect in all other cases
-							else {
-
-								flashVer = -1;
-							}
-							return flashVer;
-						}
-						// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
-						function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
-						{
-						 	reqVer = parseFloat(reqMajorVer + \".\" + reqRevision);
-						   	// loop backwards through the versions until we find the newest version
-							for (i=25;i>0;i--) {
-								if (isIE && isWin && !isOpera) {
-									versionStr = VBGetSwfVer(i);
-								} else {
-									versionStr = JSGetSwfVer(i);
-								}
-								if (versionStr == -1 ) {
-									return false;
-								} else if (versionStr != 0) {
-									if(isIE && isWin && !isOpera) {
-										tempArray         = versionStr.split(\" \");
-										tempString        = tempArray[1];
-										versionArray      = tempString .split(\",\");
-									} else {
-										versionArray      = versionStr.split(\".\");
-									}
-									versionMajor      = versionArray[0];
-									versionMinor      = versionArray[1];
-									versionRevision   = versionArray[2];
-
-									versionString     = versionMajor + \".\" + versionRevision;   // 7.0r24 == 7.24
-									versionNum        = parseFloat(versionString);
-						        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
-									if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
-										return true;
-									} else {
-										return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );
-									}
-								}
-							}
-						}
-						// -->
-						</script>";
-	Display :: display_header($nameTools, "Exercise");
-		if (!api_is_allowed_to_session_edit() ) {
-			Display :: display_warning_message(get_lang('SessionIsReadOnly'));
-		}
-} else {
-	if (empty ($charset)) {
-		$charset = 'ISO-8859-15';
-	}
-	/*
-	 * HTML HEADER
-	 */
-	Display::display_reduced_header();
-	echo '<div style="height:10px">&nbsp;</div>';
-}
-
-// I'm in a preview mode
-if (api_is_course_admin() && $origin != 'learnpath') {
-	echo '<div class="actions">';
-	echo Display :: return_icon('quiz.gif', get_lang('GoBackToEx')) . '<a href="admin.php?' . api_get_cidreq() . '&exerciseId=' . $objExercise->id . '">' . get_lang('GoBackToEx') . '</a>';
-	echo Display :: return_icon('edit.gif', get_lang('ModifyExercise')) . '<a href="exercise_admin.php?modifyExercise=yes&exerciseId=' . $objExercise->id . '">' . get_lang('ModifyExercise') . '</a>';
-	echo '</div>';
-}
-  echo '<div class="glossary-content">';
-$exerciseTitle = api_parse_tex($exerciseTitle);
-
-echo "<h3>" . $exerciseTitle . "</h3>";
-
-if ($exerciseAttempts > 0) {
-	$user_id = api_get_user_id();
-	$course_code = api_get_course_id();
-	$sql = "SELECT count(*) FROM $stat_table WHERE exe_exo_id = '$quizID'
-				AND exe_user_id = '$user_id'
-				AND status != 'incomplete'
-				AND orig_lp_id = $safe_lp_id
-				AND orig_lp_item_id = $safe_lp_item_id
-	            AND exe_cours_id = '$course_code' AND session_id = '" . (int) $_SESSION['id_session'] . "'";
-
-	$aquery = Database::query($sql, __FILE__, __LINE__);
-	$attempt = Database :: fetch_array($aquery);
-
-	if ($attempt[0] >= $exerciseAttempts) {
-		if (!api_is_allowed_to_edit(null,true)) {
-			Display :: display_warning_message(sprintf(get_lang('ReachedMaxAttempts'), $exerciseTitle, $exerciseAttempts), false);
-			if ($origin != 'learnpath')
-				Display :: display_footer();
-			exit;
-		} else {
-			Display :: display_warning_message(sprintf(get_lang('ReachedMaxAttemptsAdmin'), $exerciseTitle, $exerciseAttempts), false);
-		}
-	}
-}
-
-if (!function_exists('convert_date_to_number')) {
-	function convert_date_to_number($default) {
-		// 2008-10-12 00:00:00 ---to--> 12345672218 (timestamp)
-		$parts = split(' ', $default);
-		list ($d_year, $d_month, $d_day) = split('-', $parts[0]);
-		list ($d_hour, $d_minute, $d_second) = split(':', $parts[1]);
-		return mktime($d_hour, $d_minute, $d_second, $d_month, $d_day, $d_year);
-	}
-}
-
-$limit_time_exists = (($Exe_starttime != '0000-00-00 00:00:00') || ($Exe_endtime != '0000-00-00 00:00:00')) ? true : false;
-if ($limit_time_exists) {
-	$exercise_start_time = convert_date_to_number($Exe_starttime);
-	$exercise_end_time = convert_date_to_number($Exe_endtime);
-	$time_now = convert_date_to_number(date('Y-m-d H:i:s'));
-	$permission_to_start = (($time_now - $exercise_start_time) > 0) ? true : false;
-	if ($_SERVER['REQUEST_METHOD'] != 'POST')
-		$exercise_timeover = (($time_now - $exercise_end_time) > 0) ? true : false;
-	if ($permission_to_start == false || $exercise_timeover == true) { //
-		if (!api_is_allowed_to_edit(null,true)) {
-			$message_warning = ($permission_to_start == false) ? get_lang('ExerciseNoStartedYet') : get_lang('ReachedTimeLimit');
-			Display :: display_warning_message(sprintf($message_warning, $exerciseTitle, $exerciseAttempts));
-			Display :: display_footer();
-			exit;
-		} else {
-			$message_warning = ($permission_to_start == false) ? get_lang('ExerciseNoStartedAdmin') : get_lang('ReachedTimeLimitAdmin');
-			Display :: display_warning_message(sprintf($message_warning, $exerciseTitle, $exerciseAttempts));
-		}
-	}
-}
-
-if (!empty ($error)) {
-	Display :: display_error_message($error, false);
-} else {
-	if (!empty ($exerciseSound)) {
-		echo "<a href=\"../document/download.php?doc_url=%2Faudio%2F" . Security::remove_XSS($exerciseSound) . "\" target=\"_blank\">", "<img src=\"../img/sound.gif\" border=\"0\" align=\"absmiddle\" alt=", get_lang('Sound') .
-		"\" /></a>";
-	}
-
-	// Get number of hotspot questions for javascript validation
-	$number_of_hotspot_questions = 0;
-	$onsubmit = '';
-	$i = 0;
-	//i have a doubt in this line cvargas
-	//var_dump($questionList);
-	if (!strcmp($questionList[0], '') === 0) {
-		foreach ($questionList as $questionId) {
-			$i++;
-			$objQuestionTmp = Question :: read($questionId);
-			// for sequential exercises
-			if ($exerciseType == 2) {
-				// if it is not the right question, goes to the next loop iteration
-				if ($questionNum != $i) {
-					continue;
-				} else {
-					if ($objQuestionTmp->selectType() == HOT_SPOT) {
-						$number_of_hotspot_questions++;
-					}
-
-					break;
-				}
-			} else {
-				if ($objQuestionTmp->selectType() == HOT_SPOT) {
-					$number_of_hotspot_questions++;
-				}
-			}
-		}
-	}
-	if ($number_of_hotspot_questions > 0) {
-		$onsubmit = "onsubmit=\"return validateFlashVar('" . $number_of_hotspot_questions . "', '" . get_lang('HotspotValidateError1') . "', '" . get_lang('HotspotValidateError2') . "');\"";
-	}
-	$s = "<p>$exerciseDescription</p>";
-
-	if ($exerciseType == 2)
-	{
-		$s2 = "&exerciseId=" . $exerciseId;
-	}
-
-	$s .= " <form method='post' action='" . api_get_self() . "?autocomplete=off&gradebook=$gradebook" . $s2 . "' name='frm_exercise' $onsubmit>
-		 <input type='hidden' name='formSent' value='1' />
-		 <input type='hidden' name='exerciseType' value='" . $exerciseType . "' />
-		 <input type='hidden' name='exerciseId' value='" . $exerciseId . "' />
-		 <input type='hidden' name='questionNum' value='" . $questionNum . "' />
-		 <input type='hidden' name='nbrQuestions' value='" . $nbrQuestions . "' />
-		 <input type='hidden' name='origin' value='" . $origin . "' />
-		 <input type='hidden' name='learnpath_id' value='" . $learnpath_id . "' />
-		 <input type='hidden' name='learnpath_item_id' value='" . $learnpath_item_id . "' />
-		 <table width='100%' border='0' cellpadding='1' cellspacing='0'>
-			<tr>
-		 		<td>
-		  			<table width='100%' cellpadding='3' cellspacing='0' border='0'>";
-	echo $s;
-	$i = 1;
-	foreach ($questionList as $questionId) {
-		// for sequential exercises
-		if ($exerciseType == 2) {
-			// if it is not the right question, goes to the next loop iteration
-			if ($questionNum != $i) {
-				$i++;
-				continue;
-			} else {
-				if ($exerciseFeedbackType != 1) {
-					// if the user has already answered this question
-					if (isset ($exerciseResult[$questionId])) {
-						// construction of the Question object
-						$objQuestionTmp = Question :: read($questionId);
-						$questionName = $objQuestionTmp->selectTitle();
-						// destruction of the Question object
-						unset ($objQuestionTmp);
-						Display :: display_normal_message(get_lang('AlreadyAnswered'));
-						$i++;
-						//echo '<tr><td>'.get_lang('AlreadyAnswered').' &quot;'.$questionName.'&quot;</td></tr>';
-						break;
-					}
-				}
-			}
-		}
-		// shows the question and its answers
-		showQuestion($questionId, false, $origin, $i, $nbrQuestions);
-		$i++;
-		// for sequential exercises
-		if ($exerciseType == 2) {
-			// quits the loop
-			break;
-		}
-	}
-	// end foreach()
-	echo "<!-- <button type='submit' name='buttonCancel' class='cancel'>" . get_lang('Cancel') . "</button>
-		   &nbsp;&nbsp; //--><br />";
-	echo '<div style="padding-left:10px; margin-top:-10px;">';
-	$submit_btn = "<button class='next' type='submit' name='submit'>";
-	//	$submit_btn.=get_lang('ValidateAnswer');
-	if ($objExercise->selectFeedbackType() == 1 && $_SESSION['objExercise']->selectType() == 2) {
-		$submit_btn = '';
-		echo '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/thickbox.js" type="text/javascript"></script>';
-		echo '<style type="text/css" media="all">@import "' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/thickbox.css";</style>';
-		$hotspot_get = $_POST['hotspot'];
-		// Show a hidden div
-		echo "<script>$(document).ready( function(){
-							  $('.rounded').corners();
-							  $('.rounded_inner').corners();
-							});</script>";
-		//echo '<br /><span class="rounded" style="width: 300px; margin-top: 10px; padding: 3px; background-color:#ccc;"><span style="width: 300px" class="rounded_inner" ><a href="exercise_submit_modal.php?hotspot='.$hotspot_get.'&nbrQuestions='.$nbrQuestions.'&questionnum='.$questionNum.'&exerciseType='.$exerciseType.'&exerciseId='.$exerciseId.'&placeValuesBeforeTB_=savedValues&TB_iframe=true&height=480&width=640&modal=true" title="" class="thickbox" id="validationButton">'.get_lang('ValidateAnswer').'</a></span></span><br /><br /><br />';
-
-	} else {
-		if (api_is_allowed_to_session_edit() ) {
-			if ($exerciseType == 1 || $nbrQuestions == $questionNum) {
-				$submit_btn .= get_lang('ValidateAnswer');
-			} else {
-				$submit_btn .= get_lang('NextQuestion');
-			}
-			$submit_btn .= "</button>";
-			echo $submit_btn;
-		}
-
-	}
-
-
-	echo "</table>
-			</td>
-			</tr>
-			</table></form>";
-	$b = 2;
-}
-echo '</div>';
-if ($_configuration['live_exercise_tracking'] == true && $exerciseFeedbackType != 1) {
-	//if($questionNum < 2){
-	if ($table_recorded_not_exist) {
-		if ($exerciseType == 2) {
-			Database::query("INSERT INTO $stat_table(exe_exo_id,exe_user_id,exe_cours_id,status,session_id,data_tracking,start_date,orig_lp_id,orig_lp_item_id)
-										VALUES('$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . api_get_session_id() . "','" . implode(',', $questionList) . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)", __FILE__, __LINE__);
-		} else {
-			Database::query("INSERT INTO $stat_table (exe_exo_id,exe_user_id,exe_cours_id,status,session_id,start_date,orig_lp_id,orig_lp_item_id)
-									   VALUES('$exerciseId','" . api_get_user_id() . "','" . $_course['id'] . "','incomplete','" . api_get_session_id() . "','" . date('Y-m-d H:i:s') . "',$safe_lp_id,$safe_lp_item_id)", __FILE__, __LINE__);
-		}
-	}
-}
-
-if ($origin != 'learnpath') {
-	//so we are not in learnpath tool
-  echo '</div>'; //End glossary div
-	Display :: display_footer();
-} else {
-	echo '</body></html>';
-}

+ 2 - 2
main/exercice/exercise.lib.php

@@ -45,8 +45,8 @@ require_once '../inc/lib/fckeditor/fckeditor.php';
 function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_item, $total_item)
 {
 	if (!ereg("MSIE", $_SERVER["HTTP_USER_AGENT"])) {
-		echo '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript"></script>';
-		echo '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.corners.min.js" type="text/javascript"></script>';
+		//echo '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript"></script>';
+		//echo '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.corners.min.js" type="text/javascript"></script>';
 	}
 
 

+ 1 - 1
main/forum/newthread.php

@@ -201,7 +201,7 @@ handle_forum_and_forumcategories();
 echo '<div class="actions">';
 echo '<span style="float:right;">'.search_link().'</span>';
 echo '<a href="index.php?gradebook='.$gradebook.'">'.Display::return_icon('back.png',get_lang('BackToForumOverview')).' '.get_lang('BackToForumOverview').'</a>';
-echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'">'.Display::return_icon('forum.gif',get_lang('BackToForum')).' '.get_lang('BackToForum').'</a>';
+echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'&amp;gidReq='.$_SESSION['toolgroup'].'">'.Display::return_icon('forum.gif',get_lang('BackToForum')).' '.get_lang('BackToForum').'</a>';
 echo '</div>';
 
 /*

+ 1 - 1
main/forum/reply.php

@@ -191,7 +191,7 @@ if ($origin != 'learnpath') {
 	echo '<div class="actions">';
 	echo '<span style="float:right;">'.search_link().'</span>';
 	echo '<a href="index.php?gradebook='.$gradebook.'">'.Display::return_icon('back.png',get_lang('BackToForumOverview')).' '.get_lang('BackToForumOverview').'</a>';
-	echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'">'.Display::return_icon('forum.gif',get_lang('BackToForum')).' '.get_lang('BackToForum').'</a>';
+	echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'&amp;gidReq='.$_SESSION['toolgroup'].'">'.Display::return_icon('forum.gif',get_lang('BackToForum')).' '.get_lang('BackToForum').'</a>';
 	echo '<a href="viewthread.php?forum='.Security::remove_XSS($_GET['forum']).'&amp;gradebook='.$gradebook.'&amp;thread='.Security::remove_XSS($_GET['thread']).'">'.Display::return_icon('forumthread.gif',get_lang('BackToThread')).' '.get_lang('BackToThread').'</a>';
 	echo '</div>';
 } else {

BIN
main/img/message_reply_forum.png


+ 33 - 15
main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_automatic.js

@@ -1,9 +1,10 @@
 $(document).ready(function() {
     $(window).load(function () {
-     var my_text=$("body").html();
+		
      my_protocol = location.protocol;
 	 my_pathname=location.pathname;
 	 work_path = my_pathname.substr(0,my_pathname.indexOf('/courses/'));
+	 
      $.ajax({
         contentType: "application/x-www-form-urlencoded",
         beforeSend: function(content_object) {
@@ -11,19 +12,43 @@ $(document).ready(function() {
         type: "POST",
         url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php",
         data: "glossary_data=true",
-        success: function(datos) {
-			  if (datos.length==0) {
+        success: function(datas) {
+			  if (datas.length==0) {
 			  	return false;
 			  }
                 data_terms=datas.split("[|.|_|.|-|.|]");
+                var complex_array = new Array();
+                var cp_complex_array = new Array();
                 for(i=0;i<data_terms.length;i++) {
                     specific_terms=data_terms[i].split("__|__|");
                     var real_term = specific_terms[1];
-                    var my_specific_terms = new RegExp('([^A-Za-z0-9/_\<>])'+specific_terms[1]+'[\ .,]{0,1}',"gi");
-                    new_html=my_text.replace(my_specific_terms,function(m){return replace_complete_char(m)});
-                    $("body").html(new_html);
-                    my_text=$("body").html();
+                    var real_code = specific_terms[0];
+                    complex_array[real_code] = real_term;
+                    cp_complex_array[real_code] = real_term;
                 }
+                
+                complex_array.reverse();
+                
+                for (var my_index in complex_array) {
+                    n = complex_array[my_index];
+                    if (n == null) {
+                        n = '';
+                    } else {
+                        for (var cp_my_index in cp_complex_array) {
+                            cp_data = cp_complex_array[cp_my_index];
+                            if (cp_data == null) {
+                                cp_data = '';
+                            } else {
+                                if (cp_data == n) {
+                                    my_index = cp_my_index;
+                                }
+                            }
+                        }
+                        $('body').removeHighlight().highlight(n,my_index) 
+                    }                   
+                }
+              
+              var complex_array = new Array();
               
 			  //mouse over event
 			  $("body .glossary-ajax").mouseover(function(){
@@ -56,14 +81,7 @@ $(document).ready(function() {
 		            div_show_id=current_element.find("div").attr("id");
 		            $("div#"+div_show_id).remove();
 	          });
-            
-			//Callback Helper
-            function replace_complete_char(m) {
-               var complete_term_pattern = new RegExp(real_term,"i"); 
-               var tag = m.replace(complete_term_pattern," <span class=\"glossary-ajax\" style='color:blue' name=\"link"+specific_terms[0]+"\">$&</span>"); 
-               return tag;
-            }
-				
+         
 				}
 
             });

+ 1 - 0
main/inc/lib/fckeditor/fcktemplates.xml.php

@@ -25,6 +25,7 @@ if (api_get_setting('show_glossary_in_documents') != 'none') {
 	if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
 		$js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_manual.js"/>';
 	} else {
+    $js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"/>'.PHP_EOL;        
 		$js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"/>';
 	}
 }

+ 32 - 15
main/inc/lib/javascript/glossary.js

@@ -17,17 +17,39 @@ $(document).ready(function() {
                 return false;
               }
                 data_terms=datas.split("[|.|_|.|-|.|]");
-				
+				var complex_array = new Array();
+				var cp_complex_array = new Array();
                 for(i=0;i<data_terms.length;i++) {
                     specific_terms=data_terms[i].split("__|__|");
 					var real_term = specific_terms[1];
-                    var my_specific_terms = new RegExp('([^A-Za-z0-9/_\<>])'+specific_terms[1]+'[\ .,]{0,1}',"gi");
-                    new_html=my_text.replace(my_specific_terms,function(m){return replace_complete_char(m)});
-                    $(".glossary-content").html(new_html);
-                    my_text=$(".glossary-content").html();					
+					var real_code = specific_terms[0];
+					complex_array[real_code] = real_term;
+					cp_complex_array[real_code] = real_term;
                 }
-
-              $(".glossary-content .glossary-ajax").mouseover(function(){
+				
+				complex_array.reverse();
+				
+				for (var my_index in complex_array) {
+					n = complex_array[my_index];
+                    if (n == null) {
+                        n = '';
+                    } else {
+						for (var cp_my_index in cp_complex_array) {
+							cp_data = cp_complex_array[cp_my_index];
+							if (cp_data == null) {
+								cp_data = '';
+							} else {
+								if (cp_data == n) {
+									my_index = cp_my_index;
+								}
+							}
+						}
+                        $('#highlight-plugin').removeHighlight().highlight(n,my_index) 
+                    }					
+				}
+              
+			  var complex_array = new Array();
+              $("#highlight-plugin .glossary-ajax").mouseover(function(){
                 random_id=Math.round(Math.random()*100);
                 div_show_id="div_show_id"+random_id;
                 div_content_id="div_content_id"+random_id;
@@ -49,19 +71,14 @@ $(document).ready(function() {
                         }
                     });
               });
-              $(".glossary-content .glossary-ajax").mouseout(function(){
+              $("#highlight-plugin .glossary-ajax").mouseout(function(){
                     var current_element,
                     current_element=$(this);
                     div_show_id=current_element.find("div").attr("id");
                     $("div#"+div_show_id).remove();
               });
-                
-				function replace_complete_char(m) {
-				   var complete_term_pattern = new RegExp(real_term,"i"); 
-				   var tag = m.replace(complete_term_pattern," <span class=\"glossary-ajax\" style='color:blue' name=\"link"+specific_terms[0]+"\">$&</span>"); 
-				   return tag;
-				}
-
+                //helpers
+		
                 }
 
             });

+ 67 - 0
main/inc/lib/javascript/jquery.highlight.js

@@ -0,0 +1,67 @@
+/*
+
+highlight v3
+
+Highlights arbitrary terms.
+
+<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html>
+
+MIT license.
+
+Johann Burkard
+<http://johannburkard.de>
+<mailto:jb@eaio.com>
+
+*/
+
+jQuery.fn.highlight = function(pat,real_code) {
+ function innerHighlight(node, pat) {
+  var skip = 0;
+  if (node.nodeType == 3) {
+   var pos = node.data.toUpperCase().indexOf(pat);
+   if (pos >= 0) {
+    var spannode = document.createElement('a');
+    spannode.className = 'glossary-ajax';
+    spannode.style.color = 'blue';
+    spannode.name = 'link'+real_code;
+    spannode.href = '#';
+    var SearchRegExp = new RegExp("(" + pat +")","gi");
+    var MatchRegExp = node.nodeValue.match(SearchRegExp);
+
+    if (MatchRegExp == null) {
+        MatchRegExp = new Array();
+    }
+	//alert(node.nodeValue+'-----'+'---'+node.nodeValue[pat.length+1])
+    if (MatchRegExp.length > 0 && node.nodeValue[pat.length+1] != '') {
+     	var middlebit = node.splitText(pos);
+    	var endbit = middlebit.splitText(pat.length);
+    	if (endbit.nodeValue[0] == null || endbit.nodeValue[0] == ' ') {
+        	var middleclone = middlebit.cloneNode(true);
+    		spannode.appendChild(middleclone);
+        	middlebit.parentNode.replaceChild(spannode, middlebit);
+    	}  	
+    }
+    skip = 1;
+   }
+  }
+  else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
+   for (var i = 0; i <node.childNodes.length ; ++i) {
+    i += innerHighlight(node.childNodes[i], pat);
+   }
+  }
+  return skip;
+ }
+ return this.each(function() {
+  innerHighlight(this, pat.toUpperCase());
+ });
+};
+
+jQuery.fn.removeHighlight = function() {
+ return this.find("a.highlight").each(function() {
+  this.parentNode.firstChild.nodeName;
+  with (this.parentNode) {
+   replaceChild(this.firstChild, this);
+   normalize();
+  }
+ }).end();
+};

+ 0 - 2
main/install/dokeos_main.sql

@@ -727,8 +727,6 @@ VALUES
 ('allow_use_sub_language', NULL, 'radio', 'Platform', 'false', 'AllowUseSubLanguageTitle', 'AllowUseSubLanguageComment', NULL, NULL,0),
 ('show_glossary_in_documents', NULL, 'radio', 'Course', 'none', 'ShowGlossaryInDocumentsTitle', 'ShowGlossaryInDocumentsComment', NULL, NULL,1),
 ('allow_terms_conditions', NULL, 'radio', 'Platform', 'false', 'AllowTermsAndConditionsTitle', 'AllowTermsAndConditionsComment', NULL, NULL,0),
-('show_tutor_data',NULL,'radio','Platform','true','ShowTutorDataTitle','ShowTutorDataComment',NULL,NULL, 1),
-('show_teacher_data',NULL,'radio','Platform','true','ShowTeacherDataTitle','ShowTeacherDataComment',NULL,NULL, 1),
 ('course_create_active_tools','enable_search','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Search',0),
 ('search_enabled',NULL,'radio','Tools','false','EnableSearchTitle','EnableSearchComment',NULL,NULL,1),
 ('search_prefilter_prefix',NULL, NULL,'Search','','SearchPrefilterPrefix','SearchPrefilterPrefixComment',NULL,NULL,0),

+ 0 - 1
main/lang/bulgarian/admin.inc.php

@@ -991,5 +991,4 @@ $DeleteSelectedFullSessionCategory = "&#1048;&#1079;&#1090;&#1088;&#1080;&#1074;
 $EditTopRegister = "&#1056;&#1077;&#1076;&#1072;&#1082;&#1090;&#1080;&#1088;&#1072;&#1085;&#1077; &#1085;&#1072; &#1073;&#1077;&#1083;&#1077;&#1078;&#1082;&#1072;&#1090;&#1072;";
 $InsertTabs = "&#1044;&#1086;&#1073;&#1072;&#1074;&#1103;&#1085;&#1077; &#1085;&#1072; &#1088;&#1072;&#1079;&#1076;&#1077;&#1083;";
 $EditTabs = "&#1056;&#1077;&#1076;&#1072;&#1082;&#1090;&#1080;&#1088;&#1072;&#1085;&#1077; &#1085;&#1072; &#1088;&#1072;&#1079;&#1076;&#1077;&#1083;&#1072;";
-$Coachs = "&#1048;&#1085;&#1089;&#1090;&#1088;&#1091;&#1082;&#1090;&#1086;&#1088;&#1080;";
 ?>

+ 1 - 0
main/lang/bulgarian/trad4all.inc.php

@@ -730,4 +730,5 @@ $ReadOnly = "&#1057;&#1072;&#1084;&#1086; &#1079;&#1072; &#1095;&#1077;&#1090;&#
 $HistoryTrainingSession = "&#1048;&#1089;&#1090;&#1086;&#1088;&#1080;&#1103; &#1085;&#1072; &#1086;&#1073;&#1091;&#1095;&#1080;&#1090;&#1077;&#1083;&#1085;&#1072;&#1090;&#1072; &#1089;&#1077;&#1089;&#1080;&#1103;";
 $FirstPage = "&#1055;&#1098;&#1088;&#1074;&#1072; &#1089;&#1090;&#1088;&#1072;&#1085;&#1080;&#1094;&#1072;";
 $LastPage = "&#1055;&#1086;&#1089;&#1083;&#1077;&#1076;&#1085;&#1072; &#1089;&#1090;&#1088;&#1072;&#1085;&#1080;&#1094;&#1072;";
+$Coachs = "&#1048;&#1085;&#1089;&#1090;&#1088;&#1091;&#1082;&#1090;&#1086;&#1088;&#1080;";
 ?>

+ 0 - 1
main/lang/catalan/admin.inc.php

@@ -1068,5 +1068,4 @@ $DeleteSelectedFullSessionCategory = "Eliminar les categorias seleccionades amb
 $EditTopRegister = "Editar avis";
 $InsertTabs = "Insertar Tabs";
 $EditTabs = "Editar Tabs";
-$Coachs = "Tutors";
 ?>

+ 1 - 0
main/lang/catalan/trad4all.inc.php

@@ -725,4 +725,5 @@ $HistoryTrainingSession = "Historial de sessions de formaci
 $Until = "Fins";
 $FirstPage = "Primera pàgina";
 $LastPage = "Última pàgina";
+$Coachs = "Tutors";
 ?>

+ 0 - 1
main/lang/english/admin.inc.php

@@ -1086,7 +1086,6 @@ $DeleteSelectedFullSessionCategory = "Delete the selected categories to sessions
 $EditTopRegister = "Edit Note";
 $InsertTabs = "Add Tabs";
 $EditTabs = "Edit Tabs";
-$Coachs = "Coachs";
 $IsAdministrator = "Is administrator";
 $IsNotAdministrator = "Is not administrator";
 ?>

+ 1 - 0
main/lang/english/exercice.inc.php

@@ -347,4 +347,5 @@ $TooManyIterationsPleaseTryUsingMoreStraightforwardPolygons = "Too many iteratio
 $Thresholds = "Thresholds";
 $Delineation = "Delineation";
 $QuestionTypeDoesNotBelongToFeedbackTypeInExercise = "Question type does not belong to feedback type in exercise";
+$SessionIsReadOnly = "The session is read only";
 ?>

+ 2 - 0
main/lang/english/glossary.inc.php

@@ -22,4 +22,6 @@ $TableView = "Table view";
 $GlossaryTermAlreadyExistsYouShouldEditIt = "This glossary term already exists. Please change the term name.";
 $GlossaryManagement  = "Glossary management";
 $TermMoved = "The term has moved ";
+$ShowGlossaryInExtraToolsTitle = "Show the glossary terms in extra tools";
+$ShowGlossaryInExtraToolsComment = "From here you can configure how to add the glossary terms in extra tools as learning path and exercice tool";
 ?>

+ 1 - 0
main/lang/english/trad4all.inc.php

@@ -749,4 +749,5 @@ $HistoryTrainingSession = "History training session";
 $Until = "Until";
 $FirstPage = "First Page";
 $LastPage = "Last Page";
+$Coachs = "Coachs";
 ?>

+ 1 - 0
main/lang/english/userInfo.inc.php

@@ -91,4 +91,5 @@ $ClearSearchResults = "Clear search results";
 $SendInvitation = "Send invitation";
 $SocialInvitationToFriends = "Invite to join my group of friends";
 $MyCertificates = "My certificates";
+$ToChangeYourEmailMustTypeYourPassword = "To Change Your Email Must Type Your Password";
 ?>

+ 0 - 1
main/lang/italian/admin.inc.php

@@ -1086,7 +1086,6 @@ $DeleteSelectedFullSessionCategory = "Elimina le categorie selezionate CON sessi
 $EditTopRegister = "Modifica appunto";
 $InsertTabs = "Aggiungi separatore";
 $EditTabs = "Modifica separatore";
-$Coachs = "Tutor";
 $IsAdministrator = "E\' amministratore";
 $IsNotAdministrator = "Non è amministratore";
 ?>

+ 1 - 0
main/lang/italian/trad4all.inc.php

@@ -749,4 +749,5 @@ $HistoryTrainingSession = "Storico delle sessioni formative";
 $Until = "Fino a";
 $FirstPage = "Prima pagina";
 $LastPage = "Ultima pagina";
+$Coachs = "Tutor";
 ?>

+ 0 - 1
main/lang/portuguese/admin.inc.php

@@ -1086,5 +1086,4 @@ $DeleteSelectedFullSessionCategory = "Eliminar as categorias seleccionadas para
 $EditTopRegister = "Editar Nota";
 $InsertTabs = "Adicionar Separadores";
 $EditTabs = "Editar Separadores";
-$Coachs = "Tutores";
 ?>

+ 113 - 12
main/lang/portuguese/reservation.inc.php

@@ -1,33 +1,134 @@
 <?php /*
 for more information: see languages.txt in the lang folder. 
 */
-$BookingPeriods = "Tempos de reserva";
+$ReservationPeriodToSmall = "O período de reservas é demasiado curto.";
+$BookingSystem = "Sistema de Reservas";
+$BookingPeriodList = "Lista do período de Reservas";
+$BookingListView = "Lista de Reservas";
+$BookingCalendarView = "Visualização do calendário de Reservas";
+$BookingPeriods = "Agendar Reserva";
 $ResourceList = "Lista de recursos";
-$GoToCalendarView = "Vista de calendário";
+$GoToCalendarView = "Visualização do calendário";
+$GoToListView = "Visualização da lista";
 $ManageResources = "Gerir recursos";
 $EditResource = "Editar recurso";
+$BookIt = "Reservar um recurso";
 $GoTo = "Ir para";
-$AddNewBookingPeriod = "Acrescentar um novo tempo de reserva";
-$ResourceTypeName = "Nome do tipo de recurso";
+$NoTimePicker = "Sem temporizador";
+$TimePicker = "Temporizador";
+$ManageBookingPeriods = "Gerir períodos de reserva";
+$BookingPeriodToSmall = "O período de reserva é demasiado curto.";
+$BookingPeriodToBig = "O período de reservas é demasiado longo.";
+$BookingPeriodTimePickerError1 = "Um período de reserva sem um temporizador não pode ser efectuado se, o tempo mínimo e máximo de um período de tempo for diferente de zero.";
+$BookingPeriodTimePickerError2 = "Um período de reserva com um temporizador não pode ser efectuado se, o tempo máximo for menor que o mínimo num período de tempo.";
+$BookingPeriodTimePickerError3 = "Um período de reserva com um temporizador não pode ser efectuado se, o tempo máximo do período de tempo não se encaixa entre a data de início e de fim.";
+$BookingPeriodHasSubscriptions = "O período de reserva possui #NUM# de reservas activas, não sendo possível editar o período de reserva ";
+$TimePickerMaxUsers = "* Quando o temporizador se encontra em utilização, o número máximo de inscrições é ignorado.";
+$TimePickerMinMaxNull = "* Se os valores mínimo e máximo do temporizador for zero, o tempo pode ser definido como variável.";
+$DeleteSelectedBookingPeriod = "Eliminar os períodos de reserva seleccionados";
+$EditNewBookingPeriod = "Editar um período de reserva";
+$BookingPeriodAdded = "O período de reserva foi adicionado";
+$BookingPeriodDeleted = "O período de reserva foi eliminado ";
+$ConfirmDeleteBookingPeriod = "Tem a certeza que deseja eliminar permanentemente este período de reserva?";
+$DeleteBookingPeriod = "Remover este período de reserva";
+$BookingPeriodEdited = "O período de reserva foi editado";
+$BookingPeriodDateOverlap = "Uma parte do período de reserva já está em utilização no período de #START# até #END#";
+$BookingPeriodSubscribeUntilAfterStart = "O inscrever-se até a data é superior à data de início";
+$BookingPeriodPast = "Não é possível efectuar reservas antes do horário definido";
+$ReservationMaxUsersOverrun = "Já se encontram mais pessoas inscritas do que o número máximo de utilizadores que seleccionados";
+$AddNewBookingPeriod = "Adicionar um novo período de reserva";
+$BookingPeriodTimePickerLimitation = "Não é possível efectuar reservas com um temporizador se a data de início e de fim não forem as mesmas.";
+$ResourceTypeName = "Tipo de recurso";
 $AddNewResourceType = "Acrescentar um novo tipo de recurso";
+$ResourceTypeAdded = "O tipo de recurso foi adicionado";
+$ResourceTypeEdited = "O tipo de recurso foi editado";
+$ResourceTypeDeleted = "O tipo de recurso foi eliminado";
+$ConfirmDeleteResourceType = "Tem a certeza que deseja eliminar permanentemente este tipo de recurso?";
 $EditResourceType = "Editar o tipo de recurso";
-$DeleteResourceType = "Apagar tipo de recurso";
-$DeleteSelectedCategories = "Apagar recursos seleccionados";
+$DeleteResourceType = "Eliminar o tipo de recurso";
+$DeleteSelectedCategories = "Eliminar os recursos seleccionados";
+$NoResourcesType = "Não existe tipo de recurso ainda";
 $ResourceType = "Tipo de recurso";
-$DeleteSelectedSubscriptions = "Reserva seleccionada apagada";
-$DeleteSubscription = "Apagar reserva";
-$ReservationAdded = "Reserva acrescentada";
+$ResourceTypeExist = "Este tipo de recurso já existe";
+$ResourceTypeHasItems = "O tipo de recurso tem #NUM# de itens ! A eliminação foi abortada";
+$ResourceTypeNotDeleted = "Algumas categoria não puderam ser removidas porque contém recursos";
+$DeleteSelectedSubscriptions = "Eliminar a reserva seleccionada";
+$DeleteSubscription = "Eliminar reserva";
+$SubscriptionDeleted = "A sua reserva foi eliminada";
+$ConfirmDeleteSubscription = "Tem a certeza que deseja eliminar estas reservas?";
+$SubscribeInformation = "Por favor, confirme que deseja efectuar uma reserva desde #start# até #end# para #name#";
+$SubscribeTimePickerInformation = "Por favor seleccione para #name# um período #from_till between: #start_end";
+$ReservationAdded = "Reserva adicionada";
+$ReservationTresspassing = "Esta reserva já se encontra completamente preenchida, não tem permissões para esta página";
+$ReservationOutOfDate = "A data que seleccionou já está em utilização/ou não é o período de reserva de #START# até #END#";
+$ReservationAlready = "Já possui este recurso reservado";
+$ReservationMadeTitle = "A sua reserva de #ITEM# foi efectuada com sucesso";
+$ReservationMadeMessage = "Exmo/a. Sr./Sra., n\\nA sua reserva para #ITEM# de #START# até #END# foi efectuada com sucesso.";
+$ReservationDeleteTitle = "O período de reserva de #NAME# foi eliminado";
+$ReservationDeleteMessage = "Exmo/a. Sr./Sra., n\\nO período de reserva para de #NAME# de #START# até #END# foi removido";
+$OutPeriod = "Fora de período";
+$ReservationFromUntilError = "Operíodo de reserva de #START# até #END# não foi efectuado porque uma parte do período de reserva já se encontra reservado\\n";
 $RepeatFor = "Repetir cada";
 $RepeatUntil = "Repetir até";
 $Recurrence = "Recorrência";
 $NoRecurrence = "Sem recorrência ";
+$UntilRecurrence = "Utilizar recorrência";
+$TimePickerLimitation = "* Quando o temporizador se encontra em utilização, a data de início e de fim deverão ser as mesmas.";
+$OverviewSubscriptions = "Vista geral das inscrições";
+$OverviewReservedPeriods = "Vista geral dos períodos reservados";
+$SubscribedStartDate = "Inscrito a partir da data final";
+$SubscribedEndDate = "Inscrito até à data final";
+$SubscribedPerson = "Pessoa inscrita";
+$BookingView = "Visualização das Reservas";
+$SubscribeUntil = "Inscrever-se até";
+$SubscribeFrom = "Inscrever-se a partir de";
 $Notes = "Notas";
-$ResourceName = "Nome do recurso";
-$ResourceAdded = "Recurso acrescentado";
+$SubscriptionPeriod = "Período de inscrição";
+$NoPeriod = "Não existe período de inscrição";
+$FixedPeriod = "Período de inscrição fixa";
+$ResourceFilter = "Filtro de recursos";
+$NoReservation = "Não existe período de reservas ainda";
+$MaxUsers = "Máximo de inscrições";
+$AutoAccept = "Aceitar utilizadores automaticamente";
+$ResourceName = "Recurso";
+$ResourceAdded = "Recurso adicionado";
+$ResourceEdited = "Recurso editado";
+$ResourceDeleted = "O recurso foi eliminado";
+$AddNewResource = "Adicionar um novo recurso";
+$ConfirmDeleteResource = "Tem a certeza que deseja eliminar permanentemente este recurso?";
+$ResourceInactivated = "O recurso foi desactivado";
+$ResourceActivated = "O recurso foi activado";
 $Resource = "Recurso";
+$OpenBooking = "Reservas abertas";
 $DeleteResource = "Apagar recurso";
+$DeleteSelectedResources = "Eliminar os recursos seleccionados";
+$ResourceExist = "O recurso já existe";
 $AcceptUsers = "Aceitar utilizadores";
+$UnacceptedUsers = "Não aceitar utilizadores";
 $DeleteSubscriptions = "Apagar inscrições";
-$NoItems = "Ainda não existem itens";
+$NoItems = "Não existem recursos ainda";
+$ItemNotDeleted = "Alguns recursos não forma removidos porque existem ainda reservas pendentes";
+$ItemHasReservations = "O recurso ainda possui #NUM# reserva(s) activa(s)";
+$NoItemsReservation = "Não existem recursos disponíveis aqui para si";
+$ReservationAccepted = "A sua reserva de #ITEM# foi aceite";
+$ReservationDenied = "A sua reserva para #ITEM# foi recusada";
+$ReservationForItemAccepted = "Exmo/a. Sr./Sra., n\\nA sua reserva para #ITEM# de #BEGIN até #END foi aceite";
+$ReservationForItemDenied = "Exmo/a. Sr./Sra., n\\nA sua reserva para #ITEM# de #BEGIN até #END foi rejeitada";
+$ReservationCancelled = "AS Reservas encontram-se canceladas, #NAME# está temporariamente indisponível";
+$ReservationActive = "As Reservas encontram-se novamente activas, #NAME# está novamente disponível";
+$ReservationUnavailable = "Exmo/a. Sr./Sra., n\\nO Recurso #NAME# está temporariamente indisponível, como tal, a sua reserva de #BEGIN# até #END# foi cancelada.\\nReceberá uma mensagem na sua caixa de e-mail assim que estiver novamente disponível.";
+$ReservationAvailable = "Exmo/a. Sr./Sra., n\\nVimos informá-lo de que #NAME# está novamente disponível, como tal, a sua reserva de #BEGIN# até #END# está novamente activa.";
 $Resources = "Recursos";
+$EditBookingPeriod = "Editar período de reservas";
+$CreateResourceType = "Criar tipo de recurso";
+$ModifyResourceType = "Editar tipo de recurso";
+$ViewResourceTypes = "Visualizar os tipos de recursos";
+$ViewResources = "Visualizar os recursos";
+$ViewBookingPeriods = "Visualizar os períodos de reservas";
+$AlwaysAvailable = "Sempre disponível";
+$SelectResourceTypeAndResource = "Seleccione o tipo de recurso";
+$Step1SelectResourceType = "Passo 1: Seleccione o tipo de recurso";
+$Step2SelectResource = "Passo 2: seleccione o recurso";
+$Step3SelectBookingPeriod = "Passo 3: seleccione o período de reserva";
+$NoReservations = "Não existem reservas";
 ?>

+ 41 - 41
main/lang/portuguese/resourcelinker.inc.php

@@ -1,58 +1,58 @@
 <?php /*
 for more information: see languages.txt in the lang folder. 
 */
-$ResourceAdded = "Recurso acrescentado. Pode voltar para a Sequência ou acrescentar mais recursos.";
-$LearningPath = "Sequência de Aprendizagem";
+$ResourceAdded = "Recurso adicionado. Pode regressar ao caminho/atalho do curso ou adicionar mais recursos.";
+$LearningPath = "Cursos";
 $LevelUp = "nível acima";
-$AddIt = "Acrescentá-lo";
+$AddIt = "Adicioná-lo";
 $MainCategory = "categoria principal";
-$lang_delete_added_resources = "Apagar recursos acrescentados";
-$AddToLinks = "Acrescentar às ligações do curso";
-$DontAdd = "não acrescentar";
-$lang_show_all_added_resources = "Mostrar todos os recursos acrescentados";
-$ResourcesAdded = "Recursos acrescentados";
-$BackTo = "Para trás";
+$lang_delete_added_resources = "Eliminar os recursos adicionados";
+$AddToLinks = "Adicionar às ligações/links do curso";
+$DontAdd = "não adicionar";
+$lang_show_all_added_resources = "Apresentar todos os recursos adicionados";
+$ResourcesAdded = "Recursos adicionados";
+$BackTo = "Regressar a";
 $ExternalResources = "Recursos externos";
 $CourseResources = "Recursos do Curso";
-$ExternalLink = "Ligação externa";
-$DropboxAdd = "Acrescentar a página da Dropbox a este capítulo.";
-$AddAssignmentPage = "Acrescentar a página dos Trabalhos dos Estudantes a este capítulo.";
-$Exercise = "Exercício";
-$Link = "Ligação";
+$ExternalLink = "Ligação/link externa";
+$DropboxAdd = "Adicionar a caixa de entrega a esta secção.";
+$AddAssignmentPage = "Adicionar a ferramenta de Trabalhos/tarefas ao curso";
+$Exercise = "Exercícios";
+$Link = "Ligações/links";
 $AdValvas = "Anúncios";
-$Document = "Documentos";
-$ShowDelete = "Mostrar / Apagar";
-$IntroductionText = "Texto de apresentação";
+$Document = "Documento";
+$ShowDelete = "Mostrar / Eliminar";
+$IntroductionText = "Texto de introdução";
 $CourseDescription = "Descrição do Curso";
 $Groups = "Grupos";
 $Users = "Utilizadores";
-$IntroductionTextAdd = "Acrescentar a página do Texto de Apresentação a este capítulo.";
-$CourseDescriptionAdd = "Acrescentar a página da Descrição do Curso a este capítulo.";
-$GroupsAdd = "Acrescentar a página dos Grupos a este capítulo.";
-$UsersAdd = "Acrescentar a página dos Utilizadores a este capítulo.";
-$ExportableCourseResources = "Recursos do curso a exportar";
-$DokeosRelatedCourseMaterial = "recursos do curso relacionados com Dokeos";
-$LinkTarget = "Publicar em";
-$SameWindow = "Mesma janela";
-$NewWindow = "Nova janela";
+$IntroductionTextAdd = "Adicionar uma página contendo o texto de introdução a esta secção.";
+$CourseDescriptionAdd = "Adicionar uma página contendo a descrição do curso a esta secção. ";
+$GroupsAdd = "Adicionar a ferramenta de Grupos a esta secção.";
+$UsersAdd = "Adicionar a ferramenta de Utilizadores a esta secção.";
+$ExportableCourseResources = "Recursos do curso que podem ser exportados";
+$DokeosRelatedCourseMaterial = "Recursos do curso relacionados com o Dokeos";
+$LinkTarget = "Destino da Ligação/link";
+$SameWindow = "Na mesma janela";
+$NewWindow = "Numa nova janela";
 $StepDeleted1 = "Este";
-$StepDeleted2 = "item foi apagado nessa ferramenta.";
-$Modify = "Alterar";
-$Chapter = "Capítulo";
-$NoAgendaItems = "Não há itens na Agenda";
-$AgendaAdd = "Acrescentar item";
-$UserGroupFilter = "Usar filtro de grupo";
-$AgendaSortChronologicallyUp = "Mais antigos primeiro";
-$ShowCurrent = "Mostrar itens da Agenda";
-$ModifyCalendarItem = "Alterar item da Agenda";
+$StepDeleted2 = "item foi eliminado nessa ferramenta.";
+$Modify = "Editar";
+$Chapter = "Secção";
+$NoAgendaItems = "Não existem eventos na agenda";
+$AgendaAdd = "Adicionar um evento";
+$UserGroupFilter = "Utilizar o filtro do grupo";
+$AgendaSortChronologicallyUp = "Ordenar cronologicamente (ascendente)";
+$ShowCurrent = "Mês actual";
+$ModifyCalendarItem = "Editar evento";
 $ItemTitle = "Título";
 $Detail = "Detalhes";
-$EditSuccess = "Publicação bem sucedida";
-$AddCalendarItem = "Acrescentar item na Agenda";
-$AddAnn = "Acrescentar anúncio";
-$ForumAddNewTopic = "Fórum: novo tópico";
+$EditSuccess = "Edição concluída com sucesso";
+$AddCalendarItem = "Adicionar um evento";
+$AddAnn = "Adicionar anúncio";
+$ForumAddNewTopic = "Fórum: adicionar novo tópico";
 $ForumEditTopic = "Fórum: editar tópico";
-$ExerciseAnswers = "Exercício: responder";
+$ExerciseAnswers = "Exercício: Respostas";
 $ForumReply = "Fórum: responder";
-$AgendaSortChronologicallyDown = "Publicar itens da Agenda cronologicamente (do mais recente para o mais antigo)";
+$AgendaSortChronologicallyDown = "Ordenar cronologicamente (descendente) ";
 ?>

+ 32 - 32
main/lang/portuguese/scorm.inc.php

@@ -2,54 +2,54 @@
 for more information: see languages.txt in the lang folder. 
 */
 $langScormVersion = "versão";
-$langScormRestarted = "Todas as etapas estão agora incompletas";
-$langScormNoNext = "Última sequência. Não existem mais.";
-$langScormNoPrev = "Primeira sequência.";
+$langScormRestarted = "Todos os objectos de aprendizagem estão incompletos.";
+$langScormNoNext = "Este é o último objecto de aprendizagem.";
+$langScormNoPrev = "Este é o primeiro objecto de aprendizagem.";
 $langScormTime = "Tempo";
-$langScormNoOrder = "A ordem é arbitrária; pode clicar em qualquer sequência.";
-$langScormScore = "Resultado";
-$langScormLessonTitle = "Título da lição (sequência)";
+$langScormNoOrder = "Não existe uma ordem pré-definida, pode clicar em qualquer objecto de aprendizagem.";
+$langScormScore = "Pontuação";
+$langScormLessonTitle = "Nome do objecto de aprendizagem";
 $langScormStatus = "Estado";
-$langScormToEnter = "Para realizar";
+$langScormToEnter = "Para aceder";
 $langScormFirstNeedTo = "necessita primeiro completar";
-$langScormThisStatus = "Esta lição está";
-$langScormClose = "Terminada";
+$langScormThisStatus = "Este objecto de aprendizagem é agora";
+$langScormClose = "Terminar";
 $langScormRestart = "Recomeçar";
-$langScormCompstatus = "Completa";
-$langScormIncomplete = "Incompleta";
+$langScormCompstatus = "Concluído";
+$langScormIncomplete = "Incompleto";
 $langScormPassed = "Aprovado";
 $langScormFailed = "Não aprovado";
 $langScormPrevious = "Anterior";
 $langScormNext = "Seguinte";
-$langScormTitle = "Programa Scorm Dokeos";
-$langScormMystatus = "Ponto da situação";
-$langScormNoItems = "Este conteúdo não contém itens.";
-$langScormNoStatus = "Conteúdo sem estatística";
-$langScormLoggedout = "Sair do Scorm";
-$langScormCloseWindow = "Fechar janela";
-$ScormBrowsed = "Visto";
-$langScormExitFullScreen = "Voltar écrã normal";
-$langScormFullScreen = "Écrã grande";
-$langScormNotAttempted = "Tentativa falhada";
-$langCharset = "Tipo de caracteres";
+$langScormTitle = "Dokeos Scorm player";
+$langScormMystatus = "O meu progresso";
+$langScormNoItems = "Este curso encontra-se vazio.";
+$langScormNoStatus = "Não existe estado para este conteúdo";
+$langScormLoggedout = "desconectado da área de Scorm";
+$langScormCloseWindow = "Fechar janelas";
+$ScormBrowsed = "Acedido";
+$langScormExitFullScreen = "Regressar ao ecrã normal";
+$langScormFullScreen = "Ecrã total";
+$langScormNotAttempted = "Não acedido";
+$langCharset = "Conjunto de caracteres";
 $langLocal = "Local";
 $langRemote = "Remoto";
 $langAutodetect = "Detectar automaticamente";
-$langAccomplishedStepsTotal = "Total de etapas completas";
+$langAccomplishedStepsTotal = "Total de objectos de aprendizagem concluídos";
 $langUnknown = "Desconhecido";
-$AreYouSureToDeleteSteps = "Tem a certeza que deseja apagar estas etapas?";
-$Origin = "Origem";
+$AreYouSureToDeleteSteps = "Tem a certeza que deseja eliminar estes passos?";
+$Origin = "Ferramenta de Autoría";
 $Local = "Local";
 $Remote = "Remoto";
-$FileToUpload = "Ficheiro a enviar";
-$ContentMaker = "Criação de conteúdos";
+$FileToUpload = "Ficheiro SCORM ou AICC a enviar";
+$ContentMaker = "Ferramenta de Autoría";
 $ContentProximity = "Situação";
-$UploadLocalFileFromGarbageDir = "Enviar ficheiro a partir da directoria principal/reciclagem";
-$ThisItemIsNotExportable = "Este item, de momento, não é compatível com Scorm. É por isso que não é exportável.";
-$MoveCurrentChapter = "Mover capítulo actual";
+$UploadLocalFileFromGarbageDir = "Enviar ficheiro local a partir da pasta/directório principal";
+$ThisItemIsNotExportable = "Este objecto de aprendizagem ou actividade não é SCORM compliant ou não está conforme com a norma SCORM. Por isso não é possível exportá-lo.";
+$MoveCurrentChapter = "Mover a secção actual";
 $GenericScorm = "Scorm genérico";
-$UnknownPackageFormat = "O formato do pacote não é reconhecido. Por favor, verifique se o pacote contém erros. Alguns problemas são devidos ao formato do programa ZIP ou à transferência de ficheiros longos. Em caso de dúvida, evite usar ficheiros zipados.";
+$UnknownPackageFormat = "O formato do pacote não é reconhecido. Por favor, verifique se o pacote está correctamente construído e não contém erros. Alguns problemas poderão ser devidos às propriedades do formato ou do programa ZIP, ou à transferência de ficheiros demasiado pesados. Se não tiver certeza sobre o ZIP, por favor, tente utilizar configurações mínimas ao zipar.";
 $Attempt = "Tentativa";
 $MoveTheCurrentForum = "Mover este fórum";
-$WarningWhenEditingScorm = "Atenção !<br /> Quando altera o conteúdo de uma etapa SCORM, as estatísticas ficam alteradas e a etapa da sequência de aprendizagem inutilizada.";
+$WarningWhenEditingScorm = "Atenção !<br /> Quando edita o conteúdo de um objecto de aprendizagem, a informação do curso poderá ser alterada ou até danificar o objecto de aprendizagem.";
 ?>

+ 1 - 0
main/lang/portuguese/trad4all.inc.php

@@ -693,4 +693,5 @@ $SendAMessage = "Enviar uma mensagem";
 $Menu = "Menu";
 $BackToUserList = "Voltar para a lista de utilizadores";
 $GraphicNotAvailable = "Gráficos não disponíveis";
+$Coachs = "Tutores";
 ?>

+ 4 - 5
main/lang/spanish/admin.inc.php

@@ -299,7 +299,7 @@ $CourseQuota = "Cuota de espacio del curso en el servidor";
 $EditNotice = "Editar aviso";
 $General = "general";
 $LostPassword = "Olvidé mi contraseña";
-$Registration = "registro";
+$Registration = "Registro";
 $Password = "Contraseña";
 $InsertLink = "Insertar enlace";
 $EditNews = "Editar noticias";
@@ -863,7 +863,7 @@ $SelectAResponsible = "Seleccione a un responsable";
 $ThereIsNotStillAResponsible = "Aún no hay responsables";
 $AllowStudentsToBrowseCoursesTitle = "Los estudiantes pueden consultar el catálogo de cursos";
 $SharedSettingIconComment = "Esta configuración está compartida";
-$GlobalAgenda = "Agenda Global";
+$GlobalAgenda = "Agenda global";
 $AdvancedFileManagerTitle = "Gestor avanzado de ficheros para el editor WYSIWYG";
 $AdvancedFileManagerComment = "¿ Activar el gestor avanzado de archivos para el editor WYSIWYG ? Esto añadirá un considerable número de opciones al gestor de ficheros que se abre en una ventana cuando se envían archivos al servidor.";
 $ScormAndLPProgressTotalAverage = "Promedio total de progreso de SCORM y soló lecciones";
@@ -1037,9 +1037,9 @@ $ListSessionCategory = "Categor
 $AddSessionCategory = "Añadir categoría";
 $SessionCategoryName = "Nombre de la categoría";
 $EditSessionCategory = "Editar categoría de sesión";
-$SessionCategoryAdded = "La categoría de la sesión ha sido añadido";
+$SessionCategoryAdded = "La categoría ha sido añadida";
 $SessionCategoryUpdate = "Categoría actualizada";
-$SessionCategoryDelete = "Las categorías seleccionadas han sido borradas";
+$SessionCategoryDelete = "Se han eliminado las categorías seleccionadas";
 $SessionCategoryNameIsRequired = "Debe dar un nombre de la categoría de sesión";
 $ThereIsNotStillASession = "No hay aún una sesión";
 $SelectASession = "Seleccione una sesión";
@@ -1086,7 +1086,6 @@ $DeleteSelectedFullSessionCategory = "Eliminar las categorias seleccionadas con
 $EditTopRegister = "Editar Aviso";
 $InsertTabs = "Insertar Tabs";
 $EditTabs = "Editar Tabs";
-$Coachs = "Tutores";
 $IsAdministrator = "Es administrador";
 $IsNotAdministrator = "No es administrador";
 ?>

+ 2 - 1
main/lang/spanish/exercice.inc.php

@@ -308,7 +308,7 @@ $langDefaultUniqueAnswer1 = "leche";
 $langDefaultUniqueComment1 = "La leche es la base de numerosos productos lácteos, como la mantequilla, el queso, el yogur, entre otros";
 $langDefaultUniqueAnswer2 = "Avena";
 $langDefaultUniqueComment2 = "La avena es uno de los cereales más completos. Por sus cualidades energéticas y nutritivas ha sido la base de la alimentación de pueblos";
-$langDefaultMultipleQuestion = "¿Qué países no pertenecen al continente europeo?";
+$langDefaultMultipleQuestion = "¿Qué país no pertenece al continente europeo?";
 $langDefaultMultipleAnswer1 = "España";
 $langDefaultMultipleComment1 = "Es un país soberano miembro de la Unión Europea, constituido en Estado social y democrático de Derecho, y cuya forma de gobierno es la monarquía parlamentaria";
 $langDefaultMultipleAnswer2 = "Perú";
@@ -347,4 +347,5 @@ $TooManyIterationsPleaseTryUsingMoreStraightforwardPolygons = "Demasiadas iterac
 $Thresholds = "Thresholds";
 $Delineation = "Delineación";
 $QuestionTypeDoesNotBelongToFeedbackTypeInExercise = "Tipo de pregunta no pertenece al tipo de retroalimentación en ejercicios";
+$SessionIsReadOnly = "La sesión es de sólo lectura";
 ?>

+ 2 - 0
main/lang/spanish/glossary.inc.php

@@ -22,4 +22,6 @@ $TableView = "Ver como tabla";
 $GlossaryTermAlreadyExistsYouShouldEditIt = "Este termino del glosario ya existe, por favor cambielo por otro nombre";
 $GlossaryManagement  = "Administración de glosario";
 $TermMoved = "El término se ha movido";
+$ShowGlossaryInExtraToolsTitle = "Muestra los términos del glosario en las herramientas lecciones(scorm) y ejercicios";
+$ShowGlossaryInExtraToolsComment = "Desde aquí usted puede configurar como añadir  los términos del glosario en herramientas como lecciones(scorm) y ejercicios";
 ?>

+ 1 - 0
main/lang/spanish/trad4all.inc.php

@@ -749,4 +749,5 @@ $HistoryTrainingSession = "Historial de sesiones de formaci
 $Until = "Hasta";
 $FirstPage = "Primera página";
 $LastPage = "Última página";
+$Coachs = "Tutores";
 ?>

+ 1 - 0
main/lang/spanish/userInfo.inc.php

@@ -91,4 +91,5 @@ $ClearSearchResults = "Limpiar el resultado de la b
 $SendInvitation = "Enviar invitación";
 $SocialInvitationToFriends = "Invitar a unirse a mi red de amigos";
 $MyCertificates = "Mis certificados";
+$ToChangeYourEmailMustTypeYourPassword = "Para cambiar su correo electrónico debe escribir su contraseña";
 ?>

+ 15 - 15
main/tracking/courseLog.php

@@ -116,25 +116,10 @@ $nameTools = get_lang('Tracking');
 // display the header
 Display::display_header($nameTools, 'Tracking');
 
-require api_get_path(LIBRARY_PATH).'statsUtils.lib.inc.php';
-require api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
-
 // getting all the students of the course
 $a_students = CourseManager :: get_student_list_from_course_code($_course['id'], true, (empty($_SESSION['id_session']) ? null : $_SESSION['id_session']));
 $nbStudents = count($a_students);
 
-/**
- * count the number of students in this course (used for SortableTable)
- */
-function count_student_in_course() {
-	global $nbStudents;
-	return $nbStudents;
-}
-
-function sort_users($a, $b) {
-	return api_strcmp(trim(api_strtolower($a[$_SESSION['tracking_column']])), trim(api_strtolower($b[$_SESSION['tracking_column']])));
-}
-
 function count_item_resources() {
 	$table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
 	$table_user = Database :: get_main_table(TABLE_MAIN_USER);
@@ -800,6 +785,21 @@ if ($_GET['studentlist'] == 'false') {
 </table>
 <?php
 Display::display_footer();
+
+
+/**
+ * Display all the additionally defined user profile fields
+ * This function will only display the fields, not the values of the field because it does not act as a filter 
+ * but it adds an additional column instead. 
+ *
+ * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
+ * @since October 2009
+ * @version 1.8.7
+ */
+function display_additional_profile_fields(){
+	// getting all the extra profile fields that are defined by the platform administrator
+	$extra_fields = UserManager :: get_extra_fields(0,50,5,'ASC');
+
 	// creating the form
 	$return = '<form action="courseLog.php" method="get" name="additional_profile_field_form" id="additional_profile_field_form">';  
 

+ 61 - 21
main/user/subscribe_user.php

@@ -35,7 +35,10 @@
 */
 // name of the language file that needs to be included
 $language_file = array('registration','admin');
-require '../inc/global.inc.php';
+
+// including the global Dokeos file
+include ('../inc/global.inc.php');
+
 // the section (for the tabs)
 $this_section = SECTION_COURSES;
 // access restriction
@@ -43,11 +46,10 @@ if (!api_is_allowed_to_edit()) {
 	 api_not_allowed(true);
 }
 // including additional libraries
-$libpath = api_get_path(LIBRARY_PATH);
-require_once $libpath.'course.lib.php';
-require_once $libpath.'sortabletable.class.php';
-require_once $libpath.'formvalidator/FormValidator.class.php';
-require_once $libpath.'usermanager.lib.php';
+require_once (api_get_path(LIBRARY_PATH).'course.lib.php');
+require_once (api_get_path(LIBRARY_PATH).'sortabletable.class.php');
+require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
+require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
 
 /*
 ==============================================================================
@@ -197,6 +199,7 @@ function get_number_of_users() {
 	$user_table = Database :: get_main_table(TABLE_MAIN_USER);
 	$course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
 	$table_user_field_values 	= Database::get_main_table(TABLE_MAIN_USER_FIELD_VALUES);
+	
 	if (isset($_REQUEST['type']) && $_REQUEST['type']=='teacher') {
 		$sql = "SELECT 	u.user_id
 						FROM $user_table u
@@ -225,7 +228,7 @@ function get_number_of_users() {
 						LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'";
 						
 		// we change the SQL when we have a filter
-		if (isset($_GET['subscribe_user_filter_value'])){
+		if (isset($_GET['subscribe_user_filter_value']) AND api_get_setting('ProfilingFilterAddingUsers') == 'true'){
 			$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
 			$sql .=	"
 				LEFT JOIN $table_user_field_values field_values 
@@ -262,8 +265,11 @@ function get_number_of_users() {
 	if (isset ($_REQUEST['keyword'])) {
 		$keyword = Database::escape_string($_REQUEST['keyword']);
 		$sql .= " AND (firstname LIKE '%".$keyword."%' OR lastname LIKE '%".$keyword."%'   OR email LIKE '%".$keyword."%'  OR username LIKE '%".$keyword."%'  OR official_code LIKE '%".$keyword."%')";
+		
 		// we also want to search for users who have something in their profile fields that matches the keyword
-		$additional_users = search_additional_profile_fields($keyword);
+		if (api_get_setting('ProfilingFilterAddingUsers') == 'true') {
+			$additional_users = search_additional_profile_fields($keyword);
+		}
 					
 		// getting all the users of the course (to make sure that we do not display users that are already in the course)
 		if (!empty($_SESSION["id_session"])) {
@@ -286,7 +292,7 @@ function get_number_of_users() {
 	$result = Database::num_rows($res);
 	// we add 1 for every additional user (a user where the keyword matches one of the additional profile fields)
 	// that is not yet in the course and not yet in the search result
-	if (isset ($_REQUEST['keyword'])) {	
+	if (isset ($_REQUEST['keyword']) AND api_get_setting('ProfilingFilterAddingUsers') == 'true') {	
 		foreach($additional_users as $additional_user_key=>$additional_user_value){
 			if (!in_array($additional_user_key,$users) AND !in_array($additional_user_key,$users_of_course)){
 				$result++;
@@ -327,7 +333,7 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 					LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".$_SESSION['_course']['id']."'";
 
 			// applying the filter of the additional user profile fields 	
-			if (isset($_GET['subscribe_user_filter_value'])){
+			if (isset($_GET['subscribe_user_filter_value']) AND api_get_setting('ProfilingFilterAddingUsers') == 'true'){
 				$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
 				$sql .=	"
 					LEFT JOIN $table_user_field_values field_values 
@@ -335,6 +341,8 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 					WHERE cu.user_id IS NULL
 						AND field_values.field_id = '".Database::escape_string($field_identification[0])."' 
 						AND field_values.field_value = '".Database::escape_string($field_identification[1])."'";
+			} else {	
+				$sql .=	"WHERE cu.user_id IS NULL";
 			}
 		} else {
 		// adding a teacher NOT through a session
@@ -353,7 +361,7 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 				LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'";
 				
 				// applying the filter of the additional user profile fields 	
-				if (isset($_GET['subscribe_user_filter_value'])){
+				if (isset($_GET['subscribe_user_filter_value']) AND api_get_setting('ProfilingFilterAddingUsers') == 'true'){
 					$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
 					$sql .=	"
 						LEFT JOIN $table_user_field_values field_values 
@@ -366,6 +374,8 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 				}
 				//showing only the courses of the current Dokeos access_url_id
 				global $_configuration;
+				
+				// adding a teacher NOT trough a session on a portal with multiple URLs
 				if ($_configuration['multiple_access_urls']==true) {
 					$url_access_id = api_get_current_access_url_id();
 					if ($url_access_id !=-1) {
@@ -389,7 +399,7 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 
 
 					// applying the filter of the additional user profile fields 	
-					if (isset($_GET['subscribe_user_filter_value'])){
+					if (isset($_GET['subscribe_user_filter_value']) AND api_get_setting('ProfilingFilterAddingUsers') == 'true'){
 						$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
 						$sql .=	"
 							LEFT JOIN $table_user_field_values field_values 
@@ -404,6 +414,7 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 			}
 		}
 	} else {
+		// adding a student
 		if (!empty($_SESSION["id_session"])) {
 			$sql = "SELECT
 					u.user_id AS col0,
@@ -417,9 +428,20 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 					u.active 	AS col5,
 					u.user_id   AS col6
 				FROM $user_table u
-				LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".$_SESSION['_course']['id']."'
-				WHERE cu.id_user IS NULL
-				";
+				LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".$_SESSION['_course']['id']."'";
+				
+			// applying the filter of the additional user profile fields 	
+			if (isset($_GET['subscribe_user_filter_value'])){
+				$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
+				$sql .=	"
+					LEFT JOIN $table_user_field_values field_values 
+						ON field_values.user_id = u.user_id 
+					WHERE cu.user_id IS NULL
+						AND field_values.field_id = '".Database::escape_string($field_identification[0])."' 
+						AND field_values.field_value = '".Database::escape_string($field_identification[1])."'";
+			} else	{
+				$sql .=	"WHERE cu.user_id IS NULL";
+			}
 		} else {
 		$sql = "SELECT
 					u.user_id AS col0,
@@ -433,8 +455,21 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 					u.active 	AS col5,
 					u.user_id   AS col6
 				FROM $user_table u
-				LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'
-				WHERE cu.user_id IS NULL";
+				LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'";
+				
+			// applying the filter of the additional user profile fields 	
+			if (isset($_GET['subscribe_user_filter_value'])){
+				$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
+				$sql .=	"
+					LEFT JOIN $table_user_field_values field_values 
+						ON field_values.user_id = u.user_id 
+					WHERE cu.user_id IS NULL
+						AND field_values.field_id = '".Database::escape_string($field_identification[0])."' 
+						AND field_values.field_value = '".Database::escape_string($field_identification[1])."'";
+			} else	{
+				$sql .=	"WHERE cu.user_id IS NULL";
+			}
+
 			//showing only the courses of the current Dokeos access_url_id
 			global $_configuration;
 			if ($_configuration['multiple_access_urls']==true) {
@@ -460,7 +495,7 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 
 
 					// applying the filter of the additional user profile fields 	
-					if (isset($_GET['subscribe_user_filter_value'])){
+					if (isset($_GET['subscribe_user_filter_value']) AND api_get_setting('ProfilingFilterAddingUsers') == 'true'){
 						$field_identification = explode('*',$_GET['subscribe_user_filter_value']);
 						$sql .=	"
 							LEFT JOIN $table_user_field_values field_values 
@@ -481,8 +516,11 @@ function get_user_data($from, $number_of_items, $column, $direction) {
 	if (isset ($_REQUEST['keyword'])) {
 		$keyword = Database::escape_string($_REQUEST['keyword']);
 		$sql .= " AND (firstname LIKE '%".$keyword."%' OR lastname LIKE '%".$keyword."%'   OR email LIKE '%".$keyword."%'  OR username LIKE '%".$keyword."%'  OR official_code LIKE '%".$keyword."%')";
-		// we also want to search for users who have something in their profile fields that matches the keyword
-		$additional_users = search_additional_profile_fields($keyword);
+		
+		if (api_get_setting('ProfilingFilterAddingUsers') == 'true') {
+			// we also want to search for users who have something in their profile fields that matches the keyword
+			$additional_users = search_additional_profile_fields($keyword);
+		}
 				
 		// getting all the users of the course (to make sure that we do not display users that are already in the course)
 		if (!empty($_SESSION["id_session"])) {
@@ -582,7 +620,9 @@ if ($_GET['subscribe_user_filter_value'] AND !empty($_GET['subscribe_user_filter
 {
 	$actions .= '<a href="subscribe_user.php?type='.Security::remove_XSS($_GET['type']).'">'.Display::return_icon('clean_group.gif').' '.get_lang('ClearFilterResults').'</a>';
 }
-display_extra_profile_fields_filter();
+if (api_get_setting('ProfilingFilterAddingUsers') == 'true') {
+	display_extra_profile_fields_filter();
+}
 
 $form = new FormValidator('search_user', 'POST',api_get_self().'?type='.$_REQUEST['type'],'',null,false);
 $renderer = & $form->defaultRenderer();

+ 1 - 1
main/user/user.php

@@ -604,7 +604,7 @@ if (api_is_allowed_to_edit()) {
 	$table->set_header($header_nr++, get_lang('Active'), false);
 	$table->set_column_filter(9, 'active_filter');
 	//actions column
-	$table->set_header($header_nr++, get_lang('Modify'), false);
+	$table->set_header($header_nr++, get_lang('Action'), false);
 	$table->set_column_filter($header_nr-1, 'modify_filter');
  	if (api_is_allowed_to_edit()) {
 		$table->set_form_actions(array('unsubscribe' => get_lang('Unreg')), 'user');