Documentation

CTestResult::Update

bool
CTestResult::Update(
 int   ID,
 array arFields
);

The Update method modifies the parameters of an examination schema question identified by the ID.

Parameters

ParameterDescription
ID The examination schema question ID.
arFields An array in the format Array("field"=>"value", ...). The array contains values of all fields of an examination schema question. Required fields must be present.

Return Values

The method returns true on successful update, or false otherwise. If an error occurs, the exception will contain the error description.

See Also

  • Examination schema fields
  • CTestResult::Add
  • CTestResult::AddResponse
  • Example

    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $TEST_TESULT_ID = 2962;
    
        $arFields = Array(
            "CORRECT" => "Y",
            "POINT" => "20"
        );
    
        $plan = new CTestResult;
        $success = $plan->Update($TEST_TESULT_ID, $arFields);
    
        if($success)
        {
            echo "Ok!";
        }
        else
        {
            if($e = $APPLICATION->GetException())
                echo "Error: ".$e->GetString();
        }
    }
    ?>
    © «Bitrix24», 2001-2024