Example #1
0
}
$timenow = time();
if ($course->format == "weeks") {
    $table->head = array($strweek, $strname, $strinfo, $strsubmitted, $strdeadline);
    $table->align = array("CENTER", "LEFT", "LEFT", "LEFT", "LEFT");
} elseif ($course->format == "topics") {
    $table->head = array($strtopic, $strname, $strinfo, $strsubmitted, $strdeadline);
    $table->align = array("CENTER", "LEFT", "left", "LEFT", "LEFT");
} else {
    $table->head = array($strname, $strinfo, $strsubmitted, $strdeadline);
    $table->align = array("LEFT", "LEFT", "LEFT", "LEFT");
}
foreach ($workshops as $workshop) {
    if (workshop_is_teacher($workshop, $USER->id)) {
        // teacher see info (students see grade)
        $info = workshop_phase($workshop, 'short');
        if (time() > $workshop->submissionstart) {
            if ($num = workshop_count_student_submissions_for_assessment($workshop, $USER)) {
                $info .= " [" . get_string("unassessed", "workshop", $num) . "]";
            }
        }
    }
    $due = userdate($workshop->submissionend);
    if ($submissions = workshop_get_user_submissions($workshop, $USER)) {
        foreach ($submissions as $submission) {
            if ($submission->timecreated <= $workshop->submissionend) {
                $submitted = userdate($submission->timecreated);
            } else {
                $submitted = "<span class=\"redfont\">" . userdate($submission->timecreated) . "</span>";
            }
            if (!$workshop->visible) {
Example #2
0
function workshop_print_assignment_info($workshop)
{
    global $CFG;
    if (!($course = get_record("course", "id", $workshop->course))) {
        error("Course is misconfigured");
    }
    if (!($cm = get_coursemodule_from_instance("workshop", $workshop->id, $course->id))) {
        error("Course Module ID was incorrect");
    }
    // print standard assignment heading
    print_heading(format_string($workshop->name), "center");
    print_simple_box_start("center");
    // print phase and date info
    $string = '<b>' . get_string('currentphase', 'workshop') . '</b>: ' . workshop_phase($workshop) . '<br />';
    $dates = array('submissionstart' => $workshop->submissionstart, 'submissionend' => $workshop->submissionend, 'assessmentstart' => $workshop->assessmentstart, 'assessmentend' => $workshop->assessmentend);
    foreach ($dates as $type => $date) {
        if ($date) {
            $strdifference = format_time($date - time());
            if ($date - time() < 0) {
                $strdifference = "<span class=\"redfont\">{$strdifference}</span>";
            }
            $string .= '<b>' . get_string($type, 'workshop') . '</b>: ' . userdate($date) . " ({$strdifference})<br />";
        }
    }
    echo $string;
    $grade = $workshop->gradinggrade + $workshop->grade;
    echo "<br /><b>" . get_string("maximumgrade") . "</b>: {$grade}  ";
    // print link to specimen assessment form
    echo "(<a href=\"assessments.php?id={$cm->id}&amp;action=displaygradingform\">" . get_string("specimenassessmentform", "workshop") . "</a>";
    // print edit icon
    if (workshop_is_teacheredit($workshop) and $workshop->nelements) {
        echo " <a href=\"assessments.php?id={$cm->id}&amp;action=editelements\">" . "<img src=\"{$CFG->pixpath}/t/edit.gif\" " . 'class="iconsmall" alt="' . get_string('amendassessmentelements', 'workshop') . '" /></a>';
    }
    echo ")<br />";
    print_simple_box_end();
}