3 ///////////////////////////////////////////////////////////////////////////
5 // NOTICE OF COPYRIGHT //
7 // Moodle - Modular Object-Oriented Dynamic Learning Environment //
8 // http://moodle.com //
10 // Copyright (C) 2001-2003 Martin Dougiamas http://dougiamas.com //
12 // This program is free software; you can redistribute it and/or modify //
13 // it under the terms of the GNU General Public License as published by //
14 // the Free Software Foundation; either version 2 of the License, or //
15 // (at your option) any later version. //
17 // This program is distributed in the hope that it will be useful, //
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20 // GNU General Public License for more details: //
22 // http://www.gnu.org/copyleft/gpl.html //
24 ///////////////////////////////////////////////////////////////////////////
26 require_once('grade_object.php');
29 * A text string used to compute the value displayed by a grade_item.
30 * There can be only one grade_text per grade_item (one-to-one).
32 class grade_grade_text
extends grade_object
{
34 * DB Table (used by grade_object).
37 var $table = 'grade_grades_text';
40 * Array of class variables that are not part of the DB table fields
41 * @var array $nonfields
43 var $nonfields = array('table', 'required_fields', 'nonfields');
46 * The grade_grade.id this text refers to.
52 * Further information like forum rating distribution 4/5/7/0/1
53 * @var string $information
58 * Text format for information (FORMAT_PLAIN, FORMAT_HTML etc...).
59 * @var int $informationformat
61 var $informationformat = FORMAT_MOODLE
;
64 * Manual feedback from the teacher. This could be a code like 'mi'.
65 * @var string $feedback
70 * Text format for feedback (FORMAT_PLAIN, FORMAT_HTML etc...).
71 * @var int $feedbackformat
73 var $feedbackformat = FORMAT_MOODLE
;
76 * The userid of the person who last modified this text.
77 * @var int $usermodified
82 * Finds and returns a grade_grade_text instance based on params.
85 * @param array $params associative arrays varname=>value
86 * @return object grade_grade_text instance or false if none found.
88 function fetch($params) {
89 return grade_object
::fetch_helper('grade_grades_text', 'grade_grade_text', $params);
93 * Finds and returns all grade_grade_text instances based on params.
96 * @param array $params associative arrays varname=>value
97 * @return array array of grade_grade_text insatnces or false if none found.
99 function fetch_all($params) {
100 return grade_object
::fetch_all_helper('grade_grades_text', 'grade_grade_text', $params);