Instead of doing this
if (result == 1) {
do this
if (data.result == 1) {
inside your success callback javascript file.
Then in your PHP file instead of these:
echo json_encode(array("error" => "is ok"));
echo json_encode(array("error" => "Wrong chose"));
do these instead:
echo json_encode(array("error" => "is ok", "result"=>1));
echo json_encode(array("error" => "Wrong chose", "result"=>0));
What I did is I included result as a property in the JSON coming from AJAX call. So instead of only having the error property you also have the result property in the JSON.