Skip to content

Commit

Permalink
Merge pull request #22 from DigiKlausur/fix_copy_task
Browse files Browse the repository at this point in the history
Fix copy task
  • Loading branch information
tmetzl authored Oct 29, 2024
2 parents 9ccb006 + e9ceaae commit fba82bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit fba82bb

Please sign in to comment.