Address code review feedback
- make category a data field of an input - namespace event types - don't try to use the track function when it doesn't exist - generate event types if it doesn't match a pre-existing pattern
This commit is contained in:
@@ -8,7 +8,7 @@ class @Rubric
|
||||
@tracking_callback: (event) ->
|
||||
target_selection = $(event.target).val()
|
||||
# chop off the beginning of the name so that we can get the number of the category
|
||||
category = $(event.target).prop("name").substring(16)
|
||||
category = $(event.target).data("category")
|
||||
location = $('.rubric').data('location')
|
||||
# probably want the original problem location as well
|
||||
|
||||
@@ -459,7 +459,9 @@ class @CombinedOpenEnded
|
||||
@prompt_container.toggleClass('open')
|
||||
if @question_header.text() == "(Hide)"
|
||||
new_text = "(Show)"
|
||||
Logger.log 'oe_hide_question', {location: @location}
|
||||
else
|
||||
Logger.log 'oe_show_question', {location: @location}
|
||||
new_text = "(Hide)"
|
||||
@question_header.text(new_text)
|
||||
|
||||
@@ -478,10 +480,13 @@ class @CombinedOpenEnded
|
||||
log_feedback_click: (event) ->
|
||||
link_text = $(event.target).html()
|
||||
if link_text == 'See full feedback'
|
||||
Logger.log 'show_full_feedback', {}
|
||||
Logger.log 'oe_show_full_feedback', {}
|
||||
else if link_text == 'Respond to Feedback'
|
||||
Logger.log 'show_respond_to_feedback', {}
|
||||
Logger.log 'oe_show_respond_to_feedback', {}
|
||||
else
|
||||
generated_event_type = link_text.toLowerCase().replace(" ","_")
|
||||
Logger.log "oe_" + generated_event_type, {}
|
||||
|
||||
log_feedback_selection: (event) ->
|
||||
target_selection = $(event.target).val()
|
||||
Logger.log 'feedback_response_selected', {value: target_selection}
|
||||
Logger.log 'oe_feedback_response_selected', {value: target_selection}
|
||||
|
||||
@@ -471,9 +471,9 @@ class @PeerGradingProblem
|
||||
@prompt_container.slideToggle()
|
||||
@prompt_container.toggleClass('open')
|
||||
if @question_header.text() == "(Hide)"
|
||||
Logger.log 'hide_question', {location: @location}
|
||||
Logger.log 'peer_grading_hide_question', {location: @location}
|
||||
new_text = "(Show)"
|
||||
else
|
||||
Logger.log 'show_question', {location: @location}
|
||||
Logger.log 'peer_grading_show_question', {location: @location}
|
||||
new_text = "(Hide)"
|
||||
@question_header.text(new_text)
|
||||
|
||||
@@ -341,7 +341,10 @@ class OpenEndedChild(object):
|
||||
if get_data['can_upload_files'] in ['true', '1']:
|
||||
has_file_to_upload = True
|
||||
file = get_data['student_file'][0]
|
||||
self.system.track_function('open_ended_image_upload', {'filename': file.name})
|
||||
if self.system.track_fuction:
|
||||
self.system.track_function('open_ended_image_upload', {'filename': file.name})
|
||||
else:
|
||||
log.info("No tracking function found when uploading image.")
|
||||
uploaded_to_s3, image_ok, s3_public_url = self.upload_image_to_s3(file)
|
||||
if uploaded_to_s3:
|
||||
image_tag = self.generate_image_tag_from_url(s3_public_url, file.name)
|
||||
|
||||
@@ -443,10 +443,10 @@ class @StaffGrading
|
||||
@prompt_container.slideToggle()
|
||||
@prompt_container.toggleClass('open')
|
||||
if @question_header.text() == "(Hide)"
|
||||
Logger.log 'hide_question', {location: @location}
|
||||
Logger.log 'staff_grading_hide_question', {location: @location}
|
||||
new_text = "(Show)"
|
||||
else
|
||||
Logger.log 'show_question', {location: @location}
|
||||
Logger.log 'staff_grading_show_question', {location: @location}
|
||||
new_text = "(Hide)"
|
||||
@question_header.text(new_text)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<li class="rubric-list-item">
|
||||
% endif
|
||||
<label class="rubric-label" for="score-${i}-${j}">
|
||||
<input type="radio" class="score-selection" name="score-selection-${i}" id="score-${i}-${j}" value="${option['points']}"/>
|
||||
<input type="radio" class="score-selection" data-category="${i}" name="score-selection-${i}" id="score-${i}-${j}" value="${option['points']}"/>
|
||||
<span class="wrappable"> ${option['points']} points : ${option['text']}</span>
|
||||
</label>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user