Function mod_scorm_insert_scorm_tracks “Invalid parameter”

Function mod_scorm_insert_scorm_tracks “Invalid parameter”

by Ricardo Flores Cabal -
Number of replies: 0

Hi Guys


I have a problem with this code, I would like insert some scorm track data as a test and I'm getting this error


<br />
<b>Notice</b>:  Undefined index: x.start.time in <b>C:\xampp\htdocs\otros\PHP-REST\client.php</b> on line <b>75</b><br />
<br />
<b>Notice</b>:  Undefined offset: 1473102672 in <b>C:\xampp\htdocs\otros\PHP-REST\client.php</b> on line <b>76</b><br />
<?xml version="1.0" encoding="UTF-8" ?>
<EXCEPTION class="invalid_parameter_exception">
<ERRORCODE>invalidparameter</ERRORCODE>
<MESSAGE>Invalid parameter value detected</MESSAGE>
<DEBUGINFO>tracks =&gt; Invalid parameter value detected: Only arrays accepted. The bad value is: ''</DEBUGINFO>
</EXCEPTION>

And my code is 


$item1 =  new stdClass();
$item1->scoid = '2';
$item1->attempt = '1';
$item1->tracks = array(
        array(
            array(
                'element' => 'x.start.time',
                'value' => '1473102672'
            ),
        ),
         array(
            array(
                'element' => 'x.start.time',
                'value' => '1473102680'
            ),
        ),
    );

I'm pretty sure is a syntax error and I discovered that curl.php has something to be, I attached 2 files that I'm using


I have tried many ways to write that array but nothing is working,

Thank you!

Average of ratings: -