$currentgroup = groups_get_activity_group($cm, true);
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string('Workload Distribution'), 2);
echo $OUTPUT->heading(format_string(getGroupName($currentgroup)), 4);
//$html = "<img src='pix\\".$history_summary->method.".png' width='16px' heigh='16px' />  ".userdate($history_summary->date)."<br /><br />";
$member_rank = RankMembersTasksDistribution($currentgroup);
//echo AlertMembersTasksDistribution($member_rank);
arsort($member_rank);
//Order the Rank by number of hours
//Get the total number of hours based on each student
$total_hours = array_sum($member_rank);
if ($total_hours > 0) {
    $equal_hours = $total_hours / count($member_rank);
    $html = "Individual Recommended Hours: " . round($equal_hours, 2) . " Hours<br /><br />";
    //If large variance occurs, display column for table
    if (AlertWorkloadDistribution($currentgroup)) {
        $html .= "<table style='border:1px solid black;'><tr style='background-color:lightgrey;'><th>Member</th><th>Assigned Hours</th><th>% of Workload</th><th>Variance</th></tr>";
    } else {
        $html .= "<table style='border:1px solid black;'><tr style='background-color:lightgrey;'><th>Member</th><th>Assigned Hours</th><th>% of Workload</th><th></th></tr>";
    }
    foreach ($member_rank as $key => $member) {
        if ($key == $USER->id) {
            //Bold the current student
            $html .= "<tr><td><b>" . studentidToLMS_Name($key) . "</b></td>";
        } else {
            $html .= "<tr><td>" . studentidToLMS_Name($key) . "</td>";
        }
        $html .= "<td style='text-align:center;'>" . $member . "</td>";
        $html .= "<td style='text-align:center;'''>" . round($member / $total_hours * 100, 2) . "</td>";
        $distribution = MemberWorkloadDistribution($member, $equal_hours);
        if (!empty($distribution)) {
$currentgroup = groups_get_activity_group($cm, true);
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string('Workload Distribution'), 2);
echo $OUTPUT->heading(format_string(getGroupName($currentgroup)), 4);
//$html = "<img src='pix\\".$history_summary->method.".png' width='16px' heigh='16px' />  ".userdate($history_summary->date)."<br /><br />";
$member_rank = RankMembersTasksDistribution($currentgroup, $project->id);
//echo AlertMembersTasksDistribution($member_rank);
arsort($member_rank);
//Order the Rank by number of hours
//Get the total number of hours based on each student
$total_hours = array_sum($member_rank);
if ($total_hours > 0) {
    $equal_hours = $total_hours / count($member_rank);
    $html = "Individual Recommended Hours: " . round($equal_hours, 2) . " Hours<br /><br />";
    //If large variance occurs, display column for table
    if (AlertWorkloadDistribution($currentgroup, $project->id)) {
        $html .= "<table style='border:1px solid black;'><tr style='background-color:lightgrey;'><th>Member</th><th>Assigned Hours</th><th>% of Workload</th><th>Variance</th></tr>";
    } else {
        $html .= "<table style='border:1px solid black;'><tr style='background-color:lightgrey;'><th>Member</th><th>Assigned Hours</th><th>% of Workload</th><th></th></tr>";
    }
    foreach ($member_rank as $key => $member) {
        if ($key == $USER->id) {
            //Bold the current student
            $html .= "<tr><td><b>" . studentidToLMS_Name($key) . "</b></td>";
        } else {
            $html .= "<tr><td>" . studentidToLMS_Name($key) . "</td>";
        }
        $html .= "<td style='text-align:center;'>" . $member . "</td>";
        $html .= "<td style='text-align:center;'>" . round($member / $total_hours * 100, 2) . "</td>";
        $wl = MemberWorkloadDistribution($member, $equal_hours);
        if (isset($wl)) {
Exemple #3
0
    if ($percentage_done <= $task->progress && time() < $task->end_date || $task->progress == 100) {
        $progress_bar_colour = '#0f0';
        //Green
    } else {
        $progress_bar_colour = '#f00';
        //Red
        add_to_log($course->id, 'project', 'alert', 'task bad standing ' . $task->progress . '% progress', $task->id);
    }
    $html .= '<div style="background-color: ' . $progress_bar_colour . ';width:' . $task->progress . '%; height:12px;">&nbsp;</div>';
    //Green Progress bar to indicate complete
    $html .= '<div style="position: relative;top:-11px;text-align:center;font-size:10px;font-weight:bold;">Progress: ' . $task->progress . '%</div></div><br />';
}
//end foreach loop
//Display Workload distribution link and possible alert.
if (count($tasks) > 0) {
    $workload_alert = AlertWorkloadDistribution($currentgroup);
    $html .= "<br/> <a href='workload_distribution.php?cmid=" . $id . "&p=" . $project->id . "' style='a:link{color: #f00;}' >Workload Distribution</a>";
    //Display link
    if ($workload_alert) {
        $html .= " <img src='pix/alert_icon.png'' width='12px' height='12px'/>";
        //If alert is true, lets display an icon for attention
    }
    //end if there are alerts
}
//end if no tasks check
//Display Project Comparison with other groups in the course
$html .= "<br/> <a href='group_compare.php?cmid=" . $id . "&p=" . $project->id . "'>Progress Comparison with other Groups</a>";
$html .= "</table></td><td style='vertical-align:top;'>";
//Right side of the screen for communication
//List all the group members, and recent activity.
$html .= "<table><tr><td><u>Group Members</u></td><td><u>Last Online</u></td></tr>";
Exemple #4
0
    if ($percentage_done <= $task->progress && time() < $task->end_date || $task->progress == 100) {
        $progress_bar_colour = '#0f0';
        //Green
    } else {
        $progress_bar_colour = '#f00';
        //Red
        add_to_log($course->id, 'project', 'alert', 'task bad standing ' . $task->progress . '% progress', $task->id);
    }
    $html .= '<div style="background-color: ' . $progress_bar_colour . ';width:' . $task->progress . '%; height:12px;">&nbsp;</div>';
    //Green Progress bar to indicate complete
    $html .= '<div style="position: relative;top:-11px;text-align:center;font-size:10px;font-weight:bold;">Progress: ' . $task->progress . '%</div></div><br />';
}
//end foreach loop
//Display Workload distribution link and possible alert.
if (count($tasks) > 0) {
    $workload_alert = AlertWorkloadDistribution($currentgroup, $project->id);
    $html .= "<br/> <a href='workload_distribution.php?cmid=" . $id . "&p=" . $project->id . "' style='a:link{color: #f00;}' >Workload Distribution</a>";
    //Display link
    if ($workload_alert) {
        $html .= " <img src='pix/alert_icon.png'' width='12px' height='12px'/>";
        //If alert is true, lets display an icon for attention
    }
    //end if there are alerts
}
//end if no tasks check
//Display Project Comparison with other groups in the course
$html .= "<br/> <a href='group_compare.php?cmid=" . $id . "&p=" . $project->id . "'>Progress Comparison with other Groups</a>";
$html .= "</table></td><td style='vertical-align:top;'>";
//Right side of the screen for communication
//List all the group members, and recent activity.
$html .= "<table><tr><td><u>Group Members</u></td><td><u>Last Online</u></td></tr>";