]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19067 removed obsoleted string (never used in any STABLE branch)
authorskodak <skodak>
Tue, 5 May 2009 09:05:27 +0000 (09:05 +0000)
committerskodak <skodak>
Tue, 5 May 2009 09:05:27 +0000 (09:05 +0000)
12 files changed:
lang/en_utf8/lesson.php
lang/en_utf8/survey.php
mod/lesson/action/addcluster.php
mod/lesson/action/addendofbranch.php
mod/lesson/action/addendofcluster.php
mod/lesson/action/insertpage.php
mod/lesson/action/updatepage.php
mod/lesson/format.php
mod/lesson/highscores.php
mod/lesson/importppt.php
mod/lesson/view.php
mod/survey/save.php

index 55776f91798bb8b58a4745ba6c3b6ae7cd1c05c6..75dd20eb3f6f90dac19bfcce6e2292362936cf10 100644 (file)
@@ -51,16 +51,12 @@ $string['cannotfindanswer'] = 'Error: could not find answer';
 $string['cannotfindgrade'] = 'Error: could not find grades';
 $string['cannotfindrecords'] = 'Error: could not find lesson records';
 $string['cannotfinduser'] =  'Error: could not find users';
-$string['cannotdeleteanswer'] = 'Update page: unable to delete answer record';
-$string['cannotdeleteattempt'] = 'Error: could not delete old attempts';
-$string['cannotdeletebranch'] = 'Error: could not delete old seen branches';
 $string['cannotinsertanswer'] = 'Cannot insert answer record';
 $string['cannotinserthighscore'] = 'Insert of new high score Failed!';
 $string['cannotinsertpage'] = 'Cannot insert new page';
 $string['cannotinserttimer'] = 'Error: could not insert row into lesson_timer table';
 $string['cannotupdateanswer'] = 'Update page: answer not updated';
 $string['cannotupdatebook'] = 'Cannot update your book';
-$string['cannotupdategrade'] = 'Cannot update grade';
 $string['cannotupdatelink'] = 'Cannot update link';
 $string['cannotupdatepage'] = 'Update page: page not updated';
 $string['cannotupdatetimer'] = 'Error: could not update lesson_timer table';
index 3d68f1f11582b72c29a85b3c7682b5272067ba95..2910df937aef41db40041b15e3e99e7f218c2642 100644 (file)
@@ -61,7 +61,6 @@ $string['attlsname'] = 'ATTLS (20 item version)';
 $string['cannotfindsurveytmpt'] = 'No survey templates found!';
 $string['cannotfindquestion'] = 'Question doesn\'t exist';
 $string['cannotfindanswer'] = 'There are no answers for this survey yet.';
-$string['cannotinsertanswer'] = 'Encountered a problem trying to store your results. Sorry.';
 $string['ciq1'] = 'At what moment in class were you most engaged as a learner?';
 $string['ciq1short'] = 'Most engaged';
 $string['ciq2'] = 'At what moment in class were you most distanced as a learner?';
index c67d0aeb8bf8bfe5ca500fe035abeaeea8605fcc..1735e11d42be9d4ab7548a0741faf56bf13bc50d 100644 (file)
@@ -35,9 +35,7 @@
     $newpage->timecreated = $timenow;
     $newpage->title = get_string("clustertitle", "lesson");
     $newpage->contents = get_string("clustertitle", "lesson");
