/**
  * Constructor
  * @param $vpl. vpl object instance
  **/
 function __construct($vpl)
 {
     global $USER;
     $fake = new stdClass();
     $fake->userid = $USER->id;
     $fake->vpl = $vpl->get_instance()->id;
     parent::__construct($vpl, $fake);
 }
Beispiel #2
0
 public static function cancel($vpl, $userid)
 {
     $example = $vpl->get_instance()->example;
     $lastsub = $vpl->last_user_submission($userid);
     if (!$lastsub && !$example) {
         throw new Exception(get_string('nosubmission', VPL));
     }
     if ($example) {
         $submission = new mod_vpl_example_CE($vpl);
     } else {
         $submission = new mod_vpl_submission_CE($vpl, $lastsub);
     }
     return $submission->cancelProcess();
 }
Beispiel #3
0
$studentCount=0;
    $statusNum=0;
foreach ($list as $userinfo) {
    if($vpl->is_group_activity() && $userinfo->id != $vpl->get_group_leaderid($userinfo->id)){
        continue;
    }
    $submission = null;
    if(!isset($submissions[$userinfo->id])){
        /*if($subselection != 'all'){
            continue;
        }*/
        $submission = null;
    }
    else{
        $subinstance = $submissions[$userinfo->id];
        $submission = new mod_vpl_submission_CE($vpl,$subinstance);
        $subid=$subinstance->id;
        $subinstance->gradesortable = null;
        if($subinstance->dategraded>0){
            if($subselection == 'notgraded'){
                continue;
            }
            if($subselection == 'gradedbyuser' && $subinstance->grader != $USER->id){
                continue;
            }
            //TODO REUSE showing
            $subinstance->gradesortable = $subinstance->grade;
        }else{
            $subinstance->grade = null;
            if($subselection == 'graded' ||$subselection == 'gradedbyuser'){
                continue;