Browse Source

Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

Angel Fernando Quiroz Campos 8 years ago
parent
commit
96e083b830

+ 40 - 9
main/exercise/export/exercise_import.inc.php

@@ -161,6 +161,9 @@ function import_exercise($file)
     // 1. Create exercise.
     $exercise = new Exercise();
     $exercise->exercise = $exercise_info['name'];
+    if (!empty($exercise_info['description'])) {
+        $exercise->updateDescription($exercise_info['description']);
+    }
 
     $exercise->save();
     $last_exercise_id = $exercise->selectId();
@@ -175,13 +178,18 @@ function import_exercise($file)
                 $question->type = MCUA;
             }
             $question->setAnswer();
+            $description = '';
             if (strlen($question_array['title']) < 50) {
                 $question->updateTitle(formatText(strip_tags($question_array['title'])) . '...');
             } else {
                 $question->updateTitle(formatText(substr(strip_tags($question_array['title']), 0, 50)));
-                $question->updateDescription($question_array['title']);
+                $description .= $question_array['title'];
+            }
+            if (!empty($question_array['description'])) {
+                $description .= $question_array['description'];
             }
-            //$question->updateDescription($question_array['title']);
+            $question->updateDescription($description);
+
             $question->save($last_exercise_id);
             $last_question_id = $question->selectId();
             //3. Create answer
@@ -363,11 +371,6 @@ function startElementQti2($parser, $name, $attributes)
     } else {
         $parent_element = "";
     }
-    if (sizeof($element_pile) >= 3) {
-        $grant_parent_element = $element_pile[sizeof($element_pile) - 3];
-    } else {
-        $grant_parent_element = "";
-    }
 
     if ($record_item_body) {
 
@@ -498,7 +501,23 @@ function endElementQti2($parser, $name)
     global $non_HTML_tag_to_avoid;
     global $cardinality;
 
+    array_push($element_pile, $name);
     $current_element = end($element_pile);
+    if (sizeof($element_pile) >= 2) {
+        $parent_element = $element_pile[sizeof($element_pile) - 2];
+    } else {
+        $parent_element = "";
+    }
+    if (sizeof($element_pile) >= 3) {
+        $grand_parent_element = $element_pile[sizeof($element_pile) - 3];
+    } else {
+        $grand_parent_element = "";
+    }
+    if (sizeof($element_pile) >= 4) {
+        $great_grand_parent_element = $element_pile[sizeof($element_pile) - 4];
+    } else {
+        $great_grand_parent_element = "";
+    }
 
     //treat the record of the full content of itembody tag :
 
@@ -545,9 +564,14 @@ function elementDataQti2($parser, $data)
         $parent_element = "";
     }
     if (sizeof($element_pile) >= 3) {
-        $grant_parent_element = $element_pile[sizeof($element_pile) - 3];
+        $grand_parent_element = $element_pile[sizeof($element_pile) - 3];
+    } else {
+        $grand_parent_element = "";
+    }
+    if (sizeof($element_pile) >= 4) {
+        $great_grand_parent_element = $element_pile[sizeof($element_pile) - 4];
     } else {
-        $grant_parent_element = "";
+        $great_grand_parent_element = "";
     }
 
     //treat the record of the full content of itembody tag (needed for question statment and/or FIB text:
@@ -609,6 +633,13 @@ function elementDataQti2($parser, $data)
                 $exercise_info['question'][$current_question_ident]['wrong_answers'][] = $data;
             }
             break;
+        case 'MATTEXT':
+            if ($grand_parent_element == 'FLOW_MAT' && ($great_grand_parent_element == 'PRESENTATION_MATERIAL' || $great_grand_parent_element == 'SECTION')) {
+                if (!empty(trim($data))) {
+                    $exercise_info['description'] = $data;
+                }
+            }
+
     }
 }
 

+ 2 - 0
main/inc/lib/tracking.lib.php

@@ -4834,6 +4834,8 @@ class Tracking
                             $url,
                             array('target' => SESSION_LINK_TARGET)
                         );
+                    } elseif ($exercices['active'] == -1) {
+                        $exercices['title'] = sprintf(get_lang('XParenthesisDeleted'), $exercices['title']);
                     }
 
                     $html .= Display::tag('td', $exercices['title']);

+ 10 - 9
main/inc/lib/userportal.lib.php

@@ -1370,24 +1370,25 @@ class IndexManager
                                 }
                             }
 
-                            $sessionParams = array();
+                            $sessionParams = [];
                             // Category
                             if ($count > 0) {
                                 $session_box = Display:: get_session_title_box($session_id);
-                                $sessionParams['id'] = $session_id;
+                                $sessionParams[0]['id'] = $session_id;
+                                $sessionParams[0]['date'] = $session_box['dates'];
                                 //$sessionParams['show_link_to_session'] = !api_is_drh() && $sessionTitleLink;
-                                $sessionParams['course_list_session_style'] = $coursesListSessionStyle;
-                                $sessionParams['title'] = $session_box['title'];
-                                $sessionParams['subtitle'] = (!empty($session_box['coach']) ? $session_box['coach'] . ' | ': '') . $session_box['dates'];
-                                $sessionParams['show_actions'] = api_is_platform_admin();
-                                $sessionParams['courses'] = $html_courses_session;
-                                $sessionParams['show_simple_session_info'] = false;
+                                $sessionParams[0]['course_list_session_style'] = $coursesListSessionStyle;
+                                $sessionParams[0]['title'] = $session_box['title'];
+                                $sessionParams[0]['subtitle'] = (!empty($session_box['coach']) ? $session_box['coach'] . ' | ': '') . $session_box['dates'];
+                                $sessionParams[0]['show_actions'] = api_is_platform_admin();
+                                $sessionParams[0]['courses'] = $html_courses_session;
+                                $sessionParams[0]['show_simple_session_info'] = false;
 
                                 if (
                                     isset($_configuration['show_simple_session_info']) &&
                                     $_configuration['show_simple_session_info']
                                 ) {
-                                    $sessionParams['show_simple_session_info'] = true;
+                                    $sessionParams[0]['show_simple_session_info'] = true;
                                 }
 
                                 $this->tpl->assign('session', $sessionParams);

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

@@ -7864,4 +7864,8 @@ $MoodleFileImportedSuccessfully = "The Moodle course file has been imported succ
 $ExtensionInstalledButNotEnabled = "Extension installed but not enabled";
 $MailingTestSent = "E-mail sent. This procedure works in all aspects similarly to the normal e-mail sending of Chamilo, but allows for more flexibility in terms of destination e-mail and message body.";
 $EMailTester = "E-mail tester";
+$TicketMsgWelcome = "Welcome to YOUR tickets section. Here, you'll be able to track the state of all the tickets you created in the main tickets section.";
+$TicketNoHistory = "No history";
+$RecalculateResults = "Recalculate results";
+$XParenthesisDeleted = "%s (deleted)";
 ?>

+ 4 - 0
main/lang/french/trad4all.inc.php

@@ -7811,4 +7811,8 @@ $MoodleFileImportedSuccessfully = "Le fichier de cours Moodle a été importé a
 $ExtensionInstalledButNotEnabled = "Extension installée mais pas activée";
 $MailingTestSent = "Le courriel a été envoyé. Cette page se comporte en tous points comme l'envoi normal de courriels depuis Chamilo, ce qui permet de faire des tests un peu plus poussés en alternant les destinataires et corps du courriel.";
 $EMailTester = "Testeur de courriel";
+$TicketMsgWelcome = "Bienvenu(e) dans votre section de tickets personnels. Suivez ici-même l'état de tous les tickets que vous avez créé.";
+$TicketNoHistory = "Aucun historique";
+$RecalculateResults = "Recalculer les résultats";
+$XParenthesisDeleted = "%s (supprimé)";
 ?>

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

@@ -7883,4 +7883,8 @@ $MoodleFileImportedSuccessfully = "El archivo de curso de Moodle ha sido importa
 $ExtensionInstalledButNotEnabled = "Extensión instalada pero no activada";
 $MailingTestSent = "El correo de prueba ha sido enviado. Se comporta en todos aspectos como los demás correos de Chamilo, pero permite hacer pruebas con correos y cuerpos distintos.";
 $EMailTester = "Probador de correo electrónico";
+$TicketMsgWelcome = "Bienvenido a la sección de TUS tickets. Aquí serás capaz de revisar el estado de todos los tickets que has creado en la sección principal de tickets.";
+$TicketNoHistory = "Sin historial";
+$RecalculateResults = "Recalcular resultados";
+$XParenthesisDeleted = "%s (eliminado)";
 ?>