Changeset b0deaac in flexograder
- Timestamp:
- 01/20/26 11:03:27 (6 weeks ago)
- Branches:
- main, master
- Children:
- f0501da
- Parents:
- a8a8ecd
- Files:
-
- 1 deleted
- 3 edited
-
examples/demo/DM-2025-10-001-12345678-2025-10-07T12-35-43.240Z.json (deleted)
-
flexograder/core_entities/exam.py (modified) (1 diff)
-
flexograder/gui/create_exam_dialog.py (modified) (2 diffs)
-
flexograder/gui/exam_layout_editor.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flexograder/core_entities/exam.py
ra8a8ecd rb0deaac 197 197 if isinstance(each_question, ChoiceQuestion): 198 198 each_question.shuffle_answers() 199 200 def has_id_form(self) -> bool: 201 """Return True if the exam contains an IDForm element.""" 202 return any(isinstance(e, IDForm) for e in self.elements.values()) 199 203 200 204 @property -
flexograder/gui/create_exam_dialog.py
ra8a8ecd rb0deaac 7 7 def __init__(self, parent, title=None, exam=None): 8 8 self.exam = exam # may be None 9 self.result = None 9 10 super().__init__(parent, title) 10 11 … … 51 52 # Structural defaults 52 53 # ───────────────────────────── 53 self.var_id_form = tk.BooleanVar(value=True) 54 has_id_form = self.exam.has_id_form() if self.exam is not None else True 55 self.var_id_form = tk.BooleanVar(value=has_id_form) 54 56 self.var_instruction_block = tk.BooleanVar(value=True) 55 57 -
flexograder/gui/exam_layout_editor.py
ra8a8ecd rb0deaac 120 120 ttk.Button(footer, text="Cancel", command=self.destroy).pack(side="right", padx=5) 121 121 122 123 122 def edit_metadata(self): 124 123 dialog = ExamDialog(parent=self, title="Edit Metadata", exam=self.exam) 124 if dialog.result is None: 125 return 125 126 self.exam.title=dialog.result["title"] 126 127 self.exam.author=dialog.result["author"] … … 129 130 self.exam.allowed_aids=dialog.result["allowed_aids"] 130 131 self.exam.duration=dialog.result["duration"] 132 print(dialog.result["include_id_form"]) 131 133 if dialog.result["include_id_form"]: 132 134 self.exam.add_default_id_form() 135 else: 136 messagebox.showinfo("Deletion impossible", "Once added IDForm can not be removed.") 133 137 self.exam._update_fingerprint() 134 138 … … 184 188 return 185 189 page = self.layout.pages[idx[0]] 186 new_name = simpledialog.askstring("Rename Page", "New title:", initialvalue=page.title, parent=self) 190 new_name = simpledialog.askstring("Rename Page", "New title:", 191 initialvalue=page.title, parent=self) 187 192 if new_name: 188 193 page.title = new_name
Note:
See TracChangeset
for help on using the changeset viewer.
