Browse files

Merge branch 'report_card_summary'

  • Loading branch information...
2 parents 631ec8a + 6b43f48 commit f39a99300e9c6e2d1827338dc1bd8f069f2b0693 @rnhurt committed Feb 21, 2010
View
15 app/controllers/evaluations_controller.rb
@@ -10,28 +10,31 @@ def show
format.js {
# OPTIMIZE: Could this be moved to individual *.js.erb files??
case params[:tab]
- when "assignments"
+ when 'assignments'
@assignments = Assignment.paginate_by_course_term_id(@course_term,
:per_page => 6,
:page => params[:page],
:order => "due_date DESC, created_at ASC",
:include => :assignment_evaluations)
@scalerange = ScaleRange.find_all_by_grading_scale_id(@course_term.course.grading_scale_id)
- render :partial => "assignments"
+ render :partial => 'assignments'
- when "skills"
+ when 'skills'
@ctskills = @course_term.course_term_skills.paginate(
:per_page => 5,
:page => params[:page],
:include => [:supporting_skill, :supporting_skill_evaluations])
- render :partial => "skills"
+ render :partial => 'skills'
- when"comments"
+ when 'comments'
@quick_comments = Comment.quick.active
- render :partial => "comments"
+ render :partial => 'comments'
+
+ when 'summary'
+ render :partial => 'summary'
else
end
}
View
1 app/views/evaluations/_form_control.js
@@ -10,6 +10,7 @@ window.processPage = function(mode) {
} else if (mode == 'comments'){
controlKeyboard('comments_grid');
restrictSubmit('comments_grid');
+ } else if (mode == 'summary'){
} else { alert("WARNING - mode not defined: " + mode); }
$('loading').hide();
View
38 app/views/evaluations/_summary.html.erb
@@ -0,0 +1,38 @@
+<table class="simple box">
+
+ <% @course_term.students.each do |student| %>
+ <% grade = @course_term.calculate_grade(student) %>
+ <thead>
+ <tr>
+ <td>
+ <%= h "#{grade[:letter]} (#{grade[:score].round}%) - #{student.full_name}" %>
+ </td>
+ <td></td><td></td>
+ </tr>
+ </thead>
+ <tr>
+ <td colspan="3">
+ "<%= h @course_term.comments(student) %>"
+ </td>
+ </tr>
+
+
+ <% @course_term.course_term_skills.in_groups_of(3, "blah") do |row_ctskills| %>
+ <tr>
+ <% for ctskill in row_ctskills %>
+ <% score = ctskill.score(student) %>
+ <td>
+ <%= score.empty? ? "&nbsp;&nbsp;" : score %>
+ <%= h " \"#{ctskill.supporting_skill.description}\"" %>
+ </td>
+ <% end %>
+ </tr>
+ <% end %>
+
+ <tr class="spacer"><td colspan="3">&nbsp;</td></tr>
+ <% end %>
+
+</table>
+
+
+<%= javascript_tag "this.processPage('summary');" %>
View
12 app/views/evaluations/show.html.erb
@@ -6,11 +6,13 @@
<li class="tab"><a href="#assignments">Assignments</a></li>
<li class="tab"><a href="#skills">Supporting Skills</a></li>
<li class="tab"><a href="#comments">Comments</a></li>
+ <li class="tab"><a href="#summary">Summary</a></li>
</ul>
<div id="assignments"></div>
<div id="skills"></div>
<div id="comments"></div>
+<div id="summary"></div>
<%= link_to_remote '', { :update => "assignments",
:method => "get",
@@ -33,6 +35,12 @@
:url => { :tab => "comments", :controller => "evaluations", :action => "show", :id => @course_term.id } },
:id => 'tab_comments' -%>
+<%= link_to_remote '', { :update => "summary",
+ :method => "get",
+ :loading => "show_message('summary')",
+ :url => { :tab => "summary", :controller => "evaluations", :action => "show", :id => @course_term.id } },
+ :id => 'tab_summary' -%>
+
<div id="loading" class="box" style="display:none;text-align:center;">
<span id="loading_message">Loading data ...</span><br />
<img alt="" src="/images/ajax-loader.gif"/>
@@ -43,10 +51,10 @@
// Build the graphical tabs
new Control.Tabs("evaluations", {
afterChange: function(container){
- if (container.empty()) {$('tab_' + container.id).onclick();}}
+ // Only load empty tabs; always refresh the 'summary' tab
+ if (container.empty() || container.id == 'summary') {$('tab_' + container.id).onclick();}}
});
-
// Center the "loading" animation
element = $('loading');
var offsets = document.viewport.getScrollOffsets();
View
4 public/stylesheets/local.css
@@ -93,6 +93,10 @@ tr.help:hover td{background-color: #009900;}
.paginate {text-align: center;}
div.fixed-table { max-height:500px; overflow:auto; }
+table.simple thead {background-color: #C3D9FF; font-weight: bold;}
+
+
+
/*** Forms ***/
.spacer {padding-left:80px; color:#555555; padding-top: 20px;}
fieldset {border:none; margin:0px; padding:0px;}

0 comments on commit f39a993

Please sign in to comment.