How to calculate the proficiency based on an exam with questions of different difficulty levels? In an examination (multiple choice test), suppose there are n questions each question can have a difficulty level between 1 - 5 (1 for the easiest question and 5 for the difficult one). 
If someone answers x questions correctly and y questions wrongly (x + y = n) How can we calculate the average difficulty level of a question which s/he can correctly answer?  

Alright, so we have question $i$ with difficult level $X_i$, $i=1,2,3,\ldots,n$. 
Say the set $S$ is the collection of the question indices of the questions that are answered correctly.
So the average difficulty level of the questions answered correctly, $P$, is
$$P=\frac{\sum_{i\in S}X_i}{\mathrm{n}(S)}$$
where $\mathrm{n}(S)$ is the number of elements of the set $S$.

However, if you want the average difficulty earned by the candidate, $Q$, then we consider
$$Q=\frac{\sum_{i\in S}X_i}{n}$$
instead. This means that the candidate will earn $0$ difficulty credit for the question they answer wrong.

Using your example in the comment, we will have
$$p=\frac{3+3+3+3}{4}=3$$
but
$$q=\frac{3+3+3+3}{10}=1.2$$
Essentially, you are finding the candidate's score where each question has different weightage.
