Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cms/templates/widgets/source-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,16 @@ <h2>High Level Source Editing</h2>
if (xml.length == 0) {
alert('Conversion failed! error:' + data.message);
} else {
el.closest('.component').find('.CodeMirror-wrap')[0].CodeMirror.setValue(xml);
// If a parent CodeMirror editor is open (LaTeX problem being edited), set the text
// there. Otherwise, set the text in the active TinyMCE Editor for the case
// of an HTML component being edited.
var parentCodemirrorEditor = el.closest('.component').find('.CodeMirror-wrap');
if (parentCodemirrorEditor.length > 0) {
parentCodemirrorEditor[0].CodeMirror.setValue(xml);
}
else if (window.tinyMCE !== undefined && window.tinyMCE.activeEditor !== undefined) {
window.tinyMCE.activeEditor.setContent(xml);
}
save_hls(el);
}
},
Expand Down
6 changes: 3 additions & 3 deletions common/lib/xmodule/xmodule/capa_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,15 +885,15 @@ def check_problem(self, data):
event_info['failure'] = 'closed'
self.runtime.track_function('problem_check_fail', event_info)
if dog_stats_api:
dog_stats_api.increment(metric_name('checks'), [u'result:failed', u'failure:closed'])
dog_stats_api.increment(metric_name('checks'), tags=[u'result:failed', u'failure:closed'])
raise NotFoundError(_("Problem is closed."))

# Problem submitted. Student should reset before checking again
if self.done and self.rerandomize == "always":
event_info['failure'] = 'unreset'
self.runtime.track_function('problem_check_fail', event_info)
if dog_stats_api:
dog_stats_api.increment(metric_name('checks'), [u'result:failed', u'failure:unreset'])
dog_stats_api.increment(metric_name('checks'), tags=[u'result:failed', u'failure:unreset'])
raise NotFoundError(_("Problem must be reset before it can be checked again."))

# Problem queued. Students must wait a specified waittime before they are allowed to submit
Expand Down Expand Up @@ -962,7 +962,7 @@ def check_problem(self, data):
self.runtime.track_function('problem_check', event_info)

if dog_stats_api:
dog_stats_api.increment(metric_name('checks'), [u'result:success'])
dog_stats_api.increment(metric_name('checks'), tags=[u'result:success'])
dog_stats_api.histogram(
metric_name('correct_pct'),
float(published_grade['grade']) / published_grade['max_grade'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,15 @@ def _try_with_login(self, operation):
if (resp_json
and resp_json.get('success') is False
and resp_json.get('error') == 'login_required'):
# apparrently we aren't logged in. Try to fix that.
# apparently we aren't logged in. Try to fix that.
r = self._login()
if r and not r.get('success'):
log.warning("Couldn't log into staff_grading backend. Response: %s",
log.warning("Couldn't log into ORA backend. Response: %s",
r)
# try again
# try again
response = operation()
response.raise_for_status()
resp_json = response.json()

return resp_json

Expand Down
Loading