");
}
@@ -623,15 +641,14 @@ SUBJAVASCRIPT
my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url)));
if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; }
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : '');
-#
-# header info
+
+ # header info
if ($counter == 0) {
$request->print('
Submission Record
'.
' Resource: '.$url.'');
}
-#
-# option to display problem, only once else it cause problems with the form later since the problem has a form.
+ # option to display problem, only once else it cause problems with the form later since the problem has a form.
if ($ENV{'form.vProb'} eq 'yes' && $counter == 0) {
my $rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom,
$ENV{'request.course.id'});
@@ -645,65 +662,75 @@ SUBJAVASCRIPT
$result.='
';
$request->print($result);
}
-#
-# beginning of form
+
+ # beginning of form
if ($counter == 0) {
- my %keyhash = &Apache::lonnet::get
- ('nohist_handgrade',[$symb.'_keywords'],
+ my %keyhash = &Apache::lonnet::dump('nohist_handgrade',
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
$ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+ my $loginuser = $ENV{'user.name'}.':'.$ENV{'user.domain'};
+ # if the handgrade db has never being initialized then set some default values
+ if ($keyhash{$symb.'_handgrade'} eq '') {
+ $keyhash{$symb.'_keywords'} = '';
+ $keyhash{$symb.'_subject'} = &Apache::lonnet::metadata($url,'title');
+ $keyhash{$loginuser.'_kwclr'} = $keyhash{$loginuser.'_kwclr'} eq '' ? 'red' : $keyhash{$loginuser.'_kwclr'};
+ $keyhash{$loginuser.'_kwsize'} = $keyhash{$loginuser.'_kwsize'} eq '' ? '0' : $keyhash{$loginuser.'_kwsize'};
+ $keyhash{$loginuser.'_kwstyle'} = $keyhash{$loginuser.'_kwstyle'} eq '' ? '' : $keyhash{$loginuser.'_kwstyle'};
+ $keyhash{$symb.'_savemsgN'} = '0';
+ }
$request->print('