in reply to Problem in script
The script never goes into the end_block function because your search_for_username_and_no_of_questions function always returns -1 and the conditional where it's called *dies* when the function returns -1.