All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
You should know that producing alcohol or contributing to this is one of the grave major sins which entitles the doer to curse. It is narrated that Anas ibn Maalik said: "The Messenger of Allaah, sallallaahu ‘alayhi wa sallam, cursed ten types of people with regard to wine: the one who presses (the grapes), the one for whom it is pressed, the one who drinks it, the one who carries it, the one to whom it is carried, the one who serves it, the one who sells it, the one who consumes its price, the one who buys it and the one for whom it is bought." [At-Tirmithi, Abu Daawood and Ibn Maajah] [Al-Albaani: Saheeh]
Given that, it is clear for you now the danger of preparing alcohol and contributing to that. Getting low marks in case of refusal is not a Sharee‘ah-approved justification to do what is prohibited. Nevertheless, this is permissible if alcohol is needed to prepare some medicines and it is used just as much as needed only.
In Ahkaam An-Najaasaat, Nasri Raashid Qaasim said: "If alcohol is necessary for producing a certain medicine and specialists indicated that it is necessary indeed and there is no alternative medicine, it is permissible to use it due to necessity."