本文整理汇总了PHP中workshop::count_potential_authors方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::count_potential_authors方法的具体用法?PHP workshop::count_potential_authors怎么用?PHP workshop::count_potential_authors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workshop
的用法示例。
在下文中一共展示了workshop::count_potential_authors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
//.........这里部分代码省略.........
$task->completed = true;
} elseif ($workshop->phase >= workshop::PHASE_ASSESSMENT) {
$task->completed = false;
} else {
$task->completed = null;
// still has a chance to submit
}
$phase->tasks['submit'] = $task;
}
if (has_capability('mod/workshop:allocate', $workshop->context, $userid)) {
if ($workshop->phaseswitchassessment) {
$task = new stdClass();
$allocator = $DB->get_record('workshopallocation_scheduled', array('workshopid' => $workshop->id));
if (empty($allocator)) {
$task->completed = false;
} else {
if ($allocator->enabled and is_null($allocator->resultstatus)) {
$task->completed = true;
} else {
if ($workshop->submissionend > time()) {
$task->completed = null;
} else {
$task->completed = false;
}
}
}
$task->title = get_string('setup', 'workshopallocation_scheduled');
$task->link = $workshop->allocation_url('scheduled');
$phase->tasks['allocatescheduled'] = $task;
}
$task = new stdclass();
$task->title = get_string('allocate', 'workshop');
$task->link = $workshop->allocation_url();
$numofauthors = $workshop->count_potential_authors(false);
$numofsubmissions = $DB->count_records('workshop_submissions', array('workshopid' => $workshop->id, 'example' => 0));
$sql = 'SELECT COUNT(s.id) AS nonallocated
FROM {workshop_submissions} s
LEFT JOIN {workshop_assessments} a ON (a.submissionid=s.id)
WHERE s.workshopid = :workshopid AND s.example=0 AND a.submissionid IS NULL';
$params['workshopid'] = $workshop->id;
$numnonallocated = $DB->count_records_sql($sql, $params);
if ($numofsubmissions == 0) {
$task->completed = null;
} elseif ($numnonallocated == 0) {
$task->completed = true;
} elseif ($workshop->phase > workshop::PHASE_SUBMISSION) {
$task->completed = false;
} else {
$task->completed = null;
// still has a chance to allocate
}
$a = new stdclass();
$a->expected = $numofauthors;
$a->submitted = $numofsubmissions;
$a->allocate = $numnonallocated;
$task->details = get_string('allocatedetails', 'workshop', $a);
unset($a);
$phase->tasks['allocate'] = $task;
if ($numofsubmissions < $numofauthors and $workshop->phase >= workshop::PHASE_SUBMISSION) {
$task = new stdclass();
$task->title = get_string('someuserswosubmission', 'workshop');
$task->completed = 'info';
$phase->tasks['allocateinfo'] = $task;
}
}
if ($workshop->submissionstart) {