--- loncom/homework/grades.pm 2009/12/27 01:25:26 1.586
+++ loncom/homework/grades.pm 2010/03/11 16:29:42 1.597
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.586 2009/12/27 01:25:26 raeburn Exp $
+# $Id: grades.pm,v 1.597 2010/03/11 16:29:42 wenzelju Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -160,6 +160,10 @@ sub response_type {
return;
}
my $res = $navmap->getBySymb($symb);
+ unless (ref($res)) {
+ $$response_error = 1;
+ return;
+ }
my $partlist = $res->parts();
my %vPart =
map { $_ => 1 } (&Apache::loncommon::get_env_multiple('form.vPart'));
@@ -421,7 +425,7 @@ sub cleanRecord {
return '
'.
'
'.&mt('Answer').'
'.$toprow.'
'.
'
'.$grayFont.&mt('Option ID').'
'.
- $grayFont.$bottomrow.'
'.'
';
+ $bottomrow.''.'';
} elsif ($response eq 'essay') {
if (! exists ($env{'form.'.$symb})) {
my (%keyhash) = &Apache::lonnet::dump('nohist_handgrade',
@@ -483,8 +487,7 @@ sub cleanRecord {
#-- A couple of common js functions
sub commonJSfunctions {
my $request = shift;
- $request->print(<
+ $request->print(&Apache::lonhtmlcommon::scripttag(< 1) {
@@ -512,7 +515,6 @@ sub commonJSfunctions {
return selectOne.value;
}
}
-
COMMONJSFUNCTIONS
}
@@ -667,13 +669,13 @@ sub student_gradeStatus {
sub jscriptNform {
my ($symb) = @_;
my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
- my $jscript=''."\n";
+ "\n");
$jscript.= ''."\n";
+ ''."\n";
if ($ctr == 0) {
my $num_students=(scalar(keys(%$fullname)));
if ($num_students eq 0) {
@@ -1140,7 +1148,7 @@ LISTJAVASCRIPT
sub check_script {
my ($form, $type)=@_;
- my $chkallscript=''."\n";
+'."\n");
return $chkallscript;
}
@@ -1210,8 +1218,7 @@ sub processGroup {
sub sub_page_js {
my $request = shift;
my $alertmsg = &mt('A number equal or greater than 0 is expected. Entered value = ');
- $request->print(<
+ $request->print(&Apache::lonhtmlcommon::scripttag(<
SUBJAVASCRIPT
}
@@ -1389,8 +1395,7 @@ sub sub_page_kw_js {
my $iconpath = $request->dir_config('lonIconsURL');
&commonJSfunctions($request);
- my $inner_js_msg_central=<
+ my $inner_js_msg_central= &Apache::lonhtmlcommon::scripttag(<
INNERJS
- my $inner_js_highlight_central=<
+ my $inner_js_highlight_central= &Apache::lonhtmlcommon::scripttag(<
INNERJS
my $start_page_msg_central =
@@ -1466,8 +1468,7 @@ INNERJS
my $docopen=&Apache::lonhtmlcommon::javascript_docopen();
$docopen=~s/^document\.//;
my $alertmsg = &mt('Please select a word or group of words from document and then click this link.');
- $request->print(<
+ $request->print(&Apache::lonhtmlcommon::scripttag(<");
pDoc.write("<\\/td><\\/tr><\\/table> ");
- pDoc.write(" ");
- pDoc.write("
'.&mt('Grade Status').': '.
''.
''.
@@ -3381,7 +3421,7 @@ sub viewgrades {
$result.=&Apache::loncommon::end_data_table()."\n".
'';
$result.='';
+ 'onclick="javascript:resetEntry('.$ctsparts.');" />';
#table listing all the students in a section/class
#header of table
@@ -3445,7 +3485,7 @@ sub viewgrades {
$result.=&Apache::loncommon::end_data_table();
$result.=''."\n";
$result.=''."\n";
+ 'onclick="javascript:submit();" target="_self" />'."\n";
if (scalar(%$fullname) eq 0) {
my $colspan=3+scalar(@parts);
my $section_display = join (", ",&Apache::loncommon::get_env_multiple('form.section'));
@@ -3497,7 +3537,7 @@ sub viewstudentgrade {
'GD_'.$student.'_'.$part.'_awarded_s" value="'.$pts.'" />'."\n";
$result.='
'."\n";
} elsif ($type eq 'solved') {
my ($status,$foo)=split(/_/,$score,2);
@@ -3506,7 +3546,7 @@ sub viewstudentgrade {
$part.'_solved_s" value="'.$status.'" />'."\n";
$result.=' '."\n";
+ 'onchange="javascript:changeOneScore(\''.$part.'\',\''.$student.'\')" >'."\n";
$result.= (($status eq 'excused') ? ''
: '')."\n";
$result.='';
@@ -3544,6 +3584,7 @@ sub editgrades {
'incorrect'=>'incorrect_by_override',
'excused' =>'excused',
'ungraded' =>'ungraded_attempted',
+ 'credited' =>'credit_attempted',
'nothing' => '',
);
my ($classlist,undef,$fullname) = &getclasslist($env{'form.section'},'0');
@@ -3866,7 +3907,7 @@ $result
Total number of records found in file: $distotal
Enter as many fields as you can. The system will inform you and bring you back
to this page if the data selected is insufficient to run your class.
-
+
@@ -3880,10 +3921,8 @@ to this page if the data selected is ins
-
ENDPICK
+ $request->print(&Apache::lonhtmlcommon::scripttag($javascript));
return '';
}
@@ -3921,15 +3960,14 @@ sub csvuploadmap_footer {
-
+
ENDPICK
}
sub checkforfile_js {
my $alertmsg = &mt('Please use the browse button to select a file from your local directory.');
- my $result =<
+ my $result = &Apache::lonhtmlcommon::scripttag(<
CSVFORMJS
return $result;
}
@@ -3966,7 +4003,7 @@ sub upcsvScores_form {
$upfile_select
-
+
ENDUPFORM
@@ -4211,8 +4248,7 @@ sub pickStudentPage {
my ($request) = shift;
my $alertmsg = &mt('Please select the student you wish to grade.');
- $request->print(<
+ $request->print(&Apache::lonhtmlcommon::scripttag(<
LISTJAVASCRIPT
&commonJSfunctions($request);
my ($symb) = &get_symb($request);
@@ -4289,7 +4324,7 @@ LISTJAVASCRIPT
$result.=' '.&mt('Use CODE').': '."\n";
$result.=' '."\n";
+ 'onclick="javascript:checkPickOne(this.form);" value="'.&mt('Next').' →" /> '."\n";
$request->print($result);
@@ -4328,7 +4363,7 @@ LISTJAVASCRIPT
}
$studentTable.=&Apache::loncommon::end_data_table()."\n";
$studentTable.=''."\n";
+ 'onclick="javascript:checkPickOne(this.form);" value="'.&mt('Next').' →" />'."\n";
$studentTable.=&show_grading_menu_form($symb);
$request->print($studentTable);
@@ -4435,7 +4470,9 @@ sub displayPage {
my $checkIcon = '';
- $studentTable.=' '.&mt('Note: Problems graded correct by the computer are marked with a [_1] symbol.',$checkIcon)."\n".
+ $studentTable.=' '.
+ &mt('Problems graded correct by the computer are marked with a [_1] symbol.',$checkIcon).
+ ''."\n".
&Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row().
'