Browse Source

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

jmontoyaa 8 years ago
parent
commit
9d0be94cca

+ 2 - 2
main/exercise/exercise_show.php

@@ -444,13 +444,13 @@ foreach ($questionList as $questionId) {
                 echo "
                         <tr>
                             <td colspan=\"2\">
-                                <div id=\"hotspot-solution\"></div>
+                                <div id=\"hotspot-solution-$questionId-$id\"></div>
                                 <script>
                                     $(document).on('ready', function () {
                                         new HotspotQuestion({
                                             questionId: $questionId,
                                             exerciseId: $id,
-                                            selector: '#hotspot-solution',
+                                            selector: '#hotspot-solution-$questionId-$id',
                                             for: 'solution',
                                             relPath: '$relPath'
                                         });

+ 5 - 4
main/exercise/hotspot_actionscript.as.php

@@ -32,11 +32,11 @@ $course_id = api_get_course_int_id();
 
 // Query db for answers
 if ($answer_type==HOT_SPOT_DELINEATION) {
-	$sql = "SELECT id, answer, hotspot_coordinates, hotspot_type, ponderation FROM $TBL_ANSWERS
-	        WHERE c_id = $course_id AND question_id = ".intval($questionId)." AND hotspot_type = 'delineation' ORDER BY id";
+	$sql = "SELECT iid, id, answer, hotspot_coordinates, hotspot_type, ponderation FROM $TBL_ANSWERS
+	        WHERE c_id = $course_id AND question_id = ".intval($questionId)." AND hotspot_type = 'delineation' ORDER BY iid";
 } else {
-	$sql = "SELECT id, answer, hotspot_coordinates, hotspot_type, ponderation FROM $TBL_ANSWERS
-	        WHERE c_id = $course_id AND question_id = ".intval($questionId)." ORDER BY id";
+	$sql = "SELECT iid, id, answer, hotspot_coordinates, hotspot_type, ponderation FROM $TBL_ANSWERS
+	        WHERE c_id = $course_id AND question_id = ".intval($questionId)." ORDER BY iid";
 }
 $result = Database::query($sql);
 
@@ -74,6 +74,7 @@ while ($hotspot = Database::fetch_assoc($result))
 {
     $hotSpot = [];
     $hotSpot['id'] = $hotspot['id'];
+    $hotSpot['iid'] = $hotspot['iid'];
     $hotSpot['answer'] = $hotspot['answer'];
 
 	// Square or rectancle

+ 6 - 1
main/exercise/hotspot_answers.as.php

@@ -1,6 +1,9 @@
 <?php
 /* For licensing terms, see /license.txt */
 
+use Chamilo\CourseBundle\Entity\CQuizAnswer;
+use Chamilo\CoreBundle\Entity\TrackEHotspot;
+
 /**
  * This file generates the ActionScript variables code used by the
  * HotSpot .swf
@@ -76,9 +79,10 @@ if ($objExercise->results_disabled != RESULT_DISABLE_SHOW_SCORE_ONLY) {
         ->getQuery()
         ->getResult();
 
+    /** @var CQuizAnswer $hotspotAnswer */
     foreach ($result as $hotspotAnswer) {
         $hotSpot = [];
-        $hotSpot['id'] = $hotspotAnswer->getId();
+        $hotSpot['id'] = $hotspotAnswer->getIid();
         $hotSpot['answer'] = $hotspotAnswer->getAnswer();
 
         switch ($hotspotAnswer->getHotspotType()) {
@@ -118,6 +122,7 @@ $rs = $em
         ['hotspotId' => 'ASC']
     );
 
+/** @var TrackEHotspot $row */
 foreach ($rs as $row) {
     $data['answers'][] = $row->getHotspotCoordinate();
 }

+ 0 - 1
main/inc/lib/events.lib.php

@@ -622,7 +622,6 @@ class Event
                         api_get_user_id(),
                         $exe_id,
                         $question_id,
-                        $answer_id,
                         $answer_id
                     )
                 )

+ 3 - 6
main/inc/lib/javascript/hotspot/js/hotspot.js

@@ -53,7 +53,6 @@ window.HotspotQuestion = (function () {
                 this.set('height', y - startY);
             }
         };
-
         SquareModel.decode = function (hotspotInfo) {
             var coords = hotspotInfo.coord.split('|'),
                 position = coords[0].split(';'),
@@ -64,7 +63,7 @@ window.HotspotQuestion = (function () {
                     height: parseInt(coords[2])
                 });
 
-            hotspot.id = hotspotInfo.id;
+            hotspot.id = hotspotInfo.iid;
             hotspot.name = hotspotInfo.answer;
 
             return hotspot;
@@ -124,7 +123,7 @@ window.HotspotQuestion = (function () {
                     radiusY: parseInt(coords[2])
                 });
 
-            hotspot.id = hotspotInfo.id;
+            hotspot.id = hotspotInfo.iid;
             hotspot.name = hotspotInfo.answer;
 
             return hotspot;
@@ -170,7 +169,7 @@ window.HotspotQuestion = (function () {
             var hotspot = new PolygonModel({
                 points: points
             });
-            hotspot.id = hotspotInfo.id;
+            hotspot.id = hotspotInfo.iid;
             hotspot.name = hotspotInfo.answer;
 
             return hotspot;
@@ -269,7 +268,6 @@ window.HotspotQuestion = (function () {
                 self.render();
             });
         };
-
         HotspotSVG.prototype.render = function () {
             var newEl = null;
 
@@ -323,7 +321,6 @@ window.HotspotQuestion = (function () {
                 self.render();
             });
         };
-
         AnswerSVG.prototype.render = function () {
             this.circleEl.setAttribute('cx', this.model.get('x'));
             this.circleEl.setAttribute('cy', this.model.get('y'));

+ 1 - 1
main/install/install.lib.php

@@ -1103,7 +1103,7 @@ function display_requirements(
         </button>
         <input type="hidden" name="is_executable" id="is_executable" value="-" />
             <button type="submit" class="btn btn-default" <?php echo !$error ?: 'disabled="disabled"' ?> name="step2_update_8" value="Upgrade from Chamilo 1.9.x">
-                <em class="fa fa-forward" aria-hidden="true"></em> <?php echo get_lang('UpgradeFromLMS19x') ?>
+                <em class="fa fa-forward" aria-hidden="true"></em> <?php echo get_lang('UpgradeVersion') ?>
             </button>
             </p>
         <?php

+ 26 - 0
main/template/default/social/whoisonline.tpl

@@ -18,4 +18,30 @@
             </div>
         </div>
     </div>
+    <script>
+        $(document).ready(function() {
+            $("#link_load_more_items").click(function() {
+                page = $("#link_load_more_items").attr("data_link");
+                $.ajax({
+                    beforeSend: function(objeto) {
+                        $("#display_response_id").html("'.addslashes(get_lang('Loading')).'");
+                    },
+                    type: "GET",
+                    url: "main/inc/ajax/online.ajax.php?a=load_online_user",
+                    data: "online_page_nr="+page,
+                    success: function(data) {
+                        $("#display_response_id").html("");
+                        if (data != "end") {
+                            $("#link_load_more_items").remove();
+                            var last = $("#online_grid_container li:last");
+                            last.after(data);
+                        } else {
+                            $("#link_load_more_items").remove();
+                        }
+                    }
+                });
+            });
+        });
+    </script>
 {% endblock %}
+