~ubuntu-branches/ubuntu/natty/moodle/natty

« back to all changes in this revision

Viewing changes to mod/data/rate.php

  • Committer: Bazaar Package Importer
  • Author(s): Tomasz Muras
  • Date: 2010-10-30 12:19:28 UTC
  • mfrom: (1.1.12 upstream) (3.1.10 squeeze)
  • Revision ID: james.westby@ubuntu.com-20101030121928-qzobi6mctpnk4dif
Tags: 1.9.9.dfsg2-2
* Added Romanian translation
* Updated Japanese translation (closes: #596820)
* Backporting security fixes from Moodle 1.9.10 (closes: #601384)
   - Updated embedded CAS to 1.1.3
   - Added patch for MDL-24523:
     clean_text() not filtering text in markdown format
   - Added patch for MDL-24810 and upgraded customized HTML Purifier to 4.2.0 
   - Added patch for MDL-24258:
     students can delete their forum posts later than $CFG->maxeditingtime 
     under certain conditions
   - Added patch for MDL-23377:
     Can't delete quiz attempts in course without enrolled students

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php  // $Id: rate.php,v 1.11 2007/06/05 22:58:40 skodak Exp $
 
1
<?php  // $Id: rate.php,v 1.11.2.2 2010/01/13 16:47:42 stronk7 Exp $
2
2
    require_once('../../config.php');
3
3
    require_once('lib.php');
4
4
 
14
14
 
15
15
    if (!$cm = get_coursemodule_from_instance('data', $data->id)) {
16
16
        error("Course Module ID was incorrect");
 
17
    } else {
 
18
        $data->cmidnumber = $cm->id; //MDL-12961
17
19
    }
18
20
 
19
21
    require_login($course, false, $cm);
33
35
        error("This page was not accessed correctly");
34
36
    }
35
37
 
 
38
/// Calculate scale values
 
39
    $scale_values = make_grades_menu($data->scale);
 
40
 
36
41
    $count = 0;
37
42
 
38
43
    foreach ((array)$frmdata as $recordid => $rating) {
52
57
            continue;
53
58
        }
54
59
 
 
60
    /// Check rate is valid for that database scale values
 
61
        if (!array_key_exists($rating, $scale_values) && $rating != -999) {
 
62
            print_error('invalidrate', 'data', '', $rating);
 
63
        }
 
64
 
55
65
        // input validation ok
56
66
 
57
67
        $count++;