original_string: public static function revoke_acceptance($policyversionid, $userid, $note = null) {
          global $DB, $USER;
          if (!$userid) {
              $userid = $USER->id;
          }
          self::can_accept_policies([$policyversionid], $userid, true);
  
          if ($currentacceptance = $DB->get_record('tool_policy_acceptances',
                  ['policyversionid' => $policyversionid, 'userid' => $userid])) {
              $realuser = manager::get_realuser();
              $updatedata = ['id' => $currentacceptance->id, 'status' => 0, 'timemodified' => time(),
                  'usermodified' => $realuser->id, 'note' => $note];
              $DB->update_record('tool_policy_acceptances', $updatedata);
              acceptance_updated::create_from_record((object)($updatedata + (array)$currentacceptance))->trigger();
          }
  
          static::update_policyagreed($userid);
      }
code: public static function revoke_acceptance($policyversionid, $userid, $note = null) {
          global $DB, $USER;
          if (!$userid) {
              $userid = $USER->id;
          }
          self::can_accept_policies([$policyversionid], $userid, true);
  
          if ($currentacceptance = $DB->get_record('tool_policy_acceptances',
                  ['policyversionid' => $policyversionid, 'userid' => $userid])) {
              $realuser = manager::get_realuser();
              $updatedata = ['id' => $currentacceptance->id, 'status' => 0, 'timemodified' => time(),
                  'usermodified' => $realuser->id, 'note' => $note];
              $DB->update_record('tool_policy_acceptances', $updatedata);
              acceptance_updated::create_from_record((object)($updatedata + (array)$currentacceptance))->trigger();
          }
  
          static::update_policyagreed($userid);
      }
code_tokens: public static function revoke_acceptance ( $ policyversionid , $ userid , $ note = null ) { global $ DB , $ USER ; if ( ! $ userid ) { $ userid = $ USER -> id ; } self :: can_accept_policies ( [ $ policyversionid ] , $ userid , true ) ; if ( $ currentacceptance = $ DB -> get_record ( 'tool_policy_acceptances' , [ 'policyversionid' => $ policyversionid , 'userid' => $ userid ] ) ) { $ realuser = manager :: get_realuser ( ) ; $ updatedata = [ 'id' => $ currentacceptance -> id , 'status' => 0 , 'timemodified' => time ( ) , 'usermodified' => $ realuser -> id , 'note' => $ note ] ; $ DB -> update_record ( 'tool_policy_acceptances' , $ updatedata ) ; acceptance_updated :: create_from_record ( ( object ) ( $ updatedata + ( array ) $ currentacceptance ) ) -> trigger ( ) ; } static :: update_policyagreed ( $ userid ) ; }
docstring: May be used to revert accidentally granted acceptance for another user
  
  @param int $policyversionid
  @param int $userid
  @param null $note
docstring_tokens: May be used to revert accidentally granted acceptance for another user