Permalink
Browse files

question class in html now indicates if it is traditional multchoice,…

… truefalse, or select all that apply, and template uses this info to style choices differently
  • Loading branch information...
1 parent 6ff46b0 commit a8e1b8b0a62f3686813d9309be620c237ea7f404 @armandofox armandofox committed Jan 30, 2012
Showing with 13 additions and 3 deletions.
  1. +7 −2 html_template/template.html.erb
  2. +6 −1 lib/html5_renderer.rb
@@ -7,7 +7,8 @@
h1 { text-align: center; }
ol.questions { list-style-type: number; }
li.question { border-bottom: 1px solid grey; padding-bottom: 2ex; }
- ol.answers { list-style-type: lower-alpha; }
+ li ol.answers { list-style-type: lower-alpha; }
+ li.multiple ol.answers { list-style-type: circle; }
.instructions { clear: both; border: 1px solid black; align: center; padding: 2ex; margin: 2ex; }
</style>
</head>
@@ -20,10 +21,14 @@
<div class="instructions">
<ul>
<li>No books, notes, or electronic devices allowed. </li>
+ <li>Time limit is 30 minutes.</li>
<li><%= num_questions %> questions, all worth the same unless
otherwise noted.
<%= total_points %> points total.</li>
- <li>Time limit is 30 minutes.</li>
+ <li>For 'select all that apply' questions that have N choices,
+ you get 1/N of the points for each RIGHT answer that you check, plus
+ 1/N of the points for each WRONG answer that you correctly
+ leave unchecked.</li>
</ul>
<b>Good skill!</b>
</div>
View
@@ -83,7 +83,12 @@ def render_answer_for_solutions(answer,raw)
end
def render_question_text(question,index)
- @h.li :class => 'question', :id => "question-#{index}" do
+ html_args = {
+ :id => "question-#{index}",
+ :class => ['question', question.class.to_s.downcase, (question.multiple ? 'multiple' : '')]
+ .join(' ')
+ }
+ @h.li html_args do
@h.div :class => 'text' do
if question.raw?
@h.p { |p| p << question.question_text }

0 comments on commit a8e1b8b

Please sign in to comment.