version 1.195.2.1, 2007/01/18 23:20:56
|
version 1.208, 2007/05/15 20:21:17
|
Line 265 sub fieldnames {
|
Line 265 sub fieldnames {
|
'correct' => 'Material appears to be correct', |
'correct' => 'Material appears to be correct', |
'technical' => 'Resource is technically correct', |
'technical' => 'Resource is technically correct', |
'avetries' => 'Average number of tries till solved', |
'avetries' => 'Average number of tries till solved', |
'stdno' => 'Total number of students who have worked on this problem', |
'stdno' => 'Statistics calculated for number of students', |
'difficulty' => 'Degree of difficulty', |
'difficulty' => 'Degree of difficulty', |
'disc' => 'Degree of discrimination', |
'disc' => 'Degree of discrimination', |
'dependencies' => 'Resources used by this resource', |
'dependencies' => 'Resources used by this resource', |
Line 631 sub prettyinput {
|
Line 631 sub prettyinput {
|
if ($meta_options{$item}) { |
if ($meta_options{$item}) { |
push(@cur_values_inst,$item); |
push(@cur_values_inst,$item); |
} else { |
} else { |
$cur_values_stu .= $item.','; |
if ($item ne '') { |
|
$cur_values_stu .= $item.','; |
|
} |
} |
} |
} |
} |
|
$cur_values_stu =~ s/,$//; |
|
my @key_order = sort(keys(%meta_options)); |
|
unshift(@key_order,''); |
|
$meta_options{''} = 'Not specified'; |
|
$meta_options{'select_form_order'} = \@key_order; |
} else { |
} else { |
$cur_values_stu = $value; |
$cur_values_stu = $value; |
} |
} |
Line 645 sub prettyinput {
|
Line 652 sub prettyinput {
|
|| ($type eq 'author')||($type eq 'notes') |
|| ($type eq 'author')||($type eq 'notes') |
|| ($type eq 'abstract')|| ($type eq 'title')|| ($type eq 'standards') |
|| ($type eq 'abstract')|| ($type eq 'title')|| ($type eq 'standards') |
|| (exists($env{$course_key.'.metadata.'.$type.'.added'}))) { |
|| (exists($env{$course_key.'.metadata.'.$type.'.added'}))) { |
|
|
if ($values) { |
if ($values) { |
if ($only_one) { |
if ($only_one) { |
$output .= (&Apache::loncommon::select_form($cur_values_inst[0],'new_'.$type,%meta_options)); |
$output .= (&Apache::loncommon::select_form($cur_values_inst[0],'new_'.$type,%meta_options)); |
Line 782 sub handler {
|
Line 790 sub handler {
|
%Apache::lonpublisher::metadatakeys=(); |
%Apache::lonpublisher::metadatakeys=(); |
my $result=&Apache::lonnet::getfile($fn); |
my $result=&Apache::lonnet::getfile($fn); |
&Apache::lonpublisher::metaeval($result); |
&Apache::lonpublisher::metaeval($result); |
&Apache::lonnet::logthis("restricted is: ".$Apache::lonpublisher::metadatafields{'courserestricted'}); |
|
if ((!$Apache::lonpublisher::metadatafields{'courserestricted'}) || |
if ((!$Apache::lonpublisher::metadatafields{'courserestricted'}) || |
($env{'form.changecourse'} eq 'true')) { |
($env{'form.changecourse'} eq 'true')) { |
&pre_select_course($r,$uri); |
&pre_select_course($r,$uri); |
Line 797 sub handler {
|
Line 804 sub handler {
|
&present_editable_metadata($r,$uri,'groups'); |
&present_editable_metadata($r,$uri,'groups'); |
} elsif ($uri=~m|^/~|) { |
} elsif ($uri=~m|^/~|) { |
# Construction space |
# Construction space |
$r->print(&Apache::loncommon::start_page('Edit Catalog nformation', |
$r->print(&Apache::loncommon::start_page('Edit Catalog Information', |
undef, |
"\n".'<script type="text/javascript">'."\n". |
|
&Apache::loncommon::browser_and_searcher_javascript(). |
|
"\n".'</script>', |
{'domain' => $resdomain,})); |
{'domain' => $resdomain,})); |
&present_editable_metadata($r,$uri); |
&present_editable_metadata($r,$uri); |
} else { |
} else { |
Line 1017 sub print_dynamic_metadata {
|
Line 1026 sub print_dynamic_metadata {
|
# |
# |
# New assessment statistics |
# New assessment statistics |
$r->print('<h4>'. |
$r->print('<h4>'. |
&mt('Detailed Assessment Statistical Data'). |
&mt('Recent Detailed Assessment Statistical Data'). |
'</h4>'); |
'</h4>'); |
my $table = '<table cellspacing="2" border="0">'. |
my $table = '<table cellspacing="2" border="0">'. |
'<tr>'. |
'<tr>'. |
'<th>Course</th>'. |
'<th>'.&mt('Course').'</th>'. |
'<th>Section(s)</th>'. |
'<th>'.&mt('Section(s)').'</th>'. |
'<th>Num Students</th>'. |
'<th>'.&mt('Num Student').'s</th>'. |
'<th>Mean Tries</th>'. |
'<th>'.&mt('Mean Tries').'</th>'. |
'<th>Degree of Difficulty</th>'. |
'<th>'.&mt('Degree of Difficulty').'</th>'. |
'<th>Degree of Discrimination</th>'. |
'<th>'.&mt('Degree of Discrimination').'</th>'. |
'<th>Time of computation</th>'. |
'<th>'.&mt('Time of computation').'</th>'. |
'</tr>'.$/; |
'</tr>'.$/; |
foreach my $identifier (sort(keys(%{$dynmeta{'stats'}}))) { |
foreach my $identifier (sort(keys(%{$dynmeta{'stats'}}))) { |
my $data = $dynmeta{'stats'}->{$identifier}; |
my $data = $dynmeta{'stats'}->{$identifier}; |
Line 1203 ENDBOMBS
|
Line 1212 ENDBOMBS
|
<input type="submit" name="clearmsg" value="$clear" /> |
<input type="submit" name="clearmsg" value="$clear" /> |
ENDDEL |
ENDDEL |
} else { |
} else { |
$r->print('<a href="'.$disuri.'" />'.$goback.'</a>'); |
$r->print('<p><a href="'.$disuri.'">'.$goback.'</a></p>'); |
|
if ($env{'form.clearmsg'}) { |
|
my ($diruri) = ($disuri =~ m{(.*/)[^/]*}); |
|
$r->print('<p><a href="'.$diruri.'">'. |
|
&mt('Back To Directory').'</a></p>'); |
|
} |
} |
} |
$r->print('<br />'.$bombs); |
$r->print('<br />'.$bombs); |
} else { |
} else { |
Line 1243 ENDDEL
|
Line 1257 ENDDEL
|
<h1>$displayfile</h1> |
<h1>$displayfile</h1> |
<form method="post" action="" name="defaultmeta"> |
<form method="post" action="" name="defaultmeta"> |
ENDEDIT |
ENDEDIT |
$r->print('<script type="JavaScript">'. |
|
&Apache::loncommon::browser_and_searcher_javascript(). |
|
'</script>'); |
|
my %lt=&fieldnames($file_type); |
my %lt=&fieldnames($file_type); |
my $output; |
my $output; |
my @fields; |
my @fields; |
Line 1301 ENDEDIT
|
Line 1312 ENDEDIT
|
$Apache::lonpublisher::metadatafields{'owner'} = |
$Apache::lonpublisher::metadatafields{'owner'} = |
$env{'user.name'}.':'.$env{'user.domain'}; |
$env{'user.name'}.':'.$env{'user.domain'}; |
} |
} |
|
|
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') { |
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') { |
|
|
if ($file_type eq 'portfolio') { |
if ($file_type eq 'portfolio') { |
$r->print(&mt('Associated with course [_1]', |
$r->print(&mt('Associated with course [_1]', |
'<strong><a href="'.$uri.'?changecourse=true">'. |
'<strong><a href="'.$uri.'?changecourse=true">'. |
Line 1334 ENDEDIT
|
Line 1345 ENDEDIT
|
my $row_alt = 1; |
my $row_alt = 1; |
foreach my $field_name (@fields) { |
foreach my $field_name (@fields) { |
if (defined($env{'form.new_'.$field_name})) { |
if (defined($env{'form.new_'.$field_name})) { |
$Apache::lonpublisher::metadatafields{$field_name}= |
my @values = &Apache::loncommon::get_env_multiple('form.new_'.$field_name); |
join(',',&Apache::loncommon::get_env_multiple('form.new_'.$field_name)); |
my $newvalue = ''; |
|
foreach my $item (@values) { |
|
if ($item ne '') { |
|
$newvalue .= $item.','; |
|
} |
|
} |
|
$newvalue =~ s/,$//; |
|
$Apache::lonpublisher::metadatafields{$field_name}=$newvalue; |
} |
} |
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none' |
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none' |
&& exists($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'})) { |
&& exists($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'})) { |
Line 1368 ENDEDIT
|
Line 1386 ENDEDIT
|
$r->print($result); |
$r->print($result); |
} |
} |
$r->print($output.'<br /><input type="submit" name="store" value="'. |
$r->print($output.'<br /><input type="submit" name="store" value="'. |
&mt('Store Catalog Information').'" />'); |
&mt('Save Catalog Information').'" />'); |
|
|
if ($file_type eq 'portfolio' || $file_type eq 'groups') { |
if ($file_type eq 'portfolio' || $file_type eq 'groups') { |
my ($port_path,$group) = &get_port_path_and_group($uri); |
my ($port_path,$group) = &get_port_path_and_group($uri); |
Line 1502 sub store_portfolio_metadata {
|
Line 1520 sub store_portfolio_metadata {
|
|
|
sub update_metadata_table { |
sub update_metadata_table { |
my ($uri) = @_; |
my ($uri) = @_; |
my ($group,$file_name); |
my ($type,$udom,$uname,$file_name,$group) = |
my ($udom,$uname,$remainder) = |
&Apache::lonnet::parse_portfolio_url($uri); |
($uri=~m -^/+(?:uploaded|editupload)/+($match_domain)/+($match_name)/+(.*)$-); |
|
|
|
if ($remainder =~ /^groups\/(\w+)\/portfolio(\/.+)$/) { |
|
$group = $1; |
|
$file_name = $2; |
|
} elsif ($remainder =~ /^portfolio(\/.+)$/) { |
|
$file_name = $1; |
|
} |
|
$file_name =~ s/\.meta$//; |
$file_name =~ s/\.meta$//; |
my $current_permissions = |
my $current_permissions = |
&Apache::lonnet::get_portfile_permissions($udom,$uname); |
&Apache::lonnet::get_portfile_permissions($udom,$uname); |
my %access_controls = |
my %access_controls = |
&Apache::lonnet::get_access_controls($current_permissions,$group, |
&Apache::lonnet::get_access_controls($current_permissions,$group, |
$group.$file_name); |
$file_name); |
my $access_hash = $access_controls{$file_name}; |
my $access_hash = $access_controls{$file_name}; |
my $available = 0; |
my $available = 0; |
if (ref($access_hash) eq 'HASH') { |
if (ref($access_hash) eq 'HASH') { |