Guest User

Untitled

a guest
Jun 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. Index: app/models/asset.rb
  2. ===================================================================
  3. --- app/models/asset.rb (revision 19604)
  4. +++ app/models/asset.rb (working copy)
  5. @@ -27,6 +27,7 @@
  6. left join person_asset_notes teacher_note on teacher_note.person_id = '#{da_user.id}' and teacher_note.asset_id = visible_assets.id and teacher_note.note_type = 'teacher'
  7. left join person_asset_notes pupil_note on pupil_note.person_id = '#{da_user.id}' and pupil_note.asset_id = visible_assets.id and pupil_note.note_type = 'pupil'
  8. left join (select asset_id, products.upn, start_year, end_year from assets_products, products, rr_books where product_id = products.id and products.upn = rr_books.upn) rr_books on visible_assets.id = rr_books.asset_id
  9. + left join (select id as assignment_id, asset_id, person_id, closed from asset_assignments) aa on aa.asset_id = visible_assets.id and aa.person_id = '#{da_user.id}' and not aa.closed
  10. ",
  11. :conditions => "search.asset_id = visible_assets.id",
  12. :order => "search_score desc, title"
  13. @@ -473,6 +474,10 @@
  14. !! self.taxa.first(:conditions => ["tag ~ ?", "^mgm\.resource_type\.[^.]{2}\.video$"])
  15. end
  16.  
  17. + def rr_writing_task?
  18. + kind == "read and respond" && sub_kind = "writing_task"
  19. + end
  20. +
  21. def best_sized_deriv(total_size)
  22. # this expects a parameter which is the total size of the image, so :px140
  23. # would be 140*140, using this we can work out the nearest deriv to said size
  24. Index: app/controllers/assessment_tool/assignment_results_controller.rb
  25. ===================================================================
  26. --- app/controllers/assessment_tool/assignment_results_controller.rb (revision 19604)
  27. +++ app/controllers/assessment_tool/assignment_results_controller.rb (working copy)
  28. @@ -67,7 +67,10 @@
  29. end
  30. @assignment_result.complete = true
  31. @assignment_result.save!
  32. - @asset_assignment.close! # Auto-close asset assignment once completed
  33. + # Auto-close asset assignment once completed except for writing tasks which need marking
  34. + if ! @asset.rr_writing_task?
  35. + @asset_assignment.close!
  36. + end
  37. render_success "Successfully saved completed result"
  38. end
  39.  
  40. Index: app/controllers/assessment_tool/asset_search_controller.rb
  41. ===================================================================
  42. --- app/controllers/assessment_tool/asset_search_controller.rb (revision 19604)
  43. +++ app/controllers/assessment_tool/asset_search_controller.rb (working copy)
  44. @@ -99,7 +99,9 @@
  45. , case when teacher_note.note_type is null then 'false' else 'true' end as has_teacher_note
  46. , case when pupil_note.note_type is null then 'false' else 'true' end as has_pupil_note
  47. , case when end_year < 3 then 1 else 2 end as rr_key_stage
  48. + , assignment_id
  49. ")
  50. +
  51. end
  52.  
  53. end
  54. Index: app/views/assessment_tool/assignment_results/stickers.rxml
  55. ===================================================================
  56. --- app/views/assessment_tool/assignment_results/stickers.rxml (revision 19604)
  57. +++ app/views/assessment_tool/assignment_results/stickers.rxml (working copy)
  58. @@ -9,6 +9,7 @@
  59. xml.max_marks assignment_result.max_marks.to_i
  60. xml.actual_marks assignment_result.actual_marks.to_i
  61. xml.assignment_result_id assignment_result.id
  62. + xml.unmarked assignment_result.asset_assignment.open?
  63. end
  64. end
  65. end
  66. \ No newline at end of file
Add Comment
Please, Sign In to add comment