diff --git a/edx_proctoring/__init__.py b/edx_proctoring/__init__.py index 8f682e4b1cc..4447fb67292 100644 --- a/edx_proctoring/__init__.py +++ b/edx_proctoring/__init__.py @@ -4,6 +4,6 @@ from __future__ import absolute_import -__version__ = '1.5.0b1' +__version__ = '1.5.0b2' default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name diff --git a/edx_proctoring/backends/rest.py b/edx_proctoring/backends/rest.py index 779f5c72ad6..1d54153ca78 100644 --- a/edx_proctoring/backends/rest.py +++ b/edx_proctoring/backends/rest.py @@ -167,12 +167,15 @@ def on_exam_saved(self, exam): url = self.exam_url.format(exam_id=external_id) else: url = self.create_exam_url - log.debug('Saving exam to %r', url) + log.info('Saving exam to %r', url) + response = None try: response = self.session.post(url, json=exam) data = response.json() - except Exception: # pylint: disable=broad-except - log.exception('saving exam. %r', response.content) + except Exception as exc: # pylint: disable=broad-except + # pylint: disable=no-member + content = exc.response.content if hasattr(exc, 'response') else response.content + log.exception('failed to save exam. %r', content) data = {} return data.get('id') diff --git a/edx_proctoring/static/proctoring/js/views/proctored_exam_instructor_launch.js b/edx_proctoring/static/proctoring/js/views/proctored_exam_instructor_launch.js new file mode 100644 index 00000000000..3faa7d5eae1 --- /dev/null +++ b/edx_proctoring/static/proctoring/js/views/proctored_exam_instructor_launch.js @@ -0,0 +1,43 @@ +var edx = edx || {}; + +(function (Backbone, $, _) { + 'use strict'; + + edx.instructor_dashboard = edx.instructor_dashboard || {}; + edx.instructor_dashboard.proctoring = edx.instructor_dashboard.proctoring || {}; + edx.instructor_dashboard.proctoring.ProctoredExamDashboardView = Backbone.View.extend({ + initialize: function (options) { + this.setElement($('.student-review-dashboard-container')); + this.tempate_url = '/static/proctoring/templates/dashboard.underscore'; + this.iframeHTML = null; + this.doRender = true; + this.context = { + dashboardURL: '/api/edx_proctoring/v1/instructor/' + this.$el.data('course-id') + }; + var self = this; + + $('#proctoring-accordion').on('accordionactivate', function(event, ui) { + self.render(ui); + }); + /* Load the static template for rendering. */ + this.loadTemplateData(); + }, + loadTemplateData: function () { + var self = this; + $.ajax({url: self.tempate_url, dataType: "html"}) + .error(function (jqXHR, textStatus, errorThrown) { + + }) + .done(function (template_html) { + self.iframeHTML = _.template(template_html)(self.context); + }); + }, + render: function (ui) { + if (ui.newPanel.eq(this.$el) && this.doRender && this.iframeHTML) { + this.$el.html(this.iframeHTML); + this.doRender = false; + } + }, + }); + this.edx.instructor_dashboard.proctoring.ProctoredExamDashboardView = edx.instructor_dashboard.proctoring.ProctoredExamDashboardView; +}).call(this, Backbone, $, _); diff --git a/edx_proctoring/static/proctoring/templates/dashboard.underscore b/edx_proctoring/static/proctoring/templates/dashboard.underscore new file mode 100644 index 00000000000..8c9b65e3198 --- /dev/null +++ b/edx_proctoring/static/proctoring/templates/dashboard.underscore @@ -0,0 +1,3 @@ +
+