forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-9506 Added grade_outcome.php. Also added unit test for creation o…
…f log in history table when grade_raw is updated.
- Loading branch information
nicolasconnault
committed
May 3, 2007
1 parent
4d0263c
commit 5501446
Showing
5 changed files
with
125 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php // $Id$ | ||
|
||
/////////////////////////////////////////////////////////////////////////// | ||
// // | ||
// NOTICE OF COPYRIGHT // | ||
// // | ||
// Moodle - Modular Object-Oriented Dynamic Learning Environment // | ||
// http://moodle.com // | ||
// // | ||
// Copyright (C) 2001-2003 Martin Dougiamas http://dougiamas.com // | ||
// // | ||
// This program is free software; you can redistribute it and/or modify // | ||
// it under the terms of the GNU General Public License as published by // | ||
// the Free Software Foundation; either version 2 of the License, or // | ||
// (at your option) any later version. // | ||
// // | ||
// This program is distributed in the hope that it will be useful, // | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of // | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // | ||
// GNU General Public License for more details: // | ||
// // | ||
// http://www.gnu.org/copyleft/gpl.html // | ||
// // | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
require_once('grade_object.php'); | ||
|
||
/** | ||
* Class representing a grade outcome. It is responsible for handling its DB representation, | ||
* modifying and returning its metadata. | ||
*/ | ||
class grade_outcome extends grade_object { | ||
/** | ||
* DB Table (used by grade_object). | ||
* @var string $table | ||
*/ | ||
var $table = 'grade_outcomes'; | ||
|
||
/** | ||
* Array of class variables that are not part of the DB table fields | ||
* @var array $nonfields | ||
*/ | ||
var $nonfields = array('table', 'nonfields', 'scale'); | ||
|
||
/** | ||
* The course this outcome belongs to. | ||
* @var int $courseid | ||
*/ | ||
var $courseid; | ||
|
||
/** | ||
* The shortname of the outcome. | ||
* @var string $shortname | ||
*/ | ||
var $shortname; | ||
|
||
/** | ||
* The fullname of the outcome. | ||
* @var string $fullname | ||
*/ | ||
var $fullname; | ||
|
||
/** | ||
* A full grade_scale object referenced by $this->scaleid. | ||
* @var object $scale | ||
*/ | ||
var $scale; | ||
|
||
/** | ||
* The id of the scale referenced by this outcome. | ||
* @var int $scaleid | ||
*/ | ||
var $scaleid; | ||
|
||
/** | ||
* The userid of the person who last modified this outcome. | ||
* @var int $usermodified | ||
*/ | ||
var $usermodified; | ||
|
||
/** | ||
* Constructor. Extends the basic functionality defined in grade_object. | ||
* @param array $params Can also be a standard object. | ||
* @param boolean $fetch Wether or not to fetch the corresponding row from the DB. | ||
*/ | ||
function grade_grades_raw($params=NULL, $fetch=true) { | ||
$this->grade_object($params, $fetch); | ||
if (!empty($this->scaleid)) { | ||
$this->scale = new grade_scale(array('id' => $this->scaleid)); | ||
$this->scale->load_items(); | ||
} | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters