Help me understand how to do a crypto assignment about AES/CBC
For the CBC mode the encryption and decryption equations are as follows;

CBC encryption;

\begin{align}
C_1 &amp;= E_k(P_1 \oplus IV)\\
C_i &amp;= E_k(P_i \oplus C_{i-1}),\;\; 1 &lt; i &lt; nb,
\end{align}

CBC decryption;

\begin{align}
P_1 =&amp; D_k(C_1) \oplus IV\\
P_i =&amp; D_k(C_i) \oplus C_{i-1},\;\; 1 &lt; i &lt; nb,
\end{align}

But I'm not 100% sure what &quot;D&quot; actually is (yes, decrypt... but is it xoring? Something else?).

The $D$ is for Encryption and $E$ is for encryption, and $nb$ is the number of blocks.

If my understanding is correct (the decryption of the current layer being just xoring c[i] with the key), then it could be an implementation problem?

The key is given to AES to produce the encryption and decryptions, we don't x-or with the key, that is OTP or Vigenere.

I'm also a bit unsure about xoring the key with the blocks. I know that IV is supposed to be the same length as the blocks (16) but the key is 32 bits. Do I pad or repeat the blocks so they are 32 bits? Do I use the first 16 bits of the key?

AES has 128-bit block size regardless of the key sized those are 128,192, and 256. Therefore AES can support 128 bit IV/nonces. 128 is 16-bytes and 256 is 32-bytes.
A message to be encrypted with CBC mode needs proper padding like PKCS#7 padding and the padding is performed on the last block. The padding is the missing bytes are filled with the count of the missing bytes, if the last block is full then a new block is needed that is filled with 10. And remember CBC mode is applicable to the padding oracle attack due to improper uses of the padding error and lack of encrypt-then-mac.
The key size must be given to you, and the key size cannot be detected except in the side-channel attacks where if one can see that encryption is 40% slower than AES-128 then it must be AES-128.