$q = "select cn.notes, c.extension from ContactInfo c\n"; if ($Pset->gitless_grades) { $q .= "\t\tjoin ContactGrade cn on (cn.cid=c.contactId and cn.pset={$Pset->psetid})"; } else { $q .= "\t\tjoin ContactLink l on (l.cid=c.contactId and l.type=" . LINK_REPO . " and l.pset={$Pset->id})\n\t\tjoin RepositoryGrade rg on (rg.repoid=l.link and rg.pset={$Pset->id} and not rg.placeholder)\n\t\tjoin CommitNotes cn on (cn.hash=rg.gradehash and cn.pset=rg.pset)\n"; } $result = $Conf->qe_raw($q . " where {$notdropped}"); $series = new Series(); $xseries = new Series(); $noextra_series = $Pset->has_extra ? new Series() : null; $has_extra = false; while ($row = edb_row($result)) { if ($g = ContactView::pset_grade(json_decode($row[0]), $Pset)) { $series->add($g->total); if ($row[1]) { $xseries->add($g->total); } if ($noextra_series) { $noextra_series->add($g->total_noextra); if ($g->total_noextra != $g->total) { $has_extra = true; } } } } $r = $series->summary(); if ($xseries->n) { $r->extension = $xseries->summary(); } if ($has_extra) { $r->noextra = $noextra_series->summary();