Changeset 11cf70d in flexograder
- Timestamp:
- 01/19/26 15:41:09 (2 months ago)
- Branches:
- fake-data, main, master
- Children:
- e92c42d
- Parents:
- 891e658
- Files:
-
- 1 added
- 1 deleted
- 4 edited
-
examples/demo/example_exam.json (deleted)
-
examples/demo/new_export.json (added)
-
flexograder/core_entities/media_items.py (modified) (3 diffs)
-
flexograder/generator/exam_generator.py (modified) (1 diff)
-
org/acceptance_tests.org (modified) (5 diffs)
-
scripts/generate_exam.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flexograder/core_entities/media_items.py
r891e658 r11cf70d 34 34 return "video" 35 35 return "file" 36 37 @property38 def mtype(self) -> str:39 # logical type used for JSON, defaults to mtype40 return self.mtype41 36 42 37 @classmethod … … 90 85 91 86 def to_html(self, prefix=MediaItem.ExportPrefix) -> str: 92 return f'<img src="{prefix + self.src}" alt="{"Bild zur Frage"}" >'87 return f'<img src="{prefix + self.src}" alt="{"Bild zur Frage"}" />' 93 88 94 89 @dataclass … … 144 139 145 140 def to_html(self, prefix=""): 146 return prefix141 return "" 147 142 148 143 def media_factory(m: dict) -> MediaItem: 149 mtype = m.get(" mtype", "").lower()144 mtype = m.get("type", "").lower() 150 145 151 146 cls = { -
flexograder/generator/exam_generator.py
r891e658 r11cf70d 26 26 if not (self.media_dir / each_item.src).exists(): 27 27 raise FileNotFoundError(f"Missing file: {self.media_dir / each.media}") 28 print(exam.to_html())29 28 html = exam.to_html() 30 29 return self.write_exam(exam, html) -
org/acceptance_tests.org
r891e658 r11cf70d 17 17 #+END_SRC 18 18 19 *** Mac OS 20 21 - Install flexoentity and flexograder with 22 23 #+BEGIN_SRC shell 24 python3 -m pip install . 25 #+END_SRC 26 27 - Copy permanent remote db 28 29 #+BEGIN_SRC shell 30 cp ./examples/remote.db /Users/Shared/flexograder 31 #+END_SRC 32 33 *** Windows 10 (Classified area) 34 35 - Install flexoentity and flexograder by copying the sources to site-packages 36 37 - Copy permanent db to shared network drive 38 39 #+BEGIN_SRC shell 40 cp ./examples/remote.db whatever_drive_it_is 41 #+END_SRC 42 19 43 ** Startup 44 45 *** Linux and MacOS 46 47 Run the software from shell by typing 48 49 #+BEGIN_SRC shell 50 flexograder 51 #+END_SRC 52 53 *** Windows 54 55 tbd 20 56 21 57 |------------------------------------------------------------+-------------------------------------+----------------------------------------------------| … … 30 66 ** Catalogs 31 67 32 BEWARE: Always use export current catalog (to json) if you want persistance. Right now we do not update the sqlite database. Changes are LOST otherwise 68 BEWARE: Always use export current catalog (to json) if you want persistance. Right now we do not update the sqlite database. Changes are LOST otherwise. 69 This is postponed to version 1.3 33 70 34 71 |----------------------------------------------------+----------------------------+-----------------------------------------------------------------| … … 40 77 | Export current catalog as json | Working | | 41 78 | Switch catalogs by catalog switcher | Working | | 42 | Catalog metadata in details pane | Not implemented | |79 | Catalog metadata in details pane | Not implemented yet | | 43 80 | Copy / paste question between catalogs | Working | | 44 81 | Open same catalog a second time | Working | Duplicate warning and abort due to duplicate keys in dictionary | … … 57 94 | Delete media from question | Working | 58 95 | Promote question | Working | 59 | Edit answers and set points | | 96 | Edit answers and set points | Working | 97 | Add topic or subtopic | Not implemented yet | 60 98 |-----------------------------+--------------------------------------| 61 99 62 100 ** Exams 63 101 64 |------------------------+---------| 65 | Test case | Outcome | 66 |------------------------+---------| 67 | Import serialized exam | Working | 68 |------------------------+---------| 102 |----------------------------+---------| 103 | Test case | Outcome | 104 |----------------------------+---------| 105 | Import serialized exam | Working | 106 | Export serialized exam | Working | 107 | Edit / layout current exam | Working | 108 |----------------------------+---------| 69 109 70 110 ** Help browser … … 76 116 77 117 ** Domain management 118 119 |-----------+---------| 120 | Test case | Outcome | 121 |-----------+---------| 122 | | | -
scripts/generate_exam.py
r891e658 r11cf70d 4 4 5 5 import sys 6 import os 6 7 from pathlib import Path 7 8 from flexograder.generator.exam_generator import ExamGenerator … … 27 28 generator_dir = project_root / "flexograder" / "generator" 28 29 static_dir = generator_dir / "static" 29 media_root_dir = project_root / "media"30 media_root_dir = Path(os.environ.get('FLEXO_MEDIA', project_root / "media")) 30 31 output_dir = project_root / "out" # collect all generated artifacts here 31 32
Note:
See TracChangeset
for help on using the changeset viewer.
