--- loncom/homework/grades.pm 2010/04/25 13:18:32 1.631 +++ loncom/homework/grades.pm 2010/04/27 00:06:34 1.632 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.631 2010/04/25 13:18:32 www Exp $ +# $Id: grades.pm,v 1.632 2010/04/27 00:06:34 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -820,9 +820,7 @@ sub listStudents { $submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'}; } - my $result='

 ' - .&mt("View/Grade/Regrade Submissions for a Student or a Group of Students") - .'

'; + my $result=''; my $res_error; my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error); @@ -1913,7 +1911,6 @@ sub submission { if ($counter == 0) { &sub_page_js($request); &sub_page_kw_js($request); - $request->print('

 '.&mt('Submission Record').'

'); # option to display problem, only once else it cause problems # with the form later since the problem has a form. @@ -2693,9 +2690,7 @@ sub processHandGrade { $ctr++; } if ($total < 0) { - my $the_end = '

'.&mt('LON-CAPA User Message').'


'."\n"; - $the_end.=&mt('Message: No more students for this section or class.').'

'."\n"; - $the_end.=&mt('Click on the button below to return to the grading menu.').'

'."\n"; + my $the_end.=&mt('Message: No more students for this section or class.').'

'."\n"; $request->print($the_end); } return ''; @@ -3824,18 +3819,14 @@ sub csvuploadmap_header { $javascript=&csvupload_javascript_forward_associate(); } - my $result=''; $symb = &Apache::lonenc::check_encrypt($symb); + $request->print('
'. + &mt('Total number of records found in file: [_1]',$distotal).'
'. + &mt('Associate entries from the uploaded file with as many fields as you can.')); + my $reverse=&mt("Reverse Association"); $request->print(< -

Uploading Class Grades

-$result -
-

Identify fields

