当前位置: 首页>>代码示例>>PHP>>正文


PHP Status::is_passed方法代码示例

本文整理汇总了PHP中Status::is_passed方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::is_passed方法的具体用法?PHP Status::is_passed怎么用?PHP Status::is_passed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Status的用法示例。


在下文中一共展示了Status::is_passed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: judge

 function judge($cleanup = true)
 {
     $status = $this->do_judge();
     if (Status::is_passed($status) and $this->subm->entity()->deadline_passed($this->subm->time)) {
         $status = Status::MISSED_DEADLINE;
     }
     $this->subm->set_status($status);
     if ($cleanup) {
         $this->__destruct();
     }
 }
开发者ID:jlsa,项目名称:justitia,代码行数:11,代码来源:SubmissionJudgement.php

示例2: write_print_submission

 function write_print_submission($subm)
 {
     // include this submission?
     if (!isset($_REQUEST['include_failed'])) {
         if (!Status::is_passed($subm->status) and !$subm->status == Status::MISSED_DEADLINE) {
             return;
         }
     }
     // does it match a user filter?
     if (@$_REQUEST['user_filter'] != '') {
         $match = stripos(User::names_text($subm->users()), $_REQUEST['user_filter']);
         if ($match === false) {
             return;
         }
     }
     // submission header
     echo '<div class="submission">';
     echo '<div class="submission-head">';
     echo "<table><tr><td>Submission</td><td>#" . $subm->submissionid . " for <tt>" . htmlspecialchars($subm->entity_path) . "</tt></td></tr>";
     echo "<tr><td>by</td><td>" . User::names_html($subm->users()) . "</td></tr>";
     echo "<tr><td>on</td><td>" . format_date($subm->time) . "</td></tr>";
     if (!Status::is_passed($subm->status)) {
         echo "<tr><td>status</td><td><strong>" . strtoupper(Status::to_text($subm)) . "</strong></td></tr>";
     }
     echo "</table>";
     echo "</div>\n";
     if ($subm->is_archived()) {
         // file header
         echo "<div class=\"file\">";
         echo '<div class="file-head">';
         echo 'This submission has been archived';
         echo '</div></div>';
     } else {
         // submission files
         foreach ($subm->get_code_filenames() as $code_name => $filename) {
             $this->write_print_file($filename, $subm->get_file($code_name));
         }
     }
     echo "</div>\n";
 }
开发者ID:jlsa,项目名称:justitia,代码行数:40,代码来源:admin_print.php

示例3: write_submission_summary

 function write_submission_summary($entities, $users)
 {
     // determine summary
     $num_passed = array();
     $num_failed = array();
     $num_missed_deadline = array();
     $num_none = array();
     foreach ($entities as $e => $entity) {
         $num_passed[$e] = $num_failed[$e] = $num_missed_deadline[$e] = $num_none[$e] = 0;
         foreach ($users as $userinfo) {
             $subms = $userinfo['subms'];
             $subm = isset($subms[$e]) ? $subms[$e] : false;
             if (Status::is_passed(Status::to_status($subm))) {
                 $num_passed[$e]++;
             } else {
                 if (Status::is_failed(Status::to_status($subm))) {
                     $num_failed[$e]++;
                 } else {
                     if (Status::is_missed_deadline(Status::to_status($subm))) {
                         $num_missed_deadline[$e]++;
                     } else {
                         $num_none[$e]++;
                     }
                 }
             }
         }
     }
     $sum = array();
     foreach ($entities as $e => $entity) {
         $sum[$e] = $num_passed[$e] + $num_failed[$e] + $num_missed_deadline[$e] + $num_none[$e];
     }
     echo '<tr class="first-child"><td class="summary">passed</td>';
     foreach ($entities as $e => $entity) {
         echo '<td>' . $num_passed[$e] . ' (' . number_format(100.0 * $num_passed[$e] / $sum[$e], 1) . '%)</td>';
     }
     echo "</tr>\n";
     echo '<tr><td class="summary">failed</td>';
     foreach ($entities as $e => $entity) {
         echo '<td>' . $num_failed[$e] . ' (' . number_format(100.0 * $num_failed[$e] / $sum[$e], 1) . '%)</td>';
     }
     echo "</tr>\n";
     echo '<tr><td class="summary">missed deadline</td>';
     foreach ($entities as $e => $entity) {
         echo '<td>' . $num_missed_deadline[$e] . ' (' . number_format(100.0 * $num_missed_deadline[$e] / $sum[$e], 1) . '%)</td>';
     }
     echo "</tr>\n";
     echo '<tr><td class="summary">not submitted</td>';
     foreach ($entities as $e => $entity) {
         echo '<td>' . $num_none[$e] . ' (' . number_format(100.0 * $num_none[$e] / $sum[$e], 1) . '%)</td>';
     }
     echo "</tr>\n";
 }
开发者ID:jlsa,项目名称:justitia,代码行数:52,代码来源:admin_results.php

示例4: write_print_submission

 function write_print_submission($subm)
 {
     // include this submission?
     if (!isset($_REQUEST['include_failed'])) {
         if (!Status::is_passed($subm->status)) {
             return;
         }
     }
     // does it match a user filter?
     if (@$_REQUEST['user_filter'] != '') {
         $match = stripos(User::names_text($subm->users()), $_REQUEST['user_filter']);
         if ($match === false) {
             return;
         }
     }
     // submission header
     echo "\\section*{Submission \\#" . $subm->submissionid . " for " . htmlspecialchars($subm->entity_path) . "}\n";
     echo "by " . User::names_html($subm->users()) . ", ";
     echo "on " . format_date($subm->time) . "\n\n";
     if (!Status::is_passed($subm->status)) {
         echo "(status " . Status::to_text($subm) . ")";
     }
     // submission files
     foreach ($subm->get_code_filenames() as $code_name => $filename) {
         $this->write_print_file($filename, $subm->get_file($code_name));
     }
     echo "\\cleardoublepage\n";
 }
开发者ID:jlsa,项目名称:justitia,代码行数:28,代码来源:admin_print2.php


注:本文中的Status::is_passed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。