本文整理汇总了PHP中Permissions::TA_GATE方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::TA_GATE方法的具体用法?PHP Permissions::TA_GATE怎么用?PHP Permissions::TA_GATE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::TA_GATE方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}
示例2: get
public function get($qid, $class, $assn)
{
Permissions::TA_GATE($qid, $class, USERNAME);
$assn_dir = Utilities::get_assn_base($qid, $class, $assn);
$students = Utilities::get_all_directories($assn_dir);
$this->smarty->assign("class", $class);
$this->smarty->assign("assn", $assn);
$this->smarty->assign("students", $students);
$this->smarty->display("assignment.html");
}
示例3: 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");
}
示例4: post_xhr
public function post_xhr($qid, $class, $assignment, $student)
{
Permissions::TA_GATE($qid, $class, USERNAME);
// /cs107.1122/repos/assign2/jdoe/comments.json
$dirname = Utilities::get_student_dir($qid, $class, $assignment, $student);
$comments = Utilities::get_comments($dirname);
$file = $_POST['filename'];
$save_range = $_POST['rangeLower'] . "-" . $_POST['rangeHigher'];
if ($_POST['action'] == "save") {
$comments->{$file}->{$save_range}->commenter = USERNAME;
$comments->{$file}->{$save_range}->comment = $_POST['text'];
} else {
if ($_POST['action'] == "delete") {
unset($comments->{$file}->{$save_range});
}
}
Utilities::write_comments($dirname, $comments);
echo json_encode(array("status" => "ok", "action" => $_POST['action']));
}