Get the ongoing score message for the user (depending on the user permission and lesson settings).

@return str the ongoing score message
@since  Moodle 3.3
15420
public function get_ongoing_score_message() {
        global $USER, $DB;

        $context = $this->get_context();

        if (has_capability('mod/lesson:manage', $context)) {
            return get_string('teacherongoingwarning', 'lesson');
        } else {
            $ntries = $DB->count_records("lesson_grades", array("lessonid" => $this->properties->id, "userid" => $USER->id));
            if (isset($USER->modattempts[$this->properties->id])) {
                $ntries--;
            }
            $gradeinfo = lesson_grade($this, $ntries);
            $a = new stdClass;
            if ($this->properties->custom) {
                $a->score = $gradeinfo->earned;
                $a->currenthigh = $gradeinfo->total;
                return get_string("ongoingcustom", "lesson", $a);
            } else {
                $a->correct = $gradeinfo->earned;
                $a->viewed = $gradeinfo->attempts;
                return get_string("ongoingnormal", "lesson", $a);
            }
        }
    }
885318
public function getLastRuntimeMessage()
    {
        end($this->runtime_messages);
        $value = current($this->runtime_messages);
        reset($this->runtime_messages);

        return $value;
    }
609446
function under_score()
    {
        $key = (string) $this;

        $output = strtolower(preg_replace(array('/([a-z\d])([A-Z])/', '/([^_])([A-Z][a-z])/'), '$1_$2', $key));

        return new self($output);
    }
11231
public function getCurrentMessageCount()
    {
        // Save the current queue flags and setup the queue in passive mode
        $flags = $this->queue->getFlags();
        $this->queue->setFlags($flags | AMQP_PASSIVE);

        // Declare the queue again as passive to get the count of messages
        $messagesCount = $this->queue->declareQueue();

        // Restore the queue flags
        $this->queue->setFlags($flags);

        return $messagesCount;
    }
840775
public function getDocumentScore()
    {
        if (!$this->valid()) {
            throw new \LogicException('Document score is available only while iterating over results.');
        }

        if (!isset($this->documents[$this->key]['_score'])) {
            return null;
        }

        return $this->documents[$this->key]['_score'];
    }
239790
public function getMessage()
    {
        // check for HTTP failure response first
        $httpMessage = parent::getMessage();
        if ($httpMessage !== null) {
            return $httpMessage;
        }

        // check if descriptive failure reason is available
        if (!$this->isSuccessful() && isset($this->data['paymentStatusReason'])) {
            return $this->data['paymentStatusReason'];
        }

        // check if general payment status is available
        if (isset($this->data['paymentStatus'])) {
            return $this->data['paymentStatus'];
        }
    }
936735
public function getGrade()
    {
        //Get the hidden value.
        $response = $this->buildGetRequest(self::ZF_GRADE_URI, [], $this->headers);
        $viewstate = $this->parserOthersHiddenValue($response->getBody());

        $post['__EVENTTARGET'] = '';
        $post['__EVENTARGUMENT'] = '';
        $post['__VIEWSTATE'] = $viewstate;
        $post['hidLanguage'] = '';
        $post['ddlXN'] = '';
        $post['ddlXQ'] = '';
        $post['ddl_kcxz'] = '';
        $post['btn_zcj'] = iconv('utf-8', 'gb2312', '历年成绩');

        $response = $this->buildPostRequest(self::ZF_GRADE_URI, [], $post, $this->headers);

        return $this->parserCommonTable($response->getBody(), '#Datagrid1');
    }
458348
public function getSummaryAttribute()
    {
        if (preg_match("/with message '(.+)' in/", $this->message, $match)) {
            return $match[1];
        }

        return Str::limit($this->message, 100);
    }
1163016
public function getSessionChallengeToken()
    {
        $sRet = preg_replace('/[^a-z0-9]/i', '', $this->getVariable('sess_stoken'));
        if (!$sRet) {
            $this->_initNewSessionChallenge();
            $sRet = $this->getVariable('sess_stoken');
        }

        return $sRet;
    }
411831
public static function getMessage()
    {
        $theme = self::getCurrentTheme();
        if (
            $theme instanceof ConfigurableTheme ||
            $theme instanceof ConfigurablePlatformTheme
        ) {
            $message = $theme->getMessage();
            if (! empty($message)) {
                return $message;
            }
        }

        switch (TAO_RELEASE_STATUS) {
            case 'alpha':
            case 'demoA':
            case 'beta':
            case 'demoB':
                $message = __('Please report bugs, ideas, comments or feedback on the TAO Forum');
                break;
            default:
                $message = '';
                break;
        }

        return $message;
    }
1002563
public function toMessage()
    {
        $m = new Message();

        /* @var $w Worker */
        foreach ($this->workerStatus as $w) {
            $m->push($w['id']);
            $m->push(count($w['actionList']));
            $m->append($w['actionList']);
            $m->push($w['current']);
            $m->push($w['ready']);
            $m->push($w['valid']);
        }

        return $m;
    }
1355722
public function getUsageMessage()
    {
        foreach ($this->optionDefinitions as $def) {
            $this->usageProvider->addOptionDefinition($def);
        }
        if (empty($this->scriptName)) {
            $this->scriptName = $_SERVER['PHP_SELF'];
        }
        $this->usageProvider->setScriptName($this->scriptName);
        return $this->usageProvider->getUsageMessage();
    }
173597
function progressText()
    {
        if ( $this->Progress == self::PROGRESS_UNKNOWN )
        {
            return ezpI18n::tr( 'ezscriptmonitor', 'Unknown' );
        }

        if ( $this->Progress < 0 )
        {
            return '0%';
        }

        if ( $this->Progress > 100 )
        {
            return '100%';
        }

        return $this->Progress . '%';
    }
512002
public function get_message() {
		$message = $this->op['message'];
		$link    = $this->get_review_link_tag();
		$message = $message . ' ' . $link;
		return \wp_kses_post( $message );
	}
1001386
public function get_grade() {
        $grade = $this->get_guide_filling();

        if (!($scores = $this->get_controller()->get_min_max_score()) || $scores['maxscore'] <= $scores['minscore']) {
            return -1;
        }

        $graderange = array_keys($this->get_controller()->get_grade_range());
        if (empty($graderange)) {
            return -1;
        }
        sort($graderange);
        $mingrade = $graderange[0];
        $maxgrade = $graderange[count($graderange) - 1];

        $curscore = 0;
        foreach ($grade['criteria'] as $record) {
            $curscore += $record['score'];
        }
        $gradeoffset = ($curscore-$scores['minscore'])/($scores['maxscore']-$scores['minscore'])*
            ($maxgrade-$mingrade);
        if ($this->get_controller()->get_allow_grade_decimals()) {
            return $gradeoffset + $mingrade;
        }
        return round($gradeoffset, 0) + $mingrade;
    }
1212424
public function getRating() : ?string 
    {
        if ( ! $this->hasRating()) {
            $this->setRating($this->getDefaultRating());
        }
        return $this->rating;
    }
431949
public function getStatusAttribute()
    {
        if ($this->isActive()) {
            return self::STATUS_ACTIVE;
        }

        if ($this->isCanceled()) {
            return self::STATUS_CANCELED;
        }

        if ($this->isEnded()) {
            return self::STATUS_ENDED;
        }
    }