File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,9 @@ public function getSubmissionList(
8989 }
9090
9191 if ($ restrictions ->withExternalId ?? false ) {
92- $ queryBuilder ->andWhere ('s.externalid IS NOT NULL ' );
92+ $ queryBuilder
93+ ->andWhere ('s.externalid IS NOT NULL ' )
94+ ->andWhere ('s.expected_results IS NULL ' );
9395 }
9496
9597 if (isset ($ restrictions ->rejudgingId )) {
@@ -163,7 +165,16 @@ public function getSubmissionList(
163165
164166 if (isset ($ restrictions ->externalDifference )) {
165167 if ($ restrictions ->externalDifference ) {
166- $ queryBuilder ->andWhere ('j.result != ej.result ' );
168+ if ($ restrictions ->result === 'judging ' || $ restrictions ->externalResult === 'judging ' ) {
169+ // When either the local or external result is set to judging explicitly,
170+ // coalesce the result with a known non-null value, because in MySQL
171+ // 'correct' <> null is not true. By coalescing with '-' we prevent this.
172+ $ queryBuilder
173+ ->andWhere ('COALESCE(j.result, :dash) != COALESCE(ej.result, :dash) ' )
174+ ->setParameter ('dash ' , '- ' );
175+ } else {
176+ $ queryBuilder ->andWhere ('j.result != ej.result ' );
177+ }
167178 } else {
168179 $ queryBuilder ->andWhere ('j.result = ej.result ' );
169180 }
You can’t perform that action at this time.
0 commit comments