Possible issue with counting of completed reviews in SectionEditorSubmissionDAO class (OJS 2.4.3)

Hi all,
I’m working with the code in the SectionEditorSubmissionDAO.inc.php class and came across a possible mistake in the code that counts the number of reviews completed by a reviewer. In the getReviewersForArticle function, there is a subselect at line 798

(SELECT COUNT(ac.review_id) FROM review_assignments ac WHERE ac.reviewer_id = u.user_id AND ac.date_completed IS NOT NULL) AS completed,

The date_completed field gets set when the reviewer submits his review and ALSO when the editor cancels the review (see line 329 of SectionEditorAction). So the “Done” column that the editor sees on the “/selectReviewer” page counts the sum total of completed and cancelled reviews. It is necessary to also check that “cancelled=0” to get the correct total, and this is in fact what is done in the ReviewAssignmentDAO class. In the getCompletedReviewCounts function (line 230), there is the check “…AND r.cancelled=0”.

The average review time measure (line 808) should also have this check added to be consistent.
Roger

Hi @rkemp,

Yes, you’re right. I tested here and my only doubt was if the date completed was being set when the editor cancelled the review, and it’s exactly what’s happening.

I opened an issue for this: Cancelled reviews are counted as completed ones in reviewer stats · Issue #692 · pkp/pkp-lib · GitHub

Are you working fixing it? If yes, it would be great if you could send a pull request against that issue. Let me know if you need help with that.

Thanks for your help debugging that. :smile:

Cheers,
Bruno

Hi Bruno,
Sorry I’m not in the git space yet (although I do plan to migrate my own efforts with OJS there eventually), so I won’t be able to submit a fix for this bug in the near future.

Do you regard the bug as being the failure to test if cancelled=0 or the setting of date_completed in the SectionEditorAction::cancelReview function in the first place? In other words, does date_completed hold the date of a submitted review or does it hold the date of our completed interaction with the reviewer?
Roger

Hi all,

Fixed – see the issue entry for details.

Regards,
Alec Smecher
Public Knowledge Project Team