From 59728e8d4a615994f50f338615a0c9d4b45c9702 Mon Sep 17 00:00:00 2001
From: stronk7 <stronk7>
Date: Thu, 12 Jun 2003 17:41:52 +0000
Subject: [PATCH] Modified to flush data to browser...

---
 backup/mod/assignment/restorelib.php | 18 ++++++++++++++++++
 backup/mod/choice/restorelib.php     | 18 ++++++++++++++++++
 backup/mod/resource/restorelib.php   | 11 ++++++++++-
 backup/mod/survey/restorelib.php     | 28 ++++++++++++++++++++++++++++
 4 files changed, 74 insertions(+), 1 deletion(-)

diff --git a/backup/mod/assignment/restorelib.php b/backup/mod/assignment/restorelib.php
index 2c21ebcd52..14d82d5d49 100644
--- a/backup/mod/assignment/restorelib.php
+++ b/backup/mod/assignment/restorelib.php
@@ -55,6 +55,11 @@
 
             //The structure is equal to the db, so insert the assignment
             $newid = insert_record ("assignment",$assignment);
+
+            //Do some output     
+            echo "<ul><li>Assignment ".$assignment->name."<br>";
+            backup_flush(300);
+
             if ($newid) {
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,$mod->modtype,
@@ -67,6 +72,9 @@
             } else {
                 $status = false;
             }
+
+            //Finalize ul        
+            echo "</ul>";
         
         } else {
             $status = false;
@@ -122,6 +130,16 @@
 
             //The structure is equal to the db, so insert the assignment_submission
             $newid = insert_record ("assignment_submissions",$submission);
+
+            //Do some output
+            if ($newid % 50 == 0) {
+                echo ".";
+                if ($newid % 1000 == 0) {
+                    echo "<br>";
+                }
+                backup_flush(300);
+            }
+
             if ($newid) {
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,"assignment_submission",$oldid,
diff --git a/backup/mod/choice/restorelib.php b/backup/mod/choice/restorelib.php
index 736bfb5700..b49492c1f4 100644
--- a/backup/mod/choice/restorelib.php
+++ b/backup/mod/choice/restorelib.php
@@ -57,6 +57,11 @@
 
             //The structure is equal to the db, so insert the choice
             $newid = insert_record ("choice",$choice);
+
+            //Do some output     
+            echo "<ul><li>Choice ".$choice->name."<br>";
+            backup_flush(300);
+
             if ($newid) {
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,$mod->modtype,
@@ -70,6 +75,9 @@
                 $status = false;
             }
 
+            //Finalize ul        
+            echo "</ul>";
+
         } else {
             $status = false;
         }
@@ -112,6 +120,16 @@
 
             //The structure is equal to the db, so insert the choice_answers
             $newid = insert_record ("choice_answers",$answer);
+
+            //Do some output
+            if ($newid % 50 == 0) {
+                echo ".";
+                if ($newid % 1000 == 0) {
+                    echo "<br>";
+                }
+                backup_flush(300);
+            }
+
             if ($newid) {
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,"choice_answers",$oldid,
diff --git a/backup/mod/resource/restorelib.php b/backup/mod/resource/restorelib.php
index fc1300e37c..37779e356b 100644
--- a/backup/mod/resource/restorelib.php
+++ b/backup/mod/resource/restorelib.php
@@ -35,7 +35,7 @@
             //traverse_xmlize($info);                                                                     //Debug
             //print_object ($GLOBALS['traverse_array']);                                                  //Debug
             //$GLOBALS['traverse_array']="";                                                              //Debug
-           
+          
             //Now, build the RESOURCE record structure
             $resource->course = $restore->course_id;
             $resource->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
@@ -47,6 +47,11 @@
  
             //The structure is equal to the db, so insert the resource
             $newid = insert_record ("resource",$resource);
+
+            //Do some output     
+            echo "<ul><li>Resource ".$resource->name."<br>";
+            backup_flush(300);
+
             if ($newid) {
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,$mod->modtype,
@@ -55,6 +60,10 @@
             } else {
                 $status = false;
             }
+
+            //Finalize ul        
+            echo "</ul>";
+
         } else {
             $status = false;
         }
diff --git a/backup/mod/survey/restorelib.php b/backup/mod/survey/restorelib.php
index 2f94cabbc9..8f5a547fee 100644
--- a/backup/mod/survey/restorelib.php
+++ b/backup/mod/survey/restorelib.php
@@ -54,6 +54,11 @@
 
             //The structure is equal to the db, so insert the survey
             $newid = insert_record ("survey",$survey);
+
+            //Do some output
+            echo "<ul><li>Survey ".$survey->name."<br>";
+            backup_flush(300);
+
             if ($newid) {
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,$mod->modtype,
@@ -71,6 +76,9 @@
                 $status = false;
             }
 
+            //Finalize ul
+            echo "</ul>";
+
         } else {
             $status = false;
         }
@@ -115,6 +123,16 @@
 
             //The structure is equal to the db, so insert the survey_answers
             $newid = insert_record ("survey_answers",$answer);
+
+            //Do some output
+            if ($newid % 50 == 0) {
+                echo ".";
+                if ($newid % 1000 == 0) {
+                    echo "<br>";
+                }
+                backup_flush(300);
+            }
+
             if ($newid) {
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,"survey_answers",$oldid,
@@ -161,6 +179,16 @@
 
             //The structure is equal to the db, so insert the survey_analysis
             $newid = insert_record ("survey_analysis",$analys);
+
+            //Do some output
+            if ($newid % 50 == 0) {
+                echo ".";       
+                if ($newid % 1000 == 0) {
+                    echo "<br>";
+                }
+                backup_flush(300);
+            }
+
             if ($newid) {
                 //We have the newid, update backup_ids
                 backup_putid($restore->backup_unique_code,"survey_analysis",$oldid,
-- 
2.39.5