--- loncom/interface/loncreatecourse.pm 2020/07/20 10:37:41 1.158.2.7.2.1
+++ loncom/interface/loncreatecourse.pm 2020/05/22 15:05:30 1.173
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Create a course
#
-# $Id: loncreatecourse.pm,v 1.158.2.7.2.1 2020/07/20 10:37:41 raeburn Exp $
+# $Id: loncreatecourse.pm,v 1.173 2020/05/22 15:05:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -80,6 +80,7 @@ use Apache::loncommon;
use Apache::londocs;
use Apache::lonlocal;
use Apache::lonuserutils;
+use Apache::lonclonecourse;
use LONCAPA::batchcreatecourse;
use LONCAPA qw(:DEFAULT :match);
@@ -94,6 +95,8 @@ sub print_course_creation_page {
my $crstype = 'Community';
if ($env{'form.phase'} eq 'courseone') {
$crstype = 'Course';
+ } elsif ($env{'form.phase'} eq 'placementone') {
+ $crstype = 'Placement';
}
my $defdom=$env{'request.role.domain'};
my %domdefaults = &Apache::lonnet::get_domain_defaults($defdom);
@@ -102,12 +105,13 @@ sub print_course_creation_page {
foreach my $server (sort(keys(%host_servers))) {
$course_home .= qq{};
}
$course_home .= "\n\n";
- my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain');
+ my ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$defdom);
+ my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain',undef,undef,undef,$trusted,$untrusted);
my $cloneform=&Apache::loncommon::select_dom_form
($env{'request.role.domain'},'clonedomain').
&Apache::loncommon::selectcourse_link
@@ -121,7 +125,7 @@ sub print_course_creation_page {
$endtime,'create_defaultdates');
my $openallfrom =
&Apache::lonhtmlcommon::date_setter('ccrs','openallfrom',$starttime);
- if ($crstype eq 'Course') {
+ if (($crstype eq 'Course') || ($crstype eq 'Placement')) {
$enroll_table = &Apache::lonuserutils::date_setting_table($starttime,
$endtime,'create_enrolldates');
($krbdef,$krbdefdom) =
@@ -188,10 +192,6 @@ function validate(formname) {
'ncd' => "Do not clone date parameters",
'prd' => 'Clone date parameters as-is',
'shd' => 'Shift date parameters by number of days',
- 'dpl' => 'URL shortcuts (for deep linking)',
- 'nsl' => 'Do not clone URL shortcuts',
- 'tsl' => 'Transfer URL shortcuts from existing course to new course',
- 'csl' => 'Create new URL shortcuts in new course',
'assp' => "Assessment Parameters",
'oaas' => "Open all assessments",
'sta' => "starting from:",
@@ -225,6 +225,7 @@ function validate(formname) {
'cgrq' => 'Set a quota for the total disk space available for storage of course group portfolio files',
'opco' => 'Open Course',
'opcm' => 'Open Community',
+ 'oppt' => 'Open Placement Test',
);
$lt{'kaut'} = &mt('Key authority ([_1]id:domain[_2]) if other than course','','');
$lt{'toin'} = &mt('to interface with institutional data, e.g., [_1]fs13glg231[_2] for [_3]Fall 2013 Geology 231[_4]','','','','');
@@ -256,13 +257,21 @@ function validate(formname) {
$lt{'cc'} = &mt('(will be assigned Coordinator role)');
$lt{'cgrs'} = &mt('Community Group Settings');
$lt{'cgrq'} = &mt('Set a quota for the total disk space available for storage of community group portfolio files');
- $lt{'tsl'} = &mt('Transfer URL shortcuts from existing community to new community');
- $lt{'csl'} = &mt('Create new URL shortcuts in new community');
+ } elsif ($crstype eq 'Placement') {
+ $lt{'cinf'} = &mt('Placement Test Information');
+ $lt{'ctit'} = &mt('Placement Test Title');
+ $lt{'chsr'} = &mt('Placement Test Home Server');
+ $lt{'cidn'} = &mt('Placement Test ID/Number');
+ $lt{'crco'} = &mt('Placement Test Content');
+ $lt{'cncr'} = &mt('Completely new placement test');
+ $lt{'cecr'} = &mt('Clone an existing placement test');
+ $lt{'sacr'} = &mt('Do NOT generate as standard placement test');
+ $lt{'stco'} = &mt('standard placement tests only');
+ $lt{'navi'} = &mt('Placement Test Contents');
+ $lt{'cid'} = &mt('Placement Test ID');
}
my $js = <
-//
$coursebrowserjs
END
@@ -290,6 +297,7 @@ END
my %titles = &Apache::lonlocal::texthash(
courseone => 'Create a New Course',
groupone => 'Create a New Community',
+ placementone=> 'Create a New Placement Test',
);
my $start_page =
&Apache::loncommon::start_page($titles{$env{'form.phase'}},$js);
@@ -301,7 +309,7 @@ END
'Create_Courses');
$r->print($start_page.$crumbs);
- $r->print('