Пример #1
0
function uses_outcomes($prefix, $courseid)
{
    $grades = get_possible_criteria($prefix, $courseid);
    if ($grades['P'] && $grades['M'] && $grades['D']) {
        return true;
    }
    return false;
}
	<title><?php 
echo $course->fullname;
?>
</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;
    }
}
Пример #3
0
        if ($course['achieved']['summary']['D'] >= $course['possible']['summary']['D']) {
            $points = $values[2];
        }
        return $points;
    }
    return 0;
}
$all_courses = array();
$max = array('P' => 0, 'M' => 0, 'D' => 0);
foreach ($courses as $course) {
    if (uses_outcomes($CFG->prefix, $course->id)) {
        // 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>';
Пример #4
0
                    if ($desc) {
                        $title = ' title="' . $desc . '"';
                    }
                    if (outcome_achieved($prefix, $courseid, $student->id, $letter . $c)) {
                        $class = 'achieved';
                    }
                    $data .= '<td' . $title . ' class="' . $class . '">' . $letter . $c . '</td>';
                }
            }
        }
        $data .= '</tr>';
    }
    $data .= '</table>' . "\n";
    return $data;
}
$criteria = get_possible_criteria($CFG->prefix, $course->id);
//print_r($criteria);
?>
<!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><?php 
echo $course->fullname;
?>
</title>
	<?php 
if (file_exists('screen.css')) {
    echo '<link rel="stylesheet" href="screen.css" type="text/css" media="screen">';