[LON-CAPA-cvs] cvs: loncom /interface/statistics lonstathelpers.pm

raeburn raeburn at source.lon-capa.org
Sun Sep 6 22:25:32 EDT 2020


raeburn		Mon Sep  7 02:25:32 2020 EDT

  Modified files:              
    /loncom/interface/statistics	lonstathelpers.pm 
  Log:
  - problem selector for grading
    - use rowspan for multiple responseIDs for each part in multipart problems,
      and add missing <tr> start tags.
  
  
Index: loncom/interface/statistics/lonstathelpers.pm
diff -u loncom/interface/statistics/lonstathelpers.pm:1.77 loncom/interface/statistics/lonstathelpers.pm:1.78
--- loncom/interface/statistics/lonstathelpers.pm:1.77	Mon Aug 31 14:36:19 2020
+++ loncom/interface/statistics/lonstathelpers.pm	Mon Sep  7 02:25:32 2020
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstathelpers.pm,v 1.77 2020/08/31 14:36:19 raeburn Exp $
+# $Id: lonstathelpers.pm,v 1.78 2020/09/07 02:25:32 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -188,7 +188,7 @@
                     $rowspan = ' rowspan="'.$totalresps.'"';
                 }
                 $seq_str .= &Apache::loncommon::start_data_table_row().
-                            '<td'.$rowspan.' style="vertical-align:middle">'.
+                            '<td'.$rowspan.' style="vertical-align:top">'.
                             '<label><input type="radio" name="symb" value="'.$value.'"'.$checked.' />'.
                             $title.'</label>';
                 my $link = $res->link.'?symb='.&escape($res->shown_symb);
@@ -210,7 +210,9 @@
                     my $resptype = $response_types[$i];
                     if ($resptype =~ m/$AcceptedResponseTypes/) {
                         if ($byres) {
-                            unless (exists($partsseen{$part})) {
+                            if (exists($partsseen{$part})) {
+                                $seq_str .= &Apache::loncommon::continue_data_table_row();
+                            } else {
                                 my $parttitle = $part;
                                 if ($part eq '0') {
                                     $parttitle = '';
@@ -222,7 +224,11 @@
                                     $seq_str .= &Apache::loncommon::continue_data_table_row();
                                 }
                                 unless ($partsseen{$part}) {
-                                    $seq_str .= '<td rowspan="'.scalar(@response_ids).'" style="vertical-align:middle">'.
+                                    my $resprowspan;
+                                    if (scalar(@response_ids) > 1) {
+                                        $resprowspan = ' rowspan="'.scalar(@response_ids).'"';
+                                    }
+                                    $seq_str .= '<td'.$resprowspan.' style="vertical-align:top">'.
                                                 $parttitle.'</td>';
                                     $partsseen{$part} = scalar(@response_ids);
                                 }




More information about the LON-CAPA-cvs mailing list