Set the marking allocation for multiple users

@return void
551355
protected function process_set_batch_marking_allocation() {
        global $CFG, $DB;

        // Include batch marking allocation form.
        require_once($CFG->dirroot . '/mod/assign/batchsetallocatedmarkerform.php');

        $formparams = array(
            'userscount' => 0,  // This form is never re-displayed, so we don't need to
            'usershtml' => ''   // initialise these parameters with real information.
        );

        list($sort, $params) = users_order_by_sql('u');
        // Only enrolled users could be assigned as potential markers.
        $markers = get_enrolled_users($this->get_context(), 'mod/assign:grade', 0, 'u.*', $sort);
        $markerlist = array();
        foreach ($markers as $marker) {
            $markerlist[$marker->id] = fullname($marker);
        }

        $formparams['markers'] = $markerlist;

        $mform = new mod_assign_batch_set_allocatedmarker_form(null, $formparams);

        if ($mform->is_cancelled()) {
            return true;
        }

        if ($formdata = $mform->get_data()) {
            $useridlist = explode(',', $formdata->selectedusers);
            $marker = $DB->get_record('user', array('id' => $formdata->allocatedmarker), '*', MUST_EXIST);

            foreach ($useridlist as $userid) {
                $flags = $this->get_user_flags($userid, true);
                if ($flags->workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_READYFORREVIEW ||
                    $flags->workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_INREVIEW ||
                    $flags->workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_READYFORRELEASE ||
                    $flags->workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_RELEASED) {

                    continue; // Allocated marker can only be changed in certain workflow states.
                }

                $flags->allocatedmarker = $marker->id;

                if ($this->update_user_flags($flags)) {
                    $user = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
                    \mod_assign\event\marker_updated::create_from_marker($this, $user, $marker)->trigger();
                }
            }
        }
    }
665811
private function setRequestedAmount()
    {
        if ($this->simpleXml->{'requested-amount'}->count() < 1) {
            return;
        }

        $this->requestedAmount = new Amount(
            (float)$this->simpleXml->{'requested-amount'},
            (string)$this->simpleXml->{'requested-amount'}->attributes()->currency
        );
    }
910312
protected function setUser()
    {
        $this->uid = $this->getParam('u', null);

        if (isset($this->uid)) {

            $this->current_user = $this->user->get($this->uid);

            if (empty($this->current_user['status'])) {
                $this->errorAndExit($this->text('No access'));
            }
        }
    }
123360
public function setWatermark($low = null, $high = null)
    {
        if ($low !== null) {
            $this->lowMark = $low;
        }
        if ($high !== null) {
            $this->highMark = $high;
        }
        if ($this->highMark > 0) {
            $this->highMark = max($this->lowMark, $this->highMark);
        }
        $this->bev->setWatermark(\Event::READ, $this->lowMark, $this->highMark);
    }
314330
public function markPending(): bool
    {
        $this->owner->{$this->statusAttribute} = Status::PENDING;

        if ($this->beforeModeration()) {
            return $this->owner->save();
        }

        return false;
    }
463207
protected function setCustomer()
    {
        $this->quoteCustomer->setEntity($this->quote);
        $this->quoteCustomer->setAddress($this->quote);
        $this->quoteCustomer->resetGuest($this->quote);
    }
139489
public void setUsers(java.util.Collection<TraceUser> users) {
        if (users == null) {
            this.users = null;
            return;
        }

        this.users = new java.util.ArrayList<TraceUser>(users);
    }
409656
public function setUserAndGroup()
    {
        // Get uid.
        $user_info = posix_getpwnam($this->user);
        if (!$user_info) {
            static::log("Warning: User {$this->user} not exsits");
            return;
        }
        $uid = $user_info['uid'];
        // Get gid.
        if ($this->group) {
            $group_info = posix_getgrnam($this->group);
            if (!$group_info) {
                static::log("Warning: Group {$this->group} not exsits");
                return;
            }
            $gid = $group_info['gid'];
        } else {
            $gid = $user_info['gid'];
        }

        // Set uid and gid.
        if ($uid != posix_getuid() || $gid != posix_getgid()) {
            if (!posix_setgid($gid) || !posix_initgroups($user_info['name'], $gid) || !posix_setuid($uid)) {
                static::log("Warning: change gid or uid fail.");
            }
        }
    }
566609
protected function limitPending()
    {
        $offset     = $this->pending['limit']['offset'];
        $num        = $this->pending['limit']['number'];
        $this->data = array_slice($this->data, $offset, $num);
    }
1062226
public function setCreditPointsForInviter()
    {
        $blSet = false;
        $iPoints = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('dPointsForInvitation');
        if ($iPoints) {
            $iNewPoints = $this->oxuser__oxpoints->value + $iPoints;
            $this->oxuser__oxpoints = new Field($iNewPoints, Field::T_RAW);
            $blSet = $this->save();
        }

        return $blSet;
    }
383300
public function editUserForgot()
    {
        $this->controlAccessUserForgot();

        $this->setUserForgot();
        $this->setTitleEditUserForgot();
        $this->setBreadcrumbEditUserForgot();

        $this->setData('forgetful_user', $this->data_user);
        $this->setData('password_limit', $this->user->getPasswordLength());

        $this->submitUserForgot();
        $this->outputEditUserForgot();
    }
1002762
protected function setUser()
    {
        $objectManager = Bootstrap::$staticObjectManager;
        /** @var \Neos\Flow\Security\Context $securityContext */
        $securityContext = $objectManager->get('Neos\Flow\Security\Context');

        $userContext = array();

        if ($securityContext->isInitialized()) {
            $account = $securityContext->getAccount();
            if ($account !== null) {
                $userContext['username'] = $account->getAccountIdentifier();
            }
        }

        if ($userContext !== array()) {
            $this->client->user_context($userContext);
        }
    }
851040
public function markAllAsRead(User $user)
    {
        Notification::where('user_id', $user->id)->update(['read_at' => Carbon::now()]);
    }
496880
public function mark_for_regrade() {
        global $DB;
        if ($this->has_active_instances()) {
            $conditions = array('definitionid'  => $this->definition->id,
                        'status'  => gradingform_instance::INSTANCE_STATUS_ACTIVE);
            $DB->set_field('grading_instances', 'status', gradingform_instance::INSTANCE_STATUS_NEEDUPDATE, $conditions);
        }
    }
722484
private function setLimitAndSetOffset()
    {
        if ($this->perPage === null) {
            $this->offset = null;
            $this->limit = null;
        } else {
            $this->offset = ($this->currentPage - 1) * $this->perPage;
            $this->limit = $this->perPage;
        }
    }
180927
def mark(self, n=1):
        """"""
        self.tick_if_necessary()
        self.count += n
        self.m1_rate.update(n)
        self.m5_rate.update(n)
        self.m15_rate.update(n)
373504
public function markAsPersisted(): void
    {
        $this->markNew(false);
        $this->dispatchEvent(new Event\Persisted($this));
    }