Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9
-
Fix Version/s: None
-
Component/s: Forum
-
Labels:None
-
Difficulty:Easy
-
Affected Branches:MOODLE_19_STABLE
Description
teachers asked me to disable the "start new discussion" button from student's view
when they navigate into a "Q and A" forum type. since most of them just start a new
discussion instead of opening a discussion started by the teacher and answering it
(as the teacher expect them too) and thus missing the whole point of Q and A forum.
to patch...
open moodle/mod/forum/lib.php (line 4692~)
change :
if (forum_user_can_post_discussion($forum, $currentgroup, $groupmode, $cm, $context) ||
($forum->type != 'news' and (isguestuser() or !isloggedin() or has_capability('moodle/legacy:guest', $context, NULL, false))) )
{
to:
if ( (forum_user_can_post_discussion($forum, $currentgroup, $groupmode, $cm, $context) ||
($forum->type != 'news' and (isguestuser() or !isloggedin() or has_capability('moodle/legacy:guest', $context, NULL, false))) )
and !(has_capability('moodle/legacy:student', $context, NULL, false) and $forum->type == 'qanda') )
{
maybe we should have a $CFG for this ? or maybe a better way to implement this ?
not sure. any feedback is very welcome ![]()
now, it works