$aiccdata = optional_param('aicc_data', '', PARAM_RAW);
$version = optional_param('version', '', PARAM_RAW);
$attempt = optional_param('attempt', '1', PARAM_INT);
if (!empty($command) && ($skillsoftsession = skillsoft_check_sessionid($sessionid))) {
    $skillsoftid = $skillsoftsession->skillsoftid;
    $userid = $skillsoftsession->userid;
    //$attempt = 1;
    if ($skillsoft = $DB->get_record('skillsoft', array('id' => $skillsoftid))) {
        $user = $DB->get_record('user', array('id' => $userid));
        $handler = new aicchandler($user, $skillsoft, $attempt, $CFG->skillsoft_strictaiccstudentid);
        switch (strtolower($command)) {
            case 'getparam':
                $handler->getparam();
                break;
            case 'putparam':
                $handler->putparam($aiccdata);
                break;
            case 'exitau':
                $handler->exitau();
                break;
            case 'putcomments':
            case 'putinteractions':
            case 'putobjectives':
            case 'putpath':
            case 'putperformance':
                echo "error=0\r\nerror_text=Successful\r\n";
                break;
            default:
                echo "error=1\r\nerror_text=Invalid Command\r\n";
                break;
        }