[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /interface slotrequest.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 21 Nov 2005 22:16:39 -0000
albertel Mon Nov 21 17:16:39 2005 EDT
Modified files:
/loncom/interface slotrequest.pm
/loncom/homework structuretags.pm
Log:
- student can sign up fro slots for problems
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.35 loncom/interface/slotrequest.pm:1.36
--- loncom/interface/slotrequest.pm:1.35 Mon Nov 21 16:20:06 2005
+++ loncom/interface/slotrequest.pm Mon Nov 21 17:16:24 2005
@@ -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.35 2005/11/21 21:20:06 albertel Exp $
+# $Id: slotrequest.pm,v 1.36 2005/11/21 22:16:24 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1129,12 +1129,15 @@
} else {
my $symb=&Apache::lonnet::unescape($env{'form.symb'});
my (undef,undef,$res)=&Apache::lonnet::decode_symb($symb);
- if ($res !~ /\.task$/) {
+ my $useslots = &Apache::lonnet::EXT("resource.0.useslots",$symb);
+ if ($useslots ne 'resource') {
&fail($r,'not_valid');
return OK;
}
$env{'request.symb'}=$symb;
- my ($status) = &Apache::lonhomework::check_task_access('0');
+ my $type = ($res =~ /\.task$/) ? 'Task'
+ : 'problem';
+ my ($status) = &Apache::lonhomework::check_slot_access('0',$type);
if ($status eq 'CAN_ANSWER' ||
$status eq 'NEEDS_CHECKIN' ||
$status eq 'WAITING_FOR_GRADE') {
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.324 loncom/homework/structuretags.pm:1.325
--- loncom/homework/structuretags.pm:1.324 Mon Nov 21 16:51:29 2005
+++ loncom/homework/structuretags.pm Mon Nov 21 17:16:38 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.324 2005/11/21 21:51:29 albertel Exp $
+# $Id: structuretags.pm,v 1.325 2005/11/21 22:16:38 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -645,6 +645,8 @@
$msg.=&checkout_msg;
} elsif ($status eq 'NOT_YET_VIEWED') {
$msg.=&firstaccess_msg($accessmsg,$symb);
+ } elsif ($status eq 'NOT_IN_A_SLOT') {
+ $msg.=&Apache::bridgetask::add_request_another_attempt_button("Sign up for time to work.");
}
$result.=$msg.'<br />';
} elsif ($target eq 'tex') {