bool CTestResult::AddResponse( int TEST_RESULT_ID mixed RESPONSE );
The AddResponse method saves an answer of a student and determines if the answer is correct.
| Parameter | Description |
|---|---|
| TEST_RESULT_ID | The examination question ID. |
| RESPONSE | The answer ID or an array of ID's. |
The method returns true on success, or false otherwise. If an error occurs, the exception will contain the error description.
if (CModule::IncludeModule("learning"))
{
$TEST_TESULT_ID = 2962;
$RESPONSE = 186; /* or Array(186,187); */
$res = CTestResult::AddResponse($TEST_RESULT_ID, $RESPONSE);
if($res)
echo "Response has been added ";
else
echo "Error";
}| © 2001-2007 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |