From baba8d3a369be6ccfd4968f539cc642d27c1906e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 7 Feb 2013 12:42:05 -0500 Subject: [PATCH] Add collapse action into staff grading view --- .../src/peergrading/peer_grading_problem.coffee | 3 +-- .../coffee/src/staff_grading/staff_grading.coffee | 15 ++++++++++++++- lms/templates/instructor/staff_grading.html | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index 69bd99d54a..d0dce5343f 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -181,7 +181,6 @@ class @PeerGradingProblem @grading_message = $('.grading-message') @grading_message.hide() @question_header = $('.question-header') - @question_header @question_header.click @collapse_question @grading_wrapper =$('.grading-wrapper') @@ -445,4 +444,4 @@ class @PeerGradingProblem new_text = "(Show)" else new_text = "(Hide)" - @question_header.text(new_text) + @question_header.text(new_text) diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index 117388bab0..d3102a38c5 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -180,6 +180,9 @@ class @StaffGrading @ml_error_info_container = $('.ml-error-info-container') @breadcrumbs = $('.breadcrumbs') + + @question_header = $('.question-header') + @question_header.click @collapse_question # model state @state = state_no_data @@ -428,7 +431,17 @@ class @StaffGrading @get_next_submission(@location) else @error('System got into invalid state for submission: ' + @state) - + + collapse_question: () => + @prompt_container.slideToggle() + @prompt_container.toggleClass('open') + if @question_header.text() == "(Hide)" + new_text = "(Show)" + else + new_text = "(Hide)" + @question_header.text(new_text) + + # for now, just create an instance and load it... mock_backend = false diff --git a/lms/templates/instructor/staff_grading.html b/lms/templates/instructor/staff_grading.html index dcfece34b8..21af70756a 100644 --- a/lms/templates/instructor/staff_grading.html +++ b/lms/templates/instructor/staff_grading.html @@ -50,7 +50,7 @@
-

Question

+

Question (Hide)