本文整理汇总了PHP中flexible_table类的典型用法代码示例。如果您正苦于以下问题:PHP flexible_table类的具体用法?PHP flexible_table怎么用?PHP flexible_table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了flexible_table类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setup
/**
* Setup the columns and headers and other properties of the table and then
* call flexible_table::setup() method.
*/
function setup($reporturl, $question, $hassubqs)
{
$this->question = $question;
// Define table columns
$columns = array();
$headers = array();
if ($hassubqs) {
$columns[] = 'subq';
$headers[] = '';
}
$columns[] = 'response';
$headers[] = get_string('response', 'quiz_statistics');
$columns[] = 'credit';
$headers[] = get_string('optiongrade', 'quiz_statistics');
$columns[] = 'rcount';
$headers[] = get_string('count', 'quiz_statistics');
$columns[] = 'frequency';
$headers[] = get_string('frequency', 'quiz_statistics');
$this->define_columns($columns);
$this->define_headers($headers);
$this->sortable(false);
$this->column_class('credit', 'numcol');
$this->column_class('rcount', 'numcol');
$this->column_class('frequency', 'numcol');
// Set up the table
$this->define_baseurl($reporturl->out());
$this->collapsible(false);
$this->set_attribute('class', 'generaltable generalbox boxaligncenter');
parent::setup();
}
开发者ID:vuchannguyen,项目名称:web,代码行数:34,代码来源:statistics_question_table.php
示例2: setup
/**
* Setup the columns and headers and other properties of the table and then
* call flexible_table::setup() method.
*/
function setup($quiz, $cmid, $reporturl, $s)
{
$this->quiz = $quiz;
$this->cmid = $cmid;
// Define table columns
$columns = array();
$headers = array();
$columns[] = 'number';
$headers[] = get_string('questionnumber', 'quiz_statistics');
if (!$this->is_downloading()) {
$columns[] = 'icon';
$headers[] = '';
$columns[] = 'actions';
$headers[] = '';
} else {
$columns[] = 'qtype';
$headers[] = get_string('questiontype', 'quiz_statistics');
}
$columns[] = 'name';
$headers[] = get_string('questionname', 'quiz');
$columns[] = 's';
$headers[] = get_string('attempts', 'quiz_statistics');
if ($s > 1) {
$columns[] = 'facility';
$headers[] = get_string('facility', 'quiz_statistics');
$columns[] = 'sd';
$headers[] = get_string('standarddeviationq', 'quiz_statistics');
}
$columns[] = 'random_guess_score';
$headers[] = get_string('random_guess_score', 'quiz_statistics');
$columns[] = 'intended_weight';
$headers[] = get_string('intended_weight', 'quiz_statistics');
$columns[] = 'effective_weight';
$headers[] = get_string('effective_weight', 'quiz_statistics');
$columns[] = 'discrimination_index';
$headers[] = get_string('discrimination_index', 'quiz_statistics');
$columns[] = 'discriminative_efficiency';
$headers[] = get_string('discriminative_efficiency', 'quiz_statistics');
$this->define_columns($columns);
$this->define_headers($headers);
$this->sortable(false);
$this->column_class('s', 'numcol');
$this->column_class('random_guess_score', 'numcol');
$this->column_class('intended_weight', 'numcol');
$this->column_class('effective_weight', 'numcol');
$this->column_class('sd', 'numcol');
$this->column_class('facility', 'numcol');
$this->column_class('discrimination_index', 'numcol');
$this->column_class('discriminative_efficiency', 'numcol');
// Set up the table
$this->define_baseurl($reporturl->out());
$this->collapsible(true);
$this->set_attribute('id', 'questionstatistics');
$this->set_attribute('class', 'generaltable generalbox boxaligncenter');
parent::setup();
}
开发者ID:vuchannguyen,项目名称:web,代码行数:60,代码来源:statistics_table.php
示例3: groups_get_course_groupmode
// Fetch current active group.
$groupmode = groups_get_course_groupmode($course);
$currentgroup = $SESSION->activegroup[$course->id][$groupmode][$course->defaultgroupingid];
if (!empty($instanceid) && !empty($roleid)) {
// Trigger a report viewed event.
$event = \report_participation\event\report_viewed::create(array('context' => $context, 'other' => array('instanceid' => $instanceid, 'groupid' => $currentgroup, 'roleid' => $roleid, 'timefrom' => $timefrom, 'action' => $action)));
$event->trigger();
// from here assume we have at least the module we're using.
$cm = $modinfo->cms[$instanceid];
// Group security checks.
if (!groups_group_visible($currentgroup, $course, $cm)) {
echo $OUTPUT->heading(get_string("notingroup"));
echo $OUTPUT->footer();
exit;
}
$table = new flexible_table('course-participation-' . $course->id . '-' . $cm->id . '-' . $roleid);
$table->course = $course;
$table->define_columns(array('fullname', 'count', 'select'));
$table->define_headers(array(get_string('user'), !empty($action) ? get_string($action) : get_string('allactions'), get_string('select')));
$table->define_baseurl($baseurl);
$table->set_attribute('cellpadding', '5');
$table->set_attribute('class', 'generaltable generalbox reporttable');
$table->sortable(true, 'lastname', 'ASC');
$table->no_sorting('select');
$table->set_control_variables(array(TABLE_VAR_SORT => 'ssort', TABLE_VAR_HIDE => 'shide', TABLE_VAR_SHOW => 'sshow', TABLE_VAR_IFIRST => 'sifirst', TABLE_VAR_ILAST => 'silast', TABLE_VAR_PAGE => 'spage'));
$table->setup();
// We want to query both the current context and parent contexts.
list($relatedctxsql, $params) = $DB->get_in_or_equal($context->get_parent_context_ids(true), SQL_PARAMS_NAMED, 'relatedctx');
$params['roleid'] = $roleid;
$params['instanceid'] = $instanceid;
$params['timefrom'] = $timefrom;
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:index.php
示例4: display_submissions
/**
* Display all the submissions ready for grading
*
* @global object
* @global object
* @global object
* @global object
* @param string $message
* @return bool|void
*/
function display_submissions($message = '')
{
global $CFG, $DB, $USER, $DB, $OUTPUT;
require_once $CFG->libdir . '/gradelib.php';
/* first we check to see if the form has just been submitted
* to request user_preference updates
*/
if (isset($_POST['updatepref'])) {
$perpage = optional_param('perpage', 10, PARAM_INT);
$perpage = $perpage <= 0 ? 10 : $perpage;
set_user_preference('assignment_perpage', $perpage);
set_user_preference('assignment_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));
}
/* next we get perpage and quickgrade (allow quick grade) params
* from database
*/
$perpage = get_user_preferences('assignment_perpage', 10);
$quickgrade = get_user_preferences('assignment_quickgrade', 0);
$grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id);
if (!empty($CFG->enableoutcomes) and !empty($grading_info->outcomes)) {
$uses_outcomes = true;
} else {
$uses_outcomes = false;
}
$page = optional_param('page', 0, PARAM_INT);
$strsaveallfeedback = get_string('saveallfeedback', 'assignment');
/// Some shortcuts to make the code read better
$course = $this->course;
$assignment = $this->assignment;
$cm = $this->cm;
$tabindex = 1;
//tabindex for quick grading tabbing; Not working for dropdowns yet
add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id=' . $this->cm->id, $this->assignment->id, $this->cm->id);
$navigation = build_navigation($this->strsubmissions, $this->cm);
print_header_simple(format_string($this->assignment->name, true), "", $navigation, '', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
$course_context = get_context_instance(CONTEXT_COURSE, $course->id);
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">' . get_string('seeallcoursegrades', 'grades') . '</a></div>';
}
if (!empty($message)) {
echo $message;
// display messages here if any
}
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
/// Check to see if groups are being used in this assignment
/// find out current groups mode
$groupmode = groups_get_activity_groupmode($cm);
$currentgroup = groups_get_activity_group($cm, true);
groups_print_activity_menu($cm, 'submissions.php?id=' . $this->cm->id);
/// Get all ppl that are allowed to submit assignments
if ($users = get_users_by_capability($context, 'mod/assignment:submit', 'u.id', '', '', '', $currentgroup, '', false)) {
$users = array_keys($users);
}
// if groupmembersonly used, remove users who are not in any group
if ($users and !empty($CFG->enablegroupings) and $cm->groupmembersonly) {
if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) {
$users = array_intersect($users, array_keys($groupingusers));
}
}
$tablecolumns = array('picture', 'fullname', 'grade', 'submissioncomment', 'timemodified', 'timemarked', 'status', 'finalgrade');
if ($uses_outcomes) {
$tablecolumns[] = 'outcome';
// no sorting based on outcomes column
}
$tableheaders = array('', get_string('fullname'), get_string('grade'), get_string('comment', 'assignment'), get_string('lastmodified') . ' (' . get_string('submission', 'assignment') . ')', get_string('lastmodified') . ' (' . get_string('grade') . ')', get_string('status'), get_string('finalgrade', 'grades'));
if ($uses_outcomes) {
$tableheaders[] = get_string('outcome', 'grades');
}
require_once $CFG->libdir . '/tablelib.php';
$table = new flexible_table('mod-assignment-submissions');
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id . '&currentgroup=' . $currentgroup);
$table->sortable(true, 'lastname');
//sorted by lastname by default
$table->collapsible(true);
$table->initialbars(true);
$table->column_suppress('picture');
$table->column_suppress('fullname');
$table->column_class('picture', 'picture');
$table->column_class('fullname', 'fullname');
$table->column_class('grade', 'grade');
$table->column_class('submissioncomment', 'comment');
$table->column_class('timemodified', 'timemodified');
$table->column_class('timemarked', 'timemarked');
$table->column_class('status', 'status');
$table->column_class('finalgrade', 'finalgrade');
if ($uses_outcomes) {
$table->column_class('outcome', 'outcome');
}
//.........这里部分代码省略.........
开发者ID:ajv,项目名称:Offline-Caching,代码行数:101,代码来源:lib.php
示例5: sesskey
} else {
$version = "{$block->version} ({$plugin->version})";
}
if (!$blockobject) {
// ignore
$undeletable = '';
} else {
if (in_array($blockname, $undeletableblocktypes)) {
$undeletable = '<a href="blocks.php?unprotect=' . $blockid . '&sesskey=' . sesskey() . '" title="' . $strunprotect . '">' . '<img src="' . $OUTPUT->pix_url('t/unlock') . '" class="icon" alt="' . $strunprotect . '" /></a>';
} else {
$undeletable = '<a href="blocks.php?protect=' . $blockid . '&sesskey=' . sesskey() . '" title="' . $strprotect . '">' . '<img src="' . $OUTPUT->pix_url('t/unlock_gray') . '" class="icon" alt="' . $strprotect . '" /></a>';
}
}
$row = array('<span' . $class . '>' . $strblockname . '</span>', $blocklist, '<span' . $class . '>' . $version . '</span>', $visible, $undeletable, $delete, $settings);
$table->add_data($row);
}
$table->print_html();
if (!empty($incompatible)) {
echo $OUTPUT->heading(get_string('incompatibleblocks', 'blockstable', 'admin'));
$table = new flexible_table('admin-blocks-incompatible');
$table->define_columns(array('block', 'delete'));
$table->define_headers(array($strname, $strdelete));
$table->define_baseurl($CFG->wwwroot . '/' . $CFG->admin . '/blocks.php');
$table->set_attribute('class', 'incompatibleblockstable generaltable');
$table->setup();
foreach ($incompatible as $block) {
$table->add_data(array($block->name, '<a href="blocks.php?delete=' . $block->id . '&sesskey=' . sesskey() . '">' . $strdelete . '</a>'));
}
$table->print_html();
}
echo $OUTPUT->footer();
开发者ID:JP-Git,项目名称:moodle,代码行数:31,代码来源:blocks.php
示例6: get_string
$tablecolumns[] = 'roles';
$tableheaders[] = get_string('roles');
if ($groupmode != 0) {
$tablecolumns[] = 'groups';
$tableheaders[] = get_string('groups');
if (!empty($CFG->enablegroupings)) {
$tablecolumns[] = 'groupings';
$tableheaders[] = get_string('groupings', 'group');
}
}
}
if ($bulkoperations) {
$tablecolumns[] = 'select';
$tableheaders[] = get_string('select');
}
$table = new flexible_table('user-index-participants-' . $course->id);
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($baseurl);
if (!isset($hiddenfields['lastaccess'])) {
$table->sortable(true, 'lastaccess', SORT_DESC);
}
$table->no_sorting('roles');
$table->no_sorting('groups');
$table->no_sorting('groupings');
$table->no_sorting('select');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'participants');
$table->set_attribute('class', 'generaltable generalbox');
$table->set_control_variables(array(TABLE_VAR_SORT => 'ssort', TABLE_VAR_HIDE => 'shide', TABLE_VAR_SHOW => 'sshow', TABLE_VAR_IFIRST => 'sifirst', TABLE_VAR_ILAST => 'silast', TABLE_VAR_PAGE => 'spage'));
$table->setup();
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:index.php
示例7: get_string
if ($managesharedfeeds) {
$select = '(userid = ' . $USER->id . ' OR shared = 1)';
} else {
$select = 'userid = ' . $USER->id;
}
$feeds = $DB->get_records_select('block_rss_client', $select, null, $DB->sql_order_by_text('title'));
$strmanage = get_string('managefeeds', 'block_rss_client');
$PAGE->set_pagelayout('standard');
$PAGE->set_title($strmanage);
$PAGE->set_heading($strmanage);
$managefeeds = new moodle_url('/blocks/rss_client/managefeeds.php', $urlparams);
$PAGE->navbar->add(get_string('blocks'));
$PAGE->navbar->add(get_string('pluginname', 'block_rss_client'));
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'), $managefeeds);
echo $OUTPUT->header();
$table = new flexible_table('rss-display-feeds');
$table->define_columns(array('feed', 'actions'));
$table->define_headers(array(get_string('feed', 'block_rss_client'), get_string('actions', 'moodle')));
$table->define_baseurl($baseurl);
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'rssfeeds');
$table->set_attribute('class', 'generaltable generalbox');
$table->column_class('feed', 'feed');
$table->column_class('actions', 'actions');
$table->setup();
foreach ($feeds as $feed) {
if (!empty($feed->preferredtitle)) {
$feedtitle = s($feed->preferredtitle);
} else {
$feedtitle = s($feed->title);
}
开发者ID:alanaipe2015,项目名称:moodle,代码行数:31,代码来源:managefeeds.php
示例8: array
$DB->delete_records('block_links', array('id' => $delete));
}
$rs = $DB->get_records('block_links', null, 'linktext');
if (!is_array($rs)) {
$rs = array();
}
// Check to see if we have any records.
if (count($rs) == 0) {
$add = 1;
}
echo $OUTPUT->header();
echo html_writer::start_tag('div', array('class' => 'content'));
echo html_writer::tag('h2', $strmanagelinks, array('class' => 'main'));
// Generate the table.
echo html_writer::start_tag('form', array('method' => 'post', 'action' => $baseurl));
$table = new flexible_table('links-administration');
$table->define_columns(array('linktext', 'url', 'notes', 'defaultshow', 'category', 'actions'));
$table->define_headers(array(get_string('linktext', 'block_links'), get_string('url', 'block_links'), get_string('notes', 'block_links'), get_string('defaultshow', 'block_links'), get_string('category', 'block_links'), get_string('actions', 'moodle')));
$table->define_baseurl($baseurl);
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'links');
$table->set_attribute('class', 'generaltable generalbox');
$table->column_class('linktext', 'linktext');
$table->column_class('url', 'url');
$table->column_class('notes', 'notes');
$table->column_class('defaultshow', 'defaultshow');
$table->column_class('category', 'category');
$table->column_class('actions', 'actions');
$table->setup();
foreach ($rs as $index => $link) {
if ($link->defaultshow == '1') {
开发者ID:sbourget,项目名称:moodle-block_links,代码行数:31,代码来源:config_global_action.php
示例9: sesskey
// ignore
$undeletable = '';
} else {
if (in_array($blockname, $undeletableblocktypes)) {
$undeletable = '<a href="blocks.php?unprotect=' . $blockid . '&sesskey=' . sesskey() . '" title="' . $strunprotect . '">' . '<img src="' . $OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="' . $strunprotect . '" /></a>';
} else {
$undeletable = '<a href="blocks.php?protect=' . $blockid . '&sesskey=' . sesskey() . '" title="' . $strprotect . '">' . '<img src="' . $OUTPUT->pix_url('t/lock') . '" class="iconsmall" alt="' . $strprotect . '" /></a>';
}
}
$row = array($strblockname, $blocklist, $version, $visible, $undeletable, $settings, $uninstall);
$table->add_data($row, $class);
}
$table->print_html();
if (!empty($incompatible)) {
echo $OUTPUT->heading(get_string('incompatibleblocks', 'blockstable', 'admin'));
$table = new flexible_table('admin-blocks-incompatible');
$table->define_columns(array('block', 'uninstall'));
$table->define_headers(array($strname, $struninstall));
$table->define_baseurl($CFG->wwwroot . '/' . $CFG->admin . '/blocks.php');
$table->set_attribute('class', 'incompatibleblockstable generaltable');
$table->setup();
foreach ($incompatible as $block) {
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('block_' . $block->name, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
} else {
$uninstall = '';
}
$table->add_data(array($block->name, $uninstall));
}
$table->print_html();
}
开发者ID:gabrielrosset,项目名称:moodle,代码行数:31,代码来源:blocks.php
示例10: display_submissions
//.........这里部分代码省略.........
$wherefilter;
}
$users = $DB->get_records_sql($sql, $params);
if (!empty($users)) {
$users = array_keys($users);
}
// if groupmembersonly used, remove users who are not in any group
if ($users and !empty($CFG->enablegroupmembersonly) and $cm->groupmembersonly) {
if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) {
$users = array_intersect($users, array_keys($groupingusers));
}
}
$tablecolumns = array('picture', 'fullname', 'grade', 'submissioncomment', 'timemodified', 'timemarked', 'status', 'finalgrade');
if ($uses_outcomes) {
$tablecolumns[] = 'outcome'; // no sorting based on outcomes column
}
$tableheaders = array('',
get_string('fullname'),
get_string('grade'),
get_string('comment', 'assignment'),
get_string('lastmodified').' ('.get_string('submission', 'assignment').')',
get_string('lastmodified').' ('.get_string('grade').')',
get_string('status'),
get_string('finalgrade', 'grades'));
if ($uses_outcomes) {
$tableheaders[] = get_string('outcome', 'grades');
}
require_once($CFG->libdir.'/tablelib.php');
$table = new flexible_table('mod-assignment-submissions');
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot.'/mod/assignment/submissions.php?id='.$this->cm->id.'&currentgroup='.$currentgroup);
$table->sortable(true, 'lastname');//sorted by lastname by default
$table->collapsible(true);
$table->initialbars(true);
$table->column_suppress('picture');
$table->column_suppress('fullname');
$table->column_class('picture', 'picture');
$table->column_class('fullname', 'fullname');
$table->column_class('grade', 'grade');
$table->column_class('submissioncomment', 'comment');
$table->column_class('timemodified', 'timemodified');
$table->column_class('timemarked', 'timemarked');
$table->column_class('status', 'status');
$table->column_class('finalgrade', 'finalgrade');
if ($uses_outcomes) {
$table->column_class('outcome', 'outcome');
}
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'attempts');
$table->set_attribute('class', 'submissions');
$table->set_attribute('width', '100%');
//$table->set_attribute('align', 'center');
$table->no_sorting('finalgrade');
$table->no_sorting('outcome');
开发者ID:nuckey,项目名称:moodle,代码行数:67,代码来源:lib.php
示例11: display
//.........这里部分代码省略.........
// Statistics Data table built
unset($attempts);
unset($quizquestions);
unset($states);
// now calculate statistics and set the values in the $questions array
$top = max($attemptscores);
$bottom = min($attemptscores);
$gap = ($top - $bottom) / 3;
$top -= $gap;
$bottom += $gap;
foreach ($questions as $qid => $q) {
$questions[$qid] = $this->report_question_stats($q, $attemptscores, $statstable, $top, $bottom);
}
unset($attemptscores);
unset($statstable);
/// Now check if asked download of data
if ($download = optional_param('download', NULL)) {
$filename = clean_filename("{$course->shortname} " . format_string($quiz->name, true));
switch ($download) {
case "Excel":
$this->Export_Excel($questions, $filename);
break;
case "ODS":
$this->Export_ODS($questions, $filename);
break;
case "CSV":
$this->Export_CSV($questions, $filename);
break;
}
}
/// Construct the table for this particular report
$tablecolumns = array('id', 'qname', 'responses', 'credits', 'rcounts', 'rpercent', 'facility', 'qsd', 'disc_index', 'disc_coeff');
$tableheaders = array(get_string('qidtitle', 'quiz_analysis'), get_string('qtexttitle', 'quiz_analysis'), get_string('responsestitle', 'quiz_analysis'), get_string('rfractiontitle', 'quiz_analysis'), get_string('rcounttitle', 'quiz_analysis'), get_string('rpercenttitle', 'quiz_analysis'), get_string('facilitytitle', 'quiz_analysis'), get_string('stddevtitle', 'quiz_analysis'), get_string('dicsindextitle', 'quiz_analysis'), get_string('disccoefftitle', 'quiz_analysis'));
$table = new flexible_table('mod-quiz-report-itemanalysis');
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot . '/mod/quiz/report.php?q=' . $quiz->id . '&mode=analysis');
$table->sortable(true);
$table->no_sorting('rpercent');
$table->collapsible(true);
$table->initialbars(false);
$table->column_class('id', 'numcol');
$table->column_class('credits', 'numcol');
$table->column_class('rcounts', 'numcol');
$table->column_class('rpercent', 'numcol');
$table->column_class('facility', 'numcol');
$table->column_class('qsd', 'numcol');
$table->column_class('disc_index', 'numcol');
$table->column_class('disc_coeff', 'numcol');
$table->column_suppress('id');
$table->column_suppress('qname');
$table->column_suppress('facility');
$table->column_suppress('qsd');
$table->column_suppress('disc_index');
$table->column_suppress('disc_coeff');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'itemanalysis');
$table->set_attribute('class', 'generaltable generalbox');
// Start working -- this is necessary as soon as the niceties are over
$table->setup();
$tablesort = $table->get_sql_sort();
$sorts = explode(",", trim($tablesort));
if ($tablesort and is_array($sorts)) {
$sortindex = array();
$sortorder = array();
foreach ($sorts as $sort) {
开发者ID:veritech,项目名称:pare-project,代码行数:67,代码来源:report.php
示例12: dialogue_list_conversations
/**
* List conversations of either open or closed type for the current user
*
* Called when a user clicks the "Current Dialogues" or "Closed Dialogues" tabs
* rendering those out directly as HTML inside a print_table() showing who the
* conversation is with, what the subject is, how many entries there are,
* how many are un-read and what the most recent post date is
*
* @param object $dialogue
* @param int $groupid of the group to filter conversations by (default: 0)
* @param string $type 'open' (default) or 'closed'
* @todo remove the embedded style for 'th', make it a class driven thing in the theme
*/
function dialogue_list_conversations($dialogue, $groupid = 0, $type = 'open')
{
global $USER, $CFG;
$condition = $type == 'closed' ? " closed='1' " : " closed='0' ";
$tabid = $type == 'closed' ? 3 : 1;
if (!($course = get_record('course', 'id', $dialogue->course))) {
error('Course is misconfigured');
}
if (!($cm = get_coursemodule_from_instance('dialogue', $dialogue->id, $course->id))) {
error('Course Module ID was incorrect');
}
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$dialoguemanagers = array_keys(get_users_by_capability($context, 'mod/dialogue:manage'));
echo '<style>th.header { text-align: left; }</style>';
require_once $CFG->libdir . '/tablelib.php';
$tablecolumns = array('picture', 'subject', 'fullname', 'total', 'unread', 'lastentry');
$tableheaders = array('', get_string('subject', 'dialogue'), get_string('fullname', ''), get_string('numberofentries', 'dialogue'), get_string('unread', 'dialogue'), get_string('lastentry', 'dialogue'));
$table = new flexible_table('mod-dialogue-submissions');
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot . '/mod/dialogue/view.php?id=' . $cm->id . '&pane=' . $tabid);
$table->sortable(true, 'subject');
$table->collapsible(false);
//$table->column_suppress('picture'); // supress multiple subsequent row entries
//$table->column_suppress('fullname');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'dialogue');
$table->set_attribute('class', 'conversations');
$table->set_attribute('width', '100%');
$table->setup();
$order = '';
// so we can filter the get_conversations() call later
$namesort = '';
// if we want to sort by other calculated fields, e.g. first/last name
if ($sort = $table->get_sql_sort('mod-dialogue-submissions')) {
$sortparts = explode(',', $sort);
$sqlsort = $sortparts[0];
if (strpos($sqlsort, 'subject') !== false) {
$order = $sqlsort;
}
if (strpos($sqlsort, 'total') !== false) {
$order = $sqlsort;
}
if (strpos($sqlsort, 'lastentry') !== false) {
$order = $sqlsort;
$order = str_replace('lastentry', 'c.timemodified', $order);
}
if (strpos($sqlsort, 'firstname') !== false) {
$namesort = $sqlsort;
}
if (strpos($sqlsort, 'lastname') !== false) {
$namesort = $sqlsort;
}
if (strpos($sqlsort, 'unread') !== false) {
$namesort = $sqlsort;
}
}
// list the conversations requiring a resonse from this user in full
if ($conversations = dialogue_get_conversations($dialogue, $USER, $condition, $order, $groupid)) {
foreach ($conversations as $conversation) {
if (in_array($USER->id, $dialoguemanagers)) {
if (!in_array($conversation->userid, $dialoguemanagers)) {
if (!($with = get_record('user', 'id', $conversation->userid))) {
error("User's record not found");
}
} else {
if (!($with = get_record('user', 'id', $conversation->recipientid))) {
error("User's record not found");
}
}
} else {
if ($USER->id != $conversation->userid) {
if (!($with = get_record('user', 'id', $conversation->userid))) {
error("User's record not found");
}
} else {
if (!($with = get_record('user', 'id', $conversation->recipientid))) {
error("User's record not found");
}
}
}
// save sortable field values for each conversation so can sort by them later
$names[$conversation->id] = fullname($with);
$unread[$conversation->id] = $conversation->total - $conversation->readings;
$names_firstlast[$conversation->id] = $with->firstname . ' ' . $with->lastname;
$names_lastfirst[$conversation->id] = $with->lastname . ' ' . $with->firstname;
$photos[$conversation->id] = print_user_picture($with, $course->id, true, 0, true);
//.........这里部分代码省略.........
开发者ID:netspotau,项目名称:moodle-mod_dialogue,代码行数:101,代码来源:locallib.php
示例13: foreach
if ($criterion['id'] == $criterionid) {
foreach ($criterion['levels'] as $lvl) {
$levels[] = intval($lvl['id']);
}
}
}
}
$levels = implode(",", $levels);
// Calculates the number of criteria assigned to current user
$criteriafilter = "\n\tSELECT u.*,\n\t\tCASE WHEN S.comments = 0 AND S.status < 20 THEN 5\n\t\t\tWHEN S.comments = 0 AND S.status >= 20 THEN 20\n\t\t\tWHEN S.comments > 0 THEN 30 END AS status,\n\t\tS.submission\n\tFROM (SELECT\n\ts.id as submission,\n\ts.student,\n\tCOUNT(DISTINCT ec.id) AS comments,\n\ts.sort,\n\ts.status\n\tFROM {emarking_submission} AS s\n\tINNER JOIN {emarking_draft} as d ON (d.submissionid = s.id AND d.qualitycontrol = 0)\n\tINNER JOIN {emarking_page} AS p ON (s.emarking = {$emarking->id} AND p.submission = s.id)\n\tLEFT JOIN {emarking_comment} AS ec ON (ec.page = p.id AND ec.levelid IN ({$levels}))\n\tGROUP BY s.id) AS S\n\tINNER JOIN {user} AS u ON (S.student = u.id)";
// Check if activity is configured with separate groups to filter users
if ($cm->groupmode == SEPARATEGROUPS && $usercangrade && !is_siteadmin($USER) && !$useristeacher) {
$userfilter .= "\nAND u.id in (SELECT userid\n\t\tFROM {groups_members}\nWHERE groupid in (SELECT groupid\nFROM {groups_members} as gm\nINNER JOIN {groups} as g on (gm.groupid = g.id)\nWHERE gm.userid = {$USER->id} AND g.courseid = e.courseid))";
}
// Define flexible table (can be sorted in different ways)
$showpages = new flexible_table('emarking-kanban-' . $cmid);
$showpages->define_headers(array(get_string('notcorrected', 'mod_emarking'), get_string('marking', 'mod_emarking'), get_string('corrected', 'mod_emarking')));
$showpages->define_columns(array('notcorrected', 'marking', 'corrected'));
$showpages->define_baseurl($urlemarking);
$defaulttsort = $emarking->anonymous ? null : 'status';
$showpages->sortable(false);
$showpages->pageable(false);
$showpages->setup();
// Decide on sorting depending on URL parameters and flexible table configuration
$orderby = $emarking->anonymous ? 'ORDER BY sort ASC' : 'ORDER BY u.lastname ASC';
// Get submissions with extra info to show
$sql = $criterionid == 0 ? "\nSELECT u.*, \n\t\tIFNULL(s.id,0) as submission,\n\t\tIFNULL(s.status,0) as status,\n\t\ts.sort\nFROM {emarking_submission} AS s\n\tINNER JOIN {user} AS u ON (s.emarking = ? AND s.student = u.id)\n{$userfilter}\n{$orderby}" : $criteriafilter . $userfilter . $orderby;
// Run the query on the database
$emarkingpages = $DB->get_records_sql($sql, array($emarking->id));
$notcorrected = "";
$marking = "";
开发者ID:eduagdo,项目名称:emarking,代码行数:31,代码来源:kanban.php
示例14: array
$PAGE->set_context($context);
$PAGE->set_course($course);
$PAGE->set_url('/blocks/uniquelogin_list/list_users.php', array('courseid' => $courseid));
$PAGE->navbar->add(get_string("blocktitle", "block_uniquelogin_list"));
$PAGE->set_title(get_string("blocktitle", "block_uniquelogin_list"));
$PAGE->set_heading(get_string("blocktitle", "block_uniquelogin_list"));
$PAGE->set_pagetype(get_string("blocktitle", "block_uniquelogin_list"));
$PAGE->set_pagelayout('standard');
//Calculate if we are in separate groups
$isseparategroups = $PAGE->course->groupmode == SEPARATEGROUPS && $PAGE->course->groupmodeforce && !has_capability('moodle/site:accessallgroups', $PAGE->context);
$currentgroup = $isseparategroups ? groups_get_course_group($PAGE->course) : NULL;
$aUsers = getUserList($currentgroup, $courseid, $PAGE->context->contextlevel, $PAGE->context);
echo $OUTPUT->header();
echo '<h3>' . get_string("blocktitle_list", "block_uniquelogin_list") . '</h3>';
$baseurl = new moodle_url('/blocks/uniquelogin_list/list_users.php', array('contextid' => $context->id, 'courseid' => $courseid, 'perpage' => $perpage));
$table = new flexible_table('user-index-participants-' . $courseid);
$table->define_columns(array('userpic', 'firstname', 'lastname', 'lastip', 'lastaccess', 'deletesession'));
$table->define_headers(array(get_string('userpic'), get_string('firstname'), get_string('lastname'), 'IP', get_string('lastaccess'), get_string("deletesession", "block_uniquelogin_list")));
$table->define_baseurl($baseurl->out());
if (!isset($hiddenfields['lastaccess'])) {
$table->sortable(true, 'lastaccess', SORT_DESC);
} else {
$table->sortable(true, 'firstname', SORT_ASC);
}
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'participants');
$table->set_attribute('class', 'generaltable generalbox');
$table->set_control_variables(array(TABLE_VAR_SORT => 'ssort', TABLE_VAR_HIDE => 'shide', TABLE_VAR_SHOW => 'sshow', TABLE_VAR_IFIRST => 'sifirst', TABLE_VAR_ILAST => 'silast', TABLE_VAR_PAGE => 'spage'));
$table->setup();
$datestring = new stdClass();
$datestring->year = get_string('year');
开发者ID:ed-rom,项目名称:moodle-block_uniqueloginlist,代码行数:31,代码来源:list_users.php
示例15: flexible_table
/**
* Helper method dealing with the fact we can not just fetch the output of flexible_table
*
* @param flexible_table $table The table to render
* @param int $rowsperpage How many assignments to render in a page
* @param bool $displaylinks - Whether to render links in the table
* (e.g. downloads would not enable this)
* @return string HTML
*/
protected function flexible_table(flexible_table $table, $rowsperpage, $displaylinks)
{
$o = '';
ob_start();
$table->out($rowsperpage, $displaylinks);
$o = ob_get_contents();
ob_end_clean();
return $o;
}
开发者ID:evltuma,项目名称:moodle,代码行数:18,代码来源:renderer.php
示例16: require_login
require_once $CFG->dirroot . '/plagiarism/unplag/lib.php';
require_once 'unplag_form.php';
require_login();
admin_externalpage_setup('plagiarismunplag');
$context = context_system::instance();
$id = optional_param('id', 0, PARAM_INT);
$resetuser = optional_param('reset', 0, PARAM_INT);
$delete = optional_param('delete', 0, PARAM_INT);
$page = optional_param('page', 0, PARAM_INT);
$sort = optional_param('tsort', '', PARAM_ALPHA);
$dir = optional_param('dir', '', PARAM_ALPHA);
$download = optional_param('download', '', PARAM_ALPHA);
$exportfilename = 'UnplagDebugOutput.csv';
$limit = 20;
$baseurl = new moodle_url('unplag_debug.php', array('page' => $page, 'sort' => $sort));
$table = new flexible_table('unplagfiles');
// Get list of Events in queue.
$a = new stdClass();
$a->countallevents = $DB->count_records('events_queue_handlers');
$a->countheld = $DB->count_records_select('events_queue_handlers', 'status > 0');
if (!$table->is_downloading($download, $exportfilename)) {
echo $OUTPUT->header();
$currenttab = 'unplagdebug';
require_once 'unplag_tabs.php';
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
if ($lastcron < time() - 3600 * 0.5) {
// Check if run in last 30min.
echo $OUTPUT->box(get_string('cronwarning', 'plagiarism_unplag'), 'generalbox admin warning');
}
$warning = '';
if (!empty($a->countallevents)) {
开发者ID:POETGroup,项目名称:moodle-plagiarism_unplag,代码行数:31,代码来源:unplag_debug.php
示例17: display_submissions
/**
* Display all the submissions ready for grading
*/
function display_submissions($message = '')
{
global $CFG, $db, $USER;
require_once $CFG->libdir . '/gradelib.php';
/* first we check to see if the form has just been submitted
* to request user_preference updates
*/
if (isset($_POST['updatepref'])) {
$perpage = optional_param('perpage', 10, PARAM_INT);
$perpage = $perpage <= 0 ? 10 : $perpage;
set_user_preference('assignment_perpage', $perpage);
set_user_preference('assignment_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));
}
/* next we get perpage and quickgrade (allow quick grade) params
* from database
*/
$perpage = get_user_preferences('assignment_perpage', 10);
$quickgrade = get_user_preferences('assignment_quickgrade', 0);
$grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id);
if (!empty($CFG->enableoutcomes) and !empty($grading_info->outcomes)) {
$uses_outcomes = true;
} else {
$uses_outcomes = false;
}
$teacherattempts = true;
/// Temporary measure
$page = optional_param('page', 0, PARAM_INT);
$strsaveallfeedback = get_string('saveallfeedback', 'assignment');
/// Some shortcuts to make the code read better
$course = $this->course;
$assignment = $this->assignment;
$cm = $this->cm;
$tabindex = 1;
//tabindex for quick grading tabbing; Not working for dropdowns yet
add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id=' . $this->assignment->id, $this->assignment->id, $this->cm->id);
$navlinks = array();
$navlinks[] = array('name' => $this->strassignments, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
$navlinks[] = array('name' => format_string($this->assignment->name, true), 'link' => "view.php?a={$this->assignment->id}", 'type' => 'activityinstance');
$navlinks[] = array('name' => $this->strsubmissions, 'link' => '', 'type' => 'title');
$navigation = build_navigation($navlinks);
print_header_simple(format_string($this->assignment->name, true), "", $navigation, '', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
if (!empty($message)) {
echo $message;
|
请发表评论