Skip to content

Commit

Permalink
Use e2xauthoring api
Browse files Browse the repository at this point in the history
  • Loading branch information
tmetzl committed Aug 2, 2023
1 parent f9a2713 commit b437ff4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/authoring-menubar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 3 additions & 5 deletions packages/authoring-menubar/src/task-menubar.js
Original file line number Diff line number Diff line change
@@ -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 = [];
}

Expand All @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit b437ff4

Please sign in to comment.