[LON-CAPA-cvs] cvs: loncom /interface loncreatecourse.pm lonmodifycourse.pm
raeburn
raeburn at source.lon-capa.org
Wed Apr 6 13:41:52 EDT 2016
raeburn Wed Apr 6 17:41:52 2016 EDT
Modified files:
/loncom/interface loncreatecourse.pm lonmodifycourse.pm
Log:
- Bug 6808. New course container -- "Placement" for Placement Tests.
- Placement Tests can have an instituional course code, so that
auto-enrollment can be supported.
-------------- next part --------------
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.160 loncom/interface/loncreatecourse.pm:1.161
--- loncom/interface/loncreatecourse.pm:1.160 Mon Apr 4 01:13:38 2016
+++ loncom/interface/loncreatecourse.pm Wed Apr 6 17:41:52 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Create a course
#
-# $Id: loncreatecourse.pm,v 1.160 2016/04/04 01:13:38 raeburn Exp $
+# $Id: loncreatecourse.pm,v 1.161 2016/04/06 17:41:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -234,6 +234,7 @@
'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','<tt>','</tt>');
$lt{'toin'} = &mt('to interface with institutional data, e.g., [_1]fs13glg231[_2] for [_3]Fall 2013 Geology 231[_4]','<tt>','</tt>','<i>','</i>');
@@ -349,14 +350,16 @@
.'<input type="text" size="30" name="crsid" />'
.&Apache::lonhtmlcommon::row_closure()
);
- if ($crstype eq 'Course') {
+ if (($crstype eq 'Course') || ($crstype eq 'Placement')) {
$r->print(&Apache::lonhtmlcommon::row_headline()
.'<h3>'.$lt{'iinf'}.'</h3>'
- .$lt{'stat'}.' '
- .&mt('Default credits can also be specified, if different from the domain defaults (official courses: [_1]; unofficial courses: [_2]; textbook courses: [_3]).',
- $domdefaults{'officialcredits'},$domdefaults{'unofficialcredits'},$domdefaults{'textbookcredits'})
- .&Apache::lonhtmlcommon::row_closure()
-
+ .$lt{'stat'});
+ if ($crstype eq 'Course') {
+ $r->print(' '
+ .&mt('Default credits can also be specified, if different from the domain defaults (official courses: [_1]; unofficial courses: [_2]; textbook courses: [_3]).',
+ $domdefaults{'officialcredits'},$domdefaults{'unofficialcredits'},$domdefaults{'textbookcredits'}));
+ }
+ $r->print(&Apache::lonhtmlcommon::row_closure()
.&Apache::lonhtmlcommon::row_title($lt{'ccod'})
.'<input type="text" size="30" name="crscode" />'
.'<br />('.$lt{'toin'}.')'
@@ -372,7 +375,8 @@
.'<br />('.$lt{'cscs'}.')'
.&Apache::lonhtmlcommon::row_closure()
);
- if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'} || $domdefaults{'textbookcredits'}) {
+ if (($crstype eq 'Course') && ($domdefaults{'officialcredits'} ||
+ $domdefaults{'unofficialcredits'} || $domdefaults{'textbookcredits'})) {
$r->print(&Apache::lonhtmlcommon::row_title($lt{'ccre'})
.'<input type="text" size="3" name="defaultcredits" />'
.'<br />('.$lt{'cred'}.')'
@@ -530,7 +534,7 @@
.'<input type="text" name="reshome" size="30" value="/res/'.$defdom.'/" />'
.&Apache::lonhtmlcommon::row_closure()
);
- if ($crstype eq 'Course') {
+ unless ($crstype eq 'Community') {
$r->print(&Apache::lonhtmlcommon::row_headline()
.'<h3>'.$lt{'aens'}.'</h3>'
.&Apache::lonhtmlcommon::row_closure()
@@ -608,7 +612,7 @@
<p>
<input type="hidden" name="prevphase" value="placementone" />
<input type="hidden" name="phase" value="placementtwo" />
-<input type="submit" value="'.$lt{'opcm'}.'" />
+<input type="submit" value="'.$lt{'oppt'}.'" />
</p>'
);
}
Index: loncom/interface/lonmodifycourse.pm
diff -u loncom/interface/lonmodifycourse.pm:1.82 loncom/interface/lonmodifycourse.pm:1.83
--- loncom/interface/lonmodifycourse.pm:1.82 Mon Apr 4 01:12:11 2016
+++ loncom/interface/lonmodifycourse.pm Wed Apr 6 17:41:52 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# handler for DC-only modifiable course settings
#
-# $Id: lonmodifycourse.pm,v 1.82 2016/04/04 01:12:11 raeburn Exp $
+# $Id: lonmodifycourse.pm,v 1.83 2016/04/06 17:41:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -41,7 +41,7 @@
sub get_dc_settable {
my ($type,$cdom) = @_;
- if (($type eq 'Community') || ($type eq 'Placement')) {
+ if ($type eq 'Community') {
return ('courseowner','selfenrollmgrdc','selfenrollmgrcc');
} else {
my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc','selfenrollmgrcc');
@@ -268,9 +268,7 @@
$categorytitle = 'View/Modify Course Settings';
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.');
$setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a course via Content Editor.');
- if ($type eq 'Placement') {
- $setparams_text = 'View/Modify course owner and self-enrollment';
- } elsif (&showcredits($dom)) {
+ if (($type ne 'Placement') && (&showcredits($dom))) {
$setparams_text = 'View/Modify course owner, institutional code, default authentication, credits, and self-enrollment';
} else {
$setparams_text = 'View/Modify course owner, institutional code, default authentication, and self-enrollment';
@@ -375,10 +373,6 @@
if ($type eq 'Community') {
$menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>'."\n".
'<li>'.&mt('Override defaults for who configures self-enrollment for this specific community').'</li>'."\n";
- } elsif ($type eq 'Placement') {
- $menu_html .= '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n".
- '<li>'.&mt('Override defaults for who configures self-enrollment for this specific course.').'</li>'."\n";
-
} else {
$menu_html .= '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n".
'<li>'.&mt("Institutional code and default authentication (both required for auto-enrollment of students from institutional datafeeds).").'</li>'."\n";
@@ -853,31 +847,27 @@
$r->print(&Apache::lonhtmlcommon::row_title(
&Apache::loncommon::help_open_topic('Modify_Community_Owner').
' '.&mt('Community Owner'))."\n");
- } elsif ($crstype eq 'Placement') {
- $r->print(&Apache::lonhtmlcommon::row_title(
- &Apache::loncommon::help_open_topic('Modify_Course_Owner').
- ' '.&mt('Course Owner'))."\n");
} else {
$r->print(&Apache::lonhtmlcommon::row_title(
&Apache::loncommon::help_open_topic('Modify_Course_Instcode').
' '.&mt('Course Code'))."\n".
'<input type="text" size="15" name="coursecode" value="'.$enrollvar{'coursecode'}.'" />'.
&Apache::lonhtmlcommon::row_closure());
- if (&showcredits($cdom)) {
+ if (($crstype eq 'Course') && (&showcredits($cdom))) {
$r->print(&Apache::lonhtmlcommon::row_title(
&Apache::loncommon::help_open_topic('Modify_Course_Credithours').
' '.&mt('Credits (students)'))."\n".
'<input type="text" size="3" name="defaultcredits" value="'.$enrollvar{'defaultcredits'}.'" />'.
&Apache::lonhtmlcommon::row_closure());
- }
- $r->print(&Apache::lonhtmlcommon::row_title(
- &Apache::loncommon::help_open_topic('Modify_Course_Defaultauth').
- ' '.&mt('Default Authentication method'))."\n".
- $authenitems."\n".
- &Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title(
- &Apache::loncommon::help_open_topic('Modify_Course_Owner').
- ' '.&mt('Course Owner'))."\n");
+ }
+ $r->print(&Apache::lonhtmlcommon::row_title(
+ &Apache::loncommon::help_open_topic('Modify_Course_Defaultauth').
+ ' '.&mt('Default Authentication method'))."\n".
+ $authenitems."\n".
+ &Apache::lonhtmlcommon::row_closure().
+ &Apache::lonhtmlcommon::row_title(
+ &Apache::loncommon::help_open_topic('Modify_Course_Owner').
+ ' '.&mt('Course Owner'))."\n");
}
my ($cctitle,$rolename,$currmanages,$ccchecked,$dcchecked,$defaultchecked);
my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles();
@@ -931,7 +921,7 @@
'<br />'.&Apache::lonhtmlcommon::row_closure(1).
&Apache::lonhtmlcommon::end_pick_box().'</p><p>'.$hidden_elements.
'<input type="button" onclick="javascript:changePage(this.form,'."'processparms'".');');
- if (($crstype eq 'Community') || ($crstype eq 'Placement')) {
+ if ($crstype eq 'Community') {
$r->print('this.form.submit();"');
} else {
$r->print('javascript:verify_message(this.form);"');
@@ -1070,9 +1060,6 @@
if ($type eq 'Community') {
%changed = ( owner => 0 );
$ccrole = 'co';
- } elsif ($type eq 'Placement') {
- %changed = ( owner => 0 );
- $ccrole = 'cc';
} else {
%changed = ( code => 0,
owner => 0,
@@ -1125,7 +1112,7 @@
}
}
- if (&showcredits($cdom) && exists($env{'form.defaultcredits'})) {
+ if (($type ne 'Placement') && (&showcredits($cdom) && exists($env{'form.defaultcredits'}))) {
$newattr{'defaultcredits'} =~ s/[^\d\.]//g;
$newattr{'defaultcredits'}=$env{'form.defaultcredits'};
}
More information about the LON-CAPA-cvs
mailing list