Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-35226 lesson: Adding strings to page titles of lesson administrat…

…ive pages to make it more accessible
  • Loading branch information...
commit d42bc7dc18c7f1f6ee3623174307f1fe79f1293e 1 parent 27affa2
Ankit Agarwal ankitagarwal authored
2  mod/lesson/continue.php
View
@@ -173,7 +173,7 @@
/// Print the header, heading and tabs
lesson_add_fake_blocks($PAGE, $cm, $lesson, $timer);
-echo $lessonoutput->header($lesson, $cm, 'view', true, $page->id);
+echo $lessonoutput->header($lesson, $cm, 'view', true, $page->id, get_string('continue', 'lesson'));
if ($lesson->displayleft) {
echo '<a name="maincontent" id="maincontent" title="'.get_string('anchortitle', 'lesson').'"></a>';
2  mod/lesson/edit.php
View
@@ -47,7 +47,7 @@
$lessonoutput = $PAGE->get_renderer('mod_lesson');
$PAGE->navbar->add(get_string('edit'));
-echo $lessonoutput->header($lesson, $cm, $mode);
+echo $lessonoutput->header($lesson, $cm, $mode, false, null, get_string('edit', 'lesson'));
if (!$lesson->has_pages()) {
// There are no pages; give teacher some options
4 mod/lesson/editpage.php
View
@@ -64,7 +64,7 @@
// tie up with the current form name, which in turn means the "submitted"
// check ends up evaluating as false, thus it's not possible to check whether
// the Question type selection was cancelled. For this reason, a dummy form
-// is created here solely to check whether the selection was cancelled.
+// is created here solely to check whether the selection was cancelled.
if ($qtype) {
$mformdummy = $manager->get_page_form(0, array('editoroptions'=>$editoroptions, 'jumpto'=>$jumpto, 'lesson'=>$lesson, 'edit'=>$edit, 'maxbytes'=>$PAGE->course->maxbytes));
if ($mformdummy->is_cancelled()) {
@@ -125,6 +125,6 @@
}
$lessonoutput = $PAGE->get_renderer('mod_lesson');
-echo $lessonoutput->header($lesson, $cm);
+echo $lessonoutput->header($lesson, $cm, '', false, null, get_string('edit', 'lesson'));
$mform->display();
echo $lessonoutput->footer();
2  mod/lesson/essay.php
View
@@ -303,7 +303,7 @@
add_to_log($course->id, 'lesson', 'view grade', "essay.php?id=$cm->id", get_string('manualgrading', 'lesson'), $cm->id);
$lessonoutput = $PAGE->get_renderer('mod_lesson');
-echo $lessonoutput->header($lesson, $cm, 'essay');
+echo $lessonoutput->header($lesson, $cm, 'essay', false, null, get_string('manualgrading', 'lesson'));
switch ($mode) {
case 'display':
2  mod/lesson/highscores.php
View
@@ -160,7 +160,7 @@
add_to_log($course->id, 'lesson', 'view highscores', "highscores.php?id=$cm->id", $lesson->name, $cm->id);
$lessonoutput = $PAGE->get_renderer('mod_lesson');
-echo $lessonoutput->header($lesson, $cm, 'highscores');
+echo $lessonoutput->header($lesson, $cm, 'highscores', false, null, get_string('viewhighscores', 'lesson'));
switch ($mode) {
case 'add':
1  mod/lesson/lang/en/lesson.php
View
@@ -206,6 +206,7 @@
$string['jumps'] = 'Jumps';
$string['jumps_help'] = 'Each answer (for questions) or description (for content pages) has a corresponding jump. The jump can be relative, such as this page or next page, or absolute, specifying any one of the pages in the lesson.';
$string['jumpsto'] = 'Jumps to <em>{$a}</em>';
+$string['leftduringtimedsession'] = 'You have left during a timed lesson.';
$string['leftduringtimed'] = 'You have left during a timed lesson.<br />Please click on Continue to restart the lesson.';
$string['leftduringtimednoretake'] = 'You have left during a timed lesson and you are<br />not allowed to retake or continue the lesson.';
$string['lesson:addinstance'] = 'Add a new lesson';
4 mod/lesson/lesson.php
View
@@ -58,7 +58,7 @@
$thispage = $lesson->load_page($pageid);
- echo $lessonoutput->header($lesson, $cm);
+ echo $lessonoutput->header($lesson, $cm, '', false, null, get_string('deletingpage', 'lesson', format_string($thispage->title)));
echo $OUTPUT->heading(get_string("deletingpage", "lesson", format_string($thispage->title)));
// print the jumps to this page
$params = array("lessonid" => $lesson->id, "pageid" => $pageid);
@@ -80,7 +80,7 @@
$title = $DB->get_field("lesson_pages", "title", array("id" => $pageid));
- echo $lessonoutput->header($lesson, $cm);
+ echo $lessonoutput->header($lesson, $cm, '', false, null, get_string('moving', 'lesson', format_String($title)));
echo $OUTPUT->heading(get_string("moving", "lesson", format_string($title)));
$params = array ("lessonid" => $lesson->id, "prevpageid" => 0);
10 mod/lesson/report.php
View
@@ -94,7 +94,7 @@
}
if ($nothingtodisplay) {
- echo $lessonoutput->header($lesson, $cm, $action);
+ echo $lessonoutput->header($lesson, $cm, $action, false, null, get_string('nolessonattempts', 'lesson'));
echo $OUTPUT->notification(get_string('nolessonattempts', 'lesson'));
echo $OUTPUT->footer();
exit();
@@ -160,7 +160,7 @@
/**************************************************************************
this action is for default view and overview view
**************************************************************************/
- echo $lessonoutput->header($lesson, $cm, $action);
+ echo $lessonoutput->header($lesson, $cm, $action, false, null, get_string('overview', 'lesson'));
$course_context = context_course::instance($course->id);
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
@@ -376,7 +376,7 @@
4. Print out the object which contains all the try info
**************************************************************************/
- echo $lessonoutput->header($lesson, $cm, $action);
+ echo $lessonoutput->header($lesson, $cm, $actionfalse, null, get_string('detailedstats', 'lesson'));
$course_context = context_course::instance($course->id);
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
@@ -440,7 +440,7 @@
$page = $lessonpages[$pageid];
$answerpage = new stdClass;
$data ='';
-
+
$answerdata = new stdClass;
// Set some defaults for the answer data.
$answerdata->score = NULL;
@@ -461,7 +461,7 @@
if (empty($userid)) {
// there is no userid, so set these vars and display stats.
$answerpage->grayout = 0;
- $useranswer = NULL;
+ $useranswer = NULL;
} elseif ($useranswers = $DB->get_records("lesson_attempts",array("lessonid"=>$lesson->id, "userid"=>$userid, "retry"=>$try,"pageid"=>$page->id), "timeseen")) {
// get the user's answer for this page
// need to find the right one
12 mod/lesson/view.php
View
@@ -73,7 +73,7 @@
/// Check for high scores
if (!$canmanage) {
if (!$lesson->is_accessible()) { // Deadline restrictions
- echo $lessonoutput->header($lesson, $cm);
+ echo $lessonoutput->header($lesson, $cm, '', false, null, get_string('lessonnotready2', 'lesson'));
if ($lesson->deadline != 0 && time() > $lesson->deadline) {
echo $lessonoutput->lesson_inaccessible(get_string('lessonclosed', 'lesson', userdate($lesson->deadline)));
} else {
@@ -91,7 +91,7 @@
redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id");
}
} else {
- echo $lessonoutput->header($lesson, $cm);
+ echo $lessonoutput->header($lesson, $cm, '', false, null, get_string('passwordprotectedlesson', 'lesson', format_string($lesson->name)));
echo $lessonoutput->login_prompt($lesson, $userpassword !== '');
echo $lessonoutput->footer();
exit();
@@ -144,7 +144,7 @@
}
if (!empty($errors)) { // print out the errors if any
- echo $lessonoutput->header($lesson, $cm);
+ echo $lessonoutput->header($lesson, $cm, '', false, null, get_string('completethefollowingconditions', 'lesson', format_string($lesson->name)));
echo $lessonoutput->dependancy_errors($dependentlesson, $errors);
echo $lessonoutput->footer();
exit();
@@ -226,7 +226,7 @@
}
}
if (isset($lastpageseen) && $DB->count_records('lesson_attempts', array('lessonid'=>$lesson->id, 'userid'=>$USER->id, 'retry'=>$retries)) > 0) {
- echo $lessonoutput->header($lesson, $cm);
+ echo $lessonoutput->header($lesson, $cm, '', false, null, get_string('leftduringtimedsession', 'lesson'));
if ($lesson->timed) {
if ($lesson->retake) {
$continuelink = new single_button(new moodle_url('/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$lesson->firstpageid, 'startlastseen'=>'no')), get_string('continue', 'lesson'), 'get');
@@ -244,7 +244,7 @@
if ($attemptflag) {
if (!$lesson->retake) {
- echo $lessonoutput->header($lesson, $cm, 'view');
+ echo $lessonoutput->header($lesson, $cm, 'view', '', null, get_string("noretake", "lesson"));
$courselink = new single_button(new moodle_url('/course/view.php', array('id'=>$PAGE->course->id)), get_string('returntocourse', 'lesson'), 'get');
echo $lessonoutput->message(get_string("noretake", "lesson"), $courselink);
echo $lessonoutput->footer();
@@ -573,7 +573,7 @@
$lessoncontent .= html_writer::link($url, get_string('viewgrades', 'lesson'), array('class'=>'centerpadded lessonbutton standardbutton'));
lesson_add_fake_blocks($PAGE, $cm, $lesson, $timer);
- echo $lessonoutput->header($lesson, $cm, $currenttab, $extraeditbuttons, $lessonpageid);
+ echo $lessonoutput->header($lesson, $cm, $currenttab, $extraeditbuttons, $lessonpageid, get_string("congratulations", "lesson"));
echo $lessoncontent;
echo $lessonoutput->footer();
}
Please sign in to comment.
Something went wrong with that request. Please try again.