Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.2.7, 2.3.4, 2.4.1, 2.5
-
Fix Version/s: DEV backlog
-
Component/s: Forum
-
Affected Branches:MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
Description
MDL-9376 changed the way the Q&A forum works by preventing students seeing other people posts until the maxediting time had elapsed (i.e. a typical 30 minute delay before students could see other peoples posts).
This was to prevent "cheating" where a student writes a quick nonsense post to peek at other peoples replies.
This reduces the functionality of the Q&A forum in the classroom context where they benefit from seeing the answers immediately.
I propose a new field in the forum settings form with a name such as Delay Display that controls if students can see others post immediately after they post a reply or after the system delay time.
I have experimented with the following modifications but have done minimal testing
It has been discussed at
https://moodle.org/mod/forum/discuss.php?d=219417
Add a new column to the forum table called delaydisplay of type tinyint(4) or equivalent.
Within the function definition() code in the forum mod_form.php file around line 59
(immediately after
$this->add_intro_editor(true, get_string('forumintro', 'forum'));
)
add the following code
$mform->addElement('advcheckbox', 'delaydisplay', get_string('delaydisplay','forum'));
|
$mform->addHelpButton('delaydisplay', 'delay', 'forum');
|
The en language file would contain
$string['delaydisplay'] = 'Delay Display';
|
$string['delay']="Delay Display";
|
$string['delay_help']='Delay Display yadda yadda';
|
To match the help button.
Modify the end of the forum_user_can_see_post method in
forum/lib.php code to read as follows
...
|
if ($forum->type == 'qanda') {
|
$firstpost = forum_get_firstpost_from_discussion($discussion->id);
|
$userfirstpost = forum_get_user_posted_time($discussion->id, $user->id);
|
|
$display=1;
|
if($forum->delaydisplay==1){
|
if((time() - $userfirstpost >= $CFG->maxeditingtime)){
|
$display=0;
|
}
|
}
|
|
return (($userfirstpost !== false && $display==1) ||
|
$firstpost->id == $post->id || $post->userid == $user->id || $firstpost->userid == $user->id ||
|
has_capability('mod/forum:viewqandawithoutposting', $modcontext, $user->id));
|
}
|
return true;
|
}
|