Skip to content

Commit

Permalink
Merge branch 'MDL-27625_master' of git://github.com/stronk7/moodle
Browse files Browse the repository at this point in the history
Conflicts:
	mod/forum/lib.php
  • Loading branch information
stronk7 committed May 25, 2011
2 parents 28e2b08 + 5693d56 commit 5b52ce1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
9 changes: 7 additions & 2 deletions mod/data/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1444,9 +1444,14 @@ function data_rating_validate($params) {
}

//check that the submitted rating is valid for the scale
if ($params['rating'] < 0) {

// lower limit
if ($params['rating'] < 0 && $params['rating'] != RATING_UNSET_RATING) {
throw new rating_exception('invalidnum');
} else if ($info->scale < 0) {
}

// upper limit
if ($info->scale < 0) {
//its a custom scale
$scalerecord = $DB->get_record('scale', array('id' => -$info->scale));
if ($scalerecord) {
Expand Down
9 changes: 7 additions & 2 deletions mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3537,9 +3537,14 @@ function forum_rating_validate($params) {
}

//check that the submitted rating is valid for the scale
if ($params['rating'] < 0) {

// lower limit
if ($params['rating'] < 0 && $params['rating'] != RATING_UNSET_RATING) {
throw new rating_exception('invalidnum');
} else if ($forum->scale < 0) {
}

// upper limit
if ($info->scale < 0) {
//its a custom scale
$scalerecord = $DB->get_record('scale', array('id' => -$forum->scale));
if ($scalerecord) {
Expand Down
9 changes: 7 additions & 2 deletions mod/glossary/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,14 @@ function glossary_rating_validate($params) {
}

//check that the submitted rating is valid for the scale
if ($params['rating'] < 0) {

// lower limit
if ($params['rating'] < 0 && $params['rating'] != RATING_UNSET_RATING) {
throw new rating_exception('invalidnum');
} else if ($info->scale < 0) {
}

// upper limit
if ($info->scale < 0) {
//its a custom scale
$scalerecord = $DB->get_record('scale', array('id' => -$info->scale));
if ($scalerecord) {
Expand Down

0 comments on commit 5b52ce1

Please sign in to comment.