Problem with multiple selectors all changing each other
Hello all,
I am working on a customised scoresheet for a Bible Quiz group. Basically, I want to click on a box and have a box come up with options for correct and incorrect. I just want it to affect the score for that one box. However, if you click another box, it changes all of the boxes.
Click the 10, 20, or 30 in the top left corner. It should update the points under the 4. Click on any of the boxes assigned to a person on the grey line. A box should come up with a Cor (Correct) or Incor link. Click on either option. Then click on another grey box and do the same thing. I don't want all of the points to change when one person's score changes. Does that make sense?
Thanks in advance. Here's my code:
- $('.current-question.quizzer-points').click(function() {
-
- var quizzerPoints = $(this);
- var quizzerPointsId = $(this).attr('id');
- var box = $(this).offset();
- var boxTop = box.top + $(this).height() + 2;
- var boxLeft = box.left;
-
- $('#answer-box').css({
- left: boxLeft,
- top: boxTop
- }).show();
- $('#correct').click(function() {
-
- //alert(quizzerPointsId);
- var points = $('#point-value-q'+question).text();
- $(quizzerPoints).text(points);
- $('#answer-box').hide();
-
- });
- $('#incorrect').click(function() {
-
- var points = -($('#point-value-q'+question).text() / 2);
- $(quizzerPoints).text(points);
- $('#answer-box').hide();
-
- });
-
- $('#exit-question').click(function() {
-
- $('#answer-box').hide();
-
- });
-
- });