From b437ff4dd39dc9d2c52028fb0dea1e41bbf44edd Mon Sep 17 00:00:00 2001 From: Tim Daniel Metzler Date: Wed, 2 Aug 2023 10:59:09 +0200 Subject: [PATCH] Use e2xauthoring api --- packages/authoring-menubar/package.json | 2 +- packages/authoring-menubar/src/task-menubar.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/authoring-menubar/package.json b/packages/authoring-menubar/package.json index faff6941..ed17d585 100644 --- a/packages/authoring-menubar/package.json +++ b/packages/authoring-menubar/package.json @@ -12,7 +12,7 @@ "dependencies": { "@e2xgrader/menubar": "0.1.0-dev3", "@e2xgrader/utils": "0.1.0-dev3", - "@e2xgrader/api": "0.1.0-dev3" + "@e2xauthoring/api": "0.2.0-dev2" }, "devDependencies": { "webpack": "^5.73.0", diff --git a/packages/authoring-menubar/src/task-menubar.js b/packages/authoring-menubar/src/task-menubar.js index 808c1f0b..41c0a336 100644 --- a/packages/authoring-menubar/src/task-menubar.js +++ b/packages/authoring-menubar/src/task-menubar.js @@ -1,13 +1,11 @@ -import Jupyter from "base/js/namespace"; import { Menubar } from "@e2xgrader/menubar"; import { manage_tags, insert_question_preset_dialog } from "./dialogs"; -import { AuthoringAPI } from "@e2xgrader/api"; import { get_file_options, insert_cells, set_task_ids } from "./utils"; +import API from "@e2xauthoring/api"; export class TaskMenubar extends Menubar { constructor() { super(); - this.api = new AuthoringAPI(Jupyter.notebook.base_url); this.presets = []; } @@ -23,7 +21,7 @@ export class TaskMenubar extends Menubar { } insert_question_preset(name) { - this.api.get_question_preset(name).then((res) => { + API.get_question_preset(name).then((res) => { const cells = res.data; insert_question_preset_dialog(name, (task_name, points) => { set_task_ids(cells, task_name, points); @@ -33,7 +31,7 @@ export class TaskMenubar extends Menubar { } activate() { - this.api.list_question_presets().then((presets) => { + API.list_question_presets().then((presets) => { this.presets = presets.data; this.add_save_button(); this.add_divider();