Moodle

Only include closed attempts in manual grade counts

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Quiz
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

OU Moodle with September 2008 Quiz reports

Manual grading screen

Could you change the numbers given in 'Grade all n attempts'
and 'Grade all n ungraded attempts'
such that they only include completed attempts.

Activity

Hide
Jamie Pratt added a comment -

I attach a patch for this issue that applies to HEAD.

Tim said he would look at this. I think we should choose whether to use constants or global arrays for QUESTION_EVENTS_GRADED and the new QUESTION_EVENTS_CLOSED. I think we should use only constants if we don't need to use get_in_or_equal with constants. Can I go ahead and open a new issue linked to this one and replace all these globals with constants?

Show
Jamie Pratt added a comment - I attach a patch for this issue that applies to HEAD. Tim said he would look at this. I think we should choose whether to use constants or global arrays for QUESTION_EVENTS_GRADED and the new QUESTION_EVENTS_CLOSED. I think we should use only constants if we don't need to use get_in_or_equal with constants. Can I go ahead and open a new issue linked to this one and replace all these globals with constants?
Hide
Jamie Pratt added a comment -

Please Sarah do not apply this patch yet to the OU code base. I will produce another patch if it is decided to remove the global arrays.

Show
Jamie Pratt added a comment - Please Sarah do not apply this patch yet to the OU code base. I will produce another patch if it is decided to remove the global arrays.
Hide
Jamie Pratt added a comment - - edited

Here is the new patch for this issue "manualgradeclosedonlywithconstantsonly.txt ". Will wait to apply it to HEAD until Tim has a chance to review it.

Show
Jamie Pratt added a comment - - edited Here is the new patch for this issue "manualgradeclosedonlywithconstantsonly.txt ". Will wait to apply it to HEAD until Tim has a chance to review it.
Hide
Tim Hunt added a comment -

Looking good. Bonus marks for writing unit tests!

The things I would change are:

1. In mod/quiz/report/reportlib.php you have extra whitespace on line 138.

2. Same place, I would not use in-or-equal for combining QUESTION_EVENTS_GRADED and QUESTION_EVENTS_CLOSED. I think either define a new QUESTION_EVENTS_CLOSED_OR_GRADED, or just use '... IN ('.QUESTION_EVENTS_GRADED.','.QUESTION_EVENTS_CLOSED.') ...'. Any sensible database will have not trouble optimising IN (3,6,9,3,8,9).

3. Same to comments about mod/quiz/report/grading/report.php line 460 - why did you have duplicated code anyway?!

Show
Tim Hunt added a comment - Looking good. Bonus marks for writing unit tests! The things I would change are: 1. In mod/quiz/report/reportlib.php you have extra whitespace on line 138. 2. Same place, I would not use in-or-equal for combining QUESTION_EVENTS_GRADED and QUESTION_EVENTS_CLOSED. I think either define a new QUESTION_EVENTS_CLOSED_OR_GRADED, or just use '... IN ('.QUESTION_EVENTS_GRADED.','.QUESTION_EVENTS_CLOSED.') ...'. Any sensible database will have not trouble optimising IN (3,6,9,3,8,9). 3. Same to comments about mod/quiz/report/grading/report.php line 460 - why did you have duplicated code anyway?!
Hide
Jamie Pratt added a comment - - edited

I attach a patch that fixes this issue (manualgradeclosedonlywithconstantsonly2.txt) and does the right thing and uses constants and not get_in_or_equal.

Show
Jamie Pratt added a comment - - edited I attach a patch that fixes this issue (manualgradeclosedonlywithconstantsonly2.txt) and does the right thing and uses constants and not get_in_or_equal.
Hide
Jamie Pratt added a comment -

Committed the final patch to HEAD

Show
Jamie Pratt added a comment - Committed the final patch to HEAD

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: