mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Fixing drift between CVS and git
This commit is contained in:
parent
f3bdfe4be8
commit
a54bf344c8
6 changed files with 10 additions and 33 deletions
|
@ -38,9 +38,7 @@
|
|||
$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))) {
|
||||
print_error('cannotupdatelink', 'lesson');
|
||||
}
|
||||
$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid));
|
||||
}
|
||||
|
||||
if ($pageid == 0) {
|
||||
|
@ -48,9 +46,7 @@
|
|||
}
|
||||
if ($page->nextpageid) {
|
||||
// the 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));
|
||||
}
|
||||
// ..and the single "answer"
|
||||
$newanswer = new stdClass;
|
||||
|
|
|
@ -39,14 +39,10 @@
|
|||
$newpage->contents = get_string("endofbranch", "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');
|
||||
}
|
||||
$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid));
|
||||
if ($page->nextpageid) {
|
||||
// the 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));
|
||||
}
|
||||
// ..and the single "answer"
|
||||
$newanswer = new stdClass;
|
||||
|
|
|
@ -30,14 +30,10 @@
|
|||
$newpage->contents = get_string("endofclustertitle", "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');
|
||||
}
|
||||
$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid));
|
||||
if ($page->nextpageid) {
|
||||
// the 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));
|
||||
}
|
||||
// ..and the single "answer"
|
||||
$newanswer = new stdClass;
|
||||
|
|
|
@ -109,13 +109,8 @@
|
|||
$newpage->contents = trim($form->contents);
|
||||
$newpage->title = $newpage->title;
|
||||
$newpageid = $DB->insert_record("lesson_pages", $newpage);
|
||||
if (!$newpageid) {
|
||||
print_error('cannotfindfirstpage', 'lesson');
|
||||
}
|
||||
// update the linked list
|
||||
if (!$DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $newpage->nextpageid))) {
|
||||
print_error('cannotupdatelink', 'lesson');
|
||||
}
|
||||
$DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $newpage->nextpageid));
|
||||
}
|
||||
}
|
||||
// now add the answers
|
||||
|
|
|
@ -47,9 +47,7 @@
|
|||
$page->contents = trim($form->contents);
|
||||
$page->title = $page->title;
|
||||
|
||||
if (!$DB->update_record("lesson_pages", $page)) {
|
||||
print_error('cannotupdatepage', 'lesson');
|
||||
}
|
||||
$DB->update_record("lesson_pages", $page);
|
||||
if ($page->qtype == LESSON_ENDOFBRANCH || $page->qtype == LESSON_ESSAY || $page->qtype == LESSON_CLUSTER || $page->qtype == LESSON_ENDOFCLUSTER) {
|
||||
// there's just a single answer with a jump
|
||||
$oldanswer = new stdClass;
|
||||
|
|
|
@ -181,9 +181,7 @@
|
|||
|
||||
//Fix the forwards link of the previous page
|
||||
if ($prevpageid) {
|
||||
if (!$DB->set_field("lesson_pages", "nextpageid", $newid, array("id"=>$prevpageid))) {
|
||||
print_error('cannotupdatepage', 'lesson');
|
||||
}
|
||||
$DB->set_field("lesson_pages", "nextpageid", $newid, array("id"=>$prevpageid));
|
||||
}
|
||||
$prevpageid = $newid;
|
||||
|
||||
|
@ -251,9 +249,7 @@
|
|||
// change the absolute page id
|
||||
$page = backup_getid($restore->backup_unique_code,"lesson_pages",$answer->jumpto);
|
||||
if ($page) {
|
||||
if (!$DB->set_field("lesson_answers", "jumpto", $page->new_id, array("id"=>$answer->id))) {
|
||||
print_error('cannotresetjump', 'lesson');
|
||||
}
|
||||
$DB->set_field("lesson_answers", "jumpto", $page->new_id, array("id"=>$answer->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue