Ejemplo n.º 1
0
 public function testAbout()
 {
     $lrs = new RemoteLRS(self::$endpoint, self::$version, self::$username, self::$password);
     $response = $lrs->about();
     $this->assertInstanceOf('TinCan\\LRSResponse', $response);
     $this->assertTrue($response->success);
 }
define('CLI_SCRIPT', 1);
require_once __DIR__ . '/../../../config.php';
require_once $CFG->dirroot . '/local/strathjiscla/vendor/autoload.php';
require_once $CFG->dirroot . '/mod/assign/locallib.php';
$endpoint = 'http://localhost/learninglocker/public/data/xAPI/';
$version = '1.0.1';
$username = '******';
$password = '******';
$batchsize = 20;
/**
 * @var LoggerInterface
 */
$log = new Logger('core');
$lrs = new RemoteLRS($endpoint, $version, $username, $password);
// Check connection
$about = $lrs->about();
if (!$about->success) {
    $log->critical("Unable to connect to server");
    exit;
}
$log->debug("xAPI versions: " . implode(', ', $about->content->getVersion()));
// Can't use autoloading on old Moodle versions
class BatchController extends xapi_controller
{
    /**
     * Creates a new event.
     * @param [String => Mixed] $opts
     * @return [String => Mixed]
     */
    public function createEvent(array $opts)
    {