Refactor submit_code action to reduce code redundancy

Now set_hints will return value to determine whether the answer passed private and public test cases.
it should: return public_tests, private_tests
and get there values by: public_tests, private_tests = set_hints(...)
in case public or private are needed later.