-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.
- +
+ @@ -3908,11 +3899,11 @@ sub upcsvScores_form { my ($request,$symb) = @_; if (!$symb) {return '';} my $result=&checkforfile_js(); - $result.='
'."\n"; - $result.=''."\n"; - $result.=''. + &Apache::loncommon::end_data_table_header_row(). + &Apache::loncommon::start_data_table_row().'
'."\n"; - $result.=' '.&mt('Specify a file containing the class scores for current resource.'). - '
'."\n"; + $result.=&Apache::loncommon::start_data_table(). + &Apache::loncommon::start_data_table_header_row(). + ''.&mt('Specify a file containing the class scores for current resource.').''; my $upload=&mt("Upload Scores"); my $upfile_select=&Apache::loncommon::upfile_select_html(); my $ignore=&mt('Ignore First Line'); @@ -3926,9 +3917,10 @@ $upfile_select ENDUPFORM $result.=&Apache::loncommon::help_open_topic("Course_Convert_To_CSV", - &mt("How do I create a CSV file from a spreadsheet")) - .'
'."\n"; - $result.='


'."\n"; + &mt("How do I create a CSV file from a spreadsheet")). + ''. + &Apache::loncommon::end_data_table_row(). + &Apache::loncommon::end_data_table(); return $result; } @@ -3980,29 +3972,21 @@ sub csvuploadmap { sub csvuploadoptions { my ($request,$symb)= @_; + my $overwrite=&mt('Overwrite any existing score'); $request->print(< -

Uploading Class Grade Options

-

ENDPICK my %fields=&get_fields(); if (!defined($fields{'domain'})) { my $domform = &Apache::loncommon::select_dom_form($env{'request.role.domain'},'default_domain'); - $request->print("\n

Users are in domain: ".$domform."

\n"); + $request->print("\n

".&mt('Users are in domain: [_1]',$domform)."

\n"); } foreach my $key (sort(keys(%env))) { if ($key !~ /^form\.(.*)$/) { next; } @@ -4042,7 +4026,6 @@ sub csvuploadassign { &Apache::loncommon::load_tmp_file($request); my @gradedata = &Apache::loncommon::upfile_record_sep(); my %fields=&get_fields(); - $request->print('

Assigning Grades

'); my $courseid=$env{'request.course.id'}; my ($classlist) = &getclasslist('all',0); my @notallowed; @@ -8501,11 +8484,7 @@ sub submit_options_sequence { $result.='
'."\n". ''."\n"; - $result.=' -

- '.&mt('Grade page/folder for one student').' -

'. - &selectfield(0). + $result.=&selectfield(0). '
@@ -8524,11 +8503,7 @@ sub submit_options_table { $result.=''."\n". ''."\n"; - $result.=' -

- '.&mt('Grading table').' -

'. - &selectfield(0). + $result.=&selectfield(0). '
@@ -8570,10 +8545,7 @@ sub submit_options { $result.=''."\n". ''."\n"; - $result.=' -

- '.&mt('Select individual students to grade').' -

'.&selectfield(1).' + $result.=&selectfield(1).'
@@ -8715,11 +8687,11 @@ sub process_clicker { my ($r,$symb)=@_; if (!$symb) {return '';} my $result=&checkforfile_js(); - $result.='
'."\n"; - $result.=''."\n"; - $result.=''. + &Apache::loncommon::end_data_table_header_row(). + &Apache::loncommon::start_data_table_row()."'.&Apache::loncommon::end_data_table_row(). + &Apache::loncommon::start_data_table_row().''.&Apache::loncommon::end_data_table_row(). + &Apache::loncommon::start_data_table_row().'
'."\n"; - $result.=' '.&mt('Specify a file containing the clicker information for this resource.'). - '
'."\n"; + $result.=&Apache::loncommon::start_data_table(). + &Apache::loncommon::start_data_table_header_row(). + ''.&mt('Specify a file containing clicker information and set grading options.').'\n"; # Attempt to restore parameters from last session, set defaults if not present my %Saveable_Parameters=&clicker_grading_parameters(); &Apache::loncommon::restore_course_settings('grades_clicker', @@ -8736,7 +8708,7 @@ sub process_clicker { } } - my $upload=&mt("Upload File"); + my $upload=&mt("Evaluate File"); my $type=&mt("Type"); my $attendance=&mt("Award points just for participation"); my $personnel=&mt("Correctness determined from response by course personnel"); @@ -8794,7 +8766,10 @@ ENDUPFORM
-
+ENDUPFORM + $result.='
'.(<$attendance

@@ -8802,13 +8777,17 @@ ENDUPFORM
    -
+ENDGRADINGFORM + $result.='
'.(<$pcorrect:

' -ENDUPFORM - $result.='
'."\n". - '


'."\n"; +ENDPERCFORM + $result.=''. + &Apache::loncommon::end_data_table_row(). + &Apache::loncommon::end_data_table(); return $result; } @@ -8888,11 +8867,12 @@ sub process_clicker_file { $result.=&Apache::loncommon::studentbrowser_javascript(); $symb = &Apache::lonenc::check_encrypt($symb); - my $heading=&mt('Scanning clicker file'); - $result.=(<
-'. + &Apache::loncommon::end_data_table_header_row(). + &Apache::loncommon::start_data_table_row().(<
@@ -8940,7 +8920,9 @@ ENDHEADER } elsif ($clicker_ids{$id}) { if ($clicker_ids{$id}=~/\,/) { # More than one user with the same clicker! - $result.="\n
".&mt('Clicker registered more than once').": ".$id."
"; + $result.="".&Apache::loncommon::end_data_table_row(). + &Apache::loncommon::start_data_table_row()."
".&Apache::loncommon::end_data_table_row(). + &Apache::loncommon::start_data_table_row()."
-$heading
+ $result.=&Apache::loncommon::start_data_table(). + &Apache::loncommon::start_data_table_header_row(). + ''.&mt('Evaluate clicker file').'". + &mt('Clicker registered more than once').": ".$id."
"; $result.="\n".''. "
". + &mt('Unregistered Clicker')." ".$id."
"; $result.="\n".''. "\n".&mt("Username").":  ". "\n".&mt("Domain").": ". @@ -8980,8 +8964,9 @@ ENDHEADER } else { $result.='
'; } - $result.='
'."\n". - '


'."\n"; + $result.=''. + &Apache::loncommon::end_data_table_row(). + &Apache::loncommon::end_data_table(); return $result; } @@ -9055,14 +9040,11 @@ sub assign_clicker_grades { # FIXME: This should probably look for the first handgradeable part my $part=$$partlist[0]; # Start screen output - my $result=''; - - my $heading=&mt('Assigning grades based on clicker file'); - $result.=(<
-'. + &Apache::loncommon::end_data_table_header_row(). + &Apache::loncommon::start_data_table_row().'
-$heading
-ENDHEADER + my $result=&Apache::loncommon::start_data_table(). + &Apache::loncommon::start_data_table_header_row(). + ''.&mt('Assigning grades based on clicker file').''; # Get correct result # FIXME: Possibly need delimiter other than ":" my @correct=(); @@ -9097,6 +9079,7 @@ ENDHEADER my $pcorrect=$env{'form.pcorrect'}; my $pincorrect=$env{'form.pincorrect'}; my $storecount=0; + my %users=(); foreach my $key (keys(%env)) { my $user=''; if ($key=~/^form\.student\:(.*)$/) { @@ -9110,7 +9093,13 @@ ENDHEADER $user=$env{'form.multi'.$id}; } } - if ($user) { + if ($user) { + if ($users{$user}) { + $result.='
'. + &mt("More than one entry found for [_1]!",$user). + '
'; + } + $users{$user}=1; my @answer=split(/\,/,$env{$key}); my $sum=0; my $realnumber=$number; @@ -9150,8 +9139,9 @@ ENDHEADER } # We are done $result.='
'.&mt('Successfully stored grades for [quant,_1,student].',$storecount). - '
'."\n". - '


'."\n"; + ''. + &Apache::loncommon::end_data_table_row(). + &Apache::loncommon::end_data_table(); return $result; } @@ -9167,6 +9157,7 @@ sub startpage { unshift(@$crumbs,{href=>&href_symb_cmd($symb,'gradingmenu'),text=>"Grading"}); $r->print(&Apache::loncommon::start_page('Grading',undef, {'bread_crumbs' => $crumbs})); + $r->print('

'.$$crumbs[-1]{'text'}.'

'); unless ($nodisplayflag) { $r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag)); } @@ -9174,7 +9165,7 @@ sub startpage { sub select_problem { my ($r)=@_; - $r->print('

'.&mt('Select the problem or one of the problems you want to grade').'

'); + $r->print('

'.&mt('Select the problem or one of the problems you want to grade').'

'); $r->print(&Apache::lonstathelpers::problem_selector('.',undef,1)); $r->print(''); $r->print('
');