本文整理汇总了PHP中grade_grade::get_datesubmitted方法的典型用法代码示例。如果您正苦于以下问题:PHP grade_grade::get_datesubmitted方法的具体用法?PHP grade_grade::get_datesubmitted怎么用?PHP grade_grade::get_datesubmitted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grade_grade
的用法示例。
在下文中一共展示了grade_grade::get_datesubmitted方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fill_table_recursive
//.........这里部分代码省略.........
$data['itemname']['colspan'] = $this->maxdepth - $depth;
$data['itemname']['celltype'] = 'th';
$data['itemname']['id'] = $header_row;
/// Actual Grade
$gradeval = $grade_grade->finalgrade;
if (!$this->canviewhidden) {
/// Virtual Grade (may be calculated excluding hidden items etc).
$adjustedgrade = $this->blank_hidden_total_and_adjust_bounds($this->courseid, $grade_grade->grade_item, $gradeval);
$gradeval = $adjustedgrade['grade'];
// We temporarily adjust the view of this grade item - because the min and
// max are affected by the hidden values in the aggregation.
$grade_grade->grade_item->grademax = $adjustedgrade['grademax'];
$grade_grade->grade_item->grademin = $adjustedgrade['grademin'];
}
if ($this->showfeedback) {
// Copy $class before appending itemcenter as feedback should not be centered
$classfeedback = $class;
}
$class .= " itemcenter ";
if ($this->showweight) {
$data['weight']['class'] = $class;
$data['weight']['content'] = '-';
$data['weight']['headers'] = "{$header_cat} {$header_row} weight";
// has a weight assigned, might be extra credit
if ($grade_object->aggregationcoef > 0 && $type != 'courseitem') {
$data['weight']['content'] = number_format($grade_object->aggregationcoef, 2);
}
}
if ($this->showgrade) {
if ($grade_grade->grade_item->needsupdate) {
$data['grade']['class'] = $class . ' gradingerror';
$data['grade']['content'] = get_string('error');
} else {
if (!empty($CFG->grade_hiddenasdate) and $grade_grade->get_datesubmitted() and !$this->canviewhidden and $grade_grade->is_hidden() and !$grade_grade->grade_item->is_category_item() and !$grade_grade->grade_item->is_course_item()) {
// the problem here is that we do not have the time when grade value was modified, 'timemodified' is general modification date for grade_grades records
$class .= ' datesubmitted';
$data['grade']['class'] = $class;
$data['grade']['content'] = get_string('submittedon', 'grades', userdate($grade_grade->get_datesubmitted(), get_string('strftimedatetimeshort')));
} else {
if ($grade_grade->is_hidden()) {
$data['grade']['class'] = $class . ' dimmed_text';
$data['grade']['content'] = '-';
if ($this->canviewhidden) {
$data['grade']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true);
}
} else {
$data['grade']['class'] = $class;
$data['grade']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true);
}
}
}
$data['grade']['headers'] = "{$header_cat} {$header_row} grade";
}
// Range
if ($this->showrange) {
$data['range']['class'] = $class;
$data['range']['content'] = $grade_grade->grade_item->get_formatted_range(GRADE_DISPLAY_TYPE_REAL, $this->rangedecimals);
$data['range']['headers'] = "{$header_cat} {$header_row} range";
}
// Percentage
if ($this->showpercentage) {
if ($grade_grade->grade_item->needsupdate) {
$data['percentage']['class'] = $class . ' gradingerror';
$data['percentage']['content'] = get_string('error');
} else {
if ($grade_grade->is_hidden()) {
示例2: fill_table_recursive
private function fill_table_recursive(&$element)
{
global $CFG, $DB;
$type = $element['type'];
$depth = $element['depth'];
$grade_object = $element['object'];
$eid = $grade_object->id;
$fullname = $this->gtree->get_element_header($element, true, true, true);
$data = array();
$hidden = '';
$excluded = '';
$class = '';
// If this is a hidden grade category, hide it completely from the user
if ($type == 'category' && $grade_object->is_hidden() && !$this->canviewhidden && ($this->showhiddenitems == GRADE_REPORT_USER_HIDE_HIDDEN || $this->showhiddenitems == GRADE_REPORT_USER_HIDE_UNTIL && !$grade_object->is_hiddenuntil())) {
return false;
}
if ($type == 'category') {
$this->evenodd[$depth] = ($this->evenodd[$depth] + 1) % 2;
}
$alter = $this->evenodd[$depth] == 0 ? 'even' : 'odd';
/// Process those items that have scores associated
if ($type == 'item' or $type == 'categoryitem' or $type == 'courseitem') {
if (!($grade_grade = grade_grade::fetch(array('itemid' => $grade_object->id, 'userid' => $this->user->id)))) {
$grade_grade = new grade_grade();
$grade_grade->userid = $this->user->id;
$grade_grade->itemid = $grade_object->id;
}
$grade_grade->load_grade_item();
/// Hidden Items
if ($grade_grade->grade_item->is_hidden()) {
$hidden = ' hidden';
}
// If this is a hidden grade item, hide it completely from the user.
if ($grade_grade->is_hidden() && !$this->canviewhidden && ($this->showhiddenitems == GRADE_REPORT_USER_HIDE_HIDDEN || $this->showhiddenitems == GRADE_REPORT_USER_HIDE_UNTIL && !$grade_grade->is_hiddenuntil())) {
// return false;
} else {
/// Excluded Item
if ($grade_grade->is_excluded()) {
$fullname .= ' [' . get_string('excluded', 'grades') . ']';
$excluded = ' excluded';
}
/// Other class information
$class = "{$hidden} {$excluded}";
if ($this->switch) {
// alter style based on whether aggregation is first or last
$class .= ($type == 'categoryitem' or $type == 'courseitem') ? " " . $alter . "d{$depth} baggt b2b" : " item b1b";
} else {
$class .= ($type == 'categoryitem' or $type == 'courseitem') ? " " . $alter . "d{$depth} baggb" : " item b1b";
}
/// Name
$data['itemname']['content'] = $fullname;
$data['itemname']['class'] = $class;
$data['itemname']['colspan'] = $this->maxdepth - $depth;
/// Actual Grade
$gradeval = $grade_grade->finalgrade;
if ($grade_grade->grade_item->needsupdate) {
$data['grade']['class'] = $class . ' gradingerror';
$data['grade']['content'] = get_string('error');
} else {
if (!empty($CFG->grade_hiddenasdate) and $grade_grade->get_datesubmitted() and !$this->canviewhidden and $grade_grade->is_hidden() and !$grade_grade->grade_item->is_category_item() and !$grade_grade->grade_item->is_course_item()) {
// the problem here is that we do not have the time when grade value was modified, 'timemodified' is general modification date for grade_grades records
$class .= ' datesubmitted';
$data['grade']['class'] = $class;
$data['grade']['content'] = get_string('submittedon', 'grades', userdate($grade_grade->get_datesubmitted(), get_string('strftimedatetimeshort')));
} elseif ($grade_grade->is_hidden()) {
$data['grade']['class'] = $class . ' hidden';
$data['grade']['content'] = '-';
} else {
$data['grade']['class'] = $class;
$gradeval = $this->blank_hidden_total($this->courseid, $grade_grade->grade_item, $gradeval);
$data['grade']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true);
}
}
/// Percentage
if ($this->showpercentage) {
if ($grade_grade->grade_item->needsupdate) {
$data['percentage']['class'] = $class . ' gradingerror';
$data['percentage']['content'] = get_string('error');
} elseif ($grade_grade->is_hidden()) {
$data['percentage']['class'] = $class . ' hidden';
$data['percentage']['content'] = '-';
} else {
$data['percentage']['class'] = $class;
$data['percentage']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true, GRADE_DISPLAY_TYPE_PERCENTAGE);
}
}
/// Rank
if ($this->showrank) {
// TODO: this is broken if hidden grades present!!
if ($grade_grade->grade_item->needsupdate) {
$data['rank']['class'] = $class . ' gradingerror';
$data['rank']['content'] = get_string('error');
} elseif ($grade_grade->is_hidden()) {
$data['rank']['class'] = $class . ' hidden';
$data['rank']['content'] = '-';
} else {
if (is_null($gradeval)) {
// no grade, no rank
$data['rank']['class'] = $class;
$data['rank']['content'] = '-';
//.........这里部分代码省略.........
示例3: array
function fill_table()
{
global $CFG;
$numusers = $this->get_numusers(false);
// total course users
$items =& $this->gseq->items;
$grades = array();
$canviewhidden = has_capability('moodle/grade:viewhidden', get_context_instance(CONTEXT_COURSE, $this->courseid));
// fetch or create all grades
foreach ($items as $key => $unused) {
if (!($grade_grade = grade_grade::fetch(array('itemid' => $items[$key]->id, 'userid' => $this->user->id)))) {
$grade_grade = new grade_grade();
$grade_grade->userid = $this->user->id;
$grade_grade->itemid = $items[$key]->id;
}
$grades[$key] = $grade_grade;
$grades[$key]->grade_item =& $items[$key];
}
if ($canviewhidden) {
$altered = array();
$unknown = array();
} else {
$hiding_affected = grade_grade::get_hiding_affected($grades, $items);
$altered = $hiding_affected['altered'];
$unknown = $hiding_affected['unknown'];
unset($hiding_affected);
}
foreach ($items as $itemid => $unused) {
$grade_item =& $items[$itemid];
$grade_grade =& $grades[$itemid];
if (!$canviewhidden and $grade_item->is_hidden()) {
if ($this->showhiddenitems == 0) {
// no hidden items at all
continue;
} else {
if ($this->showhiddenitems == 1 and !$grade_item->is_hiddenuntil()) {
// hidden until that are still hidden are visible
continue;
}
}
}
$class = 'gradeitem';
if ($grade_item->is_course_item()) {
$class = 'courseitem';
} else {
if ($grade_item->is_category_item()) {
$class = 'categoryitem';
}
}
if (in_array($itemid, $unknown)) {
$gradeval = null;
} else {
if (array_key_exists($itemid, $altered)) {
$gradeval = $altered[$itemid];
} else {
$gradeval = $grade_grade->finalgrade;
}
}
$data = array();
// all users should know which items are still hidden
$hidden = '';
if ($grade_item->is_hidden()) {
$hidden = ' hidden ';
}
$element = $this->gseq->locate_element($this->gseq->get_item_eid($grade_item));
$header = $this->gseq->get_element_header($element, true, true, true);
/// prints grade item name
$data[] = '<span class="' . $hidden . $class . '">' . $header . '</span>';
/// prints category
$cat = $grade_item->get_parent_category();
$data[] = '<span class="' . $hidden . $class . '">' . $cat->get_name() . '</span>';
$hidden = '';
if ($grade_item->is_hidden()) {
// can not see grades in hidden items
$hidden = ' hidden ';
} else {
if ($canviewhidden and $grade_grade->is_hidden()) {
// if user can see hidden grades, indicate which ones are hidden
$hidden = ' hidden ';
}
}
/// prints the grade
if ($grade_grade->is_excluded()) {
$excluded = get_string('excluded', 'grades') . ' ';
} else {
$excluded = '';
}
if ($grade_item->needsupdate) {
$data[] = '<span class="' . $hidden . $class . ' gradingerror">' . get_string('error') . '</span>';
} else {
if (!empty($CFG->grade_hiddenasdate) and $grade_grade->get_datesubmitted() and !$canviewhidden and $grade_grade->is_hidden() and !$grade_item->is_category_item() and !$grade_item->is_course_item()) {
// the problem here is that we do not have the time when grade value was modified, 'timemodified' is general modification date for grade_grades records
$data[] = '<span class="' . $hidden . $class . ' datesubmitted">' . $excluded . get_string('submittedon', 'grades', userdate($grade_grade->get_datesubmitted(), get_string('strftimedatetimeshort'))) . '</span>';
} else {
$data[] = '<span class="' . $hidden . $class . '">' . $excluded . grade_format_gradevalue($gradeval, $grade_item, true) . '</span>';
}
}
/// prints percentage
if ($grade_item->needsupdate) {
$data[] = '<span class="' . $hidden . $class . 'gradingerror">' . get_string('error') . '</span>';
//.........这里部分代码省略.........
示例4: fill_table_recursive
//.........这里部分代码省略.........
$class .= ($type == 'categoryitem' or $type == 'courseitem') ? " " . $alter . "d{$depth} baggb" : " item b1b";
$class .= ($type == 'categoryitem' or $type == 'courseitem') ? " categoryitem " : "";
}
if ($type == 'categoryitem' or $type == 'courseitem') {
$header_cat = "cat_{$grade_object->iteminstance}_{$this->user->id}";
}
/// Name
$data['itemname']['content'] = $fullname;
$data['itemname']['class'] = $class;
$data['itemname']['colspan'] = $this->maxdepth - $depth + 2;
$data['itemname']['celltype'] = 'th';
$data['itemname']['id'] = $header_row;
/// Actual Grade
$gradeval = $grade_grade->finalgrade;
if ($this->showfeedback) {
// Copy $class before appending itemcenter as feedback should not be centered
$classfeedback = $class;
}
$class .= " itemcenter ";
if ($this->showweight) {
$data['weight']['class'] = $class;
$data['weight']['content'] = '-';
$data['weight']['headers'] = "{$header_cat} {$header_row} weight";
// has a weight assigned, might be extra credit
if ($grade_object->aggregationcoef > 0 && $type != 'courseitem') {
$data['weight']['content'] = number_format($grade_object->aggregationcoef, 2);
}
}
if ($this->showgrade) {
if ($grade_grade->grade_item->needsupdate) {
$data['grade']['class'] = $class . ' gradingerror';
$data['grade']['content'] = get_string('error');
} else {
if (!empty($CFG->grade_hiddenasdate) and $grade_grade->get_datesubmitted() and !$this->canviewhidden and $grade_grade->is_hidden() and !$grade_grade->grade_item->is_category_item() and !$grade_grade->grade_item->is_course_item()) {
// the problem here is that we do not have the time when grade value was modified, 'timemodified' is general modification date for grade_grades records
$class .= ' datesubmitted';
$data['grade']['class'] = $class;
$data['grade']['content'] = get_string('submittedon', 'grades', userdate($grade_grade->get_datesubmitted(), get_string('strftimedatetimeshort')));
} elseif ($grade_grade->is_hidden()) {
$data['grade']['class'] = $class . ' hidden';
$data['grade']['content'] = '-';
} else {
$data['grade']['class'] = $class;
$gradeval = $this->blank_hidden_total($this->courseid, $grade_grade->grade_item, $gradeval);
$data['grade']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true);
}
}
$data['grade']['headers'] = "{$header_cat} {$header_row} grade";
}
// Range
if ($this->showrange) {
$data['range']['class'] = $class;
$data['range']['content'] = $grade_grade->grade_item->get_formatted_range(GRADE_DISPLAY_TYPE_REAL, $this->rangedecimals);
$data['range']['headers'] = "{$header_cat} {$header_row} range";
}
// Percentage
if ($this->showpercentage) {
if ($grade_grade->grade_item->needsupdate) {
$data['percentage']['class'] = $class . ' gradingerror';
$data['percentage']['content'] = get_string('error');
} else {
if ($grade_grade->is_hidden()) {
$data['percentage']['class'] = $class . ' hidden';
$data['percentage']['content'] = '-';
} else {
$data['percentage']['class'] = $class;
示例5: fill_table_recursive
//.........这里部分代码省略.........
}
/// Name
$data['itemname']['content'] = $fullname;
$data['itemname']['class'] = $class;
$data['itemname']['colspan'] = ($this->maxdepth - $depth);
$data['itemname']['celltype'] = 'th';
$data['itemname']['id'] = $header_row;
if ($this->showfeedback) {
// Copy $class before appending itemcenter as feedback should not be centered
$classfeedback = $class;
}
$class .= " itemcenter ";
if ($this->showweight) {
$data['weight']['class'] = $class;
$data['weight']['content'] = '-';
$data['weight']['headers'] = "$header_cat $header_row weight";
// has a weight assigned, might be extra credit
// This obliterates the weight because it provides a more informative description.
if (is_numeric($hint['weight'])) {
$data['weight']['content'] = format_float($hint['weight'] * 100.0, 2) . ' %';
}
if ($hint['status'] != 'used' && $hint['status'] != 'unknown') {
$data['weight']['content'] .= '<br>' . get_string('aggregationhint' . $hint['status'], 'grades');
}
}
if ($this->showgrade) {
if ($grade_grade->grade_item->needsupdate) {
$data['grade']['class'] = $class.' gradingerror';
$data['grade']['content'] = get_string('error');
} else if (!empty($CFG->grade_hiddenasdate) and $grade_grade->get_datesubmitted() and !$this->canviewhidden and $grade_grade->is_hidden()
and !$grade_grade->grade_item->is_category_item() and !$grade_grade->grade_item->is_course_item()) {
// the problem here is that we do not have the time when grade value was modified, 'timemodified' is general modification date for grade_grades records
$class .= ' datesubmitted';
$data['grade']['class'] = $class;
$data['grade']['content'] = get_string('submittedon', 'grades', userdate($grade_grade->get_datesubmitted(), get_string('strftimedatetimeshort')));
} else if ($grade_grade->is_hidden()) {
$data['grade']['class'] = $class.' dimmed_text';
$data['grade']['content'] = '-';
if ($this->canviewhidden) {
$data['grade']['content'] = grade_format_gradevalue($gradeval,
$grade_grade->grade_item,
true);
}
} else {
$data['grade']['class'] = $class;
$data['grade']['content'] = grade_format_gradevalue($gradeval,
$grade_grade->grade_item,
true);
}
$data['grade']['headers'] = "$header_cat $header_row grade";
}
// Range
if ($this->showrange) {
$data['range']['class'] = $class;
$data['range']['content'] = $grade_grade->grade_item->get_formatted_range(GRADE_DISPLAY_TYPE_REAL, $this->rangedecimals);
$data['range']['headers'] = "$header_cat $header_row range";
}
// Percentage
if ($this->showpercentage) {