Documentation

CTestResult::GetList

CDBResult
CTestResult::GetList(
 array arOrder = Array("ID"=>"DESC"),
 array arFilter = Array()
);

The GetList method returns a list of examination schema questions filtered by arFilter and sorted in the arOrder order.

Parameters

ParameterDescription
arOrder An array in the format array("filter field"=>"sort order" [, ...]). The sorting field can have the following values:
  • ID - the examination schema question ID;
  • ATTEMPT_ID - the attempt ID;
  • QUESTION_ID - the question ID:
  • POINT - score;
  • ANSWERED - indicates whether question is answered (Y|N);
  • CORRECT - indicates whether question is answered correctly (Y|N);
  • QUESTION_NAME - the question name;
  • RAND - random order.
Sort order can be one of the following:
  • asc - ascending;
  • desc - descending;
Optional. The default value is descending.
arFilter An array in the format array("filtered field"=>"filter value" [, ...]). The following values are possible:
  • ID - the examination schema question ID;
  • ATTEMPT_ID - the attempt ID;
  • QUESTION_ID - the question ID;
  • POINT - score;
  • RESPONSE - the student answer (wildcards allowed [%_]);
  • QUESTION_NAME - the question name (wildcards allowed [%_]); 
  • ANSWERED - indicates whether question is answered (Y|N);
  • CORRECT - indicates whether question is answered correctly (Y|N).
The following logic can be specified at the beginning of the field name:
  • "!" - not equal;
  • "<" - less than;
  • "<=" - less or equal;
  • ">" - more than;
  • ">=" - more or equal.
"filter values"  is a single value or an array.

Optional. By default, records are not filtered.

Return Values

The method returns an instance of the CDBResult object.

See Also

  • CDBResult
  • CTestResult::GetByID
  • Examination schema questions
  • Example

    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $ATTEMPT_ID = 590;
        $res = CTestResult::GetList(
            Array("ID" => "ASC"), 
            Array("ANSWERED" => "N", "ATTEMPT_ID" => $ATTEMPT_ID)
        );
    
        while ($arQuestionPlan = $res->GetNext())
        {
            echo "Question ID: ".$arQuestionPlan["QUESTION_ID"]."; Correct answer: ".$arQuestionPlan["CORRECT"]."; Question name:".$arQuestionPlan["QUESTION_NAME"]."<br>";
        }
    }
    ?>
    © «Bitrix24», 2001-2024
    Up