Documentation

CTestAttempt::IsTestCompleted

bool
CTestAttempt::IsTestCompleted(
 int ATTEMPT_ID
 int PERCENT
);

The IsTestCompleted checks whether a test is completed.

Parameters

ParameterDescription
ATTEMPT_ID The attempt ID.
PERCENT The required percent of correct answers.

Return Values

The method returns true on success, or false otherwise.

Example


<?
if (CModule::IncludeModule("learning"))
{
    $ATTEMPT_ID = 563;
    $PERCENT = 30;

    $complete = CTestAttempt::IsTestCompleted($ATTEMPT_ID, $PERCENT);

    if ($complete)
        echo "Test has been completed";
    else
        echo "Try again";
}
?>
© «Bitrix24», 2001-2024
Up