本文整理汇总了PHP中print_grade_page_head函数的典型用法代码示例。如果您正苦于以下问题:PHP print_grade_page_head函数的具体用法?PHP print_grade_page_head怎么用?PHP print_grade_page_head使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_grade_page_head函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: optional_param
require_once $CFG->dirroot . '/grade/lib.php';
require_once $CFG->libdir . '/gradelib.php';
$courseid = optional_param('id', SITEID, PARAM_INT);
$action = optional_param('action', '', PARAM_ALPHA);
if (!($course = get_record('course', 'id', $courseid))) {
print_error('nocourseid');
}
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
if (!has_capability('moodle/grade:manage', $context) and !has_capability('moodle/grade:manageletters', $context)) {
error('Missing permission to view letter grades');
}
$gpr = new grade_plugin_return(array('type' => 'edit', 'plugin' => 'letter', 'courseid' => $courseid));
$strgrades = get_string('grades');
$pagename = get_string('letters', 'grades');
print_grade_page_head($courseid, 'letter', 'view', get_string('gradeletters', 'grades'));
$letters = grade_get_letters($context);
$data = array();
$max = 100;
foreach ($letters as $boundary => $letter) {
$line = array();
$line[] = format_float($max, 2) . ' %';
$line[] = format_float($boundary, 2) . ' %';
$line[] = format_string($letter);
$data[] = $line;
$max = $boundary - 0.01;
}
$table = new object();
$table->head = array(get_string('max', 'grades'), get_string('min', 'grades'), get_string('letter', 'grades'));
$table->size = array('30%', '30%', '40%');
$table->align = array('left', 'left', 'left');
示例2: array
$buttons = '';
}
$gradeserror = array();
// Handle toggle change request
if (!is_null($toggle) && !empty($toggle_type)) {
set_user_preferences(array('grade_report_show' . $toggle_type => $toggle));
}
//first make sure we have proper final grades - this must be done before constructing of the grade tree
grade_regrade_final_grades($courseid);
// Perform actions
if (!empty($target) && !empty($action) && confirm_sesskey()) {
grade_report_grader::process_action($target, $action);
}
$reportname = get_string('pluginname', 'gradereport_grader');
/// Print header
print_grade_page_head($COURSE->id, 'report', 'grader', $reportname, false, $buttons);
//Initialise the grader report object that produces the table
//the class grade_report_grader_ajax was removed as part of MDL-21562
$report = new grade_report_grader($courseid, $gpr, $context, $page, $sortitemid);
// make sure separate group does not prevent view
if ($report->currentgroup == -2) {
echo $OUTPUT->heading(get_string("notingroup"));
echo $OUTPUT->footer();
exit;
}
/// processing posted grades & feedback here
if ($data = data_submitted() and confirm_sesskey() and has_capability('moodle/grade:edit', $context)) {
$warnings = $report->process_data($data);
} else {
$warnings = array();
}
示例3: clean_param
$aid = $matches[2];
$value = clean_param($value, PARAM_BOOL);
$grade_item = grade_item::fetch(array('id' => $aid, 'courseid' => $courseid));
$grade_item->{$param} = $value;
$grade_item->update();
$recreatetree = true;
}
}
$originalweights = grade_helper::fetch_all_natural_weights_for_course($courseid);
grade_regrade_final_grades($courseid);
$alteredweights = grade_helper::fetch_all_natural_weights_for_course($courseid);
if (array_diff($originalweights, $alteredweights)) {
$normalisationmessage = get_string('weightsadjusted', 'grades');
}
}
print_grade_page_head($courseid, 'settings', 'setup', get_string('categoriesanditems', 'grades'));
// Print Table of categories and items
echo $OUTPUT->box_start('gradetreebox generalbox');
echo '<form id="gradetreeform" method="post" action="' . $returnurl . '">';
echo '<div>';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
//did we update something in the db and thus invalidate $grade_edit_tree?
if ($recreatetree) {
$grade_edit_tree = new grade_edit_tree($gtree, $movingeid, $gpr);
}
// Check to see if we have a normalisation message to send.
if (!empty($normalisationmessage)) {
echo $OUTPUT->notification($normalisationmessage, 'notifymessage');
}
echo html_writer::table($grade_edit_tree->table);
echo '<div id="gradetreesubmit">';
示例4: unformat_float
}
$grade_item->outcomeid = null;
// update hiding flag
if ($hiddenuntil) {
$grade_item->set_hidden($hiddenuntil, false);
} else {
$grade_item->set_hidden($hidden, false);
}
$grade_item->set_locktime($locktime);
// locktime first - it might be removed when unlocking
$grade_item->set_locked($locked, false, true);
$grade_item->update();
// We don't need to insert it, it's already created when the category is created
// set parent if needed
if (isset($data->parentcategory)) {
$grade_category->set_parent($data->parentcategory, 'gradebook');
}
// update agg coef if needed
if (isset($data->aggregationcoef)) {
$data->aggregationcoef = unformat_float($data->aggregationcoef);
$grade_item = $grade_category->load_grade_item();
$grade_item->aggregationcoef = $data->aggregationcoef;
$grade_item->update();
}
redirect($returnurl);
}
}
print_grade_page_head($courseid, 'edittree', null, $heading);
$mform->display();
print_footer($course);
die;
示例5: redirect
// If we are using natural weight and the weight has been un-overriden, force parent category to recalculate weights.
$grade_category->force_regrading();
}
$grade_item->weightoverride = $itemdata->weightoverride;
$grade_item->outcomeid = null;
if (!empty($data->grade_item_rescalegrades) && $data->grade_item_rescalegrades == 'yes') {
$grade_item->rescale_grades_keep_percentage($grade_item_copy->grademin, $grade_item_copy->grademax, $grade_item->grademin, $grade_item->grademax, 'gradebook');
}
// update hiding flag
if ($hiddenuntil) {
$grade_item->set_hidden($hiddenuntil, false);
} else {
$grade_item->set_hidden($hidden, false);
}
$grade_item->set_locktime($locktime);
// locktime first - it might be removed when unlocking
$grade_item->set_locked($locked, false, true);
$grade_item->update();
// We don't need to insert it, it's already created when the category is created
// set parent if needed
if (isset($data->parentcategory)) {
$grade_category->set_parent($data->parentcategory, 'gradebook');
}
redirect($returnurl);
}
}
$PAGE->navbar->add($heading);
print_grade_page_head($courseid, 'settings', null, $heading, false, false, false);
$mform->display();
echo $OUTPUT->footer();
die;
示例6: required_param
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
require_once '../../config.php';
require_once $CFG->dirroot . '/grade/lib.php';
$id = required_param('id', PARAM_INT);
// course id
if (!($course = $DB->get_record('course', array('id' => $id)))) {
print_error('nocourseid');
}
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $id);
require_capability('moodle/grade:import', $context);
print_grade_page_head($course->id, 'import', 'keymanager', get_string('keymanager', 'grades'));
$stredit = get_string('edit');
$strdelete = get_string('delete');
$data = array();
$params = array($course->id, $USER->id);
if ($keys = $DB->get_records_select('user_private_key', "script='grade/import' AND instance=? AND userid=?", $params)) {
foreach ($keys as $key) {
$line = array();
$line[0] = format_string($key->value);
$line[1] = $key->iprestriction;
$line[2] = empty($key->validuntil) ? get_string('always') : userdate($key->validuntil);
$buttons = "<a title=\"{$stredit}\" href=\"key.php?id={$key->id}\"><img" . " src=\"" . $OUTPUT->old_icon_url('t/edit') . "\" class=\"iconsmall\" alt=\"{$stredit}\" /></a> ";
$buttons .= "<a title=\"{$strdelete}\" href=\"key.php?id={$key->id}&delete=1\"><img" . " src=\"" . $OUTPUT->old_icon_url('t/delete') . "\" class=\"iconsmall\" alt=\"{$strdelete}\" /></a> ";
$line[3] = $buttons;
$data[] = $line;
}
示例7: required_param
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
require_once '../../../config.php';
require_once $CFG->dirroot . '/grade/export/lib.php';
require_once 'grade_export_ods.php';
$id = required_param('id', PARAM_INT);
// course id
$PAGE->set_url('/grade/export/ods/index.php', array('id' => $id));
if (!($course = $DB->get_record('course', array('id' => $id)))) {
print_error('nocourseid');
}
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $id);
require_capability('moodle/grade:export', $context);
require_capability('gradeexport/ods:view', $context);
print_grade_page_head($COURSE->id, 'export', 'ods', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_ods'));
if (!empty($CFG->gradepublishing)) {
$CFG->gradepublishing = has_capability('gradeexport/ods:publish', $context);
}
$mform = new grade_export_form(null, array('publishing' => true));
$groupmode = groups_get_course_groupmode($course);
// Groups are being used
$currentgroup = groups_get_course_group($course, true);
if ($groupmode == SEPARATEGROUPS and !$currentgroup and !has_capability('moodle/site:accessallgroups', $context)) {
echo $OUTPUT->heading(get_string("notingroup"));
echo $OUTPUT->footer();
die;
}
// process post information
if ($data = $mform->get_data()) {
$export = new grade_export_ods($course, $currentgroup, '', false, false, $data->display, $data->decimals);
示例8: html_table
}
$line[] = $buttons;
$data[] = $line;
}
$table = new html_table();
$table->head = array($strfullname, $strshortname, $strscale, $strcourses, $stritems, $stredit);
$table->size = array('30%', '20%', '20%', '10%', '10%', '10%');
$table->align = array('left', 'left', 'left', 'center', 'center', 'center');
$table->width = '90%';
$table->data = $data;
$return .= html_writer::table($table);
$outcomes_tables[] = $return;
}
if ($courseid) {
/// Print header
print_grade_page_head($courseid, 'outcome', 'edit', $heading);
}
foreach ($outcomes_tables as $table) {
echo $table;
}
echo $OUTPUT->container_start('buttons');
echo $OUTPUT->single_button(new moodle_url('edit.php', array('courseid' => $courseid)), $strcreatenewoutcome);
if (!empty($outcomes_tables)) {
echo $OUTPUT->single_button(new moodle_url('export.php', array('id' => $courseid, 'sesskey' => sesskey())), get_string('exportalloutcomes', 'grades'));
}
echo $OUTPUT->container_end();
echo $OUTPUT->footer();
/**
* Local shortcut function for creating a link to a scale.
* @param int $courseid The Course ID
* @param grade_scale $scale The Scale to link to
示例9: moodle_url
$disabledEP = 'disabled';
}
if (!isset($toolAE) || !$toolAE) {
$disabledAE = 'disabled';
}
if (!isset($toolEI) || !$toolEI) {
$disabledEI = 'disabled';
}
//--------------------------------------------------------------------------------
global $OUTPUT;
$PAGE->set_url(new moodle_url('/blocks/evalcomix/assessment/activity_edit_form.php', array('id' => $courseid)));
$PAGE->navbar->add('evalcomix', new moodle_url('../assessment/index.php?id=' . $courseid));
$context = context_course::instance($course->id);
//require_capability('block/evalcomix:edit', $context);
require_capability('moodle/block:edit', $context);
print_grade_page_head($COURSE->id, 'report', 'grader', null, false, '', false);
//Ln 199 antes era así
//<input type="hidden" id="maxgrade" name="maxgrade" value='.$activity->grade.'>
echo '
<center>
<div><img src="' . $CFG->wwwroot . EVXLOGOROOT . '" width="230" alt="EvalCOMIX"/></div>
<div><input type="button" style="color:#333333" value="' . get_string('designsection', 'block_evalcomix') . '" onclick="location.href=\'' . $CFG->wwwroot . '/blocks/evalcomix/tool/index.php?id=' . $courseid . '\'"/></div>
</center>
';
//-----------------------------------------------------------------------------------------------
echo '
<script>
function disabling(element, slavetag){
if(element.value != 0)
document.getElementById(slavetag).disabled = false;
else
示例10: redirect
}
// Handle null decimals value - must be done before update!
if (!property_exists($itemdata, 'decimals') or $itemdata->decimals < 0) {
$grade_item->decimals = null;
}
$grade_item->outcomeid = null;
// update hiding flag
if ($hiddenuntil) {
$grade_item->set_hidden($hiddenuntil, false);
} else {
$grade_item->set_hidden($hidden, false);
}
$grade_item->set_locktime($locktime);
// locktime first - it might be removed when unlocking
$grade_item->set_locked($locked, false, true);
$grade_item->update();
// We don't need to insert it, it's already created when the category is created
// set parent if needed
if (isset($data->parentcategory)) {
$grade_category->set_parent($data->parentcategory, 'gradebook');
}
redirect($returnurl);
}
}
$return = false;
$buttons = false;
$shownavigation = false;
print_grade_page_head($courseid, 'edittree', null, $heading, $return, $buttons, $shownavigation);
$mform->display();
echo $OUTPUT->footer();
die;
示例11: required_param
* This is a one-line short description of the file
*
* You can have a rather longer description of the file as well,
* if you like, and it can span multiple lines.
*
* @package grade_report_newgradereport
* @author Daniel Neis Araujo <danielneis@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
include '../../../config.php';
require $CFG->libdir . '/gradelib.php';
require $CFG->dirroot . '/grade/lib.php';
require $CFG->dirroot . '/grade/report/newgradereport/lib.php';
$courseid = required_param('id', PARAM_INT);
// course id
if (!($course = $DB->get_record('course', array('id' => $courseid)))) {
print_error('invalidcourseid');
}
$PAGE->set_url(new moodle_url('/grade/report/newgradereport/index.php', array('id' => $courseid)));
require_login($courseid);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('gradereport/newgradereport:view', $context);
print_grade_page_head($COURSE->id, 'report', 'newgradereport', get_string('pluginname', 'gradereport_newgradereport') . $OUTPUT->help_icon('pluginname', 'gradereport_newgradereport'));
grade_regrade_final_grades($courseid);
//first make sure we have proper final grades
$gpr = new grade_plugin_return(array('type' => 'report', 'plugin' => 'grader', 'courseid' => $courseid));
// return tracking object
$report = new grade_report_newgradereport($courseid, $gpr, $context);
// Initialise the grader report object
$report->show();
echo $OUTPUT->footer();
示例12: file_postupdate_standard_editor
$data->description = $data->description_editor['text'];
$data->descriptionformat = $data->description_editor['format'];
grade_scale::set_properties($scale, $data);
if (!has_capability('moodle/grade:manage', $systemcontext)) {
$data->standard = 0;
}
$scale->courseid = !empty($data->standard) ? 0 : $courseid;
$scale->insert();
$data = file_postupdate_standard_editor($data, 'description', $editoroptions, $systemcontext, 'grade', 'scale', $scale->id);
$DB->set_field($scale->table, 'description', $data->description, array('id' => $scale->id));
} else {
$data = file_postupdate_standard_editor($data, 'description', $editoroptions, $systemcontext, 'grade', 'scale', $id);
grade_scale::set_properties($scale, $data);
if (isset($data->standard)) {
$scale->courseid = !empty($data->standard) ? 0 : $courseid;
} else {
unset($scale->courseid);
// keep previous
}
$scale->update();
}
redirect($returnurl);
}
}
if ($courseid) {
print_grade_page_head($course->id, 'scale', 'edit', $heading);
} else {
echo $OUTPUT->header();
}
$mform->display();
echo $OUTPUT->footer();
示例13: import_xml_grades
$importcode = import_xml_grades($text, $course, $error);
if ($importcode) {
grade_import_commit($id, $importcode, $data->feedback, true);
echo $OUTPUT->footer();
die;
} else {
echo $OUTPUT->notification($error);
echo $OUTPUT->continue_button($CFG->wwwroot . '/grade/index.php?id=' . $course->id);
echo $OUTPUT->footer();
die;
}
} else {
if (empty($data->key)) {
redirect('import.php?id=' . $id . '&feedback=' . (int) $data->feedback . '&url=' . urlencode($data->url));
} else {
if ($data->key == 1) {
$data->key = create_user_key('grade/import', $USER->id, $course->id, $data->iprestriction, $data->validuntil);
}
print_grade_page_head($COURSE->id, 'import', 'xml', get_string('importxml', 'grades'));
echo '<div class="gradeexportlink">';
$link = $CFG->wwwroot . '/grade/import/xml/fetch.php?id=' . $id . '&feedback=' . (int) $data->feedback . '&url=' . urlencode($data->url) . '&key=' . $data->key;
echo get_string('import', 'grades') . ': <a href="' . $link . '">' . $link . '</a>';
echo '</div>';
echo $OUTPUT->footer();
die;
}
}
}
print_grade_page_head($COURSE->id, 'import', 'xml', get_string('importxml', 'grades'));
$mform->display();
echo $OUTPUT->footer();
示例14: optional_param
$importcode = optional_param('importcode', '', PARAM_FILE);
$url = new moodle_url('/grade/import/direct/index.php', array('id' => $id));
if ($verbosescales !== 1) {
$url->param('verbosescales', $verbosescales);
}
$PAGE->set_url($url);
if (!($course = $DB->get_record('course', array('id' => $id)))) {
print_error('nocourseid');
}
require_login($course);
$context = context_course::instance($id);
require_capability('moodle/grade:import', $context);
require_capability('gradeimport/direct:view', $context);
$separatemode = (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context));
$currentgroup = groups_get_course_group($course);
print_grade_page_head($course->id, 'import', 'direct', get_string('pluginname', 'gradeimport_direct'), false, false, true, 'userdata', 'gradeimport_direct');
$renderer = $PAGE->get_renderer('gradeimport_csv');
// Get the grade items to be matched with the import mapping columns.
$gradeitems = gradeimport_csv_load_data::fetch_grade_items($course->id);
// If the csv file hasn't been imported yet then look for a form submission or
// show the initial submission form.
if (!$iid) {
// Set up the import form.
$mform = new gradeimport_direct_import_form(null, array('includeseparator' => true, 'verbosescales' => true, 'acceptedtypes' => array('.csv', '.txt')));
// If the import form has been submitted.
if ($formdata = $mform->get_data()) {
$text = $formdata->userdata;
$csvimport = new gradeimport_csv_load_data();
$csvimport->load_csv_content($text, $formdata->encoding, 'tab', $formdata->previewrows);
$csvimporterror = $csvimport->get_error();
if (!empty($csvimporterror)) {
示例15: count
} else {
$itemname = $grade_item->get_name();
}
$outcomedata['outcome']->sum += $item->avg;
$gradehtml = $scale->get_nearest_item($item->avg);
$items_html .= "<td class=\"cell c3\">{$itemname}</td>" . "<td class=\"cell c4\">{$gradehtml} ({$item->avg})</td>" . "<td class=\"cell c5\">{$item->count}</td></tr>\n";
$print_tr = true;
}
} else {
$items_html .= "<td class=\"cell c3\"> - </td><td class=\"cell c4\"> - </td><td class=\"cell c5\"> 0 </td></tr>\n";
}
// Calculate outcome average
if (is_array($outcomedata['items'])) {
$count = count($outcomedata['items']);
if ($count > 0) {
$avg = $outcomedata['outcome']->sum / $count;
} else {
$avg = $outcomedata['outcome']->sum;
}
$avg_html = $scale->get_nearest_item($avg) . " (" . round($avg, 2) . ")\n";
} else {
$avg_html = ' - ';
}
$outcomeavg_html = '<td class="cell c1" rowspan="' . $rowspan . '">' . $avg_html . "</td>\n";
$html .= $shortname_html . $outcomeavg_html . $sitewide_html . $items_html;
$row++;
}
$html .= '</table>';
print_grade_page_head($courseid, 'report', 'outcomes');
echo $html;
print_footer($course);