Moodle
  1. Moodle
  2. MDL-37712

Delay Display option for Q & A Forum

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor 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
    • Labels:
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Rank:
      47422

      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;
      }
      

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for suggesting that and providing code to achieve it.

        Show
        Michael de Raadt added a comment - Thanks for suggesting that and providing code to achieve it.
        Hide
        Jason Hardin added a comment -

        I would recommend if this is implemented that some enhancements be made.

        1. Add a global setting that says whether this is enabled or disabled at the site level for admins

        2. Add the time of delay to the right of the disable or as a new field. This way not only can the teacher say yes I want a delay but they can also specify how long that delay is.

        I think the delay time is key to allow users to edit the post if they make a mistake. For your use case you need no editing and instant posting. Others might allow 5 minutes of editing (near instant) and others are ok with the 30 minute rule.

        I would also make $CFG->maxeditingtime a site configuration setting for forums.

        Show
        Jason Hardin added a comment - I would recommend if this is implemented that some enhancements be made. 1. Add a global setting that says whether this is enabled or disabled at the site level for admins 2. Add the time of delay to the right of the disable or as a new field. This way not only can the teacher say yes I want a delay but they can also specify how long that delay is. I think the delay time is key to allow users to edit the post if they make a mistake. For your use case you need no editing and instant posting. Others might allow 5 minutes of editing (near instant) and others are ok with the 30 minute rule. I would also make $CFG->maxeditingtime a site configuration setting for forums.
        Hide
        Marcus Green added a comment - - edited

        Thanks for your comment Jason. It has occurred to me since that rather than toggling the delay with a true/false boolean value it might make more sense to have a numeric value for this field so that the default is to use the maxeditingtime but if you change the DelayDisplay it would change it for that forum. Sometimes I think it might be handy to have a few seconds of delay, even in the classroom.

        Show
        Marcus Green added a comment - - edited Thanks for your comment Jason. It has occurred to me since that rather than toggling the delay with a true/false boolean value it might make more sense to have a numeric value for this field so that the default is to use the maxeditingtime but if you change the DelayDisplay it would change it for that forum. Sometimes I think it might be handy to have a few seconds of delay, even in the classroom.

          People

          • Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated: