diff --git a/e2xgrader/server_extensions/apps/formgrader/static/js/formgrade_models.js b/e2xgrader/server_extensions/apps/formgrader/static/js/formgrade_models.js index eb394246..4c78958a 100644 --- a/e2xgrader/server_extensions/apps/formgrader/static/js/formgrade_models.js +++ b/e2xgrader/server_extensions/apps/formgrader/static/js/formgrade_models.js @@ -175,6 +175,12 @@ let Comments = Backbone.Collection.extend({ let AnnotationUI = Backbone.View.extend({ initialize: function () { + if (this.$el.length == 0) { + console.log( + "Failed to create AnnotationUI. Cell is not present in the notebook" + ); + return; + } this.$switch = this.$el.find('input[name="annotate"]'); this.$switch.prop("checked", "checked");