Beispiel #1
0
 public function get($qid, $class, $student)
 {
     if ($student != USERNAME) {
         Permissions::TA_GATE($qid, $class, USERNAME);
     }
     $config = Utilities::get_configuration($qid, $class);
     $class_dir = Utilities::get_class_base($qid, $class);
     $assns = Utilities::get_all_directories($class_dir . "/" . $config->submissions_dir);
     $student_submissions = array();
     foreach ($assns as $assn) {
         $a_dir = $class_dir . "/" . $config->submissions_dir . "/" . $assn;
         $all_subs = Utilities::get_all_directories($a_dir);
         foreach ($all_subs as $sub) {
             $sunetid = Utilities::get_sunetid($sub);
             if ($sunetid == $student) {
                 $test = $a_dir . "/" . $sub;
                 if (is_dir($test)) {
                     $student_submissions[] = array("assn" => $assn, "dir" => $sub);
                 }
             }
         }
     }
     //print_r($student_submissions);
     $this->smarty->assign("student", $student);
     $this->smarty->assign("submissions", $student_submissions);
     $this->smarty->display("student.html");
 }
Beispiel #2
0
 public function get($qid, $class)
 {
     Permissions::TA_GATE($qid, $class, USERNAME);
     $config = Utilities::get_configuration($qid, $class);
     $class_dir = Utilities::get_class_base($qid, $class);
     $assns = Utilities::get_all_directories($class_dir . "/" . $config->submissions_dir);
     $this->smarty->assign("class", $class);
     $this->smarty->assign("assns", $assns);
     $this->smarty->display("ta.html");
 }
Beispiel #3
0
 public function get($qid, $class, $assignment, $student, $print = False)
 {
     $sunetid = Utilities::get_sunetid($student);
     if ($sunetid != USERNAME) {
         Permissions::TA_GATE($qid, $class, USERNAME);
     }
     $this->basic_setup();
     $dirname = Utilities::get_student_dir($qid, $class, $assignment, $student);
     // /cs107.1122/repos/assign2/jdoe/comments.json
     $comments = Utilities::get_comments($dirname);
     $config = Utilities::get_configuration($qid, $class);
     $preset_comments = array();
     foreach ($config->assignments as $entry) {
         if ($entry->dir == $assignment) {
             $this->smarty->assign("assignment", $entry);
             if (property_exists($entry, 'comments')) {
                 $preset_comments = $entry->comments;
                 break;
             }
         }
     }
     $this->smarty->assign("preset_comments", $preset_comments);
     $interactive = Permissions::is_ta_for_class($qid, $class, USERNAME);
     if ($interactive) {
         $this->smarty->assign("interactive", 'true');
     } else {
         $this->smarty->assign("interactive", 'false');
     }
     $this->smarty->assign("student", $student);
     // probably change this decomp
     $all_files = Utilities::get_all_files($dirname);
     $code_files = Utilities::get_code_files($dirname, $all_files, $config);
     $this->smarty->assign("comments", $comments);
     $this->smarty->assign("code_files", $code_files);
     $this->smarty->display("code.html");
 }
Beispiel #4
0
 public static function get_assn_base($qid, $class, $assn)
 {
     $class_base = Utilities::get_class_base($qid, $class);
     $config = Utilities::get_configuration($qid, $class);
     return $class_base . "/" . $config->submissions_dir . "/" . $assn;
 }
Beispiel #5
0
 public static function is_ta_for_class($qid, $class, $user)
 {
     $config = Utilities::get_configuration($qid, $class);
     $ta_list = $config->tas;
     return in_array(USERNAME, $ta_list);
 }