Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6619

Re: Απάντηση: Prevent teachers from changing course name in Moodle 2.6

$
0
0
by Zvonko Martinović.  

We do this by disabling overwrite in restore class. Here is our diff:

diff --git a/backup/moodle2/restore_course_task.class.php b/backup/moodle2/restore_course_task.class.php
index d32e1e2..bafb742 100644
--- a/backup/moodle2/restore_course_task.class.php
+++ b/backup/moodle2/restore_course_task.class.php
@@ -198,6 +198,10 @@ class restore_course_task extends restore_task {
             $overwrite->set_status(backup_setting::LOCKED_BY_CONFIG);
             $overwrite->set_visibility(backup_setting::HIDDEN);
         }
+        else{
+        	$overwrite->set_status(backup_setting::LOCKED_BY_CONFIG);
+        	$overwrite->set_visibility(backup_setting::HIDDEN);
+        }
         $this->add_setting($overwrite);

     }
--
libgit2 0.21.2
It will hide overwrite menu and as it's false by default course settings (like name or short name) will not be changed.

This core is for Moodle 2.9 but we used it on Moodle 2.7 and it should be the same on older Moodle.


Viewing all articles
Browse latest Browse all 6619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>