Below is an example;
Say you have 3 questions with weights 1, 2 and 4.
This implies that the second question gives twice the points of the first question and the third question gives 4 times the points of the initial question.
In order to grade the test, we would then multiply the answer on each question (either 1 if correct, or 0 if incorrect) by its weight and finally, divide the sum of the weight for all questions.
Score = (Q1*1 + Q2*2 + Q3*4) / 7