Bitrix Site Manager

CTestAttempt::Delete

bool
CTestAttempt::Delete(
 int ID
);

The Delete method deletes an attempt identified by the ID.

Parameters

ParameterDescription
ID The attempt ID.

Return Values

The method returns true on success, or false otherwise.

Example


<?
if (CModule::IncludeModule("learning"))
{
    $COURSE_ID = 83;
    $ATTEMPT_ID = 596;

    if (CCourse::GetPermission($COURSE_ID) >= 'W')
    {
        @set_time_limit(0);
        $DB->StartTransaction();
        if (!CTestAttempt::Delete($ATTEMPT_ID))
        {
            echo "Error!";
            $DB->Rollback();
        }
        else
            $DB->Commit();
    }
}
?>