title: python-docx get image on the side of paragraph
body: <p>So i am trying to make a bot to answer my a quiz. The work principle is simple, the bot is actually just replacing me doing CTRL + C on quiz page, CTRL + F on answered document (.docx).
  So far, i have been manage to get the answer by checking keyword <code>The correct answer is: </code> occurrences below answer choices or check if an answer paragraph is uses different paragraph style from the other.</p>
  <p>The problem is if an answered document has no keyword and use same paragraph style, the solution i can think right now is to check which radio button (image) is has more dark pixel than the other three. i couldn't get right radio button for each answer paragraph because of the radio button and the paragraph is somehow unrelated.</p>
  <p>the sample of answer document: <a href="https://docs.google.com/document/d/1xEU0Mv5LKLeA3wWEq9bOO3b8nGOpl52G/edit?usp=sharing&amp;ouid=106238154602768730311&amp;rtpof=true&amp;sd=true" rel="nofollow noreferrer">https://docs.google.com/document/d/1xEU0Mv5LKLeA3wWEq9bOO3b8nGOpl52G/edit?usp=sharing&amp;ouid=106238154602768730311&amp;rtpof=true&amp;sd=true</a></p>
  <pre><code>def get_radio_buttons(choices:list[Paragraph]):
      &quot;&quot;&quot; Get radio button corresponding of each choices &quot;&quot;&quot;
      radio_buttons = []
      # get radio button and append it to radio_buttons
  
      return radio_buttons
  </code></pre>
  <pre><code>def get_answer(choices:list[Paragraph], debug_choices:bool=False) -&gt; str:
      &quot;&quot;&quot; Get unique paragraph as an answer &quot;&quot;&quot;
      if debug_choices:
         print(&quot;=========&quot;)
         for c in choices:
         print(c.text)
  
         answer_type = get_answer_type(choices)
         if answer_type == 0:
             # type 0 is choices with no answer
             return ''
         elif answer_type == 1:
             # type 1 answer is a Paragraph with unique style
             answer_style = [answer.style for answer in choices]
             style_freq = [answer_style.count(style) for style in answer_style]
             return choices[style_freq.index(min(style_freq))].text
  
         # TODO: get answer based on unique radio buttons (type 2)
         # radio button is a image
         # there should be:
         ## - 4*n radio button (n is number of question) in a page
         ##   one of them could be selected as an answer and returned
         ## - possibility of a checklist or cross mark next to an answer
         ##   (this will called correction)
         ## - radio button, checklist, and cross mark is an image
  
         elif answer_type == 2:
             # type 2 answer use no unique style but radio button which is an image
             # one of radio button is selected as an answer and different from other radio buttons
             radio_buttons = get_radio_buttons(choices)
             # return the answer text
  
  </code></pre>