--- loncom/auth/lonroles.pm 2010/12/05 16:15:02 1.240.2.19 +++ loncom/auth/lonroles.pm 2010/12/05 17:22:18 1.240.2.22 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.240.2.19 2010/12/05 16:15:02 raeburn Exp $ +# $Id: lonroles.pm,v 1.240.2.22 2010/12/05 17:22:18 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -500,7 +500,7 @@ ENDENTERKEY $courseid = substr($courseid, 1); } $courseid =~ s/\//_/; - if (($cdom ne 'gcitest') && (($role eq 'cc') || ($role eq 'co')) + if (($cdom !~ /^\w+citest$/) && (($role eq 'cc') || ($role eq 'co')) && ($env{'course.' . $courseid .'.course.helper.not.run'})) { $furl = "/adm/helper/course.initialization.helper"; # Send the user to the course they selected @@ -524,7 +524,7 @@ ENDENTERKEY .$env{'request.course.sec'}) ) { my $startpage = &courseloadpage($courseid); - unless (($startpage eq 'firstres') || ($cdom eq 'gcitest')) { + unless (($startpage eq 'firstres') || ($cdom =~ /^\w+citest$/)) { $msg = &mt('Entering [_1] ...', $env{'course.'.$courseid.'.description'}); &redirect_user($r,&mt('New in course'), @@ -539,7 +539,7 @@ ENDENTERKEY # Guess not ... $furl=&Apache::lonpageflip::first_accessible_resource(); } - if (($cdom eq 'gcitest') && ($custommenu)) { + if (($cdom =~ /^\w+citest$/) && ($custommenu)) { $furl = '/adm/navmaps'; } $msg = &mt('Entering [_1] ...', @@ -743,8 +743,8 @@ ENDHEADER } } if ($custommenu) { - if ($env{'form.destinationurl'} eq '/adm/gci_info') { - $r->print(&gci_info_page()). + if ($env{'form.destinationurl'} eq '/adm/ci_info') { + $r->print(&ci_info_page()). &Apache::loncommon::end_page(); return OK; } @@ -755,17 +755,12 @@ ENDHEADER my $switcher; if ($numcourses > 0) { $switcher = &Apache::loncommon::gcitest_switcher('cc',%courses); - my $current; - if ($env{'request.course.id'}) { - $current = 'cc./'.$env{'course.'.$env{'request.course.id'}.'.domain'}. - '/'.$env{'course.'.$env{'request.course.id'}.'.num'}; - } } $r->print(&Apache::lonmenu::inlinemenu('gcicustom',$switcher). &Apache::loncommon::end_page()); return OK; } else { - if ($env{'form.destinationurl'} eq '/adm/gci_info') { + if ($env{'form.destinationurl'} eq '/adm/ci_info') { delete($env{'form.destinationurl'}); } } @@ -780,7 +775,7 @@ ENDHEADER $r->print(&Apache::loncoursequeueadmin::queued_selfenrollment()); my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description'); my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); - unless ($env{'user.domain'} eq 'gcitest') { + unless ($env{'user.domain'} =~ /^\w+citest$/) { $r->print( '

' .&mt('[_1]Visit the [_2]Course/Community Catalog[_3]' @@ -804,23 +799,23 @@ ENDHEADER $r->print('

'.&mt('Currently no additional roles, courses or communities').'

'); } else { if ($show_course) { - if ($env{'user.domain'} eq 'gcitest') { + if ($env{'user.domain'} =~ /^\w+citest$/) { $r->print('

'.&mt('Currently no active Concept Tests').'

'); - } elsif ($env{'user.domain'} eq 'gci') { + } elsif ($env{'user.domain'} =~ /ci$/) { $r->print('

'.&mt('Currently not assigned as a GCI contributor').'

'); } } else { $r->print('

'.&mt('Currently no active roles, courses or communities').'

'); } } - unless ($env{'user.domain'} eq 'gcitest') { + unless ($env{'user.domain'} =~ /^\w+citest$/) { &findcourse_advice($r); &requestcourse_advice($r); } $r->print(''); if ($countfuture) { if ($show_course) { - if ($env{'user.domain'} eq 'gcitest') { + if ($env{'user.domain'} =~ /^\w+citest$/) { $r->print(&mt('The following [quant,_1,Concept Test] will be available in the future:',$countfuture)); } else { $r->print(&mt('The following [quant,_1,course] will become active in the future:',$countfuture)); @@ -977,24 +972,44 @@ ENDHEADER return OK; } -sub gci_info_page { - return <<"END"; +sub ci_info_page { + my %longname = ( + GCI => 'Geoscience Concept Inventory', + SLCI => 'Science Literacy Concept Inventory', + ); + my $inventory = uc($env{'user.domain'}); + my %features = ( + review => 'Review and comment on existing $inventory questions', + submit => "Submit $inventory questions of your own", + managetest => 'Create an online test for your students', + tutorial => 'View tutorials on creating online tests', + ); + my $tabs = &Apache::loncommon::ci_tabs($env{'user.domain'}); + my %info = ( + GCI => '

For more information about writing and reviewing Concept Inventory questions please refer to the GCI Workbook.

', + ); + my $output = <<"END";
-

Welcome to the Geoscience Concept Inventory WebCenter

+

Welcome to the $longname{$inventory} WebCenter

Use the tabs to navigate the WebCenter and...

-

For more information about writing and reviewing Concept Inventory questions -please refer to the GCI Workbook. +$info{$inventory}

END + } sub gather_roles {