CTestAttempt::GetList
CDBResult CTestAttempt::GetList( array arOrder = Array("ID"=>"DESC"), array arFilter = Array() );
The GetList method returns a selection of attempts filtered by arFilter and sorted in the arOrder order. The current user access permissions are respected.
Parameters
Parameter | Description |
---|---|
arOrder |
An array in the format array("filter field"=>"sort
order" [, ...]). The sorting field can have the following values:
|
arFilter |
An array in the format array("filtered
field"=>"filter value" [, ...]). The following
values are possible:
Optional. By default, records are not filtered. |
Return Values
The method returns an instance of the CDBResult object.
See Also
Example
<? if (CModule::IncludeModule("learning")) { $TEST_ID = 45; $res = CTestAttempt::GetList( Array("ID" => "ASC"), Array("TEST_ID" => $TEST_ID) ); while ($arAttempt = $res->GetNext()) { echo "Attempt ID:".$arAttempt["ID"]."; Date start: ".$arAttempt["DATE_START"]."; Test name: ".$arAttempt["TEST_NAME"]."<br>"; } } ?>
<? if (CModule::IncludeModule("learning")) { $TEST_ID = 45; $STUDENT_ID = 3; $res = CTestAttempt::GetList( Array("SCORE" => "DESC"), Array("CHECK_PERMISSIONS" => "N", "TEST_ID" => $TEST_ID, "STUDENT_ID" => $STUDENT_ID) ); while ($arAttempt = $res->GetNext()) { echo "Attempt ID:".$arAttempt["ID"]."; Date start: ".$arAttempt["DATE_START"]."; Test name: ".$arAttempt["TEST_NAME"]."<br>"; } } ?>
© «Bitrix24», 2001-2024