$content_test_rs = $contentManager->getContentTestsAssoc($content['content_id']);
$test_ids = array(); //reset test ids
//$my_files = array(); //reset myfiles.
- while ($content_test_row = mysql_fetch_assoc($content_test_rs)){
- //export
- $test_ids[] = $content_test_row['test_id'];
- //the 'added_files' is for adding into the manifest file in this zip
- $added_files = test_qti_export($content_test_row['test_id'], '', $zipfile);
-
- //Save all the xml files in this array, and then print_organizations will add it to the manifest file.
- foreach($added_files as $filename=>$file_array){
- $my_files[] = $filename;
- foreach ($file_array as $garbage=>$filename2){
- if (!in_array($filename2, $my_files)){
- $my_files[] = $filename2;
+ if (is_array($content_test_rs)) {
+ foreach ($content_test_rs as $content_test_row){
+ //export
+ $test_ids[] = $content_test_row['test_id'];
+ //the 'added_files' is for adding into the manifest file in this zip
+ $added_files = test_qti_export($content_test_row['test_id'], '', $zipfile);
+
+ //Save all the xml files in this array, and then print_organizations will add it to the manifest file.
+ foreach($added_files as $filename=>$file_array){
+ $my_files[] = $filename;
+ foreach ($file_array as $garbage=>$filename2){
+ if (!in_array($filename2, $my_files)){
+ $my_files[] = $filename2;
+ }
}
}
+
+ //Save all the xml files in this array, and then print_organizations will add it to the manifest file.
+ $resources .= str_replace( array('{TEST_ID}', '{PATH}', '{FILES}'),
+ array($content_test_row['test_id'], 'tests_'.$content_test_row['test_id'].'.xml', $added_files_xml),
+ $ims_template_xml['resource_test']);
}
-
- //Save all the xml files in this array, and then print_organizations will add it to the manifest file.
- $resources .= str_replace( array('{TEST_ID}', '{PATH}', '{FILES}'),
- array($content_test_row['test_id'], 'tests_'.$content_test_row['test_id'].'.xml', $added_files_xml),
- $ims_template_xml['resource_test']);
}
/* generate the a4a files */