simple line integral - scalar and vector

Evaluate the following line integrals, showing your working. The path of integration in each case is anticlockwise around the four sides of the square OABC in the x−y plane whose edges are aligned with the coordinate axes. The length of each side of the square is a and one corner O is the origin.

(i) $\int dl$

(ii) $\int d\mathbf{l}$

where $dl$ is a line element and $d\mathbf{l}$ is the corresponding vector.

i: For each the sections OA and AB, the integral gets a value a a. This is clear.

However, for the sections BC and CO, the change in $x$ is in the negative $x$ direction.

Basically I have 2 different answers

$4a$ and $0$, which is correct?

ii: Same problem, I have 2 answers: $2a\mathbf{i} + 2a\mathbf{j}$ or $0\mathbf{i}+0\mathbf{j}$

Thank you

First we consider the scalar integral $\int 1\ dl$. Imagine the plane seen from above. The function is $1$ on the path so imagine a square made of iron-wire hovering at height 1 over the $x$-$y$ plane. The integral is then the area between the iron-floating square and the path (which lies "on the ground" at height $0$). This forms a set of $4$ "walls". And clearly each wall has dimension $a\times 1$. Hence you get a total surface area of the walls to be $4a$.
Now for the vector integral $\int1\ d\textbf{l}$. Integration is all about summing a lot of small stuff. $\tiny{\text{best definition ever}}$. In this case imagine a lot of small arrows. Each one pointing into the tail of the next and this chain of arrow goes around the path of the square.
These little arrows are actually $d\textbf{l}$ and we multiply them by $1$ hence not changing them. Now we apply the integral which is simply means summing all mini-arrows. Now it is clear that each little arrow will cancel with the one on the opposite side of the square (remember here we do some vector addition.) therefore the sum of all mini-arrows will be $0$. (precisely $(0,0)$)