LMS communication breaks on user input - CT#888

skala
Guillaume Viguier 16 years ago
parent dc23667b64
commit 61cd194653
  1. 8
      main/newscorm/aicc_api.php
  2. 8
      main/newscorm/lp_ajax_last_update_status.php
  3. 30
      main/newscorm/lp_ajax_save_item.php
  4. 8
      main/newscorm/lp_ajax_save_objectives.php
  5. 2
      main/newscorm/lp_ajax_switch_item.php
  6. 6
      main/newscorm/scorm_api.php

@ -700,7 +700,7 @@ function xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score
}
*/
$.ajax({
type:"GET",
type:"POST",
data: params,
url: "lp_ajax_save_item.php",
dataType: "script",
@ -740,7 +740,7 @@ function xajax_save_objectives(lms_lp_id,lms_user_id,lms_view_id,lms_item_id,ite
}
params += obj_string;
$.ajax({
type: "GET",
type: "POST",
data: params,
url: "lp_ajax_save_objectives.php",
dataType: "script",
@ -760,11 +760,11 @@ function xajax_switch_item_details(lms_lp_id,lms_user_id,lms_view_id,lms_item_id
'next': next_item
}
$.ajax({
type: "GET",
type: "POST",
data: params,
url: "lp_ajax_switch_item.php",
dataType: "script",
async: false
});
}
addEvent(window,'load',addListeners,false);
addEvent(window,'load',addListeners,false);

@ -119,7 +119,7 @@ function last_update_status($lp_id,$user_id,$view_id,$item_id)
}
error_log(__LINE__);
echo last_update_status(
$_GET['lid'],
$_GET['uid'],
$_GET['vid'],
$_GET['iid']);
$_REQUEST['lid'],
$_REQUEST['uid'],
$_REQUEST['vid'],
$_REQUEST['iid']);

@ -188,9 +188,9 @@ function save_item($lp_id,$user_id,$view_id,$item_id,$score=-1,$max=-1,$min=-1,$
//return $objResponse;
}
$interactions = array();
if(isset($_GET['interact'])) {
if (is_array($_GET['interact'])) {
foreach($_GET['interact'] as $idx=>$interac)
if(isset($_REQUEST['interact'])) {
if (is_array($_REQUEST['interact'])) {
foreach($_REQUEST['interact'] as $idx=>$interac)
{
$interactions[$idx] = split(',',substr($interac,1,-1));
if(!isset($interactions[$idx][7])){ //make sure there are 7 elements
@ -201,16 +201,16 @@ if(isset($_GET['interact'])) {
}
echo save_item(
$_GET['lid'],
$_GET['uid'],
$_GET['vid'],
$_GET['iid'],
$_GET['s'],
$_GET['max'],
$_GET['min'],
$_GET['status'],
$_GET['t'],
$_GET['suspend'],
$_GET['loc'],
$_REQUEST['lid'],
$_REQUEST['uid'],
$_REQUEST['vid'],
$_REQUEST['iid'],
$_REQUEST['s'],
$_REQUEST['max'],
$_REQUEST['min'],
$_REQUEST['status'],
$_REQUEST['t'],
$_REQUEST['suspend'],
$_REQUEST['loc'],
$interactions,
$_GET['core_exit']);
$_REQUEST['core_exit']);

@ -64,9 +64,9 @@ function save_objectives($lp_id,$user_id,$view_id,$item_id,$objectives=array())
return $return;
}
$objectives = array();
if(isset($_GET['objectives'])) {
if (is_array($_GET['objectives'])) {
foreach($_GET['objectives'] as $idx=>$ob)
if(isset($_REQUEST['objectives'])) {
if (is_array($_REQUEST['objectives'])) {
foreach($_REQUEST['objectives'] as $idx=>$ob)
{
$objectives[$idx] = split(',',substr($ob,1,-1));
if(!isset($objectives[$idx][4])){ //make sure there are 7 elements
@ -75,4 +75,4 @@ if(isset($_GET['objectives'])) {
}
}
}
echo save_objectives($_GET['lid'],$_GET['uid'],$_GET['vid'],$_GET['iid'],$objectives);
echo save_objectives($_REQUEST['lid'],$_REQUEST['uid'],$_REQUEST['vid'],$_REQUEST['iid'],$objectives);

@ -227,4 +227,4 @@ function switch_item_details($lp_id,$user_id,$view_id,$current_item,$next_item)
return $return;
//return $objResponse;
}
echo switch_item_details($_POST['lid'],$_POST['uid'],$_POST['vid'],$_POST['iid'],$_POST['next']);
echo switch_item_details($_REQUEST['lid'],$_REQUEST['uid'],$_REQUEST['vid'],$_REQUEST['iid'],$_REQUEST['next']);

@ -1476,7 +1476,7 @@ function xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score
params += '&core_exit='+lms_item_core_exit;
if ( olms.lms_lp_type==1) {
$.ajax({
type:"GET",
type:"POST",
data: params,
url: "lp_ajax_save_item.php",
dataType: "script",
@ -1564,7 +1564,7 @@ function xajax_save_item_scorm(lms_lp_id, lms_user_id, lms_view_id, lms_item_id)
is_interactions='false';
}
$.ajax({
type:"GET",
type:"POST",
data: params,
url: "lp_ajax_save_item.php",
dataType: "script",
@ -1613,7 +1613,7 @@ function xajax_save_objectives(lms_lp_id,lms_user_id,lms_view_id,lms_item_id,ite
}
params += obj_string;
$.ajax({
type: "GET",
type: "POST",
data: params,
url: "lp_ajax_save_objectives.php",
dataType: "script",

Loading…
Cancel
Save