Get review score.

@param \simplehtmldom_1_5\simple_html_dom $bottom_area

@return array
543092
private function getReviewScore($bottom_area)
    {
        $score = [];
        $score_area = $bottom_area->find('table', 0);
        if ($score_area) {
            foreach ($score_area->find('tr') as $each_score) {
                $score_type = strtolower($each_score->find('td', 0)->plaintext);
                $score_value = $each_score->find('td', 1)->plaintext;
                $score[$score_type] = $score_value;
            }
        }

        return $score;
    }
154516
public function getCommentsStatisticByActivity()
    {
        $comments = $this->model::select(['is_active', DB::raw('count(*) as total')])
            ->groupBy('is_active')
            ->get();

        return $comments;
    }
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;
    }
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);
            }
        }
    }
786949
private function getAllInfo()
    {
        $data = [];
        $review_area = $this->_parser->find('.borderDark', 0);

        $top_area = $review_area->find('.spaceit', 0);
        $bottom_area = $top_area->next_sibling();

        $data['id'] = $this->getId();
        $data['source'] = $this->getReviewSource($top_area, $bottom_area);
        $data['username'] = $this->getReviewUser($top_area);
        $data['image'] = $this->getReviewImage($top_area);
        $data['helpful'] = $this->getReviewHelpful($top_area);
        $data['date'] = $this->getReviewDate($top_area);
        if ($this->_type == 'anime') {
            $data['episode'] = $this->getReviewEpisode($top_area);
        } else {
            $data['chapter'] = $this->getReviewEpisode($top_area);
        }
        $data['score'] = $this->getReviewScore($bottom_area);
        $data['review'] = $this->getReviewText($bottom_area);

        return $data;
    }
1125800
private function getAbout()
    {
        $about_area = $this->_parser->find('.container-right', 0);
        $about = $about_area->find('table tr td div[class=word-break]', 0);

        return $about ? trim($about->innertext) : '';
    }
299801
public function getScore()
    {
        $ipLkup = $this->get('ipLkup', ['ip' => $this->ip]);

        $score = $ipLkup['response'][$this->ip];

        if ($score) {
            return (string) $score;
        } else {
            return 'unknown';
        }
    }
226525
public function GetAverageScore()
    {
        $dAvgScore = 0;
        if ($this->Length() > 0) {
            $iPt = $this->getItemPointer();
            $this->GoToStart();
            $dScore = 0;
            while ($oitem = &$this->Next()) {
                $dScore += $oitem->fieldRating;
            }
            $this->setItemPointer($iPt);

            $dAvgScore = $dScore / $this->Length();
        }

        return $dAvgScore;
    }
967209
public function getReport()
	{
		if (!isset($this->report))
		{
			$tests = array();

			foreach ($this->getTests() as $key => $audit)
			{
				if (!isset($tests[$key]))
				{
					$tests[$key] = array(
						'name'   => $audit->name(),
						'total'  => 0,
						'totals' => array(
							'skipped' => 0,
							'passed'  => 0,
							'failed'  => 0
						)
					);
				}

				$tests[$key]['totals']['skipped'] = Result::all()
					->whereEquals('scope', $this->scope)
					->whereEquals('test_id', $key)
					->whereEquals('status', 0)
					->total();

				$tests[$key]['totals']['passed'] = Result::all()
					->whereEquals('scope', $this->scope)
					->whereEquals('test_id', $key)
					->whereEquals('status', 1)
					->total();

				$tests[$key]['totals']['failed'] = Result::all()
					->whereEquals('scope', $this->scope)
					->whereEquals('test_id', $key)
					->whereEquals('status', -1)
					->total();

				$tests[$key]['total'] += $tests[$key]['totals']['skipped'];
				$tests[$key]['total'] += $tests[$key]['totals']['passed'];
				$tests[$key]['total'] += $tests[$key]['totals']['failed'];
			}

			$this->report = $tests;
		}

		return $this->report;
	}
