Пример #1
0
function get_grade($prefix, $s, $c)
{
    $grade = get_grades($prefix, $c);
    $achieved = get_achieved($prefix, $s, $c);
    $result = '';
    if ($achieved['P'] >= 1) {
        $result = $achieved['P'] . '/' . $grade['P'];
        //$result = '-';
        if ($achieved['P'] == $grade['P']) {
            $result = 'P';
            if ($achieved['M'] == $grade['M']) {
                $result = 'M';
                if ($achieved['D'] == $grade['D']) {
                    $result = 'D';
                    if ($achieved['P'] == $grade['P'] && $grade['M'] == 0 && $grade['D'] == 0) {
                        $result = 'P';
                    }
                }
            }
        }
    }
    return $result;
}
Пример #2
0
        // only a valid course if uses PMD outcomes
        $poss = array();
        $all_courses[$course->sortorder]['course'] = $course;
        $all_courses[$course->sortorder]['possible']['summary'] = get_possible($CFG->prefix, $course->id);
        $all_courses[$course->sortorder]['possible']['detail'] = get_possible_criteria($CFG->prefix, $course->id);
        $poss = get_possible($CFG->prefix, $course->id);
        if ($poss['P'] > $max['P']) {
            $max['P'] = $poss['P'];
        }
        if ($poss['M'] > $max['M']) {
            $max['M'] = $poss['M'];
        }
        if ($poss['D'] > $max['D']) {
            $max['D'] = $poss['D'];
        }
        $all_courses[$course->sortorder]['achieved']['summary'] = get_achieved($CFG->prefix, $student->id, $course->id);
        //$grades = get_grade_data($CFG->prefix, $student->id, $course->id);
    }
}
//echo '<pre>';
//print_r($all_courses);
//echo '</pre>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>Summary</title>
	<?php 
</title>
	<?php 
if (file_exists('screen.css')) {
    echo '<link rel="stylesheet" href="screen.css" type="text/css" media="screen">';
}
if (file_exists('print.css')) {
    echo '<link rel="stylesheet" href="print.css" type="text/css" media="print">';
}
?>
</head>
<body>
<?php 
$criteria = get_possible_criteria($_GET['course']);
$assignments = $DB->get_records_select('assignment', 'course=' . $_GET['course']);
$possible = get_possible($_GET['course'], $_GET['student']);
$achieved = get_achieved($_GET['course'], $_GET['student']);
$count = 0;
foreach ($assignments as $key => $val) {
    $sql = 'SELECT visible from course_modules where course=' . $course->id . ' AND instance=' . $key . ';';
    //echo '<p>'.$sql.'</p>';
    $result = mysql_query($sql);
    $row = mysql_fetch_object($result);
    if ($row->visible == 0) {
        unset($assignments[$key]);
    } else {
        $assignments[$key]->num = ++$count;
    }
}
//echo '<pre>possible:'."\n";
//print_r($assignments);
//echo '</pre>';