CDBResult
CTest::GetList(
array arOrder = Array("TIMESTAMP_X"=>"DESC"),
array arFilter = Array()
);
The GetList method returns a selection of tests filtered by arFilter and sorted in the arOrder order. The current user access permissions are respected.
| 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:
0 - a student cannot switch to the next question without answering the current one and cannot change their answers;
Optional. By default, records are not filtered. |
The method returns an instance of the CDBResult object.
<?
if (CModule::IncludeModule("learning"))
{
$COURSE_ID = 97;
$res = CTest::GetList(
Array("SORT"=>"ASC"),
Array("ACTIVE" => "Y", "COURSE_ID" => $COURSE_ID)
);
while ($arTest = $res->GetNext())
{
echo "Test name: ".$arTest["NAME"]."<br>";
}
}
?>
<?
if (CModule::IncludeModule("learning"))
{
$res = CTest::GetList(
Array("SORT"=>"ASC"),
Array("?NAME" => "Site")
);
while ($arTest = $res->GetNext())
{
echo "Test name: ".$arTest["NAME"]."<br>";
}
}
?>
<?
if (CModule::IncludeModule("learning"))
{
$COURSE_ID = 97;
$res = CTest::GetList(
Array("NAME" => "ASC", "SORT"=>"ASC"),
Array("COURSE_ID" => $COURSE_ID, "APPROVED" => "Y")
);
while ($arTest = $res->GetNext())
{
echo "Test name: ".$arTest["NAME"]."<br>";
}
}
?>
<?
if (CModule::IncludeModule("learning"))
{
$COURSE_ID = 97;
$res = CTest::GetList(
Array("TIMESTAMP_X" => "ASC", "SORT"=>"ASC"),
Array("CHECK_PERMISSIONS" => "N", "COURSE_ID" => $COURSE_ID)
);
while ($arTest = $res->GetNext())
{
echo "Test name: ".$arTest["NAME"]."<br>";
}
}
?>
| © 2001-2007 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |