The ulcer is probably caused by an infectious organism. Flagyl is specific to protozoa infections which will cause the UC condition. I beleive it is also used for bacterial infections. Some organisms will respond to the Flagyl but need a secondary rx such as e. histolytica which requires both. B. hominis is another protozoa that will respoond initially to flagyl but requires another drug cocktail. You can go the parasite drug forum here on CZ and/or see badbugs.org for some additional info.
So we don't know what the infectious organism is? If it was know then the proper treatment could be used.
Have you had any stool cultures done or any other lab services?