本文整理汇总了PHP中learnpath::get_objectives_count_from_db方法的典型用法代码示例。如果您正苦于以下问题:PHP learnpath::get_objectives_count_from_db方法的具体用法?PHP learnpath::get_objectives_count_from_db怎么用?PHP learnpath::get_objectives_count_from_db使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类learnpath
的用法示例。
在下文中一共展示了learnpath::get_objectives_count_from_db方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLpStats
//.........这里部分代码省略.........
$action = null;
if ($type == 'classic') {
$action = '<td></td>';
}
if (in_array($row['item_type'], $chapterTypes)) {
$output .= '<tr class="' . $oddclass . '">
<td>' . $extend_link . '</td>
<td colspan="4">
' . $title . '
</td>
<td colspan="2">' . learnpathItem::humanize_status($lesson_status, true, $type) . '</td>
<td colspan="2"></td>
<td colspan="2"></td>
' . $action . '
</tr>';
continue;
} else {
$output .= '<tr class="' . $oddclass . '">
<td>' . $extend_link . '</td>
<td colspan="4">
' . $title . '
</td>
<td colspan="2"></td>
<td colspan="2"></td>
<td colspan="2"></td>
' . $action . '
</tr>';
}
$attemptCount = 1;
do {
// Check if there are interactions below.
$extend_attempt_link = '';
$extend_this_attempt = 0;
if ((learnpath::get_interactions_count_from_db($row['iv_id'], $course_id) > 0 || learnpath::get_objectives_count_from_db($row['iv_id'], $course_id) > 0) && !$extend_all) {
if ($extendAttemptId == $row['iv_id']) {
// The extend button for this attempt has been clicked.
$extend_this_attempt = 1;
$extend_attempt_link = Display::url(Display::return_icon('visible.gif', get_lang('HideAttemptView')), api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix);
} else {
// Same case if fold_attempt_id is set, so not implemented explicitly.
// The extend button for this attempt has not been clicked.
$extend_attempt_link = Display::url(Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')), api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix);
}
}
if ($counter % 2 == 0) {
$oddclass = 'row_odd';
} else {
$oddclass = 'row_even';
}
$lesson_status = $row['mystatus'];
$score = $row['myscore'];
$time_for_total = $row['mytime'];
$time = learnpathItem::getScormTimeFromParameter('js', $row['mytime']);
if ($score == 0) {
$maxscore = $row['mymaxscore'];
} else {
if ($row['item_type'] == 'sco') {
if (!empty($row['myviewmaxscore']) && $row['myviewmaxscore'] > 0) {
$maxscore = $row['myviewmaxscore'];
} elseif ($row['myviewmaxscore'] === '') {
$maxscore = 0;
} else {
$maxscore = $row['mymaxscore'];
}
} else {
$maxscore = $row['mymaxscore'];
示例2:
$my_path = $row['path'];
$result_disabled_ext_all = false;
if ($row['item_type'] == 'quiz') {
// Check results_disabled in quiz table.
$my_path = Database::escape_string($my_path);
$sql = "SELECT results_disabled FROM {$TBL_QUIZ} WHERE c_id = {$course_id} AND iid ='" . (int) $my_path . "'";
$res_result_disabled = Database::query($sql);
$row_result_disabled = Database::fetch_row($res_result_disabled);
if (Database::num_rows($res_result_disabled) > 0 && (int) $row_result_disabled[0] === 1) {
$result_disabled_ext_all = true;
}
}
// Check if there are interactions below
$extend_this_attempt = 0;
$inter_num = learnpath::get_interactions_count_from_db($row['iv_id'], $course_id);
$objec_num = learnpath::get_objectives_count_from_db($row['iv_id'], $course_id);
$extend_attempt_link = '';
if ($inter_num > 0 || $objec_num > 0) {
if (!empty($_GET['extend_attempt_id']) && $_GET['extend_attempt_id'] == $row['iv_id']) {
// The extend button for this attempt has been clicked.
$extend_this_attempt = 1;
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix . '">
' . Display::return_icon('visible.gif', get_lang('HideAttemptView')) . '</a>';
} else {
// Same case if fold_attempt_id is set, so not implemented explicitly.
// The extend button for this attempt has not been clicked.
$extend_attempt_link = '<a href="' . api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix . '">
' . Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')) . '
</a>';
}
}