724971
private function getReviewHelpful($top_area)
    {
        $helpful = $top_area->find('table', 0);
        $helpful = $helpful->find('td', 1)->find('strong', 0)->plaintext;

        return trim($helpful);
    }
582163
private function getScore()
    {
        $score = [];
        $score_area = $this->_parser->find('h2', 1)->next_sibling();
        if ($score_area->tag == 'table') {
            foreach ($score_area->find('tr') as $each_score) {
                $temp_score = [];

                $temp_score['type'] = $this->getScoreType($each_score);
                $temp_score['vote'] = $this->getScoreVote($each_score);
                $temp_score['percent'] = $this->getScorePercent($each_score);

                $score[] = $temp_score;
            }
        }

        return $score;
    }
1209269
public function getDomAreas($areasAttributes = []){
        $attributes = array_merge(self::$urlLinkAttributes,$areasAttributes);
        return self::attributesBeautifier($this->domCrawler->filterXpath('//area')->extract($attributes),$attributes);
    }
67132
public function calculate( $top, $bottom )
	{
		if( $top < $bottom )
			throw new InvalidArgumentException( 'Bottom Number must be lower than or equal to Top Number.' );
		else if( $top != (int) $top )
			throw new InvalidArgumentException( 'Top Number must be an Integer.' );
		else if( $bottom != (int) $bottom )
			throw new InvalidArgumentException( 'Bottom Number must be an Integer.' );
		else
		{
			$result	= Alg_Math_Factorial::calculate( $top ) / ( Alg_Math_Factorial::calculate( $bottom ) * Alg_Math_Factorial::calculate( $top - $bottom ) );
			return $result;
		}
	}
657967
public static function get_search_area_categories() {
        if (!isset(static::$searchareacategories)) {
            $categories = self::get_core_search_area_categories();

            // Go through all existing search areas and get categories they are assigned to.
            $areacategories = [];
            foreach (self::get_search_areas_list() as $searcharea) {
                foreach ($searcharea->get_category_names() as $categoryname) {
                    if (!key_exists($categoryname, $areacategories)) {
                        $areacategories[$categoryname] = [];
                    }

                    $areacategories[$categoryname][] = $searcharea;
                }
            }

            // Populate core categories by areas.
            foreach ($areacategories as $name => $searchareas) {
                if (key_exists($name, $categories)) {
                    $categories[$name]->set_areas($searchareas);
                } else {
                    throw new \coding_exception('Unknown core search area category ' . $name);
                }
            }

            // Get additional categories.
            $additionalcategories = self::get_additional_search_area_categories();
            foreach ($additionalcategories as $additionalcategory) {
                if (!key_exists($additionalcategory->get_name(), $categories)) {
                    $categories[$additionalcategory->get_name()] = $additionalcategory;
                }
            }

            // Remove categories without areas.
            foreach ($categories as $key => $category) {
                if (empty($category->get_areas())) {
                    unset($categories[$key]);
                }
            }

            // Sort categories by order.
            uasort($categories, function($category1, $category2) {
                return $category1->get_order() > $category2->get_order();
            });

            static::$searchareacategories = $categories;
        }

        return static::$searchareacategories;
    }
969614
private function getMeanScore($a_stat_score)
    {
        $mean_score = $a_stat_score->find('div', 1);
        $temp_score = $mean_score->find('span', 0)->plaintext;

        return str_replace($temp_score, '', $mean_score->plaintext);
    }
6515
private function getReviewImage($top_area)
    {
        $image = $top_area->find('table', 0);
        $image = $image->find('td', 0)->find('img', 0)->src;

        return Helper::imageUrlCleaner($image);
    }
503710
private function getResult()
    {
        $result = [];
        foreach ($this->attributes->getAttributes() as $key) {
            $result[] = $this->arrayAnalyzer($key);
        }

        return $result;
    }