Changeset 11cf70d in flexograder


Ignore:
Timestamp:
01/19/26 15:41:09 (2 months ago)
Author:
Enrico Schwass <ennoausberlin@…>
Branches:
fake-data, main, master
Children:
e92c42d
Parents:
891e658
Message:

fix a type vs mtype regression in media_factory and question_ids vs element_ids in some older jsons

Files:
1 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • flexograder/core_entities/media_items.py

    r891e658 r11cf70d  
    3434            return "video"
    3535        return "file"
    36 
    37     @property
    38     def mtype(self) -> str:
    39         # logical type used for JSON, defaults to mtype
    40         return self.mtype
    4136
    4237    @classmethod
     
    9085
    9186    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"}" />'
    9388
    9489@dataclass
     
    144139
    145140    def to_html(self, prefix=""):
    146         return prefix
     141        return ""
    147142
    148143def media_factory(m: dict) -> MediaItem:
    149     mtype = m.get("mtype", "").lower()
     144    mtype = m.get("type", "").lower()
    150145
    151146    cls = {
  • flexograder/generator/exam_generator.py

    r891e658 r11cf70d  
    2626                    if not (self.media_dir / each_item.src).exists():
    2727                        raise FileNotFoundError(f"Missing file: {self.media_dir / each.media}")
    28         print(exam.to_html())
    2928        html = exam.to_html()
    3029        return self.write_exam(exam, html)
  • org/acceptance_tests.org

    r891e658 r11cf70d  
    1717#+END_SRC
    1818
     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
    1943** Startup
     44
     45*** Linux and MacOS
     46
     47Run the software from shell by typing
     48
     49#+BEGIN_SRC shell
     50flexograder
     51#+END_SRC
     52
     53*** Windows
     54
     55tbd
    2056
    2157|------------------------------------------------------------+-------------------------------------+----------------------------------------------------|
     
    3066** Catalogs
    3167
    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
     68BEWARE: Always use export current catalog (to json) if you want persistance. Right now we do not update the sqlite database. Changes are LOST otherwise.
     69This is postponed to version 1.3
    3370
    3471|----------------------------------------------------+----------------------------+-----------------------------------------------------------------|
     
    4077| Export current catalog as json                     | Working                    |                                                                 |
    4178| Switch catalogs by catalog switcher                | Working                    |                                                                 |
    42 | Catalog metadata in details pane                   | Not implemented            |                                                                 |
     79| Catalog metadata in details pane                   | Not implemented yet        |                                                                 |
    4380| Copy / paste question between catalogs             | Working                    |                                                                 |
    4481| Open same catalog a second time                    | Working                    | Duplicate warning and abort due to duplicate keys in dictionary |
     
    5794| Delete media from question  | Working                              |
    5895| Promote question            | Working                              |
    59 | Edit answers and set points |                                      |
     96| Edit answers and set points | Working                              |
     97| Add topic or subtopic       | Not implemented yet                  |
    6098|-----------------------------+--------------------------------------|
    6199
    62100** Exams
    63101
    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|----------------------------+---------|
    69109
    70110** Help browser
     
    76116
    77117** Domain management
     118
     119|-----------+---------|
     120| Test case | Outcome |
     121|-----------+---------|
     122|           |         |
  • scripts/generate_exam.py

    r891e658 r11cf70d  
    44
    55import sys
     6import os
    67from pathlib import Path
    78from flexograder.generator.exam_generator import ExamGenerator
     
    2728    generator_dir = project_root / "flexograder" / "generator"
    2829    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"))
    3031    output_dir = project_root / "out"  # collect all generated artifacts here
    3132
Note: See TracChangeset for help on using the changeset viewer.