Index: lib/questionlib.php
===================================================================
--- lib/questionlib.php	(revision 295)
+++ lib/questionlib.php	(working copy)
@@ -1382,16 +1382,15 @@
 
     } else { // grading event
 
-        // Unless the attempt is closing, we want to work out if the current responses
+        // We want to work out if the current responses
         // (or equivalent responses) were already given in the last graded attempt.
-        if(QUESTION_EVENTCLOSE != $action->event && QUESTION_EVENTOPEN != $state->last_graded->event &&
+        if(QUESTION_EVENTOPEN != $state->last_graded->event &&
                 $QTYPES[$question->qtype]->compare_responses($question, $state, $state->last_graded)) {
             $state->event = QUESTION_EVENTDUPLICATE;
         }
 
-        // If we did not find a duplicate or if the attempt is closing, perform grading
-        if ((!$sameresponses and QUESTION_EVENTDUPLICATE != $state->event) or
-                QUESTION_EVENTCLOSE == $action->event) {
+        // If we did not find a duplicate, perform grading
+        if ((!$sameresponses and QUESTION_EVENTDUPLICATE != $state->event) ) {
             if (!$QTYPES[$question->qtype]->grade_responses($question, $state, $cmoptions)) {
                 return false;
             }
@@ -1473,8 +1472,10 @@
         $state->grade = 0;
     }
 
+    /* negative marks hack start: commented the line below 
     // Ensure that the grade does not go down
     $state->grade = max($state->grade, $state->last_graded->grade);
+    negative marks hack stop */
 }
 
 /**
Index: question/type/multichoice/questiontype.php
===================================================================
--- question/type/multichoice/questiontype.php	(revision 295)
+++ question/type/multichoice/questiontype.php	(working copy)
@@ -365,9 +365,13 @@
             }
         }
 
+        /* negative marks hack start
         // Make sure we don't assign negative or too high marks
         $state->raw_grade = min(max((float) $state->raw_grade,
-                            0.0), 1.0) * $question->maxgrade;
+        0.0), 1.0) * $question->maxgrade; */
+        $state->raw_grade = min((float) $state->raw_grade, 1.0) * $question->maxgrade;
+        // Negative marks hack stop
+        
 
         // Apply the penalty for this attempt
         $state->penalty = $question->penalty * $question->maxgrade;

