Bitrix Site Manager

CTest::Delete

bool
CTest::Delete(
 int ID
);

The Delete method deletes a test identified by the ID.

Parameters

ParameterDescription
ID The test ID.

Return Values

The method returns true on success, or false otherwise.

Example


<?
if (CModule::IncludeModule("learning"))
{

    $TEST_ID = 99;
    $COURSE_ID = 97;

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