File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,21 @@ trait autoagreement_functions {
3333 */
3434 public function feedback_comments () {
3535 global $ DB ;
36-
37- $ feedbacks = $ DB ->get_records ('coursework_feedbacks ' , [
36+ $ sql = "SELECT * FROM {coursework_feedbacks}
37+ WHERE submissionid = :submissionid AND isfinalgrade = :isfinalgrade
38+ AND stageidentifier NOT LIKE :stageidentifier " ;
39+ $ feedbacks = $ DB ->get_records_sql ($ sql , [
3840 'submissionid ' => $ this ->get_allocatable ()->get_submission ($ this ->get_coursework ())->id (),
3941 'isfinalgrade ' => 0 ,
42+ 'stageidentifier ' => 'final_agreed_1 '
4043 ]);
4144 $ feedbackcomment = '' ;
4245 $ count = 1 ;
4346
4447 foreach ($ feedbacks as $ feedback ) {
48+ if (empty ($ feedback ->feedbackcomment )) {
49+ continue ;
50+ }
4551 // Put all initial feedbacks together for the comment field.
4652 $ feedbackcomment .= get_string ('markercomments ' , 'mod_coursework ' , $ count );
4753 $ feedbackcomment .= $ feedback ->feedbackcomment ;
You can’t perform that action at this time.
0 commit comments