Browse Source

Merge branch 'ofaj_dev' of https://github.com/chamilo/chamilo-lms into ofajpreprod

Nicolas Ducoulombier 7 years ago
parent
commit
eafd7f7ac3

+ 175 - 9
app/Resources/public/css/themes/rainbow/default.css

@@ -60,6 +60,9 @@ a:focus {
     background: #162A83;
     display: inline-block;
 }
+.result-body{
+    background-color: #FFF;
+}
 #sessionList .list-group .title{
     font-size: 12px;
     font-weight: normal;
@@ -490,10 +493,22 @@ footer #footer_right{
   list-style: outside none none;
   background: transparent;
   font-size: 12px;
+  color: #6B1D82;
+  border-radius: 0;
+  border-bottom: 1px solid #96bd0d;
+}
+.view-options {
+    padding-top: 0;
+    padding-right: 0;
 }
 .breadcrumb a{
     color: #6B1D82;
 }
+#scorm-panel .panel.panel-default{
+    margin-top:0 ;
+    border-bottom: 1px solid #84bd00;
+    border-radius: 0;
+}
 .panel-default{
   border-color: #ddd;
 }
@@ -512,21 +527,63 @@ footer #footer_right{
     font-size: 12px;
 }
 .question_row_score .title-score .total{
-   background: #162A83;
-   color: #FFF;
+   background: #FFF;
+   color: #162A83;
    border: none;
+   text-align: left;
+   display: none;
+}
+.question_row_score .title-score .total h3{
+    font-weight: bold;
+}
+.question_row_answer{
+    border: none;
+}
+.feedbaak-question{
+    padding: 5px 15px;
+    display: block;
+    width: 100%;
+}
+.feedbaak-question img{
+    padding-right: 15px;
+}
+.feedbaak-question .feedback-red{
+    color: #162a83;
+    text-decoration:line-through;
+}
+.feedbaak-question .feedback-green{
+    color: #96BD0D;
+}
+.feedbaak-question .feedback-separator{
+    color:#162a83;
+    font-weight: bold;
 }
 .ribbon{
-    background: #2c539e; /* Old browsers */
-    background: -moz-linear-gradient(top, #2c539e 0%, #1a265e 100%); /* FF3.6-15 */
-    background: -webkit-linear-gradient(top, #2c539e 0%,#1a265e 100%); /* Chrome10-25,Safari5.1-6 */
-    background: linear-gradient(to bottom, #2c539e 0%,#1a265e 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2c539e', endColorstr='#1a265e',GradientType=0 ); /* IE6-9 */
+    background: #FFFFFF;
     border: none;
+    box-shadow: none;
 }
 .ribbon h4{
     color: #FFF;
 }
+.question_row_answer .page-header{
+    font-weight: normal;
+    font-size: 22px;
+    margin: 5px 0;
+}
+.score-title{
+    color: #162a83;
+    font-weight: bold;
+    font-size: 16px;
+}
+.score-limits{
+    padding-top: 5px;
+    padding-bottom: 5px;
+}
+.score-limits .score-img{
+    display: inline-block;
+    padding-right: 5px;
+}
 /* bar progress */
 .progress{
     background: #FFF;
@@ -561,7 +618,7 @@ footer #footer_right{
     color: #162a83;
 }
 .table-ofaj .table-header th{
-    border-bottom: 2px solid #96bd0d;
+    border-bottom: 1px solid #96bd0d;
     padding-top: 20px;
 }
 .table-ofaj tbody tr td{
@@ -849,6 +906,8 @@ legend{
 .bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){
     width: 350px;
     margin-bottom: 5px;
+    margin-left: 15px;
+    margin-top: 5px;
 }
 .question_options ul.exercise-draggable-answer{
     list-style: none;
@@ -901,6 +960,9 @@ ul.exercise-draggable-answer .touch-items:hover{
 .question_options .droppable .gallery .exercise-draggable-answer-option{
     margin-left: 0;
 }
+.question_row_answer .table.table-striped tbody tr:nth-of-type(2n+1){
+    background: transparent;
+}
 .drag_question .window{
     padding: 10px 5px;
     border: 1px solid #162A83;
@@ -911,7 +973,8 @@ ul.exercise-draggable-answer .touch-items:hover{
     margin: 0;
 }
 .drag_question .window.window_right_question{
-    border-color: #96BD0D; 
+    border-color: #96BD0D;
+    font-weight: bold;
 }
 .drag_question .window.window_right_question,
 .drag_question .window.window_left_question
@@ -939,6 +1002,14 @@ svg circle{
     cy:15;
     cx:15;
 }
+.point_end ._jsPlumb_endpoint svg circle{
+    fill:rgb(255,255,255);
+    stroke:rgb(22,42,131);
+    stroke-width: 2;
+    r: 10;
+    cy:15;
+    cx:15;
+}
 .question_options input[type="text"]{
     border:1px solid #162A83;
     background-color:#FFFFFF;
@@ -995,6 +1066,101 @@ svg circle{
     background: linear-gradient(to bottom, #9dd53a 0%,#7cbc0a 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9dd53a', endColorstr='#7cbc0a',GradientType=0 ); /* IE6-9 */
 }
+@font-face {
+  font-family: 'icomoon';
+  src:url('icons/icomoon.eot?-8aafzo');
+  src:url('icons/icomoon.eot?#iefix-8aafzo') format('embedded-opentype'),
+    url('icons/icomoon.woff?-8aafzo') format('woff'),
+    url('icons/icomoon.ttf?-8aafzo') format('truetype'),
+    url('icons/icomoon.svg?-8aafzo#icomoon') format('svg');
+  font-weight: normal;
+  font-style: normal;
+}
+.icon-checkradios-checkmark, .icon-checkradios-circle{
+  font-family: 'icomoon';
+  speak: none;
+  font-style: normal;
+  font-weight: normal;
+  font-variant: normal;
+  text-transform: none;
+  line-height: 1;
+  /* Better Font Rendering =========== */
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+/*Icon Placeholder*/
+.checkradios-checkbox:after,.checkradios-radio:after{
+  content:"";
+  height:100%;
+  width:100%;
+  position:relative;
+  display:block;
+  vertical-align:bottom;
+}
+/*Icons*/
+.icon-checkradios-checkmark:before {
+  content: "\e600";
+  color: #96BD0D;
+}
+.icon-checkradios-circle:before {
+  content: "\e601";
+  color: #96BD0D;
+}
+/*
+    Default Styles for checkradios
+*/
+.checkradios-checkbox, .checkradios-radio{
+  font-size:16px;
+  position:relative;
+  display:inline-block;
+  vertical-align:bottom;
+  text-align:center;
+  border:2px solid #162A83;
+  color:#162A83;
+  width:1em;
+  height:1em;
+  cursor:pointer;
+  padding:0.2em;
+  -moz-box-sizing: content-box;
+  -webkit-box-sizing: content-box;
+  box-sizing: content-box;
+  overflow:hidden;
+}
+.checkradios-radio{
+  -moz-border-radius: 50%;
+  -webkit-border-radius: 50%;
+  border-radius: 50%;
+}
+/*Focus*/
+.checkradios-checkbox.focus, .checkradios-radio.focus{
+  -webkit-box-shadow:0px 0px 3px rgba(22,150,255,0.9);
+  -moz-box-shadow:0px 0px 3px rgba(22,150,255,0.9);
+  box-shadow:0px 0px 3px rgba(22,150,255,0.9);
+  border-color:#1696f1;
+}
+/*Hide original*/
+.checkradios-checkbox input[type=checkbox], .checkradios-radio input[type=radio]{
+  margin:0;
+  position:absolute;
+  top:0;
+  left:-9999%;
+  width:100%;
+  height:100%;
+  position:absolute;
+  display:inline-block;
+  vertical-align:bottom;
+}
+.radio {
+    display: block;
+    width: 100%;
+}
+.radio .checkradios-radio{
+    display: inline-block;
+}
+.radio p{
+    display: inline-block;
+    margin: 0;
+}
 /* Large desktop */
 @media (min-width: 1200px) {
 

BIN
app/Resources/public/css/themes/rainbow/icons/16/home.png


BIN
app/Resources/public/css/themes/rainbow/icons/22/attempt-check.png


BIN
app/Resources/public/css/themes/rainbow/icons/22/attempt-nocheck.png


BIN
app/Resources/public/css/themes/rainbow/icons/icomoon.eot


+ 12 - 0
app/Resources/public/css/themes/rainbow/icons/icomoon.svg

@@ -0,0 +1,12 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Generated by IcoMoon</metadata>
+<defs>
+<font id="icomoon" horiz-adv-x="512">
+<font-face units-per-em="512" ascent="480" descent="-32" />
+<missing-glyph horiz-adv-x="512" />
+<glyph unicode="&#x20;" d="" horiz-adv-x="256" />
+<glyph unicode="&#xe600;" d="M432 416l-240-240-112 112-80-80 192-192 320 320z" />
+<glyph unicode="&#xe601;" d="M438.857 221.714q0-59.714-29.428-110.143t-79.857-79.857-110.143-29.428-110.143 29.428-79.857 79.857-29.428 110.143 29.428 110.143 79.857 79.857 110.143 29.428 110.143-29.428 79.857-79.857 29.428-110.143z" horiz-adv-x="439" />
+</font></defs></svg>

BIN
app/Resources/public/css/themes/rainbow/icons/icomoon.ttf


BIN
app/Resources/public/css/themes/rainbow/icons/icomoon.woff


+ 370 - 0
app/Resources/public/css/themes/rainbow/js/jquery.checkradios.js

@@ -0,0 +1,370 @@
+/*
+	CHECKRADIOS - jQuery plugin to allow custom styling of checkboxes
+	by Chris McGuckin (https://github.com/cosmicwheels)
+	
+	
+	License: MIT (http://opensource.org/licenses/MIT)
+	
+	
+	Credits:
+	---------------------------------------------------------------------------------
+	
+	icomoon (http://icomoon.io/)
+	
+	Please refer to the icomoon website for the license regarding their icons.
+	
+	---------------------------------------------------------------------------------
+	
+	Fontawesome (http://fortawesome.github.io/Font-Awesome/)
+	
+	Please refer to the fontawesome website for the license regarding their icons.
+	
+	---------------------------------------------------------------------------------
+	
+	Stephan Richter (https://github.com/strichter)
+	
+	Thanks to Stephan for pointing out and helping to add the triggering of events 
+	to help further mimic the checkboxes and radios as well as providing other
+	important bug fixes.
+	
+	---------------------------------------------------------------------------------
+	---------------------------------------------------------------------------------
+	
+
+*/
+(function ($) {
+
+
+	$.fn.checkradios = function (options) {
+
+		var $elements = this;
+
+		//Default Settings
+		var settings = $.extend({
+
+			checkbox: {
+
+				iconClass: 'icon-checkradios-checkmark'
+
+			},
+
+			radio: {
+
+				iconClass: 'icon-checkradios-circle'
+
+			},
+
+
+			onChange: function (checked, $element, $realElement) {}
+
+		}, options);
+
+
+		// Functionality
+		var form = {
+
+			checkbox: function ($checkbox) {
+				
+
+				var THIS = this;
+
+				//Make sure checkradios isnt already in use
+				if (!$checkbox.parent().hasClass('checkradios-checkbox')) {
+
+					//Get the elements classes
+					var classes = $checkbox.attr('class');
+
+					if (classes === undefined) {
+
+						classes = '';
+
+					}
+
+					//Wrap the input
+					var $item = $checkbox.wrap('<div class="checkradios-checkbox ' + classes + '"/>');
+
+					//Get the new checkbox
+					var $holder = $item.parent();
+
+					//Check if box is checked
+					if ($item.is(':checked')) {
+
+						THIS.checkboxEnable($item);
+
+					} else {
+
+						THIS.checkboxDisable($item);
+
+					}
+
+					//Add keyboard support
+					$checkbox.keypress(function (e) {
+
+						var key = e.keyCode;
+
+						//On enter/return or space
+						if ((key < 1) || (key == 13) || (key == 32)) {
+
+							$holder.click();
+
+						}
+
+					});
+
+
+					//Add tabbing support
+					$checkbox.on({
+
+						focusin: function () {
+
+							$holder.addClass('focus');
+
+						},
+
+						focusout: function () {
+
+							var $this = $(this);
+
+							setTimeout(function () {
+
+								if (!$this.is(':focus')) {
+
+									$holder.removeClass('focus');
+
+								}
+
+							}, 10);
+
+						}
+					});
+
+
+					$holder.mousedown(function () {
+
+						setTimeout(function () {
+
+							//Add focus
+							$checkbox.focus();
+
+						}, 10);
+
+					});
+
+
+					//Disable usual click functionality
+					$checkbox.click(function (e) {
+
+						e.stopPropagation();
+						e.preventDefault();
+
+					});
+
+
+					//On button click
+					$holder.click(function () {
+
+						//Add check
+						if ($item.is(':checked')) {
+
+							THIS.checkboxDisable($item);
+
+							//Callback
+							settings.onChange(false, $holder, $item);
+
+						} else {
+
+							THIS.checkboxEnable($item);
+
+							//Callback
+							settings.onChange(true, $holder, $item);
+
+						}
+
+						return false;
+
+					});
+
+				}
+
+			},
+
+
+			radio: function ($radio) {
+
+				var THIS = this;
+
+				//Make sure checkradios isnt already in use
+				if (!$radio.parent().hasClass('checkradios-radio')) {
+
+					//Get the elements classes
+					var classes = $radio.attr('class');
+
+					if (classes === undefined) {
+
+						classes = '';
+
+					}
+
+					//Wrap the input
+					var $item = $radio.wrap('<div class="checkradios-radio ' + classes + '"/>');
+
+					//Get the new checkbox
+					var $holder = $item.parent();
+
+					//Check if box is checked
+					if ($item.is(':checked')) {
+
+						THIS.radioEnable($item);
+
+					} else {
+
+						THIS.radioDisable($item);
+
+					}
+
+					//Add tabbing suppot
+					$radio.on({
+						
+						focusin: function () {
+							
+							//Add focus class
+							$holder.addClass('focus');
+							
+							
+							THIS.radioEnable($item);
+
+							//Get group Name
+							var radio_name = $item.attr('name');
+
+							var $group = $('input[name="' + radio_name + '"]');
+
+							//Set checked/unchecked for each element in group
+							$group.each(function () {
+								
+								if ($(this).is(':checked')) {
+									
+									THIS.radioEnable($(this));
+									//Callback
+									settings.onChange(true, $(this).parent(), $(this));
+									
+								} else {
+									
+									THIS.radioDisable($(this));
+									//Callback
+									settings.onChange(false, $(this).parent(), $(this));
+									
+								}
+
+							});
+
+						},
+
+						focusout: function () {
+							
+							var $this = $(this);
+
+							setTimeout(function () {
+								
+								if (!$this.is(':focus')) {
+									
+									$holder.removeClass('focus');
+									
+								}
+								
+							}, 10);
+							
+						}
+					});
+
+					$holder.click(function () {
+						
+						//Add focus
+						$radio.focus();
+						
+					});
+
+					//Disable usual click functionality
+					$radio.click(function (e) {
+						
+						e.stopPropagation();
+						e.preventDefault();
+						
+					});
+
+				}
+			},
+
+			/*Private*/
+
+			checkboxEnable: function ($checkbox) {
+				
+				$checkbox.parent().removeClass(settings.checkbox.iconClass);
+				$checkbox.parent().removeClass('unchecked');
+
+				$checkbox.parent().addClass(settings.checkbox.iconClass);
+				$checkbox.parent().addClass('checked');
+				$checkbox.prop('checked', true).trigger('change');
+				
+					
+			},
+
+			checkboxDisable: function ($checkbox) {
+				
+				$checkbox.parent().removeClass(settings.checkbox.iconClass);
+				$checkbox.parent().addClass('unchecked');
+				$checkbox.prop('checked', false).trigger('change');
+				
+				
+			},
+
+			radioEnable: function ($radio) {
+				
+				$radio.parent().removeClass(settings.radio.iconClass);
+				$radio.parent().removeClass('unchecked');
+
+				$radio.parent().addClass(settings.radio.iconClass);
+				$radio.parent().addClass('checked');
+				$radio.prop('checked', true).trigger('change');
+				
+				
+					
+			},
+
+			radioDisable: function ($radio) {
+				
+				$radio.parent().removeClass('checked');
+				$radio.parent().removeClass(settings.radio.iconClass);
+				$radio.parent().addClass('unchecked');
+				$radio.prop('checked', false).trigger('change');
+				
+				
+			}
+		};
+
+		//Loop through elements
+		$elements.each(function (i, val) {
+
+			var $this = $(this);
+
+			//Check for checkbox
+			if ($this.is("input[type=checkbox]")) {
+				
+				//Setup checkboxes
+				form.checkbox($this);
+				
+			}
+
+			//Check for radio
+			if ($this.is("input[type=radio]")) {
+				
+				//Setup checkboxes
+				form.radio($this);
+				
+			}
+
+			return this;
+		});
+
+	};
+
+}(jQuery));

File diff suppressed because it is too large
+ 33 - 0
app/Resources/public/css/themes/rainbow/js/jquery.checkradios.min.js


+ 26 - 1
app/Resources/public/css/themes/rainbow/learnpath.css

@@ -284,6 +284,13 @@ table.lp_overview img {
 }
 #learning_path_toc{
     padding: 0;
+    border:none;
+}
+#scorm-panel .panel.panel-default{
+    border: none;
+}
+.section-list{
+    border-bottom: none;
 }
 .scorm_item_normal {
     line-height: 25px;
@@ -347,7 +354,6 @@ table.lp_overview img {
     margin: 0 0.5em 0 90px;
     padding-left: 25px;
 }
-/* nuevo scorm */
 #scorm-panel .panel-default .panel-heading{
     padding: 0;
 }
@@ -436,4 +442,23 @@ table.lp_overview img {
 .section-list .scorm_highlight .sub-item.type-quiz{
     background: url(images/pencil-active.png) no-repeat center right;
 }
+#scorm-panel .panel-parent .panel-default .panel-heading a{
+    padding-left: 55px;
+    background: url(images/arrow-down.png) no-repeat #E1E1E1 30px center;
+    font-size: 12px;
+}
+#scorm-panel .panel-parent .section-list li{
+    padding: 10px 10px 10px 75px;
+}
+#scorm-panel .panel-parent .section-list li.scorm_completed.scorm_item_normal.scorm_highlight{
+    background: url(images/completed-active.png) no-repeat  #772583 55px center;
+}
+#scorm-panel .panel-parent .section-list li.scorm_not_attempted.scorm_item_normal{
+    background: url(images/not-completed.png) no-repeat  #ECF0F1 55px center;
+}
+#scorm-panel .panel-parent .section-list li.scorm_completed.scorm_item_normal.scorm_highlight,
+#scorm-panel .panel-parent .section-list li.scorm_not_attempted.scorm_item_normal.scorm_highlight
+{
+    background: url(images/completed-active.png) no-repeat  #772583 55px center;
+}
 /* nuevo css */

+ 11 - 9
main/exercise/fill_blanks.class.php

@@ -1204,9 +1204,11 @@ class FillBlanks extends Question
             }
         }
 
-        $style = "color: green";
+        $style = "feedback-green";
+        $iconAnswer = Display::return_icon('attempt-check.png', get_lang('Correct'), null, ICON_SIZE_SMALL);
         if (!$right) {
-            $style = "color: red; text-decoration: line-through;";
+            $style = "feedback-red";
+            $iconAnswer = Display::return_icon('attempt-nocheck.png', get_lang('Fault'), null, ICON_SIZE_SMALL);
         }
         $type = self::getFillTheBlankAnswerType($correct);
         switch ($type) {
@@ -1229,22 +1231,22 @@ class FillBlanks extends Question
                 if (count($listCorrects) > 0) {
                     $firstCorrect = $listCorrects[0];
                 }
-                $correctAnswerHtml = "<span style='color: green'>".$firstCorrect."</span>";
+                $correctAnswerHtml = "<span style='feedback-red'>".$firstCorrect."</span>";
                 break;
             case self::FILL_THE_BLANK_STANDARD:
             default:
-                $correctAnswerHtml = "<span style='color: green'>".$correct."</span>";
+                $correctAnswerHtml = "<span style='feedback-green'>".$correct."</span>";
         }
 
         if ($hideExpectedAnswer) {
-            $correctAnswerHtml = "<span title='".get_lang("ExerciseWithFeedbackWithoutCorrectionComment")."'> - </span>";
+            $correctAnswerHtml = "<span class='feedback-green' title='".get_lang("ExerciseWithFeedbackWithoutCorrectionComment")."'> - </span>";
         }
 
-        $result = "<span style='border:1px solid black; border-radius:5px; padding:2px; font-weight:bold;'>";
-        $result .= "<span style='$style'>".$answer."</span>";
-        $result .= "&nbsp;<span style='font-size:120%;'>/</span>&nbsp;";
+        $result = "<div class='feedbaak-question'>";
+        $result .= "<span class='$style'>". $iconAnswer . ' ' . $answer."</span>";
+        $result .= "&nbsp;<span class='feedback-separator'>/</span>&nbsp;";
         $result .= $correctAnswerHtml;
-        $result .= "</span>";
+        $result .= "</div>";
 
         return $result;
     }

+ 7 - 3
main/exercise/question.class.php

@@ -1968,9 +1968,13 @@ abstract class Question
         if ($show_media) {
             $header .= $this->show_media_content();
         }
-
+        
+        $scoreCurrent = [
+            'used' => $score['score'],
+            'missing' => $score['weight']
+        ];
         $header .= Display::page_subheader2($counter_label.". ".$this->question);
-        $header .= ExerciseLib::getQuestionRibbon($class, $score_label, $score['result']);
+        $header .= ExerciseLib::getQuestionRibbon($class, $score_label, $score['result'], $scoreCurrent);
         if ($this->type != READING_COMPREHENSION) {
             // Do not show the description (the text to read) if the question is of type READING_COMPREHENSION
             $header .= Display::div($this->description, array('class' => 'question_description'));
@@ -2264,6 +2268,6 @@ abstract class Question
      */
     public function returnFormatFeedback()
     {
-        return '<br /><br />'.Display::return_message($this->feedback, 'normal', false);
+        return '<br />'.Display::return_message($this->feedback, 'normal', false);
     }
 }

+ 4 - 2
main/exercise/result.php

@@ -15,10 +15,12 @@ $id = isset($_REQUEST['id']) ? intval($_GET['id']) : null; //exe id
 $show_headers = isset($_REQUEST['show_headers']) ? intval($_REQUEST['show_headers']) : null; //exe id
 $origin = api_get_origin();
 
+$class = 'result-body';
 if ($origin == 'learnpath') {
     $show_headers = false;
 }
 
+
 api_protect_course_script($show_headers);
 
 if (empty($id)) {
@@ -73,14 +75,14 @@ if ($show_headers) {
 
 $message = Session::read('attempt_remaining');
 Session::erase('attempt_remaining');
-
+echo '<div class="'.$class.'">';
 ExerciseLib::displayQuestionListByAttempt(
     $objExercise,
     $id,
     false,
     $message
 );
-
+echo '</div>';
 if ($show_headers) {
     Display::display_footer();
 }

+ 1 - 1
main/inc/lib/banner.lib.php

@@ -803,7 +803,7 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools)
         }
 
         if (!empty($lis)) {
-            $html .= Display::tag('ul', $lis, array('class' => 'breadcrumb'));
+            $html .= Display::tag('ul', get_lang('YouAreHere').': '. $lis, array('class' => 'breadcrumb'));
         }
     }
 

+ 20 - 6
main/inc/lib/exercise.lib.php

@@ -305,7 +305,7 @@ class ExerciseLib
                 $numAnswer = $objAnswerTmp->selectAutoId($answerId);
                 $comment = $objAnswerTmp->selectComment($answerId);
                 $attributes = array();
-
+                
                 switch ($answerType) {
                     case UNIQUE_ANSWER:
                         //no break
@@ -365,7 +365,7 @@ class ExerciseLib
                             $attributes['style'] = 'display: none;';
                             $answer = '<div class="thumbnail">'.$answer.'</div>';
                         }
-
+                        $attributes['class'] = 'checkradios';
                         $answer_input .= '<label class="radio '.$hidingClass.'">';
                         $answer_input .= Display::input(
                             'radio',
@@ -418,7 +418,7 @@ class ExerciseLib
 
                         if ($answerType == MULTIPLE_ANSWER || $answerType == GLOBAL_MULTIPLE_ANSWER) {
                             $s .= '<input type="hidden" name="choice2['.$questionId.']" value="0" />';
-
+                            $attributes['class'] = 'checkradios';
                             $answer_input = '<label class="checkbox">';
                             $answer_input .= Display::input(
                                 'checkbox',
@@ -1043,7 +1043,7 @@ HTML;
 
                             $s .= <<<HTML
                             </td>
-                            <td width="45%">
+                            <td width="45%" class="point_end">
 HTML;
 
                             if (isset($select_items[$lines_count])) {
@@ -4022,16 +4022,30 @@ HOTSPOT;
      *
      * @return string
      */
-    public static function getQuestionRibbon($class, $scoreLabel, $result)
+    public static function getQuestionRibbon($class, $scoreLabel, $result, $array)
     {
         // ofaj
+        $html = null;
         $hideLabel = api_get_configuration_value('exercise_hide_label');
         $label = '<div class="rib rib-'.$class.'">
                         <h3>'.$scoreLabel.'</h3>
                   </div> 
                   <h4>'.get_lang('Score').': '.$result.'</h4>';
         if ($hideLabel === true) {
-            $label = "<h4>{$result}<h4/>";
+            
+            $answerUsed = (int)$array['used'];
+            $answerMissing = (int)$array['missing'] - $answerUsed;
+            
+            for ($i = 1; $i <= $answerUsed; $i++) {
+                $html.= '<span class="score-img">'.Display::return_icon('attempt-check.png',null,null,ICON_SIZE_SMALL).'</span>';
+            }
+            for ($i = 1; $i <= $answerMissing; $i++) {
+                $html.= '<span class="score-img">'.Display::return_icon('attempt-nocheck.png',null,null,ICON_SIZE_SMALL).'</span>';
+            }
+            $label = '<div class="score-title">'.get_lang('CorrectAnswers').': '.$result.'</div>';
+            $label .= '<div class="score-limits">';
+            $label .= $html;
+            $label .= '</div>';
         }
 
         return '<div class="ribbon">

+ 2 - 2
main/inc/lib/javascript/annotation/js/annotation.js

@@ -183,8 +183,8 @@
         this.el = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
         this.el.setAttribute('version', '1.1');
         this.el.setAttribute('viewBox', '0 0 ' + this.image.width + ' ' + this.image.height);
-        this.el.style.width = this.image.width + 'px';
-        this.el.style.height = this.image.height + 'px';
+        this.el.setAttribute('width', this.image.width);
+        this.el.setAttribute('height', this.image.height);
 
         var svgImage = document.createElementNS('http://www.w3.org/2000/svg', 'image');
         svgImage.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.image.src);

+ 102 - 88
main/inc/lib/javascript/hotspot/js/hotspot.js

@@ -504,6 +504,8 @@ window.HotspotQuestion = (function () {
         AdminHotspotsSVG.prototype.render = function () {
             this.el.setAttribute('version', '1.1');
             this.el.setAttribute('viewBox', '0 0 ' + this.image.width + ' ' + this.image.height);
+            this.el.setAttribute('width', this.image.width);
+            this.el.setAttribute('height', this.image.height);
 
             var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
             imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.image.src);
@@ -522,7 +524,7 @@ window.HotspotQuestion = (function () {
 
             this.el.appendChild(
                 hotspotSVG.render().el
-                );
+            );
 
             var hotspotSelect = new HotspotSelect(hotspotIndex, this.collection, hotspotSVG);
 
@@ -802,6 +804,8 @@ window.HotspotQuestion = (function () {
         UserHotspotsSVG.prototype.render = function () {
             this.el.setAttribute('version', '1.1');
             this.el.setAttribute('viewBox', '0 0 ' + this.image.width + ' ' + this.image.height);
+            this.el.setAttribute('width', this.image.width);
+            this.el.setAttribute('height', this.image.height);
 
             var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
             imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.image.src);
@@ -875,18 +879,20 @@ window.HotspotQuestion = (function () {
                     if (self.answersCollection.length === self.hotspotsCollection.length) {
                         $(config.selector).parent()
                             .find('#hotspot-messages-' + config.questionId + ' span:not(.fa)').text(
-                                lang.HotspotExerciseFinished
-                            );
+                            lang.HotspotExerciseFinished
+                        );
 
                         return;
                     }
 
                     $(config.selector).parent()
                         .find('#hotspot-messages-' + config.questionId + ' span:not(.fa)').text(
-                            lang.NextAnswer + ' ' + self.hotspotsCollection.get(
-                                self.answersCollection.length
-                            ).name
-                        );
+                        lang.NextAnswer +
+                            ' ' +
+                            self.hotspotsCollection
+                                .get(self.answersCollection.length)
+                                .name
+                    );
 
                     isMoving = false;
                 })
@@ -1016,6 +1022,8 @@ window.HotspotQuestion = (function () {
         SolutionHotspotsSVG.prototype.render = function () {
             this.el.setAttribute('version', '1.1');
             this.el.setAttribute('viewBox', '0 0 ' + this.image.width + ' ' + this.image.height);
+            this.el.setAttribute('width', this.image.width);
+            this.el.setAttribute('height', this.image.height);
 
             var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
             imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.image.src);
@@ -1103,13 +1111,13 @@ window.HotspotQuestion = (function () {
 
         var getPointOnImage = function (referenceElement, x, y) {
             var pointerPosition = {
-                left: x + window.scrollX,
-                top: y + window.scrollY
-            },
-            canvasOffset = {
-                x: referenceElement.getBoundingClientRect().left + window.scrollX,
-                y: referenceElement.getBoundingClientRect().top + window.scrollY
-            };
+                    left: x + window.scrollX,
+                    top: y + window.scrollY
+                },
+                canvasOffset = {
+                    x: referenceElement.getBoundingClientRect().left + window.scrollX,
+                    y: referenceElement.getBoundingClientRect().top + window.scrollY
+                };
 
             return {
                 x: Math.round(pointerPosition.left - canvasOffset.x),
@@ -1136,22 +1144,22 @@ window.HotspotQuestion = (function () {
 
         switch (config.for) {
             case 'admin':
-                xhrQuestion = $.getJSON(config.relPath+'exercise/hotspot_actionscript_admin.as.php', {
+                xhrQuestion = $.getJSON(config.relPath + 'exercise/hotspot_actionscript_admin.as.php', {
                     modifyAnswers: parseInt(config.questionId)
                 });
                 break;
 
             case 'user':
-                xhrQuestion = $.getJSON(config.relPath+'exercise/hotspot_actionscript.as.php', {
+                xhrQuestion = $.getJSON(config.relPath + 'exercise/hotspot_actionscript.as.php', {
                     modifyAnswers: parseInt(config.questionId),
                     exe_id: parseInt(config.exerciseId)
                 });
                 break;
 
             case 'solution':
-                //no break
+            //no break
             case 'preview':
-                xhrQuestion = $.getJSON(config.relPath+'exercise/hotspot_answers.as.php', {
+                xhrQuestion = $.getJSON(config.relPath + 'exercise/hotspot_answers.as.php', {
                     modifyAnswers: parseInt(config.questionId),
                     exe_id: parseInt(config.exerciseId)
                 });
@@ -1169,7 +1177,7 @@ window.HotspotQuestion = (function () {
                     break;
 
                 case 'solution':
-                    //no break
+                //no break
                 case 'preview':
                     startHotspotsSolution(questionInfo);
                     break;
@@ -1345,7 +1353,7 @@ window.DelineationQuestion = (function () {
             var type = this.model instanceof OarModel ? 'oar' : 'delineation';
 
             var template = '\n\
-                <div class="input-group hotspot-'  + this.model.id + ' active">\n\
+                <div class="input-group hotspot-' + this.model.id + ' active">\n\
                     <span class="input-group-addon" id="hotspot-' + this.model.id + '">\n\
                         <span class="fa fa-square fa-fw" data-hidden="true"></span>\n\
                         <span class="sr-only">' + (type === 'delineation' ? lang.Delineation : lang.Oar) + '</span>\n\
@@ -1428,11 +1436,13 @@ window.DelineationQuestion = (function () {
         this.render = function () {
             var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
             imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', image.src);
-            imageSvg.setAttributeNS(null, 'width', image.width);
-            imageSvg.setAttributeNS(null, 'height', image.height);
+            imageSvg.setAttribute('width', image.width);
+            imageSvg.setAttribute('height', image.height);
 
-            this.el.setAttributeNS(null, 'version', '1.1');
-            this.el.setAttributeNS(null, 'viewBox', '0 0 ' + image.width + ' ' + image.height);
+            this.el.setAttribute('version', '1.1');
+            this.el.setAttribute('viewBox', '0 0 ' + image.width + ' ' + image.height);
+            this.el.setAttribute('width', image.width);
+            this.el.setAttribute('height', image.height);
             this.el.appendChild(imageSvg);
 
             var isDrawing = false;
@@ -1449,37 +1459,37 @@ window.DelineationQuestion = (function () {
             });
 
             $el.on({
-                    'dragstart': function (e) {
-                        e.preventDefault();
-                    },
-                    'click': function (e) {
-                        e.preventDefault();
+                'dragstart': function (e) {
+                    e.preventDefault();
+                },
+                'click': function (e) {
+                    e.preventDefault();
 
-                        var currentPoint = getPointOnImage(self.el, e.clientX, e.clientY),
-                            points = [];
+                    var currentPoint = getPointOnImage(self.el, e.clientX, e.clientY),
+                        points = [];
 
-                        if (!isDrawing) {
-                            isDrawing = true;
-                        } else {
-                            points = self.collection.get(selectedPolygonIndex).get('points');
-                        }
+                    if (!isDrawing) {
+                        isDrawing = true;
+                    } else {
+                        points = self.collection.get(selectedPolygonIndex).get('points');
+                    }
 
-                        points.push([currentPoint.x, currentPoint.y]);
+                    points.push([currentPoint.x, currentPoint.y]);
 
-                        self.collection.get(selectedPolygonIndex).set('points', points);
-                    },
-                    'contextmenu': function (e) {
-                        e.preventDefault();
+                    self.collection.get(selectedPolygonIndex).set('points', points);
+                },
+                'contextmenu': function (e) {
+                    e.preventDefault();
 
-                        if (!contextMenu.el.parentNode) {
-                            $el.parent().append(contextMenu.render().el);
-                        }
+                    if (!contextMenu.el.parentNode) {
+                        $el.parent().append(contextMenu.render().el);
+                    }
 
-                        var currentPoint = getPointOnImage(self.el, e.clientX, e.clientY);
+                    var currentPoint = getPointOnImage(self.el, e.clientX, e.clientY);
 
-                        contextMenu.show(currentPoint.x, currentPoint.y);
-                    }
-                });
+                    contextMenu.show(currentPoint.x, currentPoint.y);
+                }
+            });
 
             return this;
         };
@@ -1548,11 +1558,13 @@ window.DelineationQuestion = (function () {
         this.render = function () {
             var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
             imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', image.src);
-            imageSvg.setAttributeNS(null, 'width', image.width);
-            imageSvg.setAttributeNS(null, 'height', image.height);
+            imageSvg.setAttribute('width', image.width);
+            imageSvg.setAttribute('height', image.height);
 
-            this.el.setAttributeNS(null, 'version', '1.1');
-            this.el.setAttributeNS(null, 'viewBox', '0 0 ' + image.width + ' ' + image.height);
+            this.el.setAttribute('version', '1.1');
+            this.el.setAttribute('viewBox', '0 0 ' + image.width + ' ' + image.height);
+            this.el.setAttribute('width', image.width);
+            this.el.setAttribute('height', image.height);
             this.el.appendChild(imageSvg);
 
             this.renderDelineation();
@@ -1585,37 +1597,37 @@ window.DelineationQuestion = (function () {
             });
 
             $el.on({
-                    'dragstart': function (e) {
-                        e.preventDefault();
-                    },
-                    'click': function (e) {
-                        e.preventDefault();
+                'dragstart': function (e) {
+                    e.preventDefault();
+                },
+                'click': function (e) {
+                    e.preventDefault();
 
-                        var currentPoint = getPointOnImage(self.el, e.clientX, e.clientY),
-                            points = [];
+                    var currentPoint = getPointOnImage(self.el, e.clientX, e.clientY),
+                        points = [];
 
-                        if (!isDrawing) {
-                            isDrawing = true;
-                        } else {
-                            points = self.model.get('points');
-                        }
+                    if (!isDrawing) {
+                        isDrawing = true;
+                    } else {
+                        points = self.model.get('points');
+                    }
 
-                        points.push([currentPoint.x, currentPoint.y]);
+                    points.push([currentPoint.x, currentPoint.y]);
 
-                        self.model.set('points', points);
-                    },
-                    'contextmenu': function (e) {
-                        e.preventDefault();
+                    self.model.set('points', points);
+                },
+                'contextmenu': function (e) {
+                    e.preventDefault();
 
-                        if (!contextMenu.el.parentNode) {
-                            $el.parent().append(contextMenu.render().el);
-                        }
+                    if (!contextMenu.el.parentNode) {
+                        $el.parent().append(contextMenu.render().el);
+                    }
 
-                        var currentPoint = getPointOnImage(self.el, e.clientX, e.clientY);
+                    var currentPoint = getPointOnImage(self.el, e.clientX, e.clientY);
 
-                        contextMenu.show(currentPoint.x, currentPoint.y);
-                    }
-                });
+                    contextMenu.show(currentPoint.x, currentPoint.y);
+                }
+            });
 
             return this;
         };
@@ -1673,11 +1685,13 @@ window.DelineationQuestion = (function () {
         this.render = function () {
             var imageSvg = document.createElementNS('http://www.w3.org/2000/svg', 'image');
             imageSvg.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', image.src);
-            imageSvg.setAttributeNS(null, 'width', image.width);
-            imageSvg.setAttributeNS(null, 'height', image.height);
+            imageSvg.setAttribute('width', image.width);
+            imageSvg.setAttribute('height', image.height);
 
-            this.el.setAttributeNS(null, 'version', '1.1');
-            this.el.setAttributeNS(null, 'viewBox', '0 0 ' + image.width + ' ' + image.height);
+            this.el.setAttribute('version', '1.1');
+            this.el.setAttribute('viewBox', '0 0 ' + image.width + ' ' + image.height);
+            this.el.setAttribute('width', image.width);
+            this.el.setAttribute('height', image.height);
             this.el.appendChild(imageSvg);
         };
 
@@ -1751,28 +1765,28 @@ window.DelineationQuestion = (function () {
             return;
         }
 
-    $(config.selector).html('\n\
-        <span class="fa fa-spinner fa-spin fa-3x" aria-hidden="hidden"></span>\n\
-        <span class="sr-only">Loading</span>\n\
-    ');
+        $(config.selector).html('\n\
+            <span class="fa fa-spinner fa-spin fa-3x" aria-hidden="hidden"></span>\n\
+            <span class="sr-only">Loading</span>\n\
+        ');
 
         var xhrQuestion = null;
 
         switch (config.for) {
             case 'admin':
-                xhrQuestion = $.getJSON(config.relPath+'exercise/hotspot_actionscript_admin.as.php', {
+                xhrQuestion = $.getJSON(config.relPath + 'exercise/hotspot_actionscript_admin.as.php', {
                     modifyAnswers: parseInt(config.questionId)
                 });
                 break;
             case 'user':
-                xhrQuestion = $.getJSON(config.relPath+'exercise/hotspot_actionscript.as.php', {
+                xhrQuestion = $.getJSON(config.relPath + 'exercise/hotspot_actionscript.as.php', {
                     modifyAnswers: parseInt(config.questionId)
                 });
                 break;
             case 'solution':
-                //no break
+            //no break
             case 'preview':
-                xhrQuestion = $.getJSON(config.relPath+'exercise/hotspot_answers.as.php', {
+                xhrQuestion = $.getJSON(config.relPath + 'exercise/hotspot_answers.as.php', {
                     modifyAnswers: parseInt(config.questionId),
                     exe_id: parseInt(config.exerciseId)
                 });

File diff suppressed because it is too large
+ 233 - 180
main/lp/learnpath.class.php


+ 1 - 0
main/lp/lp_view.php

@@ -545,6 +545,7 @@ $template->assign(
 
 $template->assign('lp_author', $_SESSION['oLP']->get_author());
 $template->assign('lp_mode', $_SESSION['oLP']->mode);
+$template->assign('title_course', $_SESSION['oLP']->course_info['title']);
 $template->assign('lp_title_scorm', $_SESSION['oLP']->name);
 $template->assign('lp_id', $_SESSION['oLP']->lp_id);
 $template->assign('lp_current_item_id', $_SESSION['oLP']->get_current_item_id());

+ 2 - 0
main/template/rainbow/layout/header.js.tpl

@@ -1,3 +1,4 @@
+<script src="{{ _p.web_css_theme }}js/jquery.checkradios.min.js"></script>
 <script>
 {% if constant('CHAMILO_LOAD_WYSIWYG') %}
     // External plugins not part of the default Ckeditor package.
@@ -91,6 +92,7 @@ function doneResizing() {
 };
 
 $(document).ready(function() {
+    $('.checkradios').checkradios();
     $("#open-view-list").click(function(){
         $("#student-list-work").fadeIn(300);
     });

+ 71 - 62
main/template/rainbow/learnpath/scorm_list.tpl

@@ -1,73 +1,82 @@
 {% if data_list is not empty %}
-<div id="learning_path_toc" class="scorm-list">
-    <div class="scorm-body">
-        <div id="inner_lp_toc" class="inner_lp_toc scrollbar-light">
-            {% for item in data_list %}
-                <div id="toc_{{ item.id }}" class="{{ item.class }}">
-                    {% if item.type == 'dir' %}
-                        <div class="section {{ item.css_level }}" title="{{ item.description }}">
-                            {{ item.title }}
-                        </div>
-                    {% else %}
-                        <div class="item {{ item.css_level }}" title="{{ item.description }}">
-                            <a name="atoc_{{ item.id }}"></a>
-                            <a class="items-list" href="#" onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;" >
+    <div id="learning_path_toc" class="scorm-list">
+        <div class="scorm-body">
+            <div id="inner_lp_toc" class="inner_lp_toc scrollbar-light">
+                {% for item in data_list %}
+                    <div id="toc_{{ item.id }}" class="{{ item.class }}">
+                        {% if item.type == 'dir' %}
+                            <div class="section {{ item.css_level }}" title="{{ item.description }}">
                                 {{ item.title }}
-                            </a>
-                        </div>
-                    {% endif %}
-                </div>
-            {% endfor %}
+                            </div>
+                        {% else %}
+                            <div class="item {{ item.css_level }}" title="{{ item.description }}">
+                                <a name="atoc_{{ item.id }}"></a>
+                                <a class="items-list" href="#"
+                                   onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;">
+                                    {{ item.title }}
+                                </a>
+                            </div>
+                        {% endif %}
+                    </div>
+                {% endfor %}
+            </div>
         </div>
     </div>
-</div>
 {% endif %}
 {% if data_panel is not empty %}
-<div id="learning_path_toc" class="scorm-list">
-<div class="panel-group" id="scorm-panel" role="tablist" aria-multiselectable="true">
-  {% for item in data_panel.are_parents %}
-  <div class="panel panel-default">
-    <div class="status-heading">
-        <div class="panel-heading {{ item.current }}" role="tab" id="heading-{{ item.id }}">
-            <a role="button" data-toggle="collapse" data-parent="#scorm-panel" href="#collapse-{{ item.id }}" aria-expanded="true" aria-controls="collapse-{{ item.id }}">
-              {{ item.title }}
-            </a>
-        </div>
-    </div>
-    <div id="collapse-{{ item.id }}" class="panel-collapse collapse {{ item.parent_current }}" role="tabpanel" aria-labelledby="heading-{{ item.id }}">
-      <div class="panel-body">
-            <ul class="section-list">
-                {% set  counter = 0 %}
-                {% set  final = item.children|length %}
-            {% for subitem in item.children %}
-                {% set  counter = counter + 1 %}
-                <li id="toc_{{ subitem.id }}" class="{{ subitem.class }} {{ counter == final ? 'final':'' }}">
-                    <div class="sub-item type-{{ subitem.type }}">
-                        <a name="atoc_{{ subitem.id }}"></a>
-                        <a class="item-action" href="#" onclick="switch_item('{{ subitem.current_id }}','{{ subitem.id }}'); return false;" >
-                            {{ subitem.title }}
-                        </a>
+    <div id="learning_path_toc" class="scorm-list">
+        <div class="panel-group" id="scorm-panel" role="tablist" aria-multiselectable="true">
+            {% for item in data_panel.are_parents %}
+                <div class="panel panel-default" data-lp-id="{{ item.id }}"
+                    {{ item.parent ? 'data-lp-parent="' ~ item.parent ~ '"' : '' }}>
+                    <div class="status-heading">
+                        <div class="panel-heading {{ item.current }}" role="tab" id="heading-{{ item.id }}">
+                            <a role="button" data-toggle="collapse"
+                               data-parent="#scorm-panel{{ item.parent ? '-' ~ item.parent : '' }}"
+                               href="#collapse-{{ item.id }}" aria-expanded="true"
+                               aria-controls="collapse-{{ item.id }}">
+                                {{ item.title }}
+                            </a>
+                        </div>
+                    </div>
+                    <div id="collapse-{{ item.id }}" class="panel-collapse collapse {{ item.parent_current }}"
+                         role="tabpanel" aria-labelledby="heading-{{ item.id }}">
+                        <div class="panel-body">
+                            <ul class="section-list">
+                                {% set  counter = 0 %}
+                                {% set  final = item.children|length %}
+                                {% for subitem in item.children %}
+                                    {% set  counter = counter + 1 %}
+                                    <li id="toc_{{ subitem.id }}"
+                                        class="{{ subitem.class }} {{ counter == final ? 'final':'' }}">
+                                        <div class="sub-item type-{{ subitem.type }}">
+                                            <a name="atoc_{{ subitem.id }}"></a>
+                                            <a class="item-action" href="#"
+                                               onclick="switch_item('{{ subitem.current_id }}','{{ subitem.id }}'); return false;">
+                                                {{ subitem.title }}
+                                            </a>
+                                        </div>
+                                    </li>
+
+                                {% endfor %}
+                            </ul>
+                        </div>
                     </div>
-                </li>
-                
+                </div>
             {% endfor %}
+            <ul class="section-list" style="margin-top: 5px;">
+                {% for item in data_panel.not_parents %}
+                    <li id="toc_{{ item.id }}" class="{{ item.class }}">
+                        <div class="sub-item type-{{ item.type }}">
+                            <a name="atoc_{{ item.id }}"></a>
+                            <a class="item-action" href="#"
+                               onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;">
+                                {{ item.title }}
+                            </a>
+                        </div>
+                    </li>
+                {% endfor %}
             </ul>
-      </div>
+        </div>
     </div>
-  </div>
-  {% endfor %}
-    <ul class="section-list" style="margin-top: 5px;">
-        {% for item in data_panel.not_parents %}
-            <li id="toc_{{ item.id }}" class="{{ item.class }}">
-                <div class="sub-item type-{{ item.type }}">
-                    <a name="atoc_{{ item.id }}"></a>
-                    <a class="item-action" href="#" onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;" >
-                            {{ item.title }}
-                    </a>
-                </div>
-            </li>
-        {% endfor %}
-    </ul>
-</div>
-</div>
 {% endif %}

+ 165 - 121
main/template/rainbow/learnpath/view.tpl

@@ -1,149 +1,161 @@
-<div id="learning_path_main" class="{{ is_allowed_to_edit ? 'lp-view-include-breadcrumb' }} {{ lp_mode == 'embedframe' ? 'lp-view-collapsed' }}">
+<div id="learning_path_main"
+     class="{{ is_allowed_to_edit ? 'lp-view-include-breadcrumb' }} {{ lp_mode == 'embedframe' ? 'lp-view-collapsed' }}">
     {% if is_allowed_to_edit %}
         <div id="learning_path_breadcrumb_zone" class="hidden-xs">
             {{ breadcrumb }}
         </div>
     {% endif %}
-            <div id="learning_path_left_zone" class="sidebar-scorm">
-                <div class="lp-view-zone-container">
-                    <div id="scorm-info" class="scorm-header">
-                        <div id="panel-scorm" class="panel-body">
-                                <h1 class="title">{{ lp_title_scorm }}</h1>
-                                {% if show_audio_player %}
-                                    <div id="lp_media_file" class="audio-scorm">
-                                        {{ media_player }}
-                                    </div>
-                                {% endif %}
-                                {% if gamification_mode == 1 %}
-                                    <!--- gamification -->
-                                    <div id="scorm-gamification">
-                                        <div class="row">
-                                            <div class="col-xs-6">
-                                                {% if gamification_stars > 0 %}
-                                                    {% for i in 1..gamification_stars %}
-                                                        <em class="fa fa-star level"></em>
-                                                    {% endfor %}
-                                                {% endif %}
-
-                                                {% if gamification_stars < 4 %}
-                                                    {% for i in 1..4 - gamification_stars %}
-                                                        <em class="fa fa-star"></em>
-                                                    {% endfor %}
-                                                {% endif %}
-                                            </div>
-                                            <div class="col-xs-6 text-right">
-                                                {{ "XPoints"|get_lang|format(gamification_points) }}
-                                            </div>
-                                        </div>
-                                        <div class="row">
-                                            <div class="col-xs-12 navegation-bar">
-                                                <div id="progress_bar">
-                                                    {{ progress_bar }}
-                                                </div>
-                                            </div>
-                                        </div>
-                                    </div>
-                                   <!--- end gamification -->
-                                {% else %}
+    <div id="learning_path_left_zone" class="sidebar-scorm">
+        <div class="lp-view-zone-container">
+            <div id="scorm-info" class="scorm-header">
+                <div id="panel-scorm" class="panel-body">
+                    <h1 class="title">{{ title_course }}</h1>
+                    {% if show_audio_player %}
+                        <div id="lp_media_file" class="audio-scorm">
+                            {{ media_player }}
+                        </div>
+                    {% endif %}
+                    {% if gamification_mode == 1 %}
+                        <!--- gamification -->
+                        <div id="scorm-gamification">
+                            <div class="row">
+                                <div class="col-xs-6">
+                                    {% if gamification_stars > 0 %}
+                                        {% for i in 1..gamification_stars %}
+                                            <em class="fa fa-star level"></em>
+                                        {% endfor %}
+                                    {% endif %}
+
+                                    {% if gamification_stars < 4 %}
+                                        {% for i in 1..4 - gamification_stars %}
+                                            <em class="fa fa-star"></em>
+                                        {% endfor %}
+                                    {% endif %}
+                                </div>
+                                <div class="col-xs-6 text-right">
+                                    {{ "XPoints"|get_lang|format(gamification_points) }}
+                                </div>
+                            </div>
+                            <div class="row">
+                                <div class="col-xs-12 navegation-bar">
                                     <div id="progress_bar">
                                         {{ progress_bar }}
                                     </div>
-                                {% endif %}
-                                <div class="visible-xs-block movil-toolbar">
-                                    <ul class="btn-movil">
-                                        <li>
-                                            <a href="{{ button_home_url }}" class="icon-toolbar" target="_self" onclick="javascript: window.parent.API.save_asset();">
-                                                <em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
-                                            </a>
-                                        </li>
-                                        <li>
-                                            <button type="button" id="lp-view-expand-button" class="icon-toolbar expand visible-xs-block">
-                                                <span class="fa fa-expand" aria-hidden="true"></span>
-                                            </button>
-                                        </li>
-                                    </ul>
                                 </div>
-                                {{ teacher_toc_buttons }}
+                            </div>
                         </div>
+                        <!--- end gamification -->
+                    {% else %}
+                        <div id="progress_bar">
+                            {{ progress_bar }}
+                        </div>
+                    {% endif %}
+                    <div class="visible-xs-block movil-toolbar">
+                        <ul class="btn-movil">
+                            <li>
+                                <a href="{{ button_home_url }}" class="icon-toolbar" target="_self"
+                                   onclick="javascript: window.parent.API.save_asset();">
+                                    <em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
+                                </a>
+                            </li>
+                            <li>
+                                <button type="button" id="lp-view-expand-button"
+                                        class="icon-toolbar expand visible-xs-block">
+                                    <span class="fa fa-expand" aria-hidden="true"></span>
+                                </button>
+                            </li>
+                        </ul>
                     </div>
+                    {{ teacher_toc_buttons }}
+                </div>
+            </div>
 
-                {# TOC layout #}
+            {# TOC layout #}
 
-                <div id="toc_id" class="scorm-body" name="toc_name">
-                    {% include template ~ '/learnpath/scorm_list.tpl' %}
-                </div>
-                {# end TOC layout #}
-                </div>
+            <div id="toc_id" class="scorm-body" name="toc_name">
+                {% include template ~ '/learnpath/scorm_list.tpl' %}
             </div>
-            {# end left zone #}
+            {# end TOC layout #}
+        </div>
+    </div>
+    {# end left zone #}
 
-            {# <div id="hide_bar" class="scorm-toggle" style="display:inline-block; width: 25px; height: 1000px;"></div> #}
+    {# <div id="hide_bar" class="scorm-toggle" style="display:inline-block; width: 25px; height: 1000px;"></div> #}
 
-            {# right zone #}
-            <div id="learning_path_right_zone" class="content-scorm">
-                <div class="lp-view-zone-container">
-                    <div class="title-learnpath pull-left">
-                        <h4>{{ lp_title_scorm }}</h4>
-                    </div>
-                    <div id="lp_navigation_elem" class="navegation-bar pull-right text-right">
-                        <a href="#" id="lp-view-expand-toggle" class="icon-toolbar expand" role="button">
-                            {% if lp_mode == 'embedframe' %}
-                                <span class="fa fa-compress" aria-hidden="true"></span>
-                                <span class="sr-only">{{ 'Expand'|get_lang }}</span>
-                            {% else %}
-                                <span class="fa fa-expand" aria-hidden="true"></span>
-                                <span class="sr-only">{{ 'Expand'|get_lang }}</span>
-                            {% endif %}
+    {# right zone #}
+    <div id="learning_path_right_zone" class="content-scorm">
+        <div class="lp-view-zone-container">
+            <div class="title-learnpath pull-left">
+                <h4>{{ lp_title_scorm }}</h4>
+            </div>
+            <div id="lp_navigation_elem" class="navegation-bar pull-right text-right">
+                <a href="#" id="lp-view-expand-toggle" class="icon-toolbar expand" role="button">
+                    {% if lp_mode == 'embedframe' %}
+                        <span class="fa fa-compress" aria-hidden="true"></span>
+                        <span class="sr-only">{{ 'Expand'|get_lang }}</span>
+                    {% else %}
+                        <span class="fa fa-expand" aria-hidden="true"></span>
+                        <span class="sr-only">{{ 'Expand'|get_lang }}</span>
+                    {% endif %}
+                </a>
+                <a id="home-course" href="{{ button_home_url }}" class="icon-toolbar" target="_self"
+                   onclick="javascript: window.parent.API.save_asset();">
+                    <em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
+                </a>
+                {{ navigation_bar }}
+            </div>
+
+            <div class="lp-view-tabs">
+                <ul id="navTabs" class="nav nav-tabs" role="tablist">
+                    <li role="presentation" class="active">
+                        <a href="#lp-view-content" aria-controls="lp-view-content" role="tab" data-toggle="tab">
+                            <span class="fa fa-book fa-2x fa-fw" aria-hidden="true"></span><span
+                                    class="sr-only">{{ 'Lesson'|get_lang }}</span>
                         </a>
-                        <a id="home-course" href="{{ button_home_url }}" class="icon-toolbar" target="_self" onclick="javascript: window.parent.API.save_asset();">
-                            <em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
+                    </li>
+                    <li role="presentation">
+                        <a href="#lp-view-forum" aria-controls="lp-view-forum" role="tab" data-toggle="tab">
+                            <span class="fa fa-commenting-o fa-2x fa-fw" aria-hidden="true"></span><span
+                                    class="sr-only">{{ 'Forum'|get_lang }}</span>
                         </a>
-                        {{ navigation_bar }}
-                    </div>
+                    </li>
+                </ul>
 
-                    <div class="lp-view-tabs">
-                        <ul id="navTabs" class="nav nav-tabs" role="tablist">
-                            <li role="presentation" class="active">
-                                <a href="#lp-view-content" aria-controls="lp-view-content" role="tab" data-toggle="tab">
-                                    <span class="fa fa-book fa-2x fa-fw" aria-hidden="true"></span><span class="sr-only">{{ 'Lesson'|get_lang }}</span>
-                                </a>
-                            </li>
-                            <li role="presentation">
-                                <a href="#lp-view-forum" aria-controls="lp-view-forum" role="tab" data-toggle="tab">
-                                    <span class="fa fa-commenting-o fa-2x fa-fw" aria-hidden="true"></span><span class="sr-only">{{ 'Forum'|get_lang }}</span>
-                                </a>
-                            </li>
-                        </ul>
-
-                        <div class="tab-content">
-                            <div role="tabpanel" class="tab-pane active" id="lp-view-content">
-                                <div id="wrapper-iframe" style="width:100%; height:100%">
-                                {% if lp_mode == 'fullscreen' %}
-                                    <iframe id="content_id_blank" name="content_name_blank" src="blank.php" style="width:100%; height:100%" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
-                                {% else %}
-                                    <iframe id="content_id" name="content_name" src="{{ iframe_src }}" style="width:100%; height:100%" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
-                                {% endif %}
-                                </div>
-                            </div>
-                            <div role="tabpanel" class="tab-pane" id="lp-view-forum">
-
-                            </div>
+                <div class="tab-content">
+                    <div role="tabpanel" class="tab-pane active" id="lp-view-content">
+                        <div id="wrapper-iframe" style="width:100%; height:100%">
+                            {% if lp_mode == 'fullscreen' %}
+                                <iframe id="content_id_blank" name="content_name_blank" src="blank.php"
+                                        style="width:100%; height:100%" border="0" frameborder="0"
+                                        allowfullscreen="true" webkitallowfullscreen="true"
+                                        mozallowfullscreen="true"></iframe>
+                            {% else %}
+                                <iframe id="content_id" name="content_name" src="{{ iframe_src }}"
+                                        style="width:100%; height:100%" border="0" frameborder="0"
+                                        allowfullscreen="true" webkitallowfullscreen="true"
+                                        mozallowfullscreen="true"></iframe>
+                            {% endif %}
                         </div>
                     </div>
+                    <div role="tabpanel" class="tab-pane" id="lp-view-forum">
+
+                    </div>
                 </div>
             </div>
-            {# end right Zone #}
+        </div>
+    </div>
+    {# end right Zone #}
 </div>
 {% if data_panel is not empty %}
-<script type="text/javascript">
-    $('#scorm-panel .panel .status-heading').on("click", function() {
-        $(this).siblings().find(".panel-heading").removeClass("on");
-        $(this).find(".panel-heading").toggleClass("on");
-    });
-    $('.section-list .list-item').click( function() {
-        $(this).addClass('active').siblings().removeClass('active');
-    });
-</script>
+    <script type="text/javascript">
+        $('#scorm-panel .panel .status-heading').on("click", function () {
+            $(this).siblings().find(".panel-heading").removeClass("on");
+            $(this).find(".panel-heading").toggleClass("on");
+        });
+        $('.section-list .list-item').click(function () {
+            $(this).addClass('active').siblings().removeClass('active');
+        });
+    </script>
 {% endif %}
 <script>
     (function () {
@@ -154,10 +166,42 @@
                 $('#learning_path_toc').css({
                     top: scormInfoHeight
                 });
+            },
+            groupToc: function () {
+                $('[data-lp-id]:not([data-lp-parent])').each(function () {
+                    var $self = $(this),
+                        id = $self.data('lp-id') || 0;
+
+                    if (!id) {
+                        return;
+                    }
+
+                    $self.find('.panel-collapse .panel-body').append('<div id="scorm-panel-' + id + '" class="panel-parent">');
+                });
+
+                $('[data-lp-parent]').each(function () {
+                    var $panel = $(this),
+                        parentId = $panel.data('lp-parent') || 0,
+                        id = $panel.data('lp-id') || 0;
+
+                    if (!parentId) {
+                        return;
+                    }
+
+                    $panel.appendTo('#scorm-panel-' + parentId);
+
+                    if ($('#collapse-' + id).is('.in')) {
+                        $('#collapse-' + parentId).collapse('toggle');
+                    }
+                });
             }
         };
 
         $(document).on('ready', function () {
+            {% if data_panel %}
+            LPViewUtils.groupToc();
+            {% endif %}
+
             if (/iPhone|iPod|iPad/.test(navigator.userAgent)) {
               $('#wrapper-iframe').css({
                 'overflow' : 'auto',

Some files were not shown because too many files changed in this diff