';
}
@@ -342,9 +342,11 @@ Feedback Mode:
}
sub initialize_storage {
+ my ($given_symb) = @_;
undef(%Apache::lonhomework::results);
undef(%Apache::lonhomework::history);
- my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();
+ my ($symb,$courseid,$domain,$name) =
+ &Apache::lonxml::whichuser($given_symb);
# anonymous users (CODEd exams) have no data
if ($name eq 'anonymous'
@@ -384,11 +386,13 @@ sub initialize_storage {
# Will increment totals for attempts, students, and corrects
# if running user has student role.
sub finalize_storage {
+ my ($given_symb) = @_;
my $result;
if (%Apache::lonhomework::results) {
my @remove = grep(/^INTERNAL_/,keys(%Apache::lonhomework::results));
delete(@Apache::lonhomework::results{@remove});
- my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();
+ my ($symb,$courseid,$domain,$name) =
+ &Apache::lonxml::whichuser($given_symb);
if ($env{'request.state'} eq 'construct'
|| $symb eq ''
|| $Apache::lonhomework::type eq 'practice') {
@@ -522,7 +526,8 @@ sub init_problem_globals {
@Apache::structuretags::whileline=();
$Apache::lonhomework::scantronmode=0;
undef($Apache::lonhomework::name);
-
+ undef($Apache::lonhomework::default_type);
+ undef($Apache::lonhomework::type);
}
sub reset_problem_globals {
@@ -534,6 +539,11 @@ sub reset_problem_globals {
#detect if we try to do 2 problems in one file
# undef($Apache::lonhomework::parsing_a_problem);
undef($Apache::lonhomework::name);
+ undef($Apache::lonhomework::default_type);
+ undef($Apache::lonhomework::type);
+ undef($Apache::lonhomework::scantronmode);
+ undef($Apache::lonhomework::problemstatus);
+ undef($Apache::lonhomework::ignore_response_errors);
}
sub set_problem_state {
@@ -583,7 +593,6 @@ sub start_problem {
$Apache::lonhomework::scantronmode=1;
}
- &initialize_storage();
if ($target ne 'analyze') {
if ($target eq 'web') {
&Apache::lonhomework::showhash(%Apache::lonhomework::history);
@@ -608,6 +617,8 @@ sub start_problem {
}
$Apache::lonhomework::default_type = $Apache::lonhomework::type;
+ &initialize_storage();
+
#added vars to the scripting enviroment
my $expression='$external::part=\''.$Apache::inputtags::part.'\';';
$expression.='$external::type=\''.$Apache::lonhomework::type.'\';';
@@ -725,6 +736,13 @@ sub start_problem {
'problem');
}
} elsif ($target eq 'web') {
+ if ($status eq 'CAN_ANSWER'
+ && $slot_name ne ''
+ && $Apache::lonhomework::history{'resource.0.checkedin'} eq '') {
+ # unproctored slot access, self checkin
+ &Apache::bridgetask::check_in('problem',undef,undef,
+ $slot_name);
+ }
$result.="\n $form_tag_start".
'';
# create a page header and exit
@@ -1581,9 +1599,10 @@ sub end_startouttext {
." |
".
&Apache::edit::insertlist($target,$token).
+ ' | ' .
+ &Apache::loncommon::helpLatexCheatsheet().
&Apache::edit::end_row().
- &Apache::edit::start_spanning_row()."\n"
- . &Apache::loncommon::helpLatexCheatsheet () .
+ &Apache::edit::start_spanning_row()."\n".
&Apache::edit::editfield($token->[1],$text,"",80,8,1);
}
if ($target eq 'modified') {
|