";
}
sub render_quick_status {
@@ -1102,28 +1128,28 @@ sub render_quick_status {
}
my $linkopen = "";
my $linkclose = "";
-
+
+ $result .= '
';
if ($resource->is_problem() &&
!$firstDisplayed) {
-
my $icon = $statusIconMap{$resource->simpleStatus($part)};
my $alt = $iconAltTags{$icon};
if ($icon) {
my $location=
&Apache::loncommon::lonhttpdurl("/adm/lonIcons/$icon");
- $result .= "
' ."\n";
+ $result.=&Apache::loncommon::start_data_table("LC_tableOfContent");
+
my $res = "Apache::lonnavmaps::resource";
my %condenseStatuses =
( $res->NETWORK_FAILURE => 1,
$res->NOTHING_SET => 1,
$res->CORRECT => 1 );
- my @backgroundColors = ("#FFFFFF", "#F6F6F6");
# Shared variables
$args->{'counter'} = 0; # counts the rows
$args->{'indentLevel'} = 0;
$args->{'isNewBranch'} = 0;
- $args->{'condensed'} = 0;
- my $location=
- &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace1.gif");
- $args->{'indentString'} = setDefault($args->{'indentString'}, "");
+ $args->{'condensed'} = 0;
+
+ my $location = &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21.gif");
+ $args->{'indentString'} = setDefault($args->{'indentString'}, "");
$args->{'displayedHereMarker'} = 0;
# If we're suppressing empty sequences, look for them here. Use DFS for speed,
@@ -1768,16 +1800,15 @@ END
if (defined($anchor)) { $anchor='#'.$anchor; }
my $srcHasQuestion = $src =~ /\?/;
$args->{"resourceLink"} = $src.
- ($srcHasQuestion?'&':'?') .
+ ($srcHasQuestion?'&':'?') .
'symb=' . &escape($symb).$anchor;
}
# Now, we've decided what parts to show. Loop through them and
# show them.
foreach my $part (@parts) {
$rownum ++;
- my $backgroundColor = $backgroundColors[$rownum % scalar(@backgroundColors)];
- $result .= "
\n";
+ $result .= &Apache::loncommon::start_data_table_row();
# Set up some data about the parts that the cols might want
my $filter = $it->{FILTER};
@@ -1803,7 +1834,7 @@ END
}
$result .= $colHTML . "\n";
}
- $result .= "
\n";
+ $result .= &Apache::loncommon::end_data_table_row();
$args->{'isNewBranch'} = 0;
}
@@ -1831,16 +1862,15 @@ END
# it's quite likely this might fix other browsers, too, and
# certainly won't hurt anything.
if ($displayedJumpMarker) {
- $result .= "
-";
+");
}
- $result .= "
";
-
+ $result.=&Apache::loncommon::end_data_table();
+
if ($r) {
$r->print($result);
$result = "";
@@ -1856,40 +1886,42 @@ sub add_linkitem {
$$linkitems{$name}{'text'}=&mt($text);
}
-sub show_linkitems {
- my ($linkitems)=@_;
- my @linkorder = ("blank","launchnav","closenav","firsthomework",
+sub show_linkitems_toolbar {
+ my ($linkitems,$condition)=@_;
+ my @linkorder = ("launchnav","closenav","firsthomework",
"everything","uncompleted","changefolder","clearbubbles");
-
- my $result .= (<
-
- '."\n";
-
+ $result .= ''.
+ ''."\n";
return $result;
}
+
1;
@@ -2356,7 +2388,7 @@ resource object.
Based on the symb of the resource, get a resource object for that
resource. This is one of the proper ways to get a resource object.
-=item * B(map_pc):
+=item * B(map_pc):
Based on the map_pc of the resource, get a resource object for
the given map. This is one of the proper ways to get a resource object.
@@ -3511,7 +3543,11 @@ sub navHash {
my $self = shift;
my $param = shift;
my $id = shift;
- return $self->{NAV_MAP}->navhash($param . ($id?$self->{ID}:""));
+ my $arg = $param . ($id?$self->{ID}:"");
+ if (defined($arg)) {
+ return $self->{NAV_MAP}->navhash($arg);
+ }
+ return;
}
=pod
@@ -3754,6 +3790,35 @@ sub is_problem {
}
return 0;
}
+#
+# The has below is the set of status that are considered 'incomplete'
+#
+my %incomplete_hash =
+(
+ TRIES_LEFT() => 1,
+ OPEN() => 1,
+ ATTEMPTED() => 1
+
+ );
+#
+# Return tru if a problem is incomplete... for now incomplete means that
+# any part of the problem is incomplete.
+# Note that if the resources is not a problem, 0 is returned.
+#
+sub is_incomplete {
+ my $self = shift;
+ if ($self->is_problem()) {
+ &Apache::lonnet::logthis('is problem');
+ foreach my $part (@{$self->parts()}) {
+ &Apache::lonnet::logthis("$part status ".$self->status($part));
+ if (exists($incomplete_hash{$self->status($part)})) {
+ return 1;
+ }
+ }
+ }
+ return 0;
+
+}
sub is_raw_problem {
my $self=shift;
my $src = $self->src();
@@ -3783,13 +3848,13 @@ sub map_contains_problem {
sub is_sequence {
my $self=shift;
return $self->navHash("is_map_", 1) &&
- $self->navHash("map_type_" . $self->map_pc()) eq 'sequence';
+ $self->navHash("map_type_" . $self->map_pc()) eq 'sequence';
}
sub is_survey {
my $self = shift();
my $part = shift();
my $type = $self->parmval('type',$part);
- if ($type eq 'survey') {
+ if (($type eq 'survey') || ($type eq 'surveycred')) {
return 1;
}
if ($self->src() =~ /\.(survey)$/) {
@@ -3797,6 +3862,15 @@ sub is_survey {
}
return 0;
}
+sub is_anonsurvey {
+ my $self = shift();
+ my $part = shift();
+ my $type = $self->parmval('type',$part);
+ if (($type eq 'anonsurvey') || ($type eq 'anonsurveycred')) {
+ return 1;
+ }
+ return 0;
+}
sub is_task {
my $self=shift;
my $src = $self->src();
@@ -3850,6 +3924,12 @@ resource of the map.
Returns a string with the type of the map in it.
+=item *B:
+
+Returns a string with a comma-separated ordered list of map_pc IDs
+for the hierarchy of maps containing a map, with the top level
+map first, then descending to deeper levels, with the enclosing map last.
+
=back
=cut
@@ -3880,6 +3960,12 @@ sub map_type {
my $pc = $self->map_pc();
return $self->navHash("map_type_$pc", 0);
}
+sub map_hierarchy {
+ my $self = shift;
+ my $pc = $self->map_pc();
+ return $self->navHash("map_hierarchy_$pc", 0);
+}
+
#####
# Property queries
@@ -4114,7 +4200,7 @@ sub slot_control {
if (!defined($part)) { $part = '0'; }
my $useslots = $self->parmval("useslots", $part);
my $availablestudent = $self->parmval("availablestudent", $part);
- my $available = $self->parmval("available", $part);
+ my $available = $self->parmval("available", $part);
return ($useslots,$availablestudent,$available);
}
@@ -4549,7 +4635,7 @@ sub OPEN { return 1; }
sub PAST_DUE_NO_ANSWER { return 2; }
sub PAST_DUE_ANSWER_LATER { return 3; }
sub ANSWER_OPEN { return 4; }
-sub NOTHING_SET { return 5; }
+sub NOTHING_SET { return 5; }
sub NETWORK_FAILURE { return 100; }
# getDateStatus gets the date status for a given problem part.
@@ -4635,6 +4721,10 @@ Information not available due to network
Attempted, and not yet graded.
+=item * B:
+
+Attempted, and credit received for attempt (survey and anonymous survey only).
+
=back
=cut
@@ -4646,6 +4736,7 @@ sub CORRECT { return 13; }
sub CORRECT_BY_OVERRIDE { return 14; }
sub EXCUSED { return 15; }
sub ATTEMPTED { return 16; }
+sub CREDIT_ATTEMPTED { return 17; }
sub getCompletionStatus {
my $self = shift;
@@ -4664,6 +4755,13 @@ sub getCompletionStatus {
if ($status eq 'incorrect_by_override') {return $self->INCORRECT_BY_OVERRIDE; }
if ($status eq 'excused') {return $self->EXCUSED; }
if ($status eq 'ungraded_attempted') {return $self->ATTEMPTED; }
+ if ($status eq 'credit_attempted') {
+ if ($self->is_anonsurvey($part) || $self->is_survey($part)) {
+ return $self->CREDIT_ATTEMPTED;
+ } else {
+ return $self->ATTEMPTED;
+ }
+ }
return $self->NOT_ATTEMPTED;
}
@@ -4753,6 +4851,10 @@ The item is open and not yet tried.
The problem has been attempted.
+=item * B:
+
+The problem has been attempted, and credit given for the attempt (survey and anonymous survey only).
+
=item * B:
An answer has been submitted, but the student should not see it.
@@ -4761,9 +4863,9 @@ An answer has been submitted, but the st
=cut
-sub TRIES_LEFT { return 20; }
-sub ANSWER_SUBMITTED { return 21; }
-sub PARTIALLY_CORRECT{ return 22; }
+sub TRIES_LEFT { return 20; }
+sub ANSWER_SUBMITTED { return 21; }
+sub PARTIALLY_CORRECT { return 22; }
sub RESERVED_LATER { return 30; }
sub RESERVED { return 31; }
@@ -4826,6 +4928,10 @@ sub status {
return ATTEMPTED;
}
+ if ($completionStatus == CREDIT_ATTEMPTED) {
+ return CREDIT_ATTEMPTED;
+ }
+
# If it's EXCUSED, then return that no matter what
if ($completionStatus == EXCUSED) {
return EXCUSED;
@@ -4906,11 +5012,11 @@ sub check_for_slot {
if (!&Apache::loncommon::check_ip_acc($ip)) {
return (RESERVED_LOCATION,$ip,$slot_name);
}
- }
+ }
if (@proctors > 0) {
unless ((grep(/^\Q$checkedin\E/,@proctors)) &&
($checkedinslot eq $slot_name)) {
- return (NEEDS_CHECKIN,undef,$slot_name);
+ return (NEEDS_CHECKIN,undef,$slot_name);
}
}
return (RESERVED,$end,$slot_name);
@@ -4926,19 +5032,19 @@ sub check_for_slot {
my ($is_correct,$got_grade);
if ($self->is_task()) {
my $taskstatus = $self->taskstatus();
- $is_correct = (($taskstatus eq 'pass') ||
+ $is_correct = (($taskstatus eq 'pass') ||
($self->solved() =~ /^correct_/));
- $got_grade = ($self->solved() =~ /^(?:pass|fail)$/);
+ $got_grade = ($taskstatus =~ /^(?:pass|fail)$/);
} else {
$got_grade = 1;
- $is_correct = ($self->solved() =~ /^correct_/);
+ $is_correct = ($self->solved() =~ /^correct_/);
}
($checkedin,$checkedinslot) = $self->checkedin();
if ($checkedin) {
if (!$got_grade) {
return (WAITING_FOR_GRADE);
} elsif ($is_correct) {
- return (CORRECT);
+ return (CORRECT);
}
}
return(NOT_IN_A_SLOT);
@@ -5018,6 +5124,7 @@ my %compositeToSimple =
INCORRECT() => INCORRECT,
OPEN() => OPEN,
ATTEMPTED() => ATTEMPTED,
+ CREDIT_ATTEMPTED() => CORRECT,
ANSWER_SUBMITTED() => ATTEMPTED
);
@@ -5091,8 +5198,9 @@ sub completable {
# "If any of the parts are open, or have tries left (implies open),
# and it is not "attempted" (manually graded problem), it is
# not "complete"
- if ($self->getCompletionStatus($part) == ATTEMPTED() ||
- $status == ANSWER_SUBMITTED() ) {
+ if ($self->getCompletionStatus($part) == ATTEMPTED() ||
+ $self->getCompletionStatus($part) == CREDIT_ATTEMPTED() ||
+ $status == ANSWER_SUBMITTED() ) {
# did this part already, as well as we can
next;
}