MDL-27469 scorm: Add extra activity completion conditions
This commit is contained in:
committed by
Dan Marsden
parent
a2b30aa852
commit
94db27498d
@@ -1296,6 +1296,22 @@ class completion_info {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Aggregate activity completion state
|
||||
*
|
||||
* @param int $type Aggregation type (COMPLETION_* constant)
|
||||
* @param bool $old Old state
|
||||
* @param bool $new New state
|
||||
* @return bool
|
||||
*/
|
||||
public static function aggregate_completion_states($type, $old, $new) {
|
||||
if ($type == COMPLETION_AND) {
|
||||
return $old && $new;
|
||||
} else {
|
||||
return $old || $new;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is to be used only for system errors (things that shouldn't happen)
|
||||
* and not user-level errors.
|
||||
|
||||
Reference in New Issue
Block a user