if ($can_grade && ($gi = $info->grading_info())) { $garr = render_grades($pset, $gi, null); if ($garr->totalindex !== null) { $t = $garr->all[$garr->totalindex] . " / " . $garr->maxtotal; ContactView::echo_group("grade", $t); } } ContactView::echo_repo_regrades_group($info); } else { ContactView::echo_repo_last_commit_group($info, true); } } if (!$Me->is_empty() && $User->is_student()) { Ht::stash_script("peteramati_uservalue=" . json_encode($Me->user_linkpart($User))); foreach (ContactView::pset_list(false, true) as $pset) { show_pset($pset, $User); } if ($Me->isPC) { echo "<div style='margin-top:5em'></div>\n"; if ($User->dropped) { echo Ht::form(hoturl_post("index", array("set_undrop" => 1, "u" => $Me->user_linkpart($User)))), "<div>", Ht::submit("Undrop"), "</div></form>"; } else { echo Ht::form(hoturl_post("index", array("set_drop" => 1, "u" => $Me->user_linkpart($User)))), "<div>", Ht::submit("Drop"), "</div></form>"; } } } function render_pset_row(Pset $pset, $students, Contact $s, $row, $pcmembers, $anonymous) { global $Conf, $Me, $Now, $Profile; $row->sortprefix = ""; $ncol = 0;
} } } function show_pset($info) { global $Me; echo "<hr/>\n"; if ($Me->isPC && get($info->pset, "gitless_grades")) { echo '<div style="float:right"><button type="button" onclick="jQuery(\'#upload\').show()">upload</button></div>'; } echo "<h2>", htmlspecialchars($info->pset->title), "</h2>"; ContactView::echo_partner_group($info); ContactView::echo_repo_group($info, $Me != $info->user); ContactView::echo_repo_last_commit_group($info, false); } show_pset($Info); if ($Me->isPC) { echo '<div id="upload" style="display:none"><hr/>', Ht::form($Info->hoturl_post("pset", array("uploadgrades" => 1))), '<div class="f-contain">', '<input type="file" name="file" />', Ht::submit("Upload"), '</div></form></div>'; } echo "<hr>\n"; if ($Pset->gitless) { echo_grade_cdf_here(); echo_grader(); echo_all_grades(); } else { if ($Info->repo && !$Info->can_view_repo_contents) { echo_grade_cdf_here(); echo_grader(); echo_all_grades(); } else { if ($Info->repo && $Info->recent_commits()) {