Fixing learning paths with audio - refs BT#12608

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent 6098653c0d
commit 683d68afee
  1. 6
      main/lp/learnpath.class.php
  2. 9
      main/lp/lp_nav.php
  3. 2
      main/lp/lp_view.php
  4. 4
      main/lp/scorm_api.php

@ -2210,7 +2210,7 @@ class learnpath
* Returns the HTML necessary to print a mediaplayer block inside a page
* @return string The mediaplayer HTML
*/
public function get_mediaplayer($autostart = 'true')
public function get_mediaplayer($lpItemId, $autostart = 'true')
{
$course_id = api_get_course_int_id();
$_course = api_get_course_info();
@ -2222,7 +2222,7 @@ class learnpath
INNER JOIN $tbl_lp_item_view as lp_view
ON (lp.id = lp_view.lp_item_id AND lp.c_id = lp_view.c_id)
WHERE
lp.id = '".$_SESSION['oLP']->current."' AND
lp.id = '$lpItemId' AND
lp.c_id = $course_id AND
lp_view.c_id = $course_id";
$result = Database::query($sql);
@ -2241,7 +2241,7 @@ class learnpath
if ($type_quiz) {
if ($_SESSION['oLP']->prevent_reinit == 1) {
$row['status'] === 'completed' ? $autostart_audio = 'false' : $autostart_audio = 'true';
$autostart_audio = $row['status'] === 'completed' ? 'false' : 'true';
} else {
$autostart_audio = $autostart;
}

@ -16,6 +16,13 @@ $htmlHeadXtra[] = '<script>
var chamilo_xajax_handler = window.parent.oxajax;
</script>';
$lpItemId = isset($_REQUEST['lp_item']) ? intval($_REQUEST['lp_item']) : 0;
if (!$lpItemId) {
echo '';
exit;
}
$progress_bar = '';
$navigation_bar = '';
$display_mode = '';
@ -44,7 +51,7 @@ if ($myLP) {
$progress_bar = $myLP->getProgressBar();
$navigation_bar = $myLP->get_navigation_bar();
$mediaplayer = $myLP->get_mediaplayer($autostart);
$mediaplayer = $myLP->get_mediaplayer($lpItemId, $autostart);
}
session_write_close();
?>

@ -382,7 +382,7 @@ if (!api_is_invitee()) {
}
$navigation_bar = $_SESSION['oLP']->get_navigation_bar();
$navigation_bar_bottom = $_SESSION['oLP']->get_navigation_bar("control-bottom", "display:none");
$mediaplayer = $_SESSION['oLP']->get_mediaplayer($autostart);
$mediaplayer = $_SESSION['oLP']->get_mediaplayer($_SESSION['oLP']->current, $autostart);
$tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
$show_audioplayer = false;

@ -1649,7 +1649,9 @@ function switch_item(current_item, next_item){
$.ajax({
type: "POST",
url: "lp_nav.php",
data: "",
data: {
lp_item: next_item
},
beforeSend: function() {
$.each($('audio'), function () {
var player = new MediaElementPlayer($(this));

Loading…
Cancel
Save