move send_json_request function to lib.php
fix question attempt number