Skip to content

Commit

Permalink
Merge pull request #467 from edx/dcs/instructor-dashboard
Browse files Browse the repository at this point in the history
Added review dashboard launcher for instructor dashboard.
  • Loading branch information
davestgermain committed Nov 29, 2018
2 parents a54f0c6 + e91785f commit ddd2a0d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 4 deletions.
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 6 additions & 3 deletions edx_proctoring/backends/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
Original file line number Diff line number Diff line change
@@ -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, $, _);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="wrapper-content wrapper">
<iframe src="<%= dashboardURL %>" frameborder=0 height=1280 style="width:100%">
</div>

0 comments on commit ddd2a0d

Please sign in to comment.