--- loncom/interface/slotrequest.pm 2015/09/27 22:35:39 1.130 +++ loncom/interface/slotrequest.pm 2015/10/05 02:35:45 1.131 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for requesting to have slots added to a students record # -# $Id: slotrequest.pm,v 1.130 2015/09/27 22:35:39 raeburn Exp $ +# $Id: slotrequest.pm,v 1.131 2015/10/05 02:35:45 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1494,7 +1494,8 @@ sub show_table { 'allowedusers' => 'Users slot is restricted to.', 'uniqueperiod' => 'Period of time slot is unique', 'scheduled' => 'Scheduled Students', - 'proctor' => 'List of proctors'); + 'proctor' => 'List of proctors', + 'iptied' => 'Unique IP each student',); if ($crstype eq 'Community') { $show_fields{'startreserve'} = &mt('Time members can start reserving'); $show_fields{'endreserve'} = &mt('Time members can no longer reserve'); @@ -1502,7 +1503,7 @@ sub show_table { } my @show_order=('name','description','type','starttime','endtime', 'startreserve','endreserve','reservationmsg','secret','space', - 'ip','symb','allowedsections','allowedusers','uniqueperiod', + 'ip','iptied','symb','allowedsections','allowedusers','uniqueperiod', 'scheduled','proctor'); my @show = (exists($env{'form.show'})) ? &Apache::loncommon::get_env_multiple('form.show') @@ -1834,6 +1835,16 @@ LOGLINK if (exists($show{'ip'})) { $colspan++;$r->print("$slots{$slot}{'ip'}\n"); } + if (exists($show{'iptied'})) { + $colspan++; + if ($slots{$slot}{'iptied'} eq 'yes') { + $r->print(''.&mt('Yes')."\n"); + } elsif ($slots{$slot}{'iptied'} eq 'answer') { + $r->print(''.&mt('Yes, including post-answer date')."\n"); + } else { + $r->print(''.&mt('No')."\n"); + } + } if (exists($show{'symb'})) { $colspan++;$r->print("".join('
',@titles)."\n"); } @@ -2952,6 +2963,7 @@ sub csvupload_fields { ['endreserve','Reservation End Time'], ['reservationmsg','Message when reservation changed'], ['ip','IP or DNS restriction'], + ['iptied','Unique IP each student'], ['proctor','List of proctor ids'], ['description','Slot Description'], ['maxspace','Maximum number of reservations'], @@ -3062,6 +3074,11 @@ sub csv_upload_assign { $slot{$key}=$entries{$fields{$key}}; } } + if ($entries{$fields{'iptied'}} =~ /^\s*(yes|1)\s*$/i) { + $slot{'iptied'}='yes'; + } elsif ($entries{$fields{'iptied'}} =~ /^\s*answer\s*$/i) { + $slot{'iptied'}='answer'; + } if ($entries{$fields{'allowedusers'}}) { $entries{$fields{'allowedusers'}} =~ s/^\s+//; $entries{$fields{'allowedusers'}} =~ s/\s+$//; @@ -3284,7 +3301,8 @@ sub handler { my ($status) = &Apache::lonhomework::check_slot_access('0',$type); if ($status eq 'CAN_ANSWER' || $status eq 'NEEDS_CHECKIN' || - $status eq 'WAITING_FOR_GRADE') { + $status eq 'WAITING_FOR_GRADE' || + $status eq 'NEED_DIFFERENT_IP') { &fail($r,'not_allowed'); return OK; }