version 1.557, 2016/03/04 21:43:15
|
version 1.558, 2016/03/15 14:25:26
|
Line 824 sub valout {
|
Line 824 sub valout {
|
} |
} |
} else { |
} else { |
if ($type eq 'date_interval') { |
if ($type eq 'date_interval') { |
my ($totalsecs,$donebutton) = split(/_/,$value); |
my ($totalsecs,$donebutton,$proctor,$secretkey) = split(/_/,$value); |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($totalsecs); |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($totalsecs); |
my @timer; |
my @timer; |
$year=$year-70; |
$year=$year-70; |
Line 859 sub valout {
|
Line 859 sub valout {
|
} |
} |
$result.=join(", ",@timer); |
$result.=join(", ",@timer); |
if ($donebutton eq 'done') { |
if ($donebutton eq 'done') { |
$result .= ' '.&mt('+ "done"'); |
if ($secretkey) { |
|
$result .= ' '.&mt('+ "done" with proctor key: [_1]',$secretkey); |
|
} else { |
|
$result .= ' '.&mt('+ "done"'); |
|
} |
} |
} |
} elsif (&isdateparm($type)) { |
} elsif (&isdateparm($type)) { |
$result = &Apache::lonlocal::locallocaltime($value). |
$result = &Apache::lonlocal::locallocaltime($value). |
Line 1125 sub ipacc_boxes_js {
|
Line 1129 sub ipacc_boxes_js {
|
END |
END |
} |
} |
|
|
|
sub done_proctor_js { |
|
return <<"END"; |
|
function toggleSecret(form,radio,key) { |
|
var radios = form[radio+key]; |
|
if (radios.length) { |
|
for (var i=0; i<radios.length; i++) { |
|
if (radios[i].checked) { |
|
if (radios[i].value == '_done_proctor') { |
|
if (document.getElementById('done_'+key+'_proctorkey')) { |
|
document.getElementById('done_'+key+'_proctorkey').type='text'; |
|
} |
|
} else { |
|
if (document.getElementById('done_'+key+'_proctorkey')) { |
|
document.getElementById('done_'+key+'_proctorkey').type='hidden'; |
|
document.getElementById('done_'+key+'_proctorkey').value=''; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
END |
|
|
|
} |
|
|
sub startpage { |
sub startpage { |
my ($r,$psymb,$crstype) = @_; |
my ($r,$psymb,$crstype) = @_; |
|
|
Line 3601 sub get_date_interval_from_form {
|
Line 3630 sub get_date_interval_from_form {
|
$seconds += $env{'form.'.$name.'_'.$key} * $factor; |
$seconds += $env{'form.'.$name.'_'.$key} * $factor; |
} |
} |
} |
} |
if (($key =~ /\.interval$/) && ($env{'form.done_'.$key} eq '_done')) { |
if (($key =~ /\.interval$/) && (($env{'form.done_'.$key} eq '_done') || ($env{'form.done_'.$key} eq '_done_proctor'))) { |
$seconds .= $env{'form.done_'.$key}; |
$seconds .= $env{'form.done_'.$key}; |
|
if ($env{'form.done_'.$key.'_proctorkey'}) { |
|
$seconds .= '_'.$env{'form.done_'.$key.'_proctorkey'}; |
|
} |
} |
} |
return $seconds; |
return $seconds; |
} |
} |
Line 3903 my %intervals =
|
Line 3935 my %intervals =
|
( |
( |
'date_interval' |
'date_interval' |
=> [[ 'done', 'Yes' ], |
=> [[ 'done', 'Yes' ], |
|
[ 'done_proctor', 'Yes, with proctor key'], |
[ '', 'No' ]], |
[ '', 'No' ]], |
); |
); |
|
|
my %intervalmatches = ( |
my %intervalmatches = ( |
'date_interval' |
'date_interval' |
=> [['done','\d+_done$'],], |
=> [['done','\d+_done$'], |
|
['done_proctor','\d+_done_proctor_']], |
); |
); |
|
|
my %intervaltypes = ( |
my %intervaltypes = ( |
Line 3996 sub date_interval_selector {
|
Line 4030 sub date_interval_selector {
|
if ($name eq 'interval') { |
if ($name eq 'interval') { |
unless ($skipval{'done'}) { |
unless ($skipval{'done'}) { |
my $checkedon = ''; |
my $checkedon = ''; |
|
my $checkedproc = ''; |
|
my $currproctorkey = ''; |
|
my $currprocdisplay = 'hidden'; |
my $checkedoff = ' checked="checked"'; |
my $checkedoff = ' checked="checked"'; |
if ($currval =~ /^(\d+)_done$/) { |
if ($currval =~ /^(\d+)_done$/) { |
$checkedon = ' checked="checked"'; |
$checkedon = ' checked="checked"'; |
$checkedoff = ''; |
$checkedoff = ''; |
|
} elsif ($currval =~ /^(?:\d+)_done_proctor_(.+)$/) { |
|
$currproctorkey = $1; |
|
$checkedproc = ' checked="checked"'; |
|
$checkedoff = ''; |
|
$currprocdisplay = 'text'; |
} |
} |
$result .= '<span class="LC_nobreak">'.(' ' x 3).'('.&mt('Include "done" button'). |
my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"'; |
'<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.' />'. |
$result .= '<br /><span class="LC_nobreak">'.&mt('Include "done" button'). |
&mt('Yes').'</label>'. |
'<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.$onclick.' />'. |
'<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.' />'. |
&mt('No').'</label>'.(' 'x2). |
&mt('No').'</label>)</span>'; |
'<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.$onclick.' />'. |
|
&mt('Yes').'</label>'.(' 'x2). |
|
'<label><input type="radio" value="_done_proctor" name="done_'.$thiskey.'"'.$checkedproc.$onclick.' />'. |
|
&mt('Yes, with proctor key').'</label>'. |
|
'<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '. |
|
'name="done_'.$thiskey.'_proctorkey" value="'.$currproctorkey.'" /></span>'; |
} |
} |
} |
} |
unless ($readonly) { |
unless ($readonly) { |
Line 4144 sub newoverview {
|
Line 4191 sub newoverview {
|
&toggleparmtextbox_js()."\n". |
&toggleparmtextbox_js()."\n". |
&validateparms_js()."\n". |
&validateparms_js()."\n". |
&ipacc_boxes_js()."\n". |
&ipacc_boxes_js()."\n". |
|
&done_proctor_js()."\n". |
'// ]]> |
'// ]]> |
</script> |
</script> |
'; |
'; |
Line 4343 sub overview {
|
Line 4391 sub overview {
|
&toggleparmtextbox_js()."\n". |
&toggleparmtextbox_js()."\n". |
&validateparms_js()."\n". |
&validateparms_js()."\n". |
&ipacc_boxes_js()."\n". |
&ipacc_boxes_js()."\n". |
|
&done_proctor_js()."\n". |
'// ]]>'."\n". |
'// ]]>'."\n". |
'</script>'."\n"; |
'</script>'."\n"; |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |