public function get_course_context() {
        if (!$this->context && !$this->course) {
            throw new coding_exception('Improper use of the assignment class. ' .
                                       'Cannot load the course context.');
        }
        if ($this->context) {
            return $this->context->get_course_context();
        } else {
            return context_course::instance($this->course->id);
        }
    }
public function get_course_context() {
        if (!$this->context && !$this->course) {
            throw new coding_exception('Improper use of the assignment class. ' .
                                       'Cannot load the course context.');
        }
        if ($this->context) {
            return $this->context->get_course_context();
        } else {
            return context_course::instance($this->course->id);
        }
    }
public function get_course_context ( ) { if ( ! $ this -> context && ! $ this -> course ) { throw new coding_exception ( 'Improper use of the assignment class. ' . 'Cannot load the course context.' ) ; } if ( $ this -> context ) { return $ this -> context -> get_course_context ( ) ; } else { return context_course :: instance ( $ this -> course -> id ) ; } }
Get the context of the current course.

@return mixed context|null The course context
Get the context of the current course .