Ejemplo n.º 1
0
            $s->performance = sprintf("%.1f", 100 * (0.9 * ($s->psets_noextra / $m_noextra) + 0.75 * ($s->psets / $m_psets) + 1.2 * ($s->tests / $m_tests)));
        }
        set_ranks($students, $selection, "performance");
    }
    $csv = new CsvGenerator();
    $csv->set_header($selection);
    $csv->set_selection($selection);
    foreach ($students as $s) {
        $csv->add($s);
    }
    $csv->download_headers("gradereport.csv");
    $csv->download();
    exit;
}
if ($Me->isPC && check_post() && $Qreq->report) {
    download_psets_report($Qreq);
}
function set_grader($qreq)
{
    global $Conf, $Me;
    if (!($pset = $Conf->pset_by_key($qreq->pset))) {
        return $Conf->errorMsg("No such pset");
    } else {
        if ($pset->gitless) {
            return $Conf->errorMsg("Pset has no repository");
        }
    }
    $graders = array();
    foreach (pcMembers() as $pcm) {
        if ($pcm->email == $qreq->grader || !$pcm->privChair && $qreq->grader == "__random__") {
            $graders[] = $pcm;
Ejemplo n.º 2
0
            $s->performance = sprintf("%.1f", 100 * @(0.9 * ($s->psets_noextra / $maxbyg["psets_noextra"]) + 0.75 * ($s->psets / $maxbyg["psets"]) + 1.2 * ($s->tests / $maxbyg["tests"])));
        }
        set_ranks($students, $selection, "performance");
    }
    $csv = new CsvGenerator();
    $csv->set_header($selection);
    $csv->set_selection($selection);
    foreach ($students as $s) {
        $csv->add($s);
    }
    $csv->download_headers("gradereport.csv");
    $csv->download();
    exit;
}
if ($Me->isPC && check_post() && @$_GET["report"]) {
    download_psets_report($_REQUEST);
}
function set_grader()
{
    global $Conf, $Me;
    if (!($pset = Pset::find(@$_REQUEST["pset"]))) {
        return $Conf->errorMsg("No such pset");
    } else {
        if ($pset->gitless) {
            return $Conf->errorMsg("Pset has no repository");
        }
    }
    $graders = array();
    foreach (pcMembers() as $pcm) {
        if ($pcm->email == @$_POST["grader"] || !$pcm->privChair && @$_POST["grader"] == "__random__") {
            $graders[] = $pcm;