示例#1
0
function show_pset($pset, $user)
{
    global $Me;
    if ($pset->gitless_grades && $Me == $user && !$pset->partner && !$pset->contact_grade_for($user)) {
        return;
    }
    echo "<hr/>\n";
    $pseturl = hoturl("pset", array("pset" => $pset->urlkey, "u" => $Me->user_linkpart($user), "sort" => req("sort")));
    echo "<h2><a href=\"", $pseturl, "\">", htmlspecialchars($pset->title), "</a>";
    $info = ContactView::user_pset_info($user, $pset);
    $grade_check_user = $Me->isPC && $Me != $user ? $user : $Me;
    $can_grade = $grade_check_user->can_see_grades($pset, $user, $info);
    if ($can_grade && $info->has_grading()) {
        echo ' <a class="gradesready" href="', $pseturl, '">(grade ready)</a>';
    }
    echo "</a></h2>";
    ContactView::echo_partner_group($info);
    ContactView::echo_repo_group($info);
    if ($info->repo) {
        Contact::check_repo($info->repo, 30);
    }
    if ($info->has_grading()) {
        ContactView::echo_repo_grade_commit_group($info);
        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);
    }
}
示例#2
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);
}