public function get_editable_response() { $result = new asaResponse($this->get_item_number(), $this->get_state()); foreach ($this as $val) { $result->add_response_item(new asaEditableResponseItem($val->get_answer_order(), $val->get_is_right(), $val->get_value())); } return $result; }
public function create_editable_response() { $result = new asaResponse($this->get_number(), -1); $filler = '0'; if ($this->get_unit_type() == 'open') { $filler = ''; } foreach ($this->get_variants() as $val) { $result->add_response_item(new asaEditableResponseItem($val->get_order_num(), false, $filler)); } return $result; }
public static function create_response_as_param(asaResponse $res) { $items = array(); foreach ($res as $item) { $items[] = array("AnswerOrder" => $item->get_answer_order(), "IsRight" => $item->get_is_right(), "Value" => $item->get_value()); } $result = array("ItemNumber" => $res->get_item_number(), "Pass" => $res->get_state() == 1, "Items" => $items); return $result; }