當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utilities::get_configuration方法代碼示例

本文整理匯總了PHP中Utilities::get_configuration方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utilities::get_configuration方法的具體用法?PHP Utilities::get_configuration怎麽用?PHP Utilities::get_configuration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Utilities的用法示例。


在下文中一共展示了Utilities::get_configuration方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get

 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");
 }
開發者ID:jadawebster,項目名稱:paperless2,代碼行數:27,代碼來源:student.php

示例2: get

 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");
 }
開發者ID:jadawebster,項目名稱:paperless2,代碼行數:10,代碼來源:ta.php

示例3: get

 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");
 }
開發者ID:jadawebster,項目名稱:paperless2,代碼行數:36,代碼來源:code.php

示例4: get_assn_base

 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;
 }
開發者ID:jadawebster,項目名稱:paperless2,代碼行數:6,代碼來源:utils.php

示例5: is_ta_for_class

 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);
 }
開發者ID:jadawebster,項目名稱:paperless2,代碼行數:6,代碼來源:permissions.php


注:本文中的Utilities::get_configuration方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。