in2lambda.api.response_area.ResponseAreaΒΆ
- class in2lambda.api.response_area.ResponseArea(*, answer: Any = None, evaluation_function: str, grade_params: dict[str, ~typing.Any] | None=None, pre_text: str = '', post_text: str = '', content_after: str = '', check_button_text: str = '', input_symbols: list[InputSymbol] = <factory>, display_input_symbols: bool = False, live_preview: bool = False, include_in_pdf: bool = False, save_allowed: bool = False, separate_feedback: bool = True, common_feedback_color: str = '#C4CDD5', correct_feedback_color: str = '#22C55E', correct_feedback_prefix: str = 'Correct', incorrect_feedback_color: str = '#ff5630', incorrect_feedback_prefix: str = 'Incorrect', tests: list[Test] = <factory>, cases: list[Case] = <factory>)[source]ΒΆ
Bases:
objectSpecifies the interaction when a student provides a response.
Multiple response areas per part are allowed; if so, order is implicit. Use a subclass for each response type.
grade_paramsare passed to the evaluation function unedited.Examples
>>> from in2lambda.api.response_area import NumericUnits, Test >>> area = NumericUnits( ... answer="30 N", ... grade_params={"rtol": 0.05}, ... pre_text="$F=$", ... tests=[Test("30 N", True)], ... ) >>> area.response_type, area.evaluation_function ('NUMERIC_UNITS', 'compareExpressions')
- __init__(*, answer: Any = None, evaluation_function: str, grade_params: dict[str, ~typing.Any] | None=None, pre_text: str = '', post_text: str = '', content_after: str = '', check_button_text: str = '', input_symbols: list[InputSymbol] = <factory>, display_input_symbols: bool = False, live_preview: bool = False, include_in_pdf: bool = False, save_allowed: bool = False, separate_feedback: bool = True, common_feedback_color: str = '#C4CDD5', correct_feedback_color: str = '#22C55E', correct_feedback_prefix: str = 'Correct', incorrect_feedback_color: str = '#ff5630', incorrect_feedback_prefix: str = 'Incorrect', tests: list[Test] = <factory>, cases: list[Case] = <factory>) NoneΒΆ
Methods
__init__(*, answer, evaluation_function, ...)Attributes
answerReplaces the label of the check button; left out of the JSON when empty.
common_feedback_colorMarkdown shown after the box, before the next one.
correct_feedback_colorcorrect_feedback_prefixdisplay_input_symbolsgrade_paramsinclude_in_pdfincorrect_feedback_colorincorrect_feedback_prefixlive_previewpost_textpre_textsave_allowedseparate_feedbackresponse_typeevaluation_functioninput_symbolstestscases- check_button_text: str = ''ΒΆ
Replaces the label of the check button; left out of the JSON when empty.
- content_after: str = ''ΒΆ
Markdown shown after the box, before the next one.