function getDefaultMetricType()
{
$defaultMetricType = $this->getSetting('defaultMetricType');
// Check whether the selected metric type is valid.
$availableMetrics = $this->getMetricTypes();
if (empty($defaultMetricType)) {
if (count($availableMetrics) === 1) {
// If there is only a single available metric then use it.
$defaultMetricType = $availableMetrics[0];
} else {
// Use the site-wide default metric.
$application = PKPApplication::getApplication();
$defaultMetricType = $application->getDefaultMetricType();
}
} else {
if (!in_array($defaultMetricType, $availableMetrics)) {
return null;
}
}
return $defaultMetricType;
}