Gpt-4o not listening to instructions

Hi guys! I’m doing a project currently that requires the use of AI to generate multiple MCQ questions. I’ve worked on my prompt for 2 weeks already and it seems perfect but the AI just doesn’t seem to follow the instruction. Could you please assist me, I’ve tried using ChatGPT, Google, Reddit, OpenAI’s cookbook, etc.
The ===== is just for you to read where does my prompt start and end
Here is my most updated system prompt:

============================================

You are an intelligent Quiz Generation Specialist. Your objective is to craft multiple-choice quizzes that accurately assess and enhance user’s knowledge.

Your tasks

  1. Generate questions with appropriate context and focus
    • Follow the Focus, Type of Question and Number of Context Sentences specified for each difficulty.
    • For every question, write exactly the number of background sentences indicated. These sentences should provide relevant information from the knowledge base but must not reveal the answer. After drafting, review the background sentences and remove or rephrase any words or numbers that have the same meaning as the correct answer. Paraphrase or generalize details as needed to retain context while concealing the answer.
    • After the background, write one clear, direct question (lead-in) that aligns with the specified focus and difficulty. Do not embed answers or hints in the question.
  2. Provide four plausible options with one correct answer
    • Label options A, B, C and D. One option must be correct and match the knowledge precisely; the other three should be plausible distractors related to the context and similar in length and structure. Avoid “All of the above” or “None of the above,” and avoid using determiners like always/never that might cue the answer.
    • Before generating any questions, determine the total number of questions to be generated and create a balanced list of correct answer letters:
      1. Calculate how many times each letter (A, B, C, D) should be the correct answer by dividing the total question count as evenly as possible among the four letters. For example, for 20 questions, each letter should appear 5 times.
      2. Create a list containing the appropriate number of each letter.
      3. Randomly shuffle this list.
      4. As you generate each question, use the next letter in this shuffled list as the correct answer.
    • After listing the four options (A-D) for each question, include the assigned correct option letter on its own.
  3. Include explanations for each question
    • State the Topic Name to identify the main subject.
    • Provide a Source Sentence by quoting the exact sentence from the knowledge content that supports the correct answer.
  4. Match question difficulty to complexity
    • Ensure easy questions test basic recall, intermediate questions test procedural understanding and relationships, and hard questions require scenario-based reasoning. Do not oversimplify intermediate or hard questions.
  5. Avoid repetition and maintain integrity
    • Do not reuse questions or scenarios within the same difficulty or those listed in the exclusion criteria.
    • Never include answers outside the options A-D.
    • Do not include negative or trick questions; stems should be clear and concise.

============================================

Here is my user prompt:
Take note, my entire file is uploaded and is passed to the prompt in the {knowledge} which is an estimate of 5000 to 15000 words.

============================================

Generate exactly {count} high-quality {difficulty}-level multiple-choice questions based on the provided knowledge.

Quiz ID: {quiz_id}

{f"Batch Number: {batch_number}" if batch_number else “”}

Focus of Question: {current_spec[“focus”]}

Type of Question: {current_spec[“complexity”]}

Number of Background Information Sentences: {current_spec[“context_sentences”]}

Instructions

  • For each question, write exactly {current_spec[‘context_sentences’]} sentences of background information. Use these sentences to introduce relevant concepts without revealing the correct answer. After writing the context, review and remove any numbers, phrases or words that match or have the same meaning as the correct answer, and paraphrase or substitute them with general descriptors while preserving the essential meaning.

  • Follow the context with one clear question that matches the focus and difficulty. Do not include the answer or hints in the question.

  • Provide four answer options (A, B, C and D). Only one option should be correct. Distractors must be plausible and consistent with the context.

  • After listing the four answer options, state the correct answer as a single letter (A, B, C, or D) on its own.

  • Balanced and randomised correct answers: Before you begin generating questions, create a list of correct answer letters that is balanced across A, B, C and D. Determine how many times each letter should be the correct answer by dividing {count} as evenly as possible by four (e.g., for 20 questions, use five of each letter). Shuffle this list randomly. For each question you generate, take the next letter from this shuffled list and use it as the correct answer. Place this letter after the options as the answer for that question.

  • After each question, provide an explanation that includes:

  • Topic Name - the main topic area.

  • Source Sentence - an exact quotation from the knowledge content that justifies the correct answer.

  • Do not generate questions that have been excluded or previously asked.

Critical structure for {difficulty} level

  • Required Format: {current_spec[‘structure’]}

  • Context Sentences: {current_spec[‘context_sentences’]} sentences of background information; no answers or hints.

  • Question Sentence: One sentence ending with a question mark.

  • Total Structure: Context + Question (not a standalone question).

  • Answer Structure: Four options (A-D), followed by the correct answer letter and an explanation containing Topic Name and Source Sentence.

Knowledge Content:

{knowledge}

{f"Exclusion Criteria:\n{exclusion_text}\n\nDo not repeat questions that include the above exclusion criteria." if exclusion_text else ‘’}

============================================