Skip to content
Snippets Groups Projects
Commit fe7bf143 authored by anisa kusumadewi's avatar anisa kusumadewi
Browse files

Revert "Fix type incompatibility in statistic"

This reverts commit e456750c.
parent e456750c
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@ class pdfannotator_statistics {
* Returns the average number of questions/answers a user wrote in this pdf-annotator.
* Only users that wrote at least one comment are included.
* @param type $isquestion '1' for questions, '0' for answers
* @return float
* @return type
*/
public function get_comments_average_annotator($isquestion) {
global $DB;
......@@ -85,14 +85,14 @@ class pdfannotator_statistics {
. "WHERE pdfannotatorid = ? AND isquestion = ? AND isdeleted = ? "
. "GROUP BY userid ) AS counts";
return (float) key($DB->get_records_sql($sql, array($this->annotatorid, $isquestion, '0')));
return key($DB->get_records_sql($sql, array($this->annotatorid, $isquestion, '0')));
}
/**
* Returns the average number of questions/answers a user wrote in this course.
* Only users that wrote at least one comment are included.
* @param type $isquestion '1' for questions, '0' for answers
* @return float
* @return type
*/
public function get_comments_average_course($isquestion) {
global $DB;
......@@ -102,7 +102,7 @@ class pdfannotator_statistics {
. "WHERE a.course = ? AND a.id = c.pdfannotatorid AND c.isquestion = ? AND c.isdeleted = ?"
. "GROUP BY c.userid ) AS counts";
return (float) key($DB->get_records_sql($sql, array($this->courseid, $isquestion, '0')));
return key($DB->get_records_sql($sql, array($this->courseid, $isquestion, '0')));
}
/**
......@@ -224,7 +224,7 @@ class pdfannotator_statistics {
* @param type $annotatorid
* @param type $isquestion '1' for questions, '0' for answers
* @param type $userid false by default for comments by all users. Userid for comments by a specific user
* @return float
* @return type
*/
public static function count_comments_annotator($annotatorid, $isquestion, $userid = false) {
global $DB;
......@@ -234,7 +234,7 @@ class pdfannotator_statistics {
$conditions['userid'] = $userid;
}
return (float) $DB->count_records('pdfannotator_comments', $conditions);
return $DB->count_records('pdfannotator_comments', $conditions);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment