Beispiel #1
0
$table->data = array();
$totalsubs = 0;
$totalgraded = 0;
foreach ($vpls as $vpl) {
    $instance = $vpl->get_instance();
    $url = vpl_rel_url('view.php', 'id', $vpl->get_course_module()->id);
    $row = array(count($table->data) + 1, "<a href='{$url}'>{$vpl->get_printable_name()}</a>", s($instance->shortdescription));
    if ($startdate) {
        $row[] = $instance->startdate > 0 ? userdate($instance->startdate) : '';
    }
    if ($duedate) {
        $row[] = $instance->duedate > 0 ? userdate($instance->duedate) : '';
    }
    if ($grader) {
        if ($vpl->has_capability(VPL_GRADE_CAPABILITY) && $vpl->get_grade() != 0 && !$instance->example) {
            $info = vpl_list_util::count_graded($vpl);
            $totalsubs += $info['submissions'];
            $totalgraded += $info['graded'];
            $url = vpl_rel_url('views/submissionslist.php', 'id', $vpl->get_course_module()->id, 'selection', 'allsubmissions');
            $row[] = '<a href="' . $url . '">' . $info['submissions'] . '</a>';
            //Need mark?
            if ($info['submissions'] > $info['graded'] && $vpl->get_grade() != 0 && !($instance->duedate != 0 && $instance->duedate > time())) {
                $url = vpl_rel_url('views/submissionslist.php', 'id', $vpl->get_course_module()->id, 'selection', 'notgraded');
                $diff = $info['submissions'] - $info['graded'];
                $row[] = '<div class="vpl_nm">' . $info['graded'] . ' <a href="' . $url . '">(' . $diff . ')</a><div>';
            } else {
                //No grade able
                if ($vpl->get_grade() == 0 && $info['graded'] == 0) {
                    $row[] = '-';
                } else {
                    $row[] = $info['graded'];