Documentation is available at CourseGradeRecord.class.php
- <?php
- require_once(OKI2."/osid/coursemanagement/CourseGradeRecord.php");
- /**
- * CourseGradeRecord manages the CourseGrade of a specific CourseGradeType for
- * an Agent and a CourseOffering.
- *
- * <p>
- * OSID Version: 2.0
- * </p>
- *
- * @package harmoni.osid_v2.coursemanagement
- *
- * @copyright Copyright © 2005, Middlebury College
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
- *
- * @version $Id: CourseGradeRecord.class.php,v 1.9 2007/09/04 20:25:39 adamfranco Exp $
- */
- class HarmoniCourseGradeRecord
- extends CourseGradeRecord
- {
- /**
- * @variable object $_id the unique id for this HarmoniCourseGradeRecord.
- * @access private
- * @variable object $_table the HarmoniCourseGradeRecord table.
- * @access private
- ***/
- var $_id;
- var $_table;
- /**
- * The constructor.
- *
- * @param object Id $id
- *
- * @access public
- * @return void
- */
- function HarmoniCourseGradeRecord($id)
- {
- $this->_id = $id;
- $this->_table = 'cm_grade_rec';
- }
- /**
- * Update the grade for this CourseGradeRecord.
- *
- * @param object mixed $courseGrade (original type: java.io.Serializable)
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#NULL_ARGUMENT
- * NULL_ARGUMENT}
- *
- * @access public
- */
- function updateCourseGrade ( $courseGrade ) {
- $this->_setField('grade',$courseGrade);
- }
- /**
- * Update the display name for this CourseGradeRecord.
- *
- * @param string $displayName
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#NULL_ARGUMENT
- * NULL_ARGUMENT}
- *
- * @access public
- */
- function updateDisplayName ( $displayName ) {
- $this->_setField('name',$displayName);
- }
- /**
- * Get the grade for this CourseGradeRecord.
- *
- * @return object mixed (original type: java.io.Serializable)
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getCourseGrade () {
- $grade = $this->_getField('grade');
- return $grade;
- }
- /**
- * Get the display name for this CourseGradeRecord.
- *
- * @return string
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getDisplayName () {
- return $this->_getField('name');
- }
- /**
- * Get the unique Id for this CourseGradeRecord.
- *
- * @return object Id
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getId () {
- return $this->_id;
- }
- /**
- * Get the Agent (student) associated with this CourseGradeRecord.
- *
- * @return object Id
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getAgent () {
- $IdManager = Services::getService("Id");
- $id = $IdManager->getId($this->_getField('fk_student_id'));
- $AgentManager = Services::getService("Agent");
- return $AgentManager->getAgent($id);
- }
- /**
- * Get the CourseGradeType for the GradeRecord's Offering. GradingType is defined in
- * the grading OSID. These Types are meaningful to the implementation and
- * applications and are not specified by the OSID.
- *
- * @return object Type
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getType () {
- //@TODO could be sped up with an innerjoin
- $course =$this->getCourseOffering();
- return $course->getCourseGradeType();
- }
- /**
- * Calls getType(), which may be the proper name.
- *
- * @return object Type
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getCourseGradeType () {
- return $this->getType();
- }
- /**
- * Get the unique Id for the CourseOffering for this CourseGradeRecord..
- *
- * @return object Id
- *
- * @throws object CourseManagementException An exception
- * with one of the following messages defined in
- * org.osid.coursemanagement.CourseManagementException may be
- * thrown: {@link }
- * org.osid.coursemanagement.CourseManagementException#OPERATION_FAILED
- * OPERATION_FAILED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#PERMISSION_DENIED
- * PERMISSION_DENIED}, {@link }
- * org.osid.coursemanagement.CourseManagementException#CONFIGURATION_ERROR
- * CONFIGURATION_ERROR}, {@link }
- * org.osid.coursemanagement.CourseManagementException#UNIMPLEMENTED
- * UNIMPLEMENTED}
- *
- * @access public
- */
- function getCourseOffering () {
- $idstring = $this->_getField('fk_cm_offer');
- $idManager = Services::getService("Id");
- $cm = Services::getService("CourseManagement");
- $id =$idManager->getId($idstring);
- return $cm->getCourseOffering($id);
- }
- function _typeToIndex($typename, $type)
- {
- $cm=Services::getService("CourseManagement");
- return $cm->_typeToIndex($typename, $type);
- }
- function _getTypes($typename)
- {
- $cm=Services::getService("CourseManagement");
- return $cm->_getTypes($typename);
- }
- function _getField($key)
- {
- $cm=Services::getService("CourseManagement");
- return $cm->_getField($this->_id,$this->_table,$key);
- }
- function _getType($typename){
- $cm=Services::getService("CourseManagement");
- return $cm->_getType($this->_id,$this->_table,$typename);
- }
- function _setField($key, $value)
- {
- $cm=Services::getService("CourseManagement");
- return $cm->_setField($this->_id,$this->_table,$key, $value);
- }
- }
- ?>
Documentation generated on Wed, 19 Sep 2007 10:22:14 -0400 by phpDocumentor 1.3.0RC3