MDL-27469 scorm: Add extra activity completion conditions

This commit is contained in:
Aaron Barnes
2012-03-21 09:48:38 +13:00
committed by Dan Marsden
parent a2b30aa852
commit 94db27498d
9 changed files with 497 additions and 221 deletions
+16
View File
@@ -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.