MDL-35226 lesson: Adding strings to page titles of lesson administrative pages to make it more accessible
This commit is contained in:
@@ -173,7 +173,7 @@ $PAGE->set_subpage($page->id);
|
||||
|
||||
/// 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>';
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ if ($mode != get_user_preferences('lesson_view', 'collapsed') && $mode !== 'sing
|
||||
|
||||
$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
|
||||
|
||||
@@ -64,7 +64,7 @@ $editoroptions = array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'max
|
||||
// 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 @@ if ($data = $mform->get_data()) {
|
||||
}
|
||||
|
||||
$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();
|
||||
|
||||
@@ -303,7 +303,7 @@ switch ($mode) {
|
||||
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':
|
||||
|
||||
@@ -160,7 +160,7 @@ switch ($mode) {
|
||||
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':
|
||||
|
||||
@@ -206,6 +206,7 @@ $string['jump'] = 'Jump';
|
||||
$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';
|
||||
|
||||
@@ -58,7 +58,7 @@ switch ($action) {
|
||||
|
||||
$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 @@ switch ($action) {
|
||||
|
||||
$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);
|
||||
|
||||
@@ -94,7 +94,7 @@ if (! $times = $DB->get_records('lesson_timer', array('lessonid' => $lesson->id)
|
||||
}
|
||||
|
||||
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 @@ if ($action === 'delete') {
|
||||
/**************************************************************************
|
||||
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 @@ if ($action === 'delete') {
|
||||
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 @@ if ($action === 'delete') {
|
||||
$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 ($action === 'delete') {
|
||||
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
|
||||
|
||||
+6
-6
@@ -73,7 +73,7 @@ if ($userhasgrade && !$lesson->retake) {
|
||||
/// 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 @@ if (!$canmanage) {
|
||||
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 (!$canmanage) {
|
||||
}
|
||||
|
||||
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 (empty($pageid)) {
|
||||
}
|
||||
}
|
||||
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 (empty($pageid)) {
|
||||
|
||||
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 @@ if ($pageid != LESSON_EOL) {
|
||||
$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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user