本文整理汇总了PHP中Exercise::getQuestionListPagination方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::getQuestionListPagination方法的具体用法?PHP Exercise::getQuestionListPagination怎么用?PHP Exercise::getQuestionListPagination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exercise
的用法示例。
在下文中一共展示了Exercise::getQuestionListPagination方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$columns = array('username', 'firstname', 'lastname', 'exam_password');
$column_names = array(get_lang('Username'), get_lang('Firstname'), get_lang('Lastname'), get_lang('Password'));
$result = UserManager::get_user_data($start, $limit, $sidx, $sord);
break;
case 'get_question_list':
if (isset($exercise) && !empty($exercise)) {
$extraField = new ExtraField('question');
$extraFields = $extraField->get_all(array('field_filter = ?' => 1));
$columns = array('question', 'type', 'category', 'level', 'score');
if (!empty($extraFields)) {
foreach ($extraFields as $extraField) {
$columns[] = $extraField['field_variable'];
}
}
$columns[] = 'actions';
$result = $exercise->getQuestionListPagination($start, $limit, $sidx, $sord, $where_condition, $extraFields);
}
break;
case 'get_group_reporting':
$columns = array('name', 'time', 'progress', 'score', 'works', 'messages', 'actions');
$result = Tracking::get_group_reporting($course_id, $group_id, 'all', $start, $limit, $sidx, $sord, $where_condition);
break;
case 'get_course_exercise_medias':
$columns = array('question');
$result = Question::get_course_medias($course_id, $start, $limit, $sidx, $sord, $where_condition);
if (!empty($result)) {
foreach ($result as &$media) {
$media['id'] = $media['iid'];
}
}
break;
示例2: indexAction
//.........这里部分代码省略.........
if (!empty($limit)) {
$total_pages = ceil($count / $limit);
}
}
if ($page > $total_pages) {
$page = $total_pages;
}
$start = $limit * $page - $limit;
if ($start < 0) {
$start = 0;
}
//4. Deleting an element if the user wants to
if ($operation == 'del') {
$obj->delete($request->get('id'));
}
$is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_allowed_to_edit(true) || api_is_drh();
//5. Querying the DB for the elements
$columns = array();
switch ($action) {
case 'get_questions':
$columns = \Question::getQuestionColumns(api_get_course_id(), $extra_fields, $questionFields, true);
$columns = $columns['simple_column_name'];
$result = \Question::getQuestions($app, $categoryId, $exerciseId, $courseId, array('where' => $where_condition, 'order' => "{$sidx} {$sord}", 'extra' => $extra_fields, 'question' => $questionFields, 'limit' => "{$start} , {$limit}"));
//var_dump($result);
break;
case 'get_user_list_plugin_widescale':
$columns = array('username', 'firstname', 'lastname', 'exam_password');
$column_names = array(get_lang('Username'), get_lang('Firstname'), get_lang('Lastname'), get_lang('Password'));
$result = \UserManager::get_user_data($start, $limit, $sidx, $sord);
break;
case 'get_question_list':
if (isset($exercise) && !empty($exercise)) {
$columns = array('question', 'type', 'category', 'level', 'score', 'actions');
$result = $exercise->getQuestionListPagination($start, $limit, $sidx, $sord, $where_condition);
}
break;
case 'get_group_reporting':
$columns = array('name', 'time', 'progress', 'score', 'works', 'messages', 'actions');
$result = \Tracking::get_group_reporting($course_id, $group_id, 'all', $start, $limit, $sidx, $sord, $where_condition);
break;
case 'get_course_exercise_medias':
$columns = array('question');
$result = \Question::get_course_medias($course_id, $start, $limit, $sidx, $sord, $where_condition);
if (!empty($result)) {
foreach ($result as &$media) {
$media['id'] = $media['iid'];
}
}
break;
case 'get_user_course_report_resumed':
$columns = array('extra_ruc', 'training_hours', 'count_users', 'count_users_registered', 'average_hours_per_user', 'count_certificates');
$column_names = array(get_lang('Company'), get_lang('TrainingHoursAccumulated'), get_lang('CountOfSubscriptions'), get_lang('CountOfUsers'), get_lang('AverageHoursPerStudent'), get_lang('CountCertificates'));
$result = \CourseManager::get_user_list_from_course_code(null, null, "LIMIT {$start}, {$limit}", " {$sidx} {$sord}", null, null, true, true, 'ruc');
$new_result = array();
if (!empty($result)) {
foreach ($result as $row) {
$row['training_hours'] = api_time_to_hms($row['training_hours']);
$row['average_hours_per_user'] = api_time_to_hms($row['average_hours_per_user']);
$new_result[] = $row;
}
$result = $new_result;
}
break;
case 'get_user_course_report':
$columns = array('course', 'user', 'time', 'certificate', 'progress_100', 'progress');
$column_names = array(get_lang('Course'), get_lang('User'), get_lang('ManHours'), get_lang('CertificateGenerated'), get_lang('Approved'), get_lang('CourseAdvance'));