| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v 1.53 2006/07/24 23:28:41 gage Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v 1.54 2006/07/28 02:10:33 sh002i Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 34 | use WeBWorK::Debug; |
34 | use WeBWorK::Debug; |
| 35 | use WeBWorK::Utils qw(cryptPassword writeLog listFilesRecursive); |
35 | use WeBWorK::Utils qw(cryptPassword writeLog listFilesRecursive); |
| 36 | use WeBWorK::Utils::CourseManagement qw(addCourse renameCourse deleteCourse listCourses archiveCourse |
36 | use WeBWorK::Utils::CourseManagement qw(addCourse renameCourse deleteCourse listCourses archiveCourse |
| 37 | listArchivedCourses unarchiveCourse); |
37 | listArchivedCourses unarchiveCourse); |
| 38 | use WeBWorK::Utils::DBImportExport qw(dbExport dbImport); |
38 | use WeBWorK::Utils::DBImportExport qw(dbExport dbImport); |
|
|
39 | |
|
|
40 | use constant IMPORT_EXPORT_WARNING => "The ability to import and export |
|
|
41 | databases is still under development. It seems to work but it is <b>VERY</b> |
|
|
42 | slow on large courses. You may prefer to use webwork2/bin/wwdb or the mysql |
|
|
43 | dump facility for archiving large courses. Please send bug reports if you find |
|
|
44 | errors."; |
| 39 | |
45 | |
| 40 | sub pre_header_initialize { |
46 | sub pre_header_initialize { |
| 41 | my ($self) = @_; |
47 | my ($self) = @_; |
| 42 | my $r = $self->r; |
48 | my $r = $self->r; |
| 43 | my $ce = $r->ce; |
49 | my $ce = $r->ce; |
| … | |
… | |
| 296 | CGI::a({href=>$self->systemLink($urlpath, params=>{subDisplay=>"unarchive_course"})}, "Unarchive Course"), |
302 | CGI::a({href=>$self->systemLink($urlpath, params=>{subDisplay=>"unarchive_course"})}, "Unarchive Course"), |
| 297 | CGI::hr(), |
303 | CGI::hr(), |
| 298 | $methodMessage, |
304 | $methodMessage, |
| 299 | |
305 | |
| 300 | ); |
306 | ); |
| 301 | |
|
|
| 302 | print CGI::p("The ability to import and to export databases is still under development. |
|
|
| 303 | It seems to work but it is <b>VERY</b> slow on large courses. You may prefer to |
|
|
| 304 | use webwork2/bin/wwdb or the mysql dump facility for archiving large courses. |
|
|
| 305 | Please send bug reports if you find errors. "); |
|
|
| 306 | |
307 | |
| 307 | my @errors = @{$self->{errors}}; |
308 | my @errors = @{$self->{errors}}; |
| 308 | |
309 | |
| 309 | |
310 | |
| 310 | if (@errors) { |
311 | if (@errors) { |
| … | |
… | |
| 1391 | $courseLabels{$courseID} = "$courseID (" . $tempCE->{dbLayoutName} . ")"; |
1392 | $courseLabels{$courseID} = "$courseID (" . $tempCE->{dbLayoutName} . ")"; |
| 1392 | } |
1393 | } |
| 1393 | |
1394 | |
| 1394 | print CGI::h2("Export Database"); |
1395 | print CGI::h2("Export Database"); |
| 1395 | |
1396 | |
|
|
1397 | print CGI::p(IMPORT_EXPORT_WARNING); |
|
|
1398 | |
| 1396 | print CGI::start_form(-method=>"GET", -action=>$r->uri); |
1399 | print CGI::start_form(-method=>"GET", -action=>$r->uri); |
| 1397 | print $self->hidden_authen_fields; |
1400 | print $self->hidden_authen_fields; |
| 1398 | print $self->hidden_fields("subDisplay"); |
1401 | print $self->hidden_fields("subDisplay"); |
| 1399 | |
1402 | |
| 1400 | print CGI::p({},"Select a course to export the course's database. Please note |
1403 | print CGI::p({},"Select a course to export the course's database. Please note |
| … | |
… | |
| 1592 | my %databaseLabels = map { ($_ => $_) } @databaseFiles; |
1595 | my %databaseLabels = map { ($_ => $_) } @databaseFiles; |
| 1593 | |
1596 | |
| 1594 | ####### |
1597 | ####### |
| 1595 | |
1598 | |
| 1596 | print CGI::h2("Import Database"); |
1599 | print CGI::h2("Import Database"); |
|
|
1600 | |
|
|
1601 | print CGI::p(IMPORT_EXPORT_WARNING); |
| 1597 | |
1602 | |
| 1598 | print CGI::start_form(-method=>"POST", -action=>$r->uri, -enctype=>&CGI::MULTIPART); |
1603 | print CGI::start_form(-method=>"POST", -action=>$r->uri, -enctype=>&CGI::MULTIPART); |
| 1599 | print $self->hidden_authen_fields; |
1604 | print $self->hidden_authen_fields; |
| 1600 | print $self->hidden_fields("subDisplay"); |
1605 | print $self->hidden_fields("subDisplay"); |
| 1601 | |
1606 | |