The Issues is that your serialized String contains back-slashes which would mess with the serialized object. Solution: Remove the backslashes and unserialzed the string and you'd get your object back:
<?php
$strSerializedWithSlashes = 'a:1:{i:0;O:8:\"stdClass\":7:{s:11:\"question_id\";s:1:\"1\";s:13:\"question_text\";s:18:\"This is question 1\";s:9:\"answer_id\";s:1:\"2\";s:11:\"answer_text\";s:4:\"asss\";s:11:\"points_base\";s:1:\"2\";s:6:\"points\";s:1:\"2\";s:15:\"custom_response\";s:0:\"\";}}';
$strSerializedWithoutSlashes = str_replace("\\", "", $strSerializedWithSlashes);
$objUnSerialized = unserialize($strSerializedWithoutSlashes);
var_dump($objUnSerialized);
// DUMPS::
array (size=1)
0 =>
object(stdClass)[1]
public 'question_id' => string '1' (length=1)
public 'question_text' => string 'This is question 1' (length=18)
public 'answer_id' => string '2' (length=1)
public 'answer_text' => string 'asss' (length=4)
public 'points_base' => string '2' (length=1)
public 'points' => string '2' (length=1)
public 'custom_response' => string '' (length=0)
You can test it here: https://eval.in/571535
And now; to get you answer_id You can simply do this:
<?php
$objData = $objUnSerialized[0];
$answerID = $objData->answer_id;
var_dump($answerID); // DUMPS: '2'