-    if (!$newpageid = $DB->insert_record("lesson_pages", $newpage)) {
-        print_error('cannotinsertpage', 'lesson');
-    }
+    $newpageid = $DB->insert_record("lesson_pages", $newpage);
     // update the linked list...
     if ($pageid != 0) {
         if (!$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid))) {
index e29d127624eb980df120b2021fa963fc2c461299..a052aa7fca47ca654f0a9ca98779490c1282dcc1 100644 (file)
@@ -37,9 +37,7 @@
         $newpage->timecreated = $timenow;
         $newpage->title = get_string("endofbranch", "lesson");
         $newpage->contents = get_string("endofbranch", "lesson");
-        if (!$newpageid = $DB->insert_record("lesson_pages", $newpage)) {
-            print_error('cannotinsertpage', 'lesson');
-        }
+        $newpageid = $DB->insert_record("lesson_pages", $newpage);
         // update the linked list...
         if (!$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid))) {
             print_error('cannotupdatelink', 'lesson');
index 2dcc30c48d6d2e393bbd289c9c9f045f364cff7c..15fff40ad6ac5674862387869230d00fdcc94eed 100644 (file)
@@ -28,9 +28,7 @@
     $newpage->timecreated = $timenow;
     $newpage->title = get_string("endofclustertitle", "lesson");
     $newpage->contents = get_string("endofclustertitle", "lesson");
-    if (!$newpageid = $DB->insert_record("lesson_pages", $newpage)) {
-        print_error('cannotinsertpage', 'lesson');
-    }
+    $newpageid = $DB->insert_record("lesson_pages", $newpage);
     // update the linked list...
     if (!$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid))) {
         print_error('cannotupdatelink', 'lesson');
index f8aa3ac7aed36f1bdd21c4595aab04c66cf8c291..4f9d37fbcb852feae52bfaf3409fd19f8dee9f82 100644 (file)
         $newpage->contents = trim($form->contents);
         $newpage->title = $newpage->title;
         $newpageid = $DB->insert_record("lesson_pages", $newpage);
-        if (!$newpageid) {
-            print_error('cannotinsertpage', 'lesson');
-        }
         // update the linked list (point the previous page to this new one)
-        if (!$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $newpage->prevpageid))) {
-            print_error('cannotupdatelink', 'lesson');
-        }
+        $DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $newpage->prevpageid));
         if ($page->nextpageid) {
             // new page is not the last page
-            if (!$DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->nextpageid))) {
-                print_error('cannotupdatelink', 'lesson');
-            }
+            $DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->nextpageid));
         }
     } else {
         // new page is the first page
@@ -90,9 +83,6 @@
             $newpage->contents = trim($form->contents);
             $newpage->title = $newpage->title;
             $newpageid = $DB->insert_record("lesson_pages", $newpage);
-            if (!$newpageid) {
-                print_error('cannotinsertpage', 'lesson');
-            }
         } else {
             // there are existing pages put this at the start
             $newpage->lessonid = $lesson->id;
index d42375cef02a19ce11a36426d405d30b91c7f398..85eab4e7f66fb2c6d872f553c473ca2ba493002c 100644 (file)
@@ -70,9 +70,7 @@
                 }
             }
         }        
-        if (!$DB->update_record("lesson_answers", $oldanswer)) {
-            print_error('cannotupdateanswer', 'lesson');
-        }
+        $DB->update_record("lesson_answers", $oldanswer);
     } else {
         // it's an "ordinary" page
         if ($page->qtype == LESSON_MATCHING) {
                     if (isset($form->score[$i])) {
                         $oldanswer->score = clean_param($form->score[$i], PARAM_INT);
                     }
-                    if (!$DB->update_record("lesson_answers", $oldanswer)) {
-                        print_error('cannotupdateanswer', 'lesson');
-                    }
+                    $DB->update_record("lesson_answers", $oldanswer);
                 } else {
                     // it's a new answer
                     $newanswer = new stdClass; // need to clear id if more than one new answer is ben added
                                             $form->responseeditor[$i] * LESSON_RESPONSE_EDITOR;
                         $oldanswer->timemodified = $timenow;
                         $oldanswer->answer = NULL;
-                        if (!$DB->update_record("lesson_answers", $oldanswer)) {
-                            print_error('cannotupdateanswer', 'lesson');
-                        }
+                        $DB->update_record("lesson_answers", $oldanswer);
                     }                        
                 } elseif (!empty($form->answerid[$i])) {
                     // need to delete blanked out answer
index faa1a3c5126281a82f14ab2b37caa2640a842d3b..34f73fe7b25508127298cf4a86c77b666fc389eb 100644 (file)
@@ -93,13 +93,9 @@ class qformat_default {
                         $newpage->prevpageid = $pageid;
                         $newpage->nextpageid = $page->nextpageid;
                         // insert the page and reset $pageid
-                        if (!$newpageid = $DB->insert_record("lesson_pages", $newpage)) {
-                            print_error('cannotinsertpage', 'lesson');
-                        }
+                        $newpageid = $DB->insert_record("lesson_pages", $newpage);
                         // update the linked list
-                        if (!$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid))) {
-                            print_error('cannotupdateanswer', 'lesson');
-                        }
+                        $DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid));
 
                     } else {
                         // new page is the first page
@@ -110,21 +106,13 @@ class qformat_default {
                             $newpage->prevpageid = 0; // this is a first page
                             $newpage->nextpageid = 0; // this is the only page
                             $newpageid = $DB->insert_record("lesson_pages", $newpage);
-                            if (!$newpageid) {
-                                print_error('cannotinsertpage', 'lesson');
-                            }
                         } else {
                             // there are existing pages put this at the start
                             $newpage->prevpageid = 0; // this is a first page
                             $newpage->nextpageid = $page->id;
                             $newpageid = $DB->insert_record("lesson_pages", $newpage);
-                            if (!$newpageid) {
-                                print_error('cannotinsertpage', 'lesson');
-                            }
                             // update the linked list
-                            if (!$DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->id))) {
-                                print_error('cannotupdatelink', 'lesson');
-                            }
+                            $DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->id));
                         }
                     }
                     // reset $pageid and put the page ID in $question, used in save_question_option()
index d2ba6a4780b0e1d83a5e56374298a34daf20a178..c955773b0579495bac39773ed97b4c778dce5fe5 100644 (file)
                 $newhighscore->gradeid = $newgrade->id;
                 $newhighscore->nickname = $name;
 
-                if (!$DB->insert_record('lesson_high_scores', $newhighscore)) {
-                    print_error('cannotinserthighscore', 'lesson');
-                }
+                $DB->insert_record('lesson_high_scores', $newhighscore);
                 
                 // Log it
                 add_to_log($course->id, 'lesson', 'update highscores', "highscores.php?id=$cm->id", $name, $cm->id);
index 44662e309412a21dbfb65881eada42ffae923aaf..ff69e1515aea9fd5c8b8468308c9fd46b82110fb 100644 (file)
@@ -543,15 +543,11 @@ function lesson_save_objects($branchtables, $lessonid, $after) {
         $branchtable->page->prevpageid = $prevpageid;
         
         // insert the page
-        if(!$id = $DB->insert_record('lesson_pages', $branchtable->page)) {
-            print_error('cannotinsertpage', 'lesson');
-        }
+        $id = $DB->insert_record('lesson_pages', $branchtable->page);
     
         // update the link of the page previous to the one we just updated
         if ($prevpageid != 0) {  // if not the first page
-            if (!$DB->set_field("lesson_pages", "nextpageid", $id, array("id" => $prevpageid))) {
-                print_error('cannotupdatepage', 'lesson');
-            }
+            $DB->set_field("lesson_pages", "nextpageid", $id, array("id" => $prevpageid));
         }
 
         // insert the answers
@@ -565,9 +561,7 @@ function lesson_save_objects($branchtables, $lessonid, $after) {
     
     // all done with inserts.  Now check to update our last page (this is when we import between two lesson pages)
     if ($nextpageid != 0) {  // if the next page is not the end of lesson
-        if (!$DB->set_field("lesson_pages", "prevpageid", $id, array("id" => $nextpageid))) {
-            print_error('cannotupdatepage', 'lesson');
-        }
+        $DB->set_field("lesson_pages", "prevpageid", $id, array("id" => $nextpageid));
     }
     
     return true;
@@ -581,9 +575,7 @@ function book_save_objects($chapters, $bookid, $pageid='0') {
     
     // nothing fancy, just save them all in order
     foreach ($chapters as $chapter) {
-        if (!$chapter->id = $DB->insert_record('book_chapters', $chapter)) {
-            print_error('cannotupdatebook', 'lesson');
-        }
+        $chapter->id = $DB->insert_record('book_chapters', $chapter);
     }
     return true;
 }
index 590a82b8c9103fce4c08a1bb19b3f3628465e96f..848de15e2b1889560ff7515edd5f3be12f394bc9 100644 (file)
             $startlesson->starttime = time();
             $startlesson->lessontime = time();
             
-            if (!$DB->insert_record('lesson_timer', $startlesson)) {
-                print_error('cannotinserttimer', 'lesson');
-            }
+            $DB->insert_record('lesson_timer', $startlesson);
             if ($lesson->timed) {
                 lesson_set_message(get_string('maxtimewarning', 'lesson', $lesson->maxtime), 'center');
             }
index a405d4969fdd473c923f62cacb7905e5a620ed95..bcc9e6202e32579765bfd03618e35dd15a82399e 100644 (file)
@@ -84,9 +84,7 @@
             $newdata->answer2 = "";
         }
 
-        if (! $DB->insert_record("survey_answers", $newdata)) {
-            print_error('cannotinsertanswer', 'survey');
-        }
+        $DB->insert_record("survey_answers", $newdata);
     }
 
 // Print the page and finish up.