\n".
+ &mt('Construction Space access is only available from '.
+ 'the home server of the corresponding Author.').' '.
+ &mt("Click the 'Switch Server' link to go there.").' ');
+ }
}
# ----------------------------------------------------------------------- Table
- if ($numdc > 0) {
- $r->print(&coursepick_jscript());
- $r->print(&Apache::loncommon::coursebrowser_javascript().
- &Apache::loncommon::authorbrowser_javascript());
- }
-
- unless ((!&Apache::loncommon::show_course()) || ($nochoose) || ($countactive==1)) {
+ unless ((!$show_course) || ($nochoose) || ($countactive==1)) {
$r->print("
".&mt('Select a Course to Enter')."
\n");
}
if ($env{'form.destinationurl'}) {
@@ -780,31 +888,23 @@ ENDHEADER
my %recent_roles =
&Apache::lonhtmlcommon::get_recent('roles',$env{'environment.recentrolesn'});
my $output='';
- foreach my $role (sort(keys(%recent_roles))) {
- if (ref($roletext{'user.role.'.$role}) eq 'ARRAY') {
+ foreach (sort(keys(%recent_roles))) {
+ if (ref($roletext{'user.role.'.$_}) eq 'ARRAY') {
$output.= &Apache::loncommon::start_data_table_row().
- $roletext{'user.role.'.$role}->[0].
+ $roletext{'user.role.'.$_}->[0].
+ &Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::continue_data_table_row().
+ $roletext{'user.role.'.$_}->[1].
&Apache::loncommon::end_data_table_row();
- if ($roletext{'user.role.'.$role}->[1] ne '') {
- $output .= &Apache::loncommon::continue_data_table_row().
- $roletext{'user.role.'.$role}->[1].
- &Apache::loncommon::end_data_table_row();
- }
- if ($role =~ m{dc\./($match_domain)/}
+ if ($_ =~ m-dc\./($match_domain)/-
&& $dcroles{$1}) {
$output .= &adhoc_roles_row($1,'recent');
}
} elsif ($numdc > 0) {
- unless ($role =~/^error\:/) {
- my ($roletext,$role_text_end) = &display_cc_role('user.role.'.$role);
- $output.= &Apache::loncommon::start_data_table_row().
- $roletext.
- &Apache::loncommon::end_data_table_row().
- &Apache::loncommon::continue_data_table_row().
- $role_text_end.
- &Apache::loncommon::end_data_table_row();
+ unless ($_ =~/^error\:/) {
+ $output.=&display_cc_role('user.role.'.$_);
}
- }
+ }
}
if ($output) {
$r->print(&Apache::loncommon::start_data_table_empty_row()
@@ -817,6 +917,12 @@ ENDHEADER
$doheaders ++;
}
}
+
+ if ($numdc > 0) {
+ $r->print(&coursepick_jscript());
+ $r->print(&Apache::loncommon::coursebrowser_javascript().
+ &Apache::loncommon::authorbrowser_javascript());
+ }
&print_rolerows($r,$doheaders,\%roleclass,\%sortrole,\%dcroles,\%roletext);
if ($countactive > 1) {
my $tremark='';
@@ -867,6 +973,46 @@ ENDHEADER
return OK;
}
+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 $longname{$inventory} WebCenter
+
+Use the tabs to navigate the WebCenter and...
+
+END
+ if (ref($tabs) eq 'ARRAY') {
+ foreach my $tab (@{$tabs}) {
+ if ($features{$tab}) {
+ $output .= '
'.$features{$tab}.'
'."\n";
+ }
+ }
+ }
+ $output .= <<"END";
+
+
+$info{$inventory}
+
+END
+
+}
+
sub gather_roles {
my ($then,$refresh,$now,$reinit,$nochoose,$roletext,$sortrole,$roleclass,$futureroles,$timezones) = @_;
my ($countactive,$countfuture,$inrole,$possiblerole) = (0,0,0,'');
@@ -939,7 +1085,7 @@ sub gather_roles {
foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }
if (!$allowed) {
$button=0;
- $switchserver='otherserver='.$home.'&role='.$trolecode;
+ $switchserver='otherserver='.$home.'&role='.$trolecode;
}
#next if ($home eq 'no_host');
$home = &Apache::lonnet::hostname($home);
@@ -959,7 +1105,7 @@ sub gather_roles {
foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }
if (!$allowed) {
$button=0;
- $switchserver='otherserver='.$home.'&role='.$trolecode;
+ $switchserver='otherserver='.$home.'&role='.$trolecode;
}
#next if ($home eq 'no_host');
$home = &Apache::lonnet::hostname($home);
@@ -976,7 +1122,6 @@ sub gather_roles {
if ($env{'course.'.$tcourseid.'.description'}) {
$twhere=$env{'course.'.$tcourseid.'.description'};
$sortkey=$role."\0".$tdom."\0".$twhere."\0".$envkey;
- $twhere = &HTML::Entities::encode($twhere,'"<>&');
unless ($twhere eq &mt('Currently not available')) {
$twhere.=' '.
&Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom).
@@ -987,7 +1132,7 @@ sub gather_roles {
if (%newhash) {
$sortkey=$role."\0".$tdom."\0".$newhash{'description'}.
"\0".$envkey;
- $twhere=&HTML::Entities::encode($newhash{'description'},'"<>&').
+ $twhere=$newhash{'description'}.
' '.
&Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom).
'';
@@ -1170,10 +1315,15 @@ sub findcourse_advice {
} else {
$r->print(&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').' ');
}
- $r->print('
'.&mt('Self-Enrollment').'
'.
- '
'.&mt('The [_1]Course/Community Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created, as well as any communities in the domain.','','',$domdesc).' ');
- $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'
'.
- &Apache::loncoursequeueadmin::queued_selfenrollment());
+ my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment();
+ if ($queued) {
+ $r->print($queued);
+ } else {
+ $r->print(&mt('You have no request for contributor access pending approval by the GCI WebCenter team.').'
'.
+ '
'.&mt('This may mean that action was taken on your request in the time since your most recent log-in.[_1]View [_2]Message[_3] to see if this is the case.',' ','','').'
'.
+ '
'.&mt('If you logout and log-in again you may find you now have access to the Geoscience Concept Inventory, as a contributor.').'
'.
+ '
');
+ }
return;
}
@@ -1185,12 +1335,12 @@ sub requestcourse_advice {
&Apache::lonnet::check_can_request($env{'user.domain'},\%can_request,\%request_doms);
if (keys(%request_doms) > 0) {
my ($types,$typename) = &Apache::loncommon::course_types();
- if ((ref($types) eq 'ARRAY') && (ref($typename) eq 'HASH')) {
+ if ((ref($types) eq 'ARRAY') && (ref($typename) eq 'HASH')) {
$r->print('
'.&mt('Request creation of a course or community').'
'.
'
'.&mt('You have rights to request the creation of courses and/or communities in the following domain(s):').'
');
my (@reqdoms,@reqtypes);
foreach my $type (sort(keys(%request_doms))) {
- push(@reqtypes,$type);
+ push(@reqtypes,$type);
if (ref($request_doms{$type}) eq 'ARRAY') {
my $domstr = join(', ',map { &Apache::lonnet::domain($_) } sort(@{$request_doms{$type}}));
$r->print(
@@ -1223,7 +1373,7 @@ sub requestcourse_advice {
}
if (@reqdoms == 1 || @showtypes > 0) {
$requrl .= '&state=crstype&action=new';
- }
+ }
$r->print('
'.&mt('Use the [_1]request form[_2] to submit a request for creation of a new course or community.','','').'');
}
}
@@ -1554,10 +1704,8 @@ sub display_cc_role {
unless ($rolekey =~/^error\:/) {
if ($rolekey =~ m{^user\.role\.(cc|co)\./($match_domain)/($match_courseid)$}) {
my $ccrole = $1;
- my $tdom = $2;
- my $trest = $3;
- my $tcourseid = $tdom.'_'.$trest;
- my $trolecode = $ccrole.'./'.$tdom.'/'.$trest;
+ my $tcourseid = $2.'_'.$3;
+ my $trolecode = $1.'./'.$2.'/'.$3;
my $twhere;
my $ttype;
my $tbg='LC_roles_is';
@@ -1565,7 +1713,7 @@ sub display_cc_role {
if (%newhash) {
$twhere=$newhash{'description'}.
' '.
- &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom).
+ &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$2,$1).
'';
$ttype = $newhash{'type'};
} else {
@@ -1574,7 +1722,7 @@ sub display_cc_role {
}
my $trole = &Apache::lonnet::plaintext($ccrole,$ttype,$tcourseid);
$twhere.=" ".&mt('Domain').":".$1;
- ($roletext,$roletext_end) = &build_roletext($trolecode,$tdom,$trest,'is',$tryagain,$advanced,'',$tbg,$trole,$twhere,'','','',1,'');
+ ($roletext,$roletext_end) = &build_roletext($trolecode,$1,$2,'is',$tryagain,$advanced,'',$tbg,$trole,$twhere,'','','',1,'');
}
}
return ($roletext,$roletext_end);
@@ -1592,7 +1740,7 @@ sub adhoc_roles_row {
my $carole = &Apache::lonnet::plaintext('ca');
my $selectcalink = &coauthorlink($dcdom,$rowtype);
$output.=$ccrole.': '.$selectcclink
- .' | '.$carole.': '.$selectcalink.''
+ .' | '.$carole.': '.$selectcalink
.&Apache::loncommon::end_data_table_row();
return $output;
}