version 1.496, 2010/06/06 02:40:30
|
version 1.504, 2010/12/21 14:14:55
|
Line 1214 sub isdateparm {
|
Line 1214 sub isdateparm {
|
} |
} |
|
|
# |
# |
# This function prints a list of parameters, which were selected. It also display a link from which you can |
# parmmenu displays a list of the selected parameters. |
# hide or show the complete parameter list, from which you can choose your parameters. |
# It also offers a link to show/hide the complete parameter list |
|
# from which you can select all desired parameters. |
# |
# |
sub parmmenu { |
sub parmmenu { |
my ($r,$allparms,$pscat,$keyorder)=@_; |
my ($r,$allparms,$pscat,$keyorder)=@_; |
Line 1290 sub parmmenu {
|
Line 1291 sub parmmenu {
|
checkdates(); |
checkdates(); |
checkthis('weight','pscat'); |
checkthis('weight','pscat'); |
checkthis('maxtries','pscat'); |
checkthis('maxtries','pscat'); |
|
checkthis('type','pscat'); |
|
checkthis('problemstatus','pscat'); |
} |
} |
|
|
function hideParms() { |
function hideParms() { |
Line 1319 ENDSCRIPT
|
Line 1322 ENDSCRIPT
|
$r->print(&mt('Selected Parameters:').'<br />'); |
$r->print(&mt('Selected Parameters:').'<br />'); |
|
|
#print out all possible parms and hide them by default |
#print out all possible parms and hide them by default |
$r->print('<ul>'); |
$r->print('<ul class="LC_parm_parmlist">'); |
foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { |
foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { |
$r->print('<li id="'.$tempkey.'_li" value="'.$tempkey.'_li" name="pscat_li"'); |
$r->print('<li id="'.$tempkey.'_li" value="'.$tempkey.'_li" name="pscat_li"'); |
if (!($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat})) { |
if (!($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat})) { |
Line 1373 sub lookUpTableParameter {
|
Line 1376 sub lookUpTableParameter {
|
'handgrade' => 'grading', |
'handgrade' => 'grading', |
'maxtries' => 'tries', |
'maxtries' => 'tries', |
'hinttries' => 'tries', |
'hinttries' => 'tries', |
|
'randomizeontries' => 'tries', |
'type' => 'problem_appearance', |
'type' => 'problem_appearance', |
'problemstatus' => 'problem_appearance', |
'problemstatus' => 'problem_appearance', |
'display' => 'problem_appearance', |
'display' => 'problem_appearance', |
Line 1685 sub displaymenu {
|
Line 1689 sub displaymenu {
|
} |
} |
|
|
sub mapmenu { |
sub mapmenu { |
my ($r,$allmaps,$pschp,$maptitles, $symbp)=@_; |
my ($r,$allmaps,$pschp,$maptitles,$symbp)=@_; |
my %allmaps_inverted = reverse %$allmaps; |
my %allmaps_inverted = reverse %$allmaps; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $tree=[]; |
my $tree=[]; |
my $treeinfo={}; |
my $treeinfo={}; |
if (defined($navmap)) { |
if (defined($navmap)) { |
my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); |
my $it=$navmap->getIterator(undef,undef,undef,1,1,undef); |
my $curRes; |
my $curRes; |
my $depth = 0; |
my $depth = 0; |
my %parent = (); |
my %parent = (); |
Line 1736 sub mapmenu {
|
Line 1740 sub mapmenu {
|
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',' id="mapmenu"')); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',' id="mapmenu"')); |
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
$r->print(&Apache::loncommon::start_data_table() |
my $whitespace = |
.&Apache::loncommon::start_data_table_row() |
'<img src="' |
.'<td>'.$icon |
.&Apache::loncommon::lonhttpdurl('/adm/lonIcons/whitespace_21.gif') |
.'<label> ' |
.'" alt="" />'; |
.'<input type="radio" name="pschp" checked="checked" value="all" />' |
|
.&mt('All Maps or Folders') |
# Info about selectable folders/maps |
.'</label></td>' |
$r->print( |
.&Apache::loncommon::end_data_table_row() |
'<div class="LC_info">' |
|
.&mt('You can only select those maps and folders which can be currently parameterized.') |
|
# .' '.&Apache::loncommon::help_open_topic('...') # Later: Add further help |
|
.'</div>' |
); |
); |
my $whitespace = '<img src="' |
|
.&Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21.gif") |
|
.'" alt="" />'; |
$r->print(&Apache::loncommon::start_data_table()); |
|
|
|
# Display row: "All Maps or Folders" |
|
$r->print( |
|
&Apache::loncommon::start_data_table_row() |
|
.'<td>' |
|
.'<label>' |
|
.'<input type="radio" name="pschp"' |
|
); |
|
$r->print(' checked="checked"') if ($pschp eq 'all' || !$pschp); |
|
$r->print( |
|
' value="all" /> '.$icon.' ' |
|
.&mt('All Maps or Folders') |
|
.'</label>' |
|
.'<hr /></td>' |
|
.&Apache::loncommon::end_data_table_row() |
|
); |
|
|
|
# Display row: "Main Course Documents" |
if (exists($$allmaps{1})) { |
if (exists($$allmaps{1})) { |
$r->print(&Apache::loncommon::start_data_table_row() |
$r->print( |
.'<td>'.$icon |
&Apache::loncommon::start_data_table_row() |
.'<label> ' |
.'<td>' |
.'<input type="radio" name="pschp" value="1"' |
.'<label>' |
|
.'<input type="radio" name="pschp" value="1"' |
); |
); |
if ($pschp eq 1) { |
$r->print(' checked="checked"') if ($pschp eq '1'); |
$r->print(' checked="checked"'); |
$r->print( |
} |
'/> '.$icon.' ' |
$r->print('/>' |
.$$maptitles{1} |
.$$maptitles{1} |
.($$allmaps{1} !~/^uploaded/?' ['.$$allmaps{1}.']':'') |
.($$allmaps{1} !~/^uploaded/?' ['.$$allmaps{1}.']':'') |
.'</label>' |
.'</label>' |
.'</td>' |
.'</td>' |
.&Apache::loncommon::end_data_table_row() |
.&Apache::loncommon::end_data_table_row() |
|
); |
); |
} |
} |
|
|
|
# Display rows for all course maps and folders |
foreach my $id (@{$tree}) { |
foreach my $id (@{$tree}) { |
my ($mapid,$resid)=split(/\./,$id); |
my ($mapid,$resid)=split(/\./,$id); |
# Indentation |
# Indentation |
Line 1780 sub mapmenu {
|
Line 1807 sub mapmenu {
|
my $symb_name = $$symbp{$id}; |
my $symb_name = $$symbp{$id}; |
my ($front, $tail) = split (/___${resid}___/, $symb_name); |
my ($front, $tail) = split (/___${resid}___/, $symb_name); |
$symb_name = $tail; |
$symb_name = $tail; |
$r->print(&Apache::loncommon::start_data_table_row() |
$r->print( |
.'<td>'.$indent.$icon |
&Apache::loncommon::start_data_table_row() |
.'<label> ' |
.'<td>' |
.'<input type ="radio" name="pschp" value="'.$allmaps_inverted{$symb_name}.'"' |
.'<label>' |
); |
); |
if ($pschp eq $allmaps_inverted{$symb_name}) { |
# Only offer radio button for folders/maps which can be parameterized |
$r->print(' checked="checked"'); |
if ($allmaps_inverted{$symb_name}) { |
|
$r->print( |
|
'<input type ="radio" name="pschp"' |
|
.' value="'.$allmaps_inverted{$symb_name}.'"' |
|
); |
|
$r->print(' checked="checked"') if ($allmaps_inverted{$symb_name} eq $pschp); |
|
$r->print('/>'); |
|
} else { |
|
$r->print($whitespace); |
} |
} |
$r->print('/>' |
$r->print( |
.$treeinfo->{$id}->{name} |
$indent.$icon.' ' |
.($$allmaps{$mapid}!~/^uploaded/?' ['.$$allmaps{$mapid}.']':'') |
.$treeinfo->{$id}->{name} |
.'</label>' |
.($$allmaps{$mapid}!~/^uploaded/?' ['.$$allmaps{$mapid}.']':'') |
.'</td>' |
.'</label>' |
.&Apache::loncommon::end_data_table_row() |
.'</td>' |
|
.&Apache::loncommon::end_data_table_row() |
); |
); |
} |
} |
|
|
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
} |
} |
} |
} |
Line 2052 sub assessparms {
|
Line 2089 sub assessparms {
|
$message="\n<p>\n".&mt("Full Name").": ". |
$message="\n<p>\n".&mt("Full Name").": ". |
$name{'firstname'}.' '.$name{'middlename'}.' ' |
$name{'firstname'}.' '.$name{'middlename'}.' ' |
.$name{'lastname'}.' '.$name{'generation'}. |
.$name{'lastname'}.' '.$name{'generation'}. |
"<br />\n".&mt('ID').": ".$name{'id'}.'<p>'; |
"<br />\n".&mt('Student/Employee ID').": ".$name{'id'}.'<p>'; |
} |
} |
@usersgroups = &Apache::lonnet::get_users_groups( |
@usersgroups = &Apache::lonnet::get_users_groups( |
$udom,$uname,$env{'request.course.id'}); |
$udom,$uname,$env{'request.course.id'}); |
Line 2080 sub assessparms {
|
Line 2117 sub assessparms {
|
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
|
my ($got_chostname,$chostname,$cmajor,$cminor); |
|
my $totalstored = 0; |
for (my $i=0;$i<=$#markers;$i++) { |
for (my $i=0;$i<=$#markers;$i++) { |
|
my ($needsrelease,$needsnewer); |
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my (@ok_slots,@fail_slots,@del_slots); |
my (@ok_slots,@fail_slots,@del_slots); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
my ($level,@all) = |
my ($level,@all) = |
Line 2113 sub assessparms {
|
Line 2154 sub assessparms {
|
} |
} |
} |
} |
} |
} |
|
} elsif ($markers[$i] =~ /_type\&\d+$/) { |
|
$needsrelease = |
|
$Apache::lonnet::needsrelease{'parameter:type:'.$values[$i]}; |
|
if ($needsrelease) { |
|
unless ($got_chostname) { |
|
($chostname,$cmajor,$cminor) = &questiontype_release_vars(); |
|
$got_chostname = 1; |
|
} |
|
$needsnewer = &questiontype_releasecheck($values[$i], |
|
$needsrelease, |
|
$chostname, |
|
$cmajor,$cminor); |
|
} |
|
} |
|
if ($needsnewer) { |
|
$message .= &oldversion_warning($values[$i],$chostname,$cmajor, |
|
$cminor,$needsrelease); |
|
} else { |
|
$message.=&storeparm(split(/\&/,$markers[$i]), |
|
$values[$i], |
|
$types[$i], |
|
$uname,$udom,$csec,$cgroup); |
|
$totalstored ++; |
} |
} |
$message.=&storeparm(split(/\&/,$markers[$i]), |
|
$values[$i], |
|
$types[$i], |
|
$uname,$udom,$csec,$cgroup); |
|
} |
} |
# ---------------------------------------------------------------- Done storing |
# ---------------------------------------------------------------- Done storing |
$message.='<p class="LC_warning">' |
if ($totalstored) { |
.&mt('Changes can take up to 10 minutes before being active for all students.') |
$message.='<p class="LC_warning">' |
.&Apache::loncommon::help_open_topic('Caching') |
.&mt('Changes can take up to 10 minutes before being active for all students.') |
.'</p>'; |
.&Apache::loncommon::help_open_topic('Caching') |
|
.'</p>'; |
|
} |
} |
} |
#----------------------------------------------- if all selected, fill in array |
#----------------------------------------------- if all selected, fill in array |
if ($pscat[0] eq "all") {@pscat = (keys %allparms);} |
if ($pscat[0] eq "all") {@pscat = (keys %allparms);} |
if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') }; |
if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries','type','problemstatus') }; |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
# ------------------------------------------------------------------ Start page |
# ------------------------------------------------------------------ Start page |
|
|
Line 2226 COURSECONTENTSCRIPT
|
Line 2288 COURSECONTENTSCRIPT
|
# parameter screen for a single resource. |
# parameter screen for a single resource. |
my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my $title = &Apache::lonnet::gettitle($pssymb); |
my $title = &Apache::lonnet::gettitle($pssymb); |
$r->print(&mt('Specific Resource: [_1] ([_2])',$title,$resource). |
$r->print(&mt('Specific Resource: [_1] ([_2])', |
|
$title,'<span class="LC_filename">'.$resource.'</span>'). |
'<input type="hidden" value="'.$pssymb.'" name="symb" />'. |
'<input type="hidden" value="'.$pssymb.'" name="symb" />'. |
'<br />'); |
'<br />'); |
$r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('Additional Display Specification (optional)'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('Additional Display Specification (optional)'))); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')). |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')). |
'<label>'.&mt('Show all parts').': <input type="checkbox" name="psprt" value="all"'. |
'<label>'. |
($env{'form.psprt'}?' checked="checked"':'').' /></label></td></tr>'); |
'<input type="checkbox" name="psprt" value="all"'. |
|
($env{'form.psprt'}?' checked="checked"':'').' />'. |
|
&mt('Show all parts'). |
|
'</label></td></tr>'); |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
Line 2284 COURSECONTENTSCRIPT
|
Line 2350 COURSECONTENTSCRIPT
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'pie' => "Parameter in Effect", |
'pie' => "Parameter in Effect", |
'csv' => "Current Session Value", |
'csv' => "Current Session Value", |
'at' => 'at', |
|
'rl' => "Resource Level", |
'rl' => "Resource Level", |
'ic' => 'in Course', |
'ic' => 'in Course', |
'aut' => "Assessment URL and Title", |
'aut' => "Assessment URL and Title", |
Line 2300 COURSECONTENTSCRIPT
|
Line 2365 COURSECONTENTSCRIPT
|
); |
); |
$r->print(<<ENDTABLETWO); |
$r->print(<<ENDTABLETWO); |
<th rowspan="3">$lt{'pie'}</th> |
<th rowspan="3">$lt{'pie'}</th> |
<th rowspan="3">$lt{'csv'}<br />($csuname $lt{'at'} $csudom)</th> |
<th rowspan="3">$lt{'csv'}<br />($csuname:$csudom)</th> |
</tr><tr><td colspan="5"></td><th colspan="2">$lt{'ic'}</th><th colspan="2">$lt{'rl'}</th> |
</tr><tr><td colspan="5"></td><th colspan="2">$lt{'ic'}</th><th colspan="2">$lt{'rl'}</th> |
<th colspan="1">$lt{'ic'}</th> |
<th colspan="1">$lt{'ic'}</th> |
|
|
Line 2718 sub storedata {
|
Line 2783 sub storedata {
|
undef %newdata; |
undef %newdata; |
my @deldata=(); |
my @deldata=(); |
undef @deldata; |
undef @deldata; |
foreach (keys %env) { |
my ($got_chostname,$chostname,$cmajor,$cminor); |
if ($_=~/^form\.([a-z]+)\_(.+)$/) { |
foreach my $key (keys(%env)) { |
|
if ($key =~ /^form\.([a-z]+)\_(.+)$/) { |
my $cmd=$1; |
my $cmd=$1; |
my $thiskey=$2; |
my $thiskey=$2; |
my ($tuname,$tudom)=&extractuser($thiskey); |
my ($tuname,$tudom)=&extractuser($thiskey); |
Line 2730 sub storedata {
|
Line 2796 sub storedata {
|
if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') { |
if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') { |
my ($data, $typeof, $text); |
my ($data, $typeof, $text); |
if ($cmd eq 'set') { |
if ($cmd eq 'set') { |
$data=$env{$_}; |
$data=$env{$key}; |
$typeof=$env{'form.typeof_'.$thiskey}; |
$typeof=$env{'form.typeof_'.$thiskey}; |
$text = &mt('Saved modified parameter for'); |
$text = &mt('Saved modified parameter for'); |
|
if ($typeof eq 'string_questiontype') { |
|
my ($needsrelease,$needsnewer); |
|
$needsrelease = $Apache::lonnet::needsrelease{'parameter:type:'.$data}; |
|
if ($needsrelease) { |
|
unless ($got_chostname) { |
|
($chostname,$cmajor,$cminor)=&questiontype_release_vars(); |
|
$got_chostname = 1; |
|
} |
|
$needsnewer = &questiontype_releasecheck($data,$needsrelease, |
|
$chostname,$cmajor, |
|
$cminor); |
|
} |
|
if ($needsnewer) { |
|
$r->print('<br />'.&oldversion_warning($data,$chostname,$cmajor, |
|
$cminor,$needsrelease)); |
|
next; |
|
} |
|
} |
} elsif ($cmd eq 'datepointer') { |
} elsif ($cmd eq 'datepointer') { |
$data=&Apache::lonhtmlcommon::get_date_from_form($env{$_}); |
$data=&Apache::lonhtmlcommon::get_date_from_form($env{$key}); |
$typeof=$env{'form.typeof_'.$thiskey}; |
$typeof=$env{'form.typeof_'.$thiskey}; |
$text = &mt('Saved modified date for'); |
$text = &mt('Saved modified date for'); |
} elsif ($cmd eq 'dateinterval') { |
} elsif ($cmd eq 'dateinterval') { |
Line 3028 my %strings =
|
Line 3112 my %strings =
|
[ 'answer', 'Yes, and show correct answer if they exceed the maximum number of tries.' ], |
[ 'answer', 'Yes, and show correct answer if they exceed the maximum number of tries.' ], |
[ 'no', 'No, don\'t show correct/incorrect feedback.' ], |
[ 'no', 'No, don\'t show correct/incorrect feedback.' ], |
[ 'no_feedback_ever', 'No, show no feedback at all.' ]], |
[ 'no_feedback_ever', 'No, show no feedback at all.' ]], |
|
'string_questiontype' |
|
=> [[ 'problem', 'Standard Problem'], |
|
[ 'survey', 'Survey'], |
|
[ 'anonsurveycred', 'Anonymous Survey (credit for submission)'], |
|
[ 'exam', 'Exam'], |
|
[ 'anonsurvey', 'Anonymous Survey'], |
|
[ 'randomizetry', 'New Randomization Each N Tries (default N=1)'], |
|
[ 'practice', 'Practice'], |
|
[ 'surveycred', 'Survey (credit for submission)']], |
); |
); |
|
|
|
|
Line 3038 sub string_selector {
|
Line 3131 sub string_selector {
|
return &default_selector($thiskey,$showval); |
return &default_selector($thiskey,$showval); |
} |
} |
|
|
|
my %skiptype; |
|
if ($thistype eq 'string_questiontype') { |
|
my ($got_chostname,$chostname,$cmajor,$cminor); |
|
foreach my $possibilities (@{ $strings{$thistype} }) { |
|
next unless (ref($possibilities) eq 'ARRAY'); |
|
my ($name, $description) = @{ $possibilities }; |
|
my $needsrelease=$Apache::lonnet::needsrelease{'parameter:type:'.$name}; |
|
if ($needsrelease) { |
|
unless ($got_chostname) { |
|
($chostname,$cmajor,$cminor)=&questiontype_release_vars(); |
|
$got_chostname = 1; |
|
} |
|
my $needsnewer=&questiontype_releasecheck($name,$needsrelease, |
|
$chostname,$cmajor, |
|
$cminor); |
|
if ($needsnewer) { |
|
$skiptype{$name} = 1; |
|
} |
|
} |
|
} |
|
} |
|
|
my $result; |
my $result; |
foreach my $possibilities (@{ $strings{$thistype} }) { |
my $numinrow = 3; |
my ($name, $description) = @{ $possibilities }; |
if ($thistype eq 'string_problemstatus') { |
$result .= '<label><input type="radio" name="set_'.$thiskey. |
$numinrow = 2; |
'" value="'.$name.'"'; |
} elsif ($thistype eq 'string_questiontype') { |
if ($showval eq $name) { |
if (keys(%skiptype) > 0) { |
$result .= ' checked="checked"'; |
$numinrow = 4; |
|
} |
|
} |
|
my $rem; |
|
if (ref($strings{$thistype}) eq 'ARRAY') { |
|
my $i=0; |
|
foreach my $possibilities (@{ $strings{$thistype} }) { |
|
next unless (ref($possibilities) eq 'ARRAY'); |
|
my ($name, $description) = @{ $possibilities }; |
|
next if ($skiptype{$name}); |
|
$rem = $i%($numinrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$result .= '</tr>'; |
|
} |
|
$result .= '<tr>'; |
|
} |
|
$result .= '<td class="LC_left_item">'. |
|
'<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="set_'.$thiskey. |
|
'" value="'.$name.'"'; |
|
if ($showval eq $name) { |
|
$result .= ' checked="checked"'; |
|
} |
|
$result .= ' />'.&mt($description).'</label></span></td>'; |
|
$i++; |
|
} |
|
$rem = @{ $strings{$thistype} }%($numinrow); |
|
my $colsleft = $numinrow - $rem; |
|
if ($colsleft > 1 ) { |
|
$result .= '<td colspan="'.$colsleft.'" class="LC_left_item">'. |
|
' </td>'; |
|
} elsif ($colsleft == 1) { |
|
$result .= '<td class="LC_left_item"> </td>'; |
|
} |
|
$result .= '</tr>'; |
} |
} |
$result .= ' />'.&mt($description).'</label> '; |
if ($result) { |
|
$result = '<table border="0">'.$result.'</table>'; |
} |
} |
return $result; |
return $result; |
} |
} |
Line 4398 sub check_for_course_info {
|
Line 4549 sub check_for_course_info {
|
return 0; |
return 0; |
} |
} |
|
|
|
sub questiontype_release_vars { |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
|
my $chostname = &Apache::lonnet::hostname($chome); |
|
my ($cmajor,$cminor) = |
|
split(/\./,&Apache::lonnet::get_server_loncaparev($cdom,$chome)); |
|
return ($chostname,$cmajor,$cminor); |
|
} |
|
|
|
sub questiontype_releasecheck { |
|
my ($questiontype,$needsrelease,$chostname,$cmajor,$cminor) = @_; |
|
my $needsnewer; |
|
my ($needsmajor,$needsminor) = split(/\./,$needsrelease); |
|
if (($cmajor < $needsmajor) || |
|
($cmajor == $needsmajor && $cminor < $needsminor)) { |
|
$needsnewer = 1; |
|
} else { |
|
&Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:type:'.$questiontype}); |
|
} |
|
return $needsnewer; |
|
} |
|
|
|
sub oldversion_warning { |
|
my ($questiontype,$chostname,$cmajor,$cminor,$needsrelease) = @_; |
|
my $desc; |
|
if (ref($strings{'string_questiontype'}) eq 'ARRAY') { |
|
foreach my $possibilities (@{ $strings{'string_questiontype'} }) { |
|
next unless (ref($possibilities) eq 'ARRAY'); |
|
my ($name, $description) = @{ $possibilities }; |
|
if ($name eq $questiontype) { |
|
$desc = $description; |
|
last; |
|
} |
|
} |
|
} |
|
return '<p class="LC_warning">'. |
|
&mt('Question Type was [_1]not[_2] set to [_3].', |
|
'<b>','</b>','"'.$desc.'"').'<br />'. |
|
&mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).', |
|
$cmajor.'.'.$cminor,$chostname, |
|
$needsrelease). |
|
'</p>'; |
|
} |
|
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |