From 78b9c960e9b6e6ef04a7ce663851afb20033d33b Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 12 Jul 2006 17:37:36 +0000 Subject: [PATCH] Fixed notice when restoring a numerical question with no units. --- question/restorelib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/question/restorelib.php b/question/restorelib.php index 3206a15b1a..33249ed197 100644 --- a/question/restorelib.php +++ b/question/restorelib.php @@ -421,7 +421,11 @@ $status = true; //Get the numerical array - $numerical_units = $info['#']['NUMERICAL_UNITS']['0']['#']['NUMERICAL_UNIT']; + if (!empty($info['#']['NUMERICAL_UNITS'])) { + $numerical_units = $info['#']['NUMERICAL_UNITS']['0']['#']['NUMERICAL_UNIT']; + } else { + $numerical_units = array(); + } //Iterate over numerical_units for($i = 0; $i < sizeof($numerical_units); $i++) { -- 2.39.5