Code reinforcement
This commit is contained in:
parent
35a0577d7d
commit
eb7e459fcc
1 changed files with 8 additions and 2 deletions
|
@ -569,7 +569,9 @@ class studyitem {
|
|||
// Add course if available.
|
||||
if (courseinfo::exists($this->r->course_id)) {
|
||||
$cinfo = $this->getcourseinfo();
|
||||
$model['course'] = $cinfo->user_model($userid);
|
||||
if (is_object($cinfo)) {
|
||||
$model['course'] = $cinfo->user_model($userid);
|
||||
}
|
||||
}
|
||||
|
||||
// Add incoming and outgoing connection info.
|
||||
|
@ -608,7 +610,11 @@ class studyitem {
|
|||
if (strtolower($this->r->type) == 'course') {
|
||||
// Determine competency by competency completion.
|
||||
$courseinfo = $this->getcourseinfo();
|
||||
return $this->aggregator->aggregate_course($courseinfo, $this, $userid);
|
||||
if (is_object($courseinfo)) {
|
||||
return $this->aggregator->aggregate_course($courseinfo, $this, $userid);
|
||||
} else {
|
||||
return completion::INCOMPLETE;
|
||||
}
|
||||
} else if (strtolower($this->r->type) == 'start') {
|
||||
// Does not need to use aggregator.
|
||||
// Either true, or the completion of the reference.
|
||||
|
|
Reference in a new issue