-
Notifications
You must be signed in to change notification settings - Fork 3
In Antworten Editor-Daten und Uploads an das Paket weitergeben #248
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
Open
MHajoha
wants to merge
2
commits into
dev
Choose a base branch
from
response-editors
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ name = "questionpy-sdk" | |
| description = "Library and toolset for the development of QuestionPy packages" | ||
| license = "MIT" | ||
| urls = { homepage = "https://questionpy.org" } | ||
| version = "0.6.0" | ||
| version = "0.7.0" | ||
| authors = [ | ||
| { name = "TU Berlin innoCampus" }, | ||
| { email = "[email protected]" } | ||
|
|
@@ -18,7 +18,7 @@ dependencies = [ | |
| "aiohttp >=3.11.18, <4.0.0", | ||
| "pydantic >=2.11.4, <3.0.0", | ||
| "PyYAML >=6.0.2, <7.0.0", | ||
| "questionpy-server @ git+https://github.com/questionpy-org/questionpy-server.git@a9f052d552e68268684792e028279feabae2c2e2", | ||
| "questionpy-server @ git+https://github.com/questionpy-org/questionpy-server.git@06d63e6f4a3bf31ec182e219b5025a1c3b45f70c", | ||
| "jinja2 >=3.1.6, <4.0.0", | ||
| "aiohttp-jinja2 >=1.6, <2.0", | ||
| "lxml[html-clean] >=5.4.0, <5.5.0", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ | |
| # (c) Technische Universität Berlin, innoCampus <[email protected]> | ||
|
|
||
| # We reexport these for them to be used in file upload elements. | ||
| from questionpy_common.api.files import OptionsFile | ||
| from questionpy_common.constants import GiB, KiB, MiB | ||
| from questionpy_common.elements import ( | ||
| CanHaveConditions, | ||
|
|
@@ -81,7 +82,7 @@ | |
| text_area, | ||
| text_input, | ||
| ) | ||
| from ._model import FormModel, OptionEnum, OptionsFile, RichTextEditor | ||
| from ._model import FormModel, OptionEnum | ||
|
|
||
| __all__ = [ | ||
| "CanHaveConditions", | ||
|
|
@@ -101,7 +102,6 @@ | |
| "OptionsFormDefinition", | ||
| "RadioGroupElement", | ||
| "RepetitionElement", | ||
| "RichTextEditor", | ||
| "SelectElement", | ||
| "StaticTextElement", | ||
| "TextAreaElement", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,12 +3,11 @@ | |
| # (c) Technische Universität Berlin, innoCampus <[email protected]> | ||
| from collections.abc import Callable, Sequence | ||
| from dataclasses import dataclass | ||
| from datetime import datetime | ||
| from enum import Enum | ||
| from itertools import starmap | ||
| from typing import TYPE_CHECKING, Annotated, Any, ClassVar, Literal, get_args, get_origin | ||
|
|
||
| from pydantic import BaseModel, ByteSize, ConfigDict, Field | ||
| from pydantic import BaseModel, Field | ||
| from pydantic._internal._model_construction import ModelMetaclass # noqa: PLC2701 | ||
| from pydantic.fields import FieldInfo | ||
| from pydantic_core import CoreSchema, core_schema | ||
|
|
@@ -17,47 +16,6 @@ | |
| from questionpy_common.elements import FormElement, FormSection, OptionsFormDefinition | ||
|
|
||
|
|
||
| class OptionsFile(BaseModel): | ||
| """Metadata about a file uploaded in question options. | ||
|
|
||
| The file content is stored by the LMS and can be retrieved using the | ||
| [`file_ref`][questionpy.form.OptionsFile.file_ref] or embedded in the question using | ||
| [`uri`][questionpy.form.OptionsFile.uri]. The filename can be freely changed without informing the LMS. | ||
|
|
||
| See Also: | ||
| - [questionpy.form.rich_text_editor][] | ||
| - [questionpy.form.file_upload][] | ||
| """ | ||
|
|
||
| path: str | ||
| """The folder path of this files. Must begin and end in `/`. Top-level files have a path of `/`.""" | ||
| filename: str | ||
| file_ref: str | ||
| """An opaque reference that can be used to retrieve the file content from the LMS.""" | ||
| uploaded_at: datetime | ||
| mime_type: str | ||
| size: ByteSize | ||
|
|
||
| @property | ||
| def uri(self) -> str: | ||
| """Builds a URI that can be used to embed the file in a question.""" | ||
| return f"qpy://options/{self.file_ref}" | ||
|
|
||
|
|
||
| class RichTextEditor(BaseModel): | ||
| """The form data generated by a [questionpy.form.rich_text_editor][] element.""" | ||
|
|
||
| # The LMS may send and expect to receive back again additional properties. They must begin with _, though we don't | ||
| # check that restriction yet. | ||
| model_config = ConfigDict(extra="allow") | ||
|
|
||
| text: str | ||
| """The text content of the editor, in whichever markup format the LMS uses.""" | ||
|
|
||
| files: list[OptionsFile] = [] | ||
| """Files referenced by the markup.""" | ||
|
|
||
|
|
||
| @dataclass | ||
| class _OptionInfo: | ||
| label: str | TranslatableString | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.