Fixing glossary tool. There is no more necessary to modified an html file that is upload by an user when using the glossary tooltip funcionality.

skala
Julio Montoya 15 years ago
parent 6272aa23c1
commit a62267b462
  1. 106
      main/document/showinframes.php
  2. 66
      main/exercice/exercice_submit.php
  3. 38
      main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_automatic.js
  4. 19
      main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_manual.js
  5. 3
      main/inc/lib/fckeditor/fcktemplates.xml.php
  6. 270
      main/inc/lib/javascript/jquery.frameready.js
  7. 3
      main/inc/lib/javascript/jquery.highlight.js
  8. 12
      main/newscorm/lp_stats.php
  9. 69
      main/newscorm/lp_view.php
  10. 44
      main/newscorm/scorm_api.php

@ -100,21 +100,95 @@ $path_info= pathinfo($file_url_sys);
<title>
<?php echo $browser_display_title;?>
</title>
</head>
<frameset rows="<?php echo $frameheight; ?>,*" border="0" frameborder="no" >
<frame name="top" scrolling="no" noresize target="contents" src="headerpage.php?file=<?php echo $file.'&amp;'.api_get_cidreq(); ?>" />
<?php
if (file_exists($file_url_sys)) {
echo '<frame name="main" id="framemain" src="'.$file_url_web.'?'.api_get_cidreq().'&rand='.mt_rand(1,10000).'" />';
} else {
echo '<frame name="main" id="framemain" src=showinframes.php?nopages=1 />';
<script language="javascript" src="<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"></script>
<script language="javascript" src="<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.frameready.js"></script>
<script type="text/javascript">
// Fixes the content height of the frame
var leftZoneHeightOccupied = 0;
var rightZoneHeightOccupied = 0;
var initialLeftZoneHeight = 0;
var initialRightZoneHeight = 0;
var updateContentHeight = function() {
winHeight = (window.innerHeight != undefined ? window.innerHeight : document.documentElement.clientHeight);
newLeftZoneHeight = winHeight - leftZoneHeightOccupied;
newRightZoneHeight = winHeight - rightZoneHeightOccupied;
if (newLeftZoneHeight <= initialLeftZoneHeight) {
newLeftZoneHeight = initialLeftZoneHeight;
newRightZoneHeight = newLeftZoneHeight + leftZoneHeightOccupied - rightZoneHeightOccupied;
}
if (newRightZoneHeight <= initialRightZoneHeight) {
newRightZoneHeight = initialRightZoneHeight;
newLeftZoneHeight = newRightZoneHeight + rightZoneHeightOccupied - leftZoneHeightOccupied;
}
?>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.<br/>
We suggest you try Mozilla, Firefox, Safari, Opera, or other browsers updated this millenium.</p>
</body>
</noframes>
<frame src="#"></frameset>
document.getElementById('mainFrame').style.height = newRightZoneHeight + 'px';
if (document.body.clientHeight > winHeight) {
document.body.style.overflow = 'auto';
} else {
document.body.style.overflow = 'hidden';
}
};
</script>
<?php
if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
?>
<script type="text/javascript">
$(document).ready(function() {
updateContentHeight();
$.frameReady(function(){
// $("<div>I am a div courses</div>").prependTo("body");
}, "top.mainFrame",
{ load: [
{type:"script", id:"_fr1", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
{type:"script", id:"_fr2", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
{type:"script", id:"_fr3", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_manual.js"}
]
}
);
window.onresize = updateContentHeight;
}
);
</script>
<?php
} elseif(api_get_setting('show_glossary_in_documents') == 'isautomatic') {
?>
<script type="text/javascript">
$(document).ready(function() {
updateContentHeight();
window.onresize = updateContentHeight;
$.frameReady(function(){
// $("<div>I am a div courses</div>").prependTo("body");
}, "top.mainFrame",
{ load: [
{type:"script", id:"_fr1", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
{type:"script", id:"_fr2", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
{type:"script", id:"_fr3", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"}
]
}
);
}
);
</script>
<?php
}
?>
</head>
<body>
<iframe border="0" frameborder="0" scrolling="no" style="width:100%;" src="headerpage.php?file=<?php echo $file.'&amp;'.api_get_cidreq(); ?>"> </iframe>
<?php
if (file_exists($file_url_sys)) {
echo '<iframe border="0" frameborder="0" scrolling="no" height="100%" style="width:100%;" id="mainFrame" name="mainFrame" src="'.$file_url_web.'?'.api_get_cidreq().'&rand='.mt_rand(1,10000).'"></iframe>';
} else {
echo '<frame name="mainFrame" id="mainFrame" src=showinframes.php?nopages=1 />';
}
?>
</body>
</html>

@ -1,29 +1,5 @@
<?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
==============================================================================
*/
/* For licensing terms, see /dokeos_license.txt */
/**
* Exercise submission
@ -71,9 +47,10 @@ $this_section = SECTION_COURSES;
$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/jquery.corners.min.js" type="text/javascript"></script>';
if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/glossary.js" type="text/javascript" language="javascript"></script>'; //Glossary
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/glossary.js" type="text/javascript" language="javascript"></script>'; //Glossary
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>';
}
//This library is necessary for the time control feature
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.epiclock.min.js" type="text/javascript" language="javascript"></script>'; //jQuery
@ -147,6 +124,7 @@ $error = '';
if (!isset ($exerciseType)) {
$exe_start_date = time();
$_SESSION['exercice_start_date'] = $exe_start_date;
error_log($_SESSION['exercice_start_date']);
}
// if the user has clicked on the "Cancel" button
if ($buttonCancel) {
@ -1209,25 +1187,25 @@ echo '</div>';
if ($_configuration['live_exercise_tracking'] == true && $exerciseFeedbackType != 1) {
//if($questionNum < 2){
if ($table_recorded_not_exist) { //$table_recorded_not_exist
if ($exercise_row['expired_time'] != 0) {
$sql_fields = "expired_time_control, ";
$sql_fields_values = "'"."$clock_expired_time"."',";
} else {
$sql_fields = "";
$sql_fields_values = "";
}
if ($exercise_row['expired_time'] != 0) {
$sql_fields = "expired_time_control, ";
$sql_fields_values = "'"."$clock_expired_time"."',";
} else {
$sql_fields = "";
$sql_fields_values = "";
} error_log($exerciseType);
if ($exerciseType == 2) {
$sql = "INSERT INTO $stat_table($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,data_tracking,start_date,orig_lp_id,orig_lp_item_id)
VALUES($sql_fields_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)";
Database::query($sql, __FILE__, __LINE__);
$sql = "INSERT INTO $stat_table($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,data_tracking,start_date,orig_lp_id,orig_lp_item_id)
VALUES($sql_fields_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)";
error_log($sql);
Database::query($sql, __FILE__, __LINE__);
} else {
$sql = "INSERT INTO $stat_table ($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,start_date,orig_lp_id,orig_lp_item_id)
VALUES($sql_fields_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)";
Database::query($sql, __FILE__, __LINE__);
$sql = "INSERT INTO $stat_table ($sql_fields exe_exo_id,exe_user_id,exe_cours_id,status,session_id,start_date,orig_lp_id,orig_lp_item_id)
VALUES($sql_fields_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)";
error_log($sql);
Database::query($sql, __FILE__, __LINE__);
}
}
}

@ -1,14 +1,24 @@
$(document).ready(function() {
$(window).load(function () {
/**
Makes posible to load glossary items from the Glossary Tool
This library will be loaded in:
document/showinframes.php
newscorm/lp_view.php
newscorm/scorm_api.php
*/
/*$(document).ready(function() {
$(window).load(function() {
*/
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) {
},
beforeSend: function(content_object) {},
type: "POST",
url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php",
data: "glossary_data=true",
@ -16,13 +26,14 @@ $(document).ready(function() {
if (datas.length==0) {
return false;
}
data_terms=datas.split("[|.|_|.|-|.|]");
// glossary terms
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 real_code = specific_terms[0];
var real_term = specific_terms[1]; // glossary term
var real_code = specific_terms[0]; // glossary id
complex_array[real_code] = real_term;
cp_complex_array[real_code] = real_term;
}
@ -44,15 +55,16 @@ $(document).ready(function() {
}
}
}
//alert(n + ' ' + my_index);
$('body').removeHighlight().highlight(n,my_index)
}
}
var complex_array = new Array();
//mouse over event
$("body .glossary-ajax").mouseover(function(){
random_id=Math.round(Math.random()*100);
$("body .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;
$(this).append("<div id="+div_show_id+" ><div id="+div_content_id+">&nbsp;</div></div>");
@ -60,6 +72,7 @@ $(document).ready(function() {
$("div#"+div_content_id).attr("style","background-color:#F2F2F2;color:#0B3861;margin-left:8px;margin-right:8px;margin-top:5px;margin-bottom:5px;");
notebook_id=$(this).attr("name");
data_notebook=notebook_id.split("link");
my_glossary_id=data_notebook[1];
$.ajax({
contentType: "application/x-www-form-urlencoded",
@ -85,5 +98,6 @@ $(document).ready(function() {
}
});
/*
});
});
});*/

@ -1,5 +1,15 @@
$(document).ready(function() {
$(window).load(function () {
/**
Makes posible to load glossary items from the Glossary Tool
This library will be loaded in:
document/showinframes.php
newscorm/lp_view.php
newscorm/scorm_api.php
*/
//$(document).ready(function() {
// $(window).load(function () {
my_protocol = location.protocol;
my_pathname=location.pathname;
work_path = my_pathname.substr(0,my_pathname.indexOf('/courses/'));
@ -29,5 +39,6 @@ $(document).ready(function() {
div_show_id=current_element.find("div").attr("id");
$("div#"+div_show_id).remove();
});
});
});
// });
//});

@ -19,6 +19,7 @@ $css = loadCSS(api_get_setting('stylesheets'));
// load libreries js
/* This libraries will be loaded in the showinframes.php file
$js = '';
if (api_get_setting('show_glossary_in_documents') != 'none') {
$js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js"/>'.PHP_EOL;
@ -29,7 +30,7 @@ if (api_get_setting('show_glossary_in_documents') != 'none') {
$js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"/>';
}
}
*/
// setting some paths
$img_dir = api_get_path(REL_CODE_PATH).'img/';
$default_course_dir = api_get_path(REL_CODE_PATH).'default_course_document/';

@ -0,0 +1,270 @@
/****
*
* frameReady: Remote function calling for jQuery
*
* Version 1.2.0
*
* Copyright (c) 2007 Daemach (John Wilson) <daemach@gmail.com>, http://ideamill.synaptrixgroup.com
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* Credit John Resig and his excellent book for the ready function concepts.
*
* ============================================================================================
* Usage: $.frameReady(function (function),target (string)[,options (map/object)]);
*
* Function: (function/required) An anonymous function to be run within the target frame.
*
* Target: (string/required) The target frame. This must be a window object name (in quotes),
* so work from the top down. If you have 3 frames named topFrame, navFrame, mainFrame, and
* an iframe inside of mainframe named iFrame, use "top.topFrame", "top.navFrame",
* "top.mainFrame", "top.mainFrame.iFrame" respectively.
*
* Options: (object/optional) Map of options in object literal form. Options include:
*
* remote: (boolean/ default true) Run the function in the context of the target frame.
* If true, jQuery will be loaded in the target frame automatically and you can run
* jQuery selectors in the target frame as if they were local. ie: $("p") instead of
* $("p",top.mainFrame.document). If false, jQuery will not be loaded automatically
* and you must use a context in jquery selectors.
*
* load: (array or object) jquery is loaded by default. You can pass a single object to
* frameReady, or an array of objects that will be loaded and tested in order. 2 types
* of files can be loaded. Scripts and stylesheets:
*
* scripts: {type:"script", src:"/js/myscript.js", id:"_ms", test:"afunction"}
* stylesheets: {type:"stylesheet", src:"/css/mycss.css", id:"_ss"}
*
* type: (string/required) "script" for script files, "stylesheet" for stylesheets.
* src: (string/required) The source of the file, ie: /js/myscript.js.
* id: (string/optional) An id for the id attribute. If one isn't provided it
* will be generated.
* test: (sting/optional) The name of a function that should exist once the script
* is loaded properly. Until this function becomes available, the script will
* be considered not ready and no other files will be loaded. If a test is not
* provided, the next file will be loaded immediately. Tests are not useful
* with stylesheets.
*
* One gotcha: You must have something other than space characters within the body tags of
* target frame documents for frameReady to work properly. A single character is enough.
* The reason for this is a workaround for an iFrame bug in Firefox, of all things.
* ==============================================================================================
*
* Example:
*
* $.frameReady(function(){
* $("<div>I am a div element</div>").prependTo("body");
* }, "top.mainFrame",
* { load: [
* {type:"script",id:"_fr",src:"/js/jquery.frameReady.js",test: "$.frameReady"},
* {type:"stylesheet",id:"_ss",src:"frameReady.css"}
* ] }
* );
*
*
* Release Notes:
*
* 1.2.0 - Added provision for a local callback function;
* Added functionality to reset frame information if frame unloads for any reason;
*
* 1.1.0 - Added the ability to load scripts and stylesheets inside the target frame before
* processing function stack;
*
****/
if (typeof $daemach == "undefined") {
$daemach = {};
$daemach.debug = false; // set this to true to enable logging
$daemach.log = function() {
if (!top.window.console || !top.window.console.log || !$daemach.debug) {
return;
} else {
top.window.console.log([].join.call(arguments,''));
}
}
}
if (typeof $daemach["frameReady"] == "undefined") {
$daemach["frameReady"] = {};
}
jQuery.frameReady = function(f,t,r,j) {
/************************************************************
You must specify the path to your jquery.js file below!
*************************************************************/
var jQueryPath = "/main/inc/lib/javascript/jquery.js";
var u = "undefined";
var $fr = $daemach["frameReady"];
var fn = t.split(".").join("_");
// create a branch
if (typeof $fr[fn] == u) {
$fr[fn] = {};
$fr[fn]["settings"] = {
remote: true,
jquery: true,
load: [ {type:"script",id:"_jq", src:jQueryPath, test:"jQuery"} ],
bLoaded: false,
loadInit: [],
callback: false
};
$fr[fn]["target"] = t;
}
var fr = $fr[fn];
var frs = fr["settings"];
if (fr.done) {
$daemach.log(fr.target + " is ready. Running functions now.");
return (frs.remote) ? eval(fr.target).eval("(" + f.toString() + ")()") : f();
};
// process arguments
for (var a=2;a<arguments.length;a++){
var arg = arguments[a];
if ($.isFunction(arg)){
frs.callback = arg;
} else if (typeof arg == "object") {
if (typeof arg.remote !== u) {
frs.remote = arg.remote;
};
if (typeof arg.jquery !== u) {
frs.jquery = arg.jquery;
};
// if we're not running functions in the remote frame itself, no need for jQuery
if (!frs.remote || !frs.jquery) {
frs.load.pop();
}
if (typeof arg.load !== u) {
var bl = true;
if (arg.load.constructor == Array && arg.load.length){
for (var i=0;i<arg.load.length;i++){
bl = true;
for (var h=0;h<frs.load.length;h++){
if (frs.load[h].src == arg.load[i].src) { bl=false; };
}
if (bl) { frs.load.push(arg.load[i]); }
}
} else if (typeof arg.load == "object") {
for (var h=0;h<frs.load.length;h++){
if (frs.load[h].src == arg.load.src) { bl=false; };
}
if (bl) { frs.load.push(arg.load); }
}
}
}
}
if (fr.timer) {
fr.ready.push(f);
} else {
fr.ready=[f];
if (typeof addEvent !== "undefined"){ addEvent(window,"load",function(){ jQuery.isFrameReady(fn); }); };
fr.timer = setInterval(function(){ jQuery.isFrameReady(fn); },13);
}
}
jQuery.isFrameReady = function(fn){
var u = "undefined";
var $d = $daemach;
var fr = $d["frameReady"][fn];
var frs = fr["settings"];
if (fr.done) { return false; };
var fx = eval(fr.target);
$d.log(fn, ": New Pass. Checking target");
// make sure we have a target
if (typeof fx !== "undefined") {
$d.log(fn, ": Found target. Checking DOM");
var fd = fx.document;
// make sure we have a DOM
if (fd && fd.getElementsByTagName && fd.getElementById && fd.body && fd.body.innerHTML.length) {
$d.log(fn, ": Found DOM");
if (frs.load.length && !frs.bLoaded){
for (var i=0;i<frs.load.length;i++){
var s = frs.load[i];
var _test;
try { _test = eval('typeof fx.'+s.test+ ' !== "undefined"'); }
catch(ex){ _test = false;}
finally { $d.log(fn, ": Running test for script ",i,". ", (_test || !s.test) ? "Passed.":"Failed."); }
if ((_test || !s.test) && frs.loadInit[i]) {
frs.bLoaded = (typeof s.test == u) ? true : _test;
continue;
} else {
frs.bLoaded = false;
if (typeof frs.loadInit[i] == u){
var id = s.id || "frs_"+i;
switch (s.type) {
case "script" :
$d.log(fn, ": Loading script "+ i + " (" + s.src + ")");
var ele=fd.createElement('script');
ele.setAttribute('id', id);
ele.setAttribute('src', s.src);
fd.getElementsByTagName("body")[0].appendChild(ele);
void(ele);
frs.loadInit[i] = true;
break
case "stylesheet" :
$d.log(fn, ": Loading stylesheet "+ i + " (" + s.src + ")");
var ele=fd.createElement('link');
ele.setAttribute('id', id);
ele.setAttribute('href', s.src);
ele.setAttribute('rel', "stylesheet");
ele.setAttribute('type', "text/css");
fd.getElementsByTagName("body")[0].appendChild(ele);
void(ele);
frs.loadInit[i] = true;
break
default :
$d.log(fn, ": Script "+i+" has a bad or missing type attribute..." );
}
}
break;
}
}
} else {
clearInterval(fr.timer);
fr.timer = null;
fr.ready.push(function(){ window.frameReadyUnload = function(root, fn){ $(window).bind("unload",function(){ root.jQuery.frameReady.unload(fn); }); } });
$d.log(fn, ": Processing function stack:");
for (var i=0; i<fr.ready.length;i++){
(frs.remote) ? fx.eval("(" + fr.ready[i].toString() + ")()") : fr.ready[i]();
}
fx.frameReadyUnload(window,fn);
$d.log(fn, ": Function stack processing complete.");
// we're done here. let's have a beer.
fr.ready = null;
fr.done=true;
if (frs.callback){
$d.log(fn, ": Found a callback. Executing...");
frs.callback();
}
}
}
}
$d.log(fn, ":");
}
jQuery.frameReady.unload = function(fn){
$daemach.log("Frame " + fn + " is unloading. Resetting state.")
$daemach["frameReady"][fn].done = false;
$daemach["frameReady"][fn]["settings"].bLoaded = false;
$daemach["frameReady"][fn]["settings"].loadInit = [];
}

@ -1,11 +1,12 @@
/*
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>
Julio Montoya <gugli100@gmail.com> fixes for Chamilo 1.8.6.2 Glossary tool to strict search
Julio Montoya <gugli100@gmail.com> fixes for the Glossary tool to strict search
*/

@ -139,6 +139,7 @@ if (isset($_GET['lp_id']) && isset($_GET['my_lp_id'])) {
} else {
$sql_attempts = 'SELECT * FROM ' . $tbl_stats_exercices . ' WHERE exe_exo_id="' . (int)$row_path['path'] . '" AND exe_user_id="' . $student_id . '" AND orig_lp_id = "'.(int)$clean_lp_id.'" AND orig_lp_item_id = "'.(int)$clean_lp_item_id.'" AND exe_cours_id="' . $clean_course_code. '" AND status <> "incomplete" ORDER BY exe_date';
}
echo $sql_attempts;
}
}
@ -185,7 +186,7 @@ if (is_array($list) && count($list) > 0){
" AND v.user_id = " . $user_id . " " .
" ORDER BY iv.view_count $qry_order ";
}
echo $sql.'<br/>';
$result = Database::query($sql, __FILE__, __LINE__);
$num = Database :: num_rows($result);
$time_for_total = 'NaN';
@ -231,7 +232,9 @@ if (is_array($list) && count($list) > 0){
}
$counter++;
do {
do {
echo $row['iv_view_count'];
//check if there are interactions below
$extend_attempt_link = '';
$extend_this_attempt = 0;
@ -478,7 +481,7 @@ if (is_array($list) && count($list) > 0){
$res_score = Database::query($sql,__FILE__,__LINE__);
$row_score = Database::fetch_array($res_score);
$sql = "SELECT SUM(total_time) as total_time FROM $TBL_LP_ITEM_VIEW WHERE lp_item_id = '".(int)$my_id."' and lp_view_id = '".(int)$my_lp_view_id."'";
echo $sql = "SELECT SUM(total_time) as total_time FROM $TBL_LP_ITEM_VIEW WHERE lp_item_id = '".(int)$my_id."' and lp_view_id = '".(int)$my_lp_view_id."'";
$res_time = Database::query($sql,__FILE__,__LINE__);
$row_time = Database::fetch_array($res_time);
@ -506,6 +509,7 @@ if (is_array($list) && count($list) > 0){
}
}
$time_for_total = $subtotal_time;
echo $subtotal_time.' - ';
$time = learnpathItem :: get_scorm_time('js', $subtotal_time);
if (empty ($title)) {
$title = rl_get_resource_name(api_get_course_id(), $lp_id, $row['myid']);
@ -677,7 +681,7 @@ if (is_array($list) && count($list) > 0){
}
//$view_score = ($my_score == 0 ? '0.00/'.$my_maxscore : ($my_maxscore == 0 ? $my_score : $my_score . '/' . $my_maxscore));
}
echo $time_attemp;
$output .= '<tr class="'.$oddclass.'" ><td>&nbsp;</td><td>'.$extend_attempt_link.'</td><td colspan="3">' . api_convert_encoding(get_lang('Attempt'), $lp_charset, $dokeos_charset) . ' ' . $n . '</td>'
. '<td colspan="2"><font color="' . $color . '"><div class="mystatus">' . $my_lesson_status . '</div></font></td><td colspan="2"><div class="mystatus" align="center">' . $view_score . '</div></td><td colspan="2"><div class="mystatus">' . $time_attemp . '</div></td>';
if ($origin != 'tracking') {

@ -74,6 +74,7 @@ $my_style=$platform_theme;
//$htmlHeadXtra[] = '<script type="text/javascript" src="lp_view.lib.js"></script>';
//$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/')."\n";
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.frameready.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] = '<script language="javascript">
function cleanlog(){
@ -110,11 +111,9 @@ unset($_SESSION['questionList']);
*/
if (!isset($src))
{
if (!isset($src)) {
$src = '';
switch($lp_type)
{
switch($lp_type) {
case 1:
$_SESSION['oLP']->stop_previous_item();
$htmlHeadXtra[] = '<script src="scorm_api.php" type="text/javascript" language="javascript"></script>';
@ -264,8 +263,7 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
<?php if ($_SESSION['oLP']->get_preview_image()!=''): ?>
<img width="115" height="100" src="<?php echo api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image(); ?>">
<?php
else
: echo Display :: display_icon('unknown_250_100.jpg', ' ');
else : echo Display :: display_icon('unknown_250_100.jpg', ' ');
endif;
?>
</span>
@ -412,19 +410,14 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
</script>
<?php
}
else
{
} else {
include_once('../inc/reduced_header.inc.php');
//$displayAudioRecorder = (api_get_setting('service_visio','active')=='true') ? true : false;
//check if audio recorder needs to be in studentview
$course_id=$_SESSION["_course"]["id"];
if($_SESSION["status"][$course_id]==5)
{
if($_SESSION["status"][$course_id]==5) {
$audio_recorder_studentview = true;
}
else
{
} else {
$audio_recorder_studentview = false;
}
//set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php)
@ -435,7 +428,6 @@ else
<input type="hidden" id="current_item_id" name ="current_item_id" value="0" />
<div id="learningPathMain" style="width:100%;height:100%;" >
<div id="learningPathLeftZone" style="float:left;width:280px;height:100%">
<!-- header -->
@ -568,6 +560,8 @@ else
var initialLeftZoneHeight = 0;
var initialRightZoneHeight = 0;
// Fixes the content height of the frame
var updateContentHeight = function() {
winHeight = (window.innerHeight != undefined ? window.innerHeight : document.documentElement.clientHeight);
newLeftZoneHeight = winHeight - leftZoneHeightOccupied;
@ -587,7 +581,7 @@ else
document.body.style.overflow = 'auto';
} else {
document.body.style.overflow = 'hidden';
}
}
};
window.onload = function() {
@ -613,8 +607,47 @@ else
rightZoneHeightOccupied = docHeight - initialRightZoneHeight;
document.body.style.overflow = 'hidden';
updateContentHeight();
//loads the glossary library
<?php
if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
?>
$(document).ready(function() {
$.frameReady(function(){
// $("<div>I am a div courses</div>").prependTo("body");
}, "top.content_name",
{ load: [
{type:"script", id:"_fr1", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
{type:"script", id:"_fr2", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
{type:"script", id:"_fr3", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_manual.js"}
]
}
);
});
<?php
} elseif(api_get_setting('show_glossary_in_documents') == 'isautomatic') {
?>
$(document).ready(function() {
$.frameReady(function(){
// $("<div>I am a div courses</div>").prependTo("body");
}, "top.content_name",
{ load: [
{type:"script", id:"_fr1", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
{type:"script", id:"_fr2", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
{type:"script", id:"_fr3", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"}
]
}
);
});
<?php
}
}
?>
}
window.onresize = updateContentHeight;
-->
</script>
@ -629,4 +662,4 @@ else
}
//restore global setting
$_setting['show_navigation_menu'] = $save_setting;
?>
?>

@ -186,12 +186,41 @@ $(document).ready( function() {
info_lms_item[1]= info_lms_item[1];
<?php
if (api_get_setting('show_glossary_in_extra_tools') == 'true') {
?>
if (lms_lp_type == 2) { //Only scorm
attach_glossary_into_scorm();
if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
//Will be always automatic
?>
$.frameReady(function(){
// $("<div>I am a div courses</div>").prependTo("body");
}, "top.content_name",
{ load: [
{type:"script", id:"_fr1", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
{type:"script", id:"_fr2", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
{type:"script", id:"_fr3", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"}
] }
);
if (lms_lp_type == 2) { //Only scorm
//attach_glossary_into_scorm();
}
<?php
} else {
?>
$.frameReady(function(){
// $("<div>I am a div courses</div>").prependTo("body");
}, "top.content_name",
{ load: [
{type:"script", id:"_fr1", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.js"},
{type:"script", id:"_fr2", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"},
{type:"script", id:"_fr3", src:"<?= api_get_path(WEB_LIBRARY_PATH); ?>fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"}
] }
);
if (lms_lp_type == 2) { //Only scorm
//attach_glossary_into_scorm();
}
<?php
}
}
?>
});
@ -1590,10 +1619,13 @@ if(lms_lp_type==1 || lms_item_type=='asset'){
}
/**
*Allow attach the glossary terms into html document of scorm
*Added by Isaac flores
* Allow attach the glossary terms into html document of scorm
* Added by Isaac flores
* This function should be deprecated
*/
function attach_glossary_into_scorm() {
var f = $('#content_id')[0];
var doc = f.contentWindow ? f.contentWindow.document :

Loading…
Cancel
Save