$string['activitylink'] = 'Link to an activity';
$string['activitylinkname'] = 'Go to: $a';
$string['addabranchtable'] = 'Add a Branch Table';
+$string['addbranchtable'] = 'Add a Branch Table';
$string['addanendofbranch'] = 'Add an End of Branch';
$string['addaquestionpage'] = 'Add a Question Page';
$string['addaquestionpagehere'] = 'Add a question page here';
$string['completederror'] = 'Complete the lesson';
$string['completethefollowingconditions'] = 'You must complete the following condition(s) in <b>$a</b> lesson before you can proceed.';
$string['conditionsfordependency'] = 'Condition(s) for the dependency';
+$string['confirmdelete']= 'Delete page';
$string['confirmdeletionofthispage'] = 'Confirm deletion of this page';
$string['congratulations'] = 'Congratulations - end of lesson reached';
$string['continue'] = 'Continue';
$string['displayscorewithessays'] = 'You earned $a->score out of $a->tempmaxgrade for the automatically graded questions.<br />Your $a->essayquestions essay question(s) will be graded and added<br />into your final score at a later date.<br /><br />Your current grade without the essay question(s) is $a->score out of $a->grade';
$string['displayscorewithoutessays'] = 'Your score is $a->score (out of $a->grade).';
$string['edit'] = 'Edit';
+$string['editpage'] = 'Edit page contents';
$string['editlessonsettings'] = 'Edit lesson settings';
$string['editpagecontent'] = 'Edit page contents';
$string['email'] = 'Email';
$string['jumpsto'] = 'Jumps to <em>$a</em>';
$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['lessonadministration'] = 'Lesson administration';
$string['lesson:edit'] = 'Edit a lesson activity';
$string['lesson:manage'] = 'Manage a lesson activity';
$string['lessonattempted'] = 'Lesson attempted';
$string['modattemptsnoteacher'] = 'Student review only works for students.';
$string['modulename'] = 'Lesson';
$string['modulenameplural'] = 'Lessons';
+$string['move'] = 'Move page';
$string['movedpage'] = 'Moved page';
$string['movepagehere'] = 'Move page to here';
$string['moving'] = 'Moving page: $a';
}
require_login($course->id, false, $cm);
+
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/edit.php', array('id'=>$id,'mode'=>$mode));
+ if ($display !== 0) {
+ $url->param('display', $display);
+ }
+ if ($pageid !== 0) {
+ $url->param('pageid', $pageid);
+ }
+ $PAGE->set_url($url);
+ $PAGE->navbar->add(get_string('edit'));
+
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/lesson:manage', $context);
list($cm, $course, $lesson) = lesson_get_basics($id);
require_login($course->id, false, $cm);
-
+
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/essay.php', array('id'=>$id));
+ if ($mode !== 'display') {
+ $url->param('mode', $mode);
+ }
+ $PAGE->set_url($url);
+ $PAGE->navbar->add(get_string('manualgrading','lesson'));
+
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/lesson:edit', $context);
list($cm, $course, $lesson) = lesson_get_basics($id);
- require_login($course->id);
+ require_login($course->id, false, $cm);
+
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/edit.php', array('id'=>$id,'action'=>$action));
+ $PAGE->set_url($url);
+ $PAGE->navbar->add(get_string($action, 'lesson'));
+
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
/// Set up some general variables
case FEATURE_GROUPS: return false;
case FEATURE_GROUPINGS: return false;
case FEATURE_GROUPMEMBERSONLY: return true;
- case FEATURE_MOD_INTRO: return true;
+ case FEATURE_MOD_INTRO: return false;
case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
case FEATURE_GRADE_HAS_GRADE: return true;
case FEATURE_GRADE_OUTCOMES: return true;
default: return null;
}
}
+
+/**
+ * This fucntion extends the global navigaiton for the site.
+ * It is important to note that you should not rely on PAGE objects within this
+ * body of code as there is no guarantee that during an AJAX request they are
+ * available
+ *
+ * @param navigation_node $navigation The lesson node within the global navigation
+ * @param stdClass $course The course object returned from the DB
+ * @param stdClass $module The module object returned from the DB
+ * @param stdClass $cm The course module isntance returned from the DB
+ */
+function lesson_extend_navigation($navigation, $course, $module, $cm) {
+ /**
+ * This is currently just a stub so that it can be easily expanded upon.
+ * When expanding just remove this comment and the line below and then add
+ * you content.
+ */
+ $navigation->nodetype = navigation_node::NODETYPE_LEAF;
+}
+
+/**
+ * This function extends the settings navigation block for the site.
+ *
+ * It is safe to rely on PAGE here as we will only ever be within the module
+ * context when this is called
+ *
+ * @param navigation_node $settings
+ * @param stdClass $module
+ */
+function lesson_extend_settings_navigation($settings, $module) {
+ global $PAGE, $CFG, $DB, $USER, $OUTPUT;
+
+ $lesson = $DB->get_record('lesson', array('id'=>$PAGE->cm->instance));
+ $lessonnavkey = $settings->add(get_string('lessonadministration', 'lesson'));
+ $lessonnav = $settings->get($lessonnavkey);
+ $lessonnav->forceopen = true;
+
+ $canedit = has_capability('mod/lesson:edit', $PAGE->cm->context);
+
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/view.php', array('id'=>$PAGE->cm->id));
+ $key = $lessonnav->add(get_string('preview', 'lesson'), $url);
+
+ if ($canedit) {
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/edit.php', array('id'=>$PAGE->cm->id));
+ $key = $lessonnav->add(get_string('edit', 'lesson'), $url);
+ }
+
+ if (has_capability('mod/lesson:manage', $PAGE->cm->context)) {
+ $key = $lessonnav->add(get_string('reports', 'lesson'));
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/report.php', array('id'=>$PAGE->cm->id, 'action'=>'reportoverview'));
+ $lessonnav->get($key)->add(get_string('overview', 'lesson'), $url);
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/report.php', array('id'=>$PAGE->cm->id, 'action'=>'reportdetail'));
+ $lessonnav->get($key)->add(get_string('detailedstats', 'lesson'), $url);
+ }
+
+ if ($canedit) {
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/essay.php', array('id'=>$PAGE->cm->id));
+ $lessonnav->add(get_string('manualgrading', 'lesson'), $url);
+ }
+
+ if ($lesson->highscores) {
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/highscores.php', array('id'=>$PAGE->cm->id));
+ $lessonnav->add(get_string('highscores', 'lesson'), $url);
+ }
+
+ if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
+ $url = new moodle_url($CFG->wwwroot.'/course/mod.php', array('update' => $PAGE->cm->id, 'return' => true, 'sesskey' => sesskey()));
+ $lessonnav->add(get_string('updatethis', '', get_string('modulename', 'lesson')), $url);
+ }
+
+ if (count($lessonnav->children)<1) {
+ $settings->remove_child($lessonnavkey);
+ }
+}
\ No newline at end of file
// make sure people are where they should be
require_login($course->id, false, $cm);
+
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/report.php', array('id'=>$id));
+ if ($action !== 'reportoverview') {
+ $url->param('action', $action);
+ }
+ if ($pageid !== NULL) {
+ $url->param('pageid', $pageid);
+ }
+ $PAGE->set_url($url);
+ $PAGE->navbar->add(get_string('reports', 'lesson'), new moodle_url($CFG->wwwroot.'/mod/lesson/report.php', array('id'=>$id)));
+
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/lesson:manage', $context);