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(
89
89
}
90
90
91
91
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 ' );
93
95
}
94
96
95
97
if (isset ($ restrictions ->rejudgingId )) {
@@ -163,7 +165,16 @@ public function getSubmissionList(
163
165
164
166
if (isset ($ restrictions ->externalDifference )) {
165
167
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
+ }
167
178
} else {
168
179
$ queryBuilder ->andWhere ('j.result = ej.result ' );
169
180
}
You can’t perform that action at this time.
0 commit comments