public function show_info()
 {
     global $DB;
     $vpl = self::$vpls[$this->vplid];
     $cmid = $vpl->get_course_module()->id;
     $ret = '';
     if ($this->userid >= 0) {
         $user = $DB->get_record('user', array('id' => $this->userid));
     } else {
         $user = false;
     }
     if ($user) {
         $ret .= '<a href="' . vpl_mod_href('/forms/submissionview.php', 'id', $cmid, 'userid', $user->id) . '">';
     }
     $ret .= s($this->filename);
     if ($user) {
         $ret .= '</a> ';
         $sub = new mod_vpl_submission($vpl, $this->subid);
         $ret .= $sub->print_grade_core() . '<br />';
         $ret .= $vpl->user_fullname_picture($user);
     }
     return $ret;
 }
Exemplo n.º 2
0
function vpl_user_outline($course, $user, $mod, $instance)
{
    //Search submisions for $user $instance
    $vpl = new mod_vpl(null, $instance->id);
    $subinstance = $vpl->last_user_submission($user->id);
    if (!$subinstance) {
        $return = null;
    } else {
        require_once 'vpl_submission.class.php';
        $return = new stdClass();
        $submission = new mod_vpl_submission($vpl, $subinstance);
        $return->time = $subinstance->datesubmitted;
        $subs = $vpl->user_submissions($user->id);
        if (count($subs) > 1) {
            $info = get_string('nsubmissions', VPL, count($subs));
        } else {
            $info = get_string('submission', VPL, count($subs));
        }
        if ($subinstance->dategraded) {
            $info .= '<br />' . get_string('grade') . ': ' . $submission->print_grade_core();
        }
        $url = vpl_mod_href('forms/submissionview.php', 'id', $vpl->get_course_module()->id, 'userid', $user->id);
        $return->info = '<a href="' . $url . '">' . $info . '</a>';
    }
    return $return;
}
Exemplo n.º 3
0
                 $row[] = $info['graded'];
             }
         }
     } else {
         $row[] = '';
         $row[] = '';
     }
 }
 if ($student) {
     if (!$vpl->has_capability(VPL_GRADE_CAPABILITY) && $vpl->has_capability(VPL_SUBMIT_CAPABILITY) && $vpl->get_grade() != 0 && !$instance->example) {
         $subinstance = $vpl->last_user_submission($USER->id);
         if ($subinstance) {
             //Submitted
             $submission = new mod_vpl_submission($vpl, $subinstance);
             if ($subinstance->dategraded > 0 && $vpl->get_visiblegrade()) {
                 $text = $submission->print_grade_core();
             } else {
                 $result = $submission->getCE();
                 $text = '';
                 if ($result['executed'] !== 0) {
                     $prograde = $submission->proposedGrade($result['execution']);
                     if ($prograde > '') {
                         $text = get_string('proposedgrade', VPL, $submission->print_grade_core($prograde));
                     }
                 } else {
                     $text = get_string('nograde');
                 }
             }
         } else {
             //No submitted
             $text = get_string('nosubmission', VPL);