Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix copy task #22

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion e2xauthoring/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Task(Observer):
name: str
pool: str
path: str
base_path: str
n_questions: int
points: int
git_status: Dict[str, str]
Expand All @@ -53,6 +54,7 @@ def __init__(self, name: str, pool: str, base_path: str, repo: GitRepo):
self.name = name
self.pool = pool
self.path = os.path.join(base_path, pool, name)
self.base_path = base_path
self.repo = repo
self.repo.attach(self)
self.last_modified = 0
Expand Down Expand Up @@ -135,7 +137,7 @@ def copy(self, new_name: str):
)
nbformat.write(nb, os.path.join(new_path, f"{new_name}.ipynb"))
self.repo.update_status()
return Task(new_name, self.pool, os.path.dirname(old_path), self.repo)
return Task(new_name, self.pool, self.base_path, self.repo)

def rename(self, new_name: str):
old_path = self.path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function TaskSelectionTable({ tasks, setChecked, selectedTasks }) {
flex: 2,
},
{
field: "questions",
field: "n_questions",
headerName: "# Questions",
flex: 1,
},
Expand Down
Loading