MDL-13050 Modules were updated, and grades.php files were added to the lesson and hotpot modules
This commit is contained in:
+22
-3
@@ -1020,7 +1020,26 @@ class assignment_base {
|
||||
|
||||
add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id='.$this->assignment->id, $this->assignment->id, $this->cm->id);
|
||||
|
||||
$navigation = build_navigation($this->strsubmissions, $this->cm);
|
||||
$navlinks = array();
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('grades'),
|
||||
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
|
||||
'type' => 'link');
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('modulenameplural', $cm->modname),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
|
||||
'type' => 'activity');
|
||||
$navlinks[] = array(
|
||||
'name' => format_string($cm->name),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
|
||||
'type' => 'activityinstance');
|
||||
$navlinks[] = array(
|
||||
'name' => $this->strsubmissions,
|
||||
'link' => '',
|
||||
'type' => 'link');
|
||||
|
||||
$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));
|
||||
|
||||
@@ -1128,7 +1147,7 @@ class assignment_base {
|
||||
$sort = ' ORDER BY '.$sort;
|
||||
}
|
||||
|
||||
$select = 'SELECT u.id, u.firstname, u.lastname, u.picture,
|
||||
$select = 'SELECT u.id, u.firstname, u.lastname, u.picture, u.imagealt,
|
||||
s.id AS submissionid, s.grade, s.submissioncomment,
|
||||
s.timemodified, s.timemarked,
|
||||
COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status ';
|
||||
@@ -1152,7 +1171,7 @@ class assignment_base {
|
||||
$final_grade = $grading_info->items[0]->grades[$auser->id];
|
||||
/// Calculate user status
|
||||
$auser->status = ($auser->timemarked > 0) && ($auser->timemarked >= $auser->timemodified);
|
||||
$picture = print_user_picture($auser->id, $course->id, $auser->picture, false, true);
|
||||
$picture = print_user_picture($auser, $course->id, $auser->picture, false, true);
|
||||
|
||||
if (empty($auser->submissionid)) {
|
||||
$auser->grade = -1; //no submission yet
|
||||
|
||||
@@ -50,7 +50,25 @@
|
||||
$strsubmissions = get_string("submissions", "exercise");
|
||||
|
||||
// ... print the header and...
|
||||
$navigation = build_navigation($strsubmissions, $cm);
|
||||
$navlinks = array();
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('grades'),
|
||||
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
|
||||
'type' => 'link');
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('modulenameplural', $cm->modname),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
|
||||
'type' => 'activity');
|
||||
$navlinks[] = array(
|
||||
'name' => format_string($cm->name),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
|
||||
'type' => 'activityinstance');
|
||||
$navlinks[] = array(
|
||||
'name' => $strsubmissions,
|
||||
'link' => ,
|
||||
'type' => 'title');
|
||||
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header_simple(format_string($exercise->name), "", $navigation,
|
||||
"", "", true);
|
||||
|
||||
|
||||
+15
-1
@@ -64,7 +64,21 @@
|
||||
|
||||
|
||||
/// Print header.
|
||||
$navigation = build_navigation('', $cm);
|
||||
$navlinks = array();
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('grades'),
|
||||
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
|
||||
'type' => 'link');
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('modulenameplural', $cm->modname),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
|
||||
'type' => 'activity');
|
||||
$navlinks[] = array(
|
||||
'name' => format_string($cm->name),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
|
||||
'type' => 'activityinstance');
|
||||
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header_simple(format_string($forum->name), "",
|
||||
$navigation, "", "", true, $buttontext, navmenu($course, $cm));
|
||||
|
||||
|
||||
+21
-2
@@ -225,16 +225,35 @@
|
||||
$strwaitingapproval = get_string('waitingapproval', 'glossary');
|
||||
|
||||
/// If we are in approval mode, prit special header
|
||||
$navlinks = array();
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('grades'),
|
||||
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
|
||||
'type' => 'link');
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('modulenameplural', $cm->modname),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
|
||||
'type' => 'activity');
|
||||
$navlinks[] = array(
|
||||
'name' => format_string($cm->name),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
|
||||
'type' => 'activityinstance');
|
||||
|
||||
if ($tab == GLOSSARY_APPROVAL_VIEW) {
|
||||
require_capability('mod/glossary:approve', $context);
|
||||
|
||||
$navigation = build_navigation($strwaitingapproval, $cm);
|
||||
$navlinks[] = array(
|
||||
'name' => $strwaitingapproval,
|
||||
'link' => '',
|
||||
'type' => 'title');
|
||||
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
|
||||
update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
|
||||
|
||||
print_heading($strwaitingapproval);
|
||||
} else { /// Print standard header
|
||||
$navigation = build_navigation('', $cm);
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
|
||||
update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT); // Course module ID
|
||||
|
||||
if (! $cm = get_coursemodule_from_id('hotpot', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
|
||||
if (! $hotpot = get_record("hotpot", "id", $cm->instance)) {
|
||||
error("hotpot ID was incorrect");
|
||||
}
|
||||
|
||||
if (! $course = get_record("course", "id", $hotpot->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
if (has_capability('mod/hotpot:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
||||
redirect('report.php?id='.$cm->id);
|
||||
} else {
|
||||
redirect('view.php?id='.$cm->id);
|
||||
}
|
||||
|
||||
?>
|
||||
+27
-2
@@ -399,6 +399,7 @@ function hotpot_delete_selected_attempts(&$hotpot, $del) {
|
||||
/// report selector menus
|
||||
|
||||
function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
|
||||
global $CFG;
|
||||
$strmodulenameplural = get_string("modulenameplural", "hotpot");
|
||||
$strmodulename = get_string("modulename", "hotpot");
|
||||
|
||||
@@ -406,6 +407,22 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
|
||||
$heading = $course->fullname;
|
||||
|
||||
$modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
|
||||
$navlinks = array();
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('grades'),
|
||||
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
|
||||
'type' => 'link');
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('modulenameplural', $cm->modname),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
|
||||
'type' => 'activity');
|
||||
$navlinks[] = array(
|
||||
'name' => format_string($cm->name),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
|
||||
'type' => 'activityinstance');
|
||||
|
||||
|
||||
if (has_capability('mod/hotpot:viewreport',$modulecontext)) {
|
||||
if ($mode=='overview' || $mode=='simplestat' || $mode=='fullstat') {
|
||||
$module = "quiz";
|
||||
@@ -413,10 +430,18 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
|
||||
$module = "hotpot";
|
||||
}
|
||||
|
||||
$navigation = build_navigation(get_string("report$mode", $module), $cm);
|
||||
$navlinks[] = array(
|
||||
'name' => get_string("report$mode", $module),
|
||||
'link' => '',
|
||||
'type' => 'title');
|
||||
} else {
|
||||
$navigation = build_navigation(get_string("report", "quiz"), $cm);
|
||||
$navlinks[] = array(
|
||||
'name' => get_string("report", "quiz"),
|
||||
'link' => '',
|
||||
'type' => 'title');
|
||||
}
|
||||
|
||||
$navigation = build_navigation($navlinks);
|
||||
|
||||
$button = update_module_button($cm->id, $course->id, $strmodulename);
|
||||
print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php // $Id$
|
||||
|
||||
require_once("../../config.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT); // Course module ID
|
||||
|
||||
if (! $cm = get_coursemodule_from_id('lesson', $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
|
||||
if (! $lesson = get_record("lesson", "id", $cm->instance)) {
|
||||
error("lesson ID was incorrect");
|
||||
}
|
||||
|
||||
if (! $course = get_record("course", "id", $lesson->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
if (has_capability('mod/lesson:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
||||
redirect('report.php?id='.$cm->id);
|
||||
} else {
|
||||
redirect('view.php?id='.$cm->id);
|
||||
}
|
||||
|
||||
?>
|
||||
+19
-1
@@ -238,7 +238,25 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '') {
|
||||
}
|
||||
|
||||
/// Header setup
|
||||
$navigation = build_navigation('', $cm);
|
||||
if (in_array($currenttab, array('reportoverview', 'reportdetail'))) {
|
||||
$navlinks = array();
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('grades'),
|
||||
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
|
||||
'type' => 'link');
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('modulenameplural', $cm->modname),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
|
||||
'type' => 'activity');
|
||||
$navlinks[] = array(
|
||||
'name' => format_string($cm->name),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
|
||||
'type' => 'activityinstance');
|
||||
|
||||
$navigation = build_navigation($navlinks);
|
||||
} else {
|
||||
$navigation = build_navigation('', $cm);
|
||||
}
|
||||
|
||||
/// Print header, heading, tabs and messages
|
||||
print_header("$course->shortname: $strname", $course->fullname, $navigation,
|
||||
|
||||
@@ -125,7 +125,7 @@ class page_lesson extends page_generic_activity {
|
||||
// }
|
||||
|
||||
$navigation = build_navigation($morenavlinks, $this->modulerecord);
|
||||
print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord));
|
||||
// print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord));
|
||||
|
||||
if (has_capability('mod/lesson:manage', $context)) {
|
||||
print_heading_with_help($activityname, 'overview', 'lesson');
|
||||
@@ -180,4 +180,4 @@ class page_lesson extends page_generic_activity {
|
||||
$this->lessonpageid = $pageid;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -27,7 +27,21 @@ class quiz_default_report {
|
||||
$strquizzes = get_string("modulenameplural", "quiz");
|
||||
$strquiz = get_string("modulename", "quiz");
|
||||
/// Print the page header
|
||||
$navigation = build_navigation('', $cm);
|
||||
$navlinks = array();
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('grades'),
|
||||
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
|
||||
'type' => 'link');
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('modulenameplural', $cm->modname),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
|
||||
'type' => 'activity');
|
||||
$navlinks[] = array(
|
||||
'name' => format_string($cm->name),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
|
||||
'type' => 'activityinstance');
|
||||
|
||||
$navigation = build_navigation($navlinks);
|
||||
|
||||
print_header_simple(format_string($quiz->name), "", $navigation,
|
||||
'', $meta, true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
|
||||
|
||||
+26
-1
@@ -68,7 +68,32 @@
|
||||
}
|
||||
|
||||
// ...display header...
|
||||
$navigation = build_navigation($action, $cm);
|
||||
|
||||
if ($action == 'teachersview') {
|
||||
$navlinks = array();
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('grades'),
|
||||
'link' => $CFG->wwwroot . '/grade/report/index.php?id=' . $cm->course,
|
||||
'type' => 'link');
|
||||
$navlinks[] = array(
|
||||
'name' => get_string('modulenameplural', $cm->modname),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/index.php?id=' . $cm->course,
|
||||
'type' => 'activity');
|
||||
$navlinks[] = array(
|
||||
'name' => format_string($cm->name),
|
||||
'link' => $CFG->wwwroot . '/mod/' . $cm->modname . '/view.php?id=' . $cm->id,
|
||||
'type' => 'activityinstance');
|
||||
$navlinks[] = array(
|
||||
'name' => $action,
|
||||
'link' => '',
|
||||
'type' => 'title');
|
||||
|
||||
|
||||
$navigation = build_navigation($navlinks);
|
||||
} else {
|
||||
$navigation = build_navigation($action, $cm);
|
||||
}
|
||||
|
||||
print_header_simple(format_string($workshop->name), "", $navigation,
|
||||
"", "", true, update_module_button($cm->id, $course->id, $strworkshop), navmenu($course, $cm));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user