Depends on your data structure.
For a multiple-choice exam, you might set it up this way:
tblQuestion: one record for each question
QuestionID primary key
Question text of the question
tblAnswer: one record for each possible answer
QuestionID foreign key to tblQuestion.QuestionID
Choice choice number within question (e.g. a,b,c)
Answer text of the answer
Marks marks for this answer (e.g. zero if wrong, 1 if right).
(Primary key is combination of QuestionID and Choice).
tblExam: one record for each answer given by a student:
StudentID student who gave this answer.
QuestionID
Choice
(QuestionID + Choice is foreign key to tblAnswer).
With that kind of structure, you would create a query into tblAnswer and
tblExam, joined on two fields - QuestionID and Choice. Then read the value
of Marks, and sum for the result.
(Note that the structure permits partial marks for some answers if desired.)