[LON-CAPA-cvs] cvs: loncom /homework matchresponse.pm radiobuttonresponse.pm rankresponse.pm /interface loncommon.pm
damieng
damieng at source.lon-capa.org
Fri Jan 22 17:42:51 EST 2016
damieng Fri Jan 22 22:42:51 2016 EDT
Modified files:
/loncom/interface loncommon.pm
/loncom/homework matchresponse.pm radiobuttonresponse.pm
rankresponse.pm
Log:
using a div and CSS instead of br to better control spaces around foils, especially when a div or p is used before the response
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1230 loncom/interface/loncommon.pm:1.1231
--- loncom/interface/loncommon.pm:1.1230 Tue Dec 22 20:39:18 2015
+++ loncom/interface/loncommon.pm Fri Jan 22 22:42:47 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1230 2015/12/22 20:39:18 damieng Exp $
+# $Id: loncommon.pm,v 1.1231 2016/01/22 22:42:47 damieng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -7648,6 +7648,16 @@
}
/*
+ styles used for response display
+*/
+div.LC_radiofoil, div.LC_rankfoil {
+ margin: .5em 0em .5em 0em;
+}
+table.LC_itemgroup {
+ margin-top: 1em;
+}
+
+/*
styles used by TTH when "Default set of options to pass to tth/m
when converting TeX" in course settings has been set
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.92 loncom/homework/matchresponse.pm:1.93
--- loncom/homework/matchresponse.pm:1.92 Mon Jan 19 15:35:53 2015
+++ loncom/homework/matchresponse.pm Fri Jan 22 22:42:51 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Full matching style response
#
-# $Id: matchresponse.pm,v 1.92 2015/01/19 15:35:53 goltermann Exp $
+# $Id: matchresponse.pm,v 1.93 2016/01/22 22:42:51 damieng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -171,7 +171,7 @@
}
if ($target eq 'web') {
- my $table='<br /><table>'; # extra space to match what latex does.
+ my $table='<table class="LC_itemgroup">'; # extra space to match what latex does.
if ((!$columns) || ($columns < 0)) {
if ($direction eq 'horizontal') {
if (@names > 0) {
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.159 loncom/homework/radiobuttonresponse.pm:1.160
--- loncom/homework/radiobuttonresponse.pm:1.159 Tue Apr 7 15:08:12 2015
+++ loncom/homework/radiobuttonresponse.pm Fri Jan 22 22:42:51 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# mutliple choice style responses
#
-# $Id: radiobuttonresponse.pm,v 1.159 2015/04/07 15:08:12 raeburn Exp $
+# $Id: radiobuttonresponse.pm,v 1.160 2016/01/22 22:42:51 damieng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -592,7 +592,7 @@
if ($direction eq 'horizontal') {
return ('<table><tr>', '</tr></table>', '<td>', '</td>');
} else {
- return ('', '<br />', '<br />', '');
+ return ('', '', '<div class="LC_radiofoil">', '</div>');
}
}
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.72 loncom/homework/rankresponse.pm:1.73
--- loncom/homework/rankresponse.pm:1.72 Mon Jan 19 15:35:53 2015
+++ loncom/homework/rankresponse.pm Fri Jan 22 22:42:51 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# rank style response
#
-# $Id: rankresponse.pm,v 1.72 2015/01/19 15:35:53 goltermann Exp $
+# $Id: rankresponse.pm,v 1.73 2016/01/22 22:42:51 damieng Exp $
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -362,7 +362,7 @@
my $text=$Apache::response::foilgroup{$name.'.text'};
my $value=shift(@correctorder);
if ($target eq 'web') {
- $result.='<br /><b>'.$value.':</b> '.$text;
+ $result.='<div class="LC_rankfoil"><b>'.$value.':</b> '.$text.'</div>';
} else {
$result.=' \strut\\\\\strut '.$value.':'.$text;
}
@@ -444,15 +444,17 @@
}
my $text=$Apache::response::foilgroup{$name.'.text'};
if ($target ne 'tex') {
+ $result .= '<div class="LC_rankfoil">';
if ($Apache::lonhomework::type ne 'exam') {
- $result.='<br />'.$optionlist.$text."\n";
+ $result.=$optionlist.$text."\n";
} else {
- $result.='<br />'.$text."\n";
+ $result.=$text."\n";
}
if ($Apache::lonhomework::type eq 'exam') {
my @values=(1..scalar(@whichopt));
$result.=&Apache::optionresponse::webbubbles(\@values,\@whichopt,$temp,$lastopt);
}
+ $result .= '</div>';
} else {
if ($Apache::lonhomework::type eq 'exam') {
my $itemlabel;
More information about the LON-CAPA-cvs
mailing list