Turn editing on by default with teacher/creator login

Turn editing on by default with teacher/creator login

by Michael Penney -
Number of replies: 5
Hi all, many of our faculty migrating from Blackboard are geting stuck on the 'turn editing on' step.

Is there an easy way to have this turned on by default when a user with edit privs. logs in to the course?

Thanks!
Average of ratings: -
In reply to Michael Penney

Re: Turn editing on by default with teacher/creator login

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
You can put this near the top of course/view.php

   if (!isset($USER->editing)) {
        $USER->editing = true;
   }

...but bear in mind it slows down the rendering of the course page, so think very carefully about doing this.  Perhaps an email to everyone would also solve the problem.


In reply to Martin Dougiamas

Re: Turn editing on by default with teacher/creator login

by Michael Penney -
Thanks Martin, I've tried the email and covered it in faculty trainings. It just doesn't seem to be sticking.

My plan is to leave it on during the initial phases, once the tendancy to think its broken because its new is past and alot of faculty are using it, I'll try setting it back.

As for the slow rendering, I don't think it will be too much of a problem, these folks are used to the hyper-snailspace of Blackboard, after allsmile.
In reply to Michael Penney

Re: Turn editing on by default with teacher/creator login

by Jan Dierckx -
Could this be a solution?  tongueout
Attachment naamloos.GIF
In reply to Martin Dougiamas

Re: Turn editing on by default with teacher/creator login

by Gordon McLeod -

Hi,

In our new Moodle 2.3 I've tried adding the code to default editing to on

if (!isset($USER->editing)) {
        $USER->editing = true;
   }

It works fine if you've got site admin rights - but not if you are an editing teacher. I know roles have changed considerably since this was originally scripted - but if it works for admin I'm assuming that it should work for editing teachers too. Can anyone offer a suggestion of what is missing (role permission or code) to get this working?

Thanks, Gordon.

In reply to Gordon McLeod

회신: Re: Turn editing on by default with teacher/creator login

by Jong-Dae Park -
How about changing as follows,
Go to line number 133 of course/view.php
if (!isset($USER->editing)) { $USER->editing = 0; }
change to
if (!isset($USER->editing)) { if ($PAGE->user_allowed_editing()) { $USER->editing = 1; if ($course->id == SITEID) { redirect($CFG->wwwroot . '/?redirect=0'); } else { $url = new moodle_url($PAGE->url, array('notifyeditingon' => 1)); redirect($url); } } else $USER->editing = 0; }