1919 "SubquestionModel" ,
2020]
2121
22+ from .files import EditorData , ResponseFile
23+
2224
2325class ScoringMethod (Enum ):
2426 ALWAYS_MANUAL_SCORING_REQUIRED = "ALWAYS_MANUAL_SCORING_REQUIRED"
@@ -68,23 +70,33 @@ def start_attempt(self, variant: int) -> AttemptStartedModel:
6870
6971 @abstractmethod
7072 def get_attempt (
71- self , attempt_state : str , scoring_state : str | None = None , response : dict [str , JsonValue ] | None = None
73+ self ,
74+ attempt_state : str ,
75+ scoring_state : str | None = None ,
76+ response : dict [str , JsonValue ] | None = None ,
77+ uploads : dict [str , list [ResponseFile ]] | None = None ,
78+ editors : dict [str , EditorData ] | None = None ,
7279 ) -> AttemptModel :
7380 """Create an attempt object for a previously started attempt.
7481
7582 Args:
7683 attempt_state: The `attempt_state` attribute of an attempt which was previously returned by
7784 [start_attempt][].
7885 scoring_state: Not implemented.
79- response: The response currently entered by the student.
86+ response: The response currently entered by the student, excluding uploads and editors.
87+ uploads: Files uploaded by the student in file upload elements (files belonging to editors are passed in
88+ `editors`.)
89+ editors: WYSIWYG editor responses entered by the student.
8090 """
8191
8292 @abstractmethod
8393 def score_attempt (
8494 self ,
8595 attempt_state : str ,
86- scoring_state : str | None = None ,
87- response : dict [str , JsonValue ] | None = None ,
96+ scoring_state : str | None ,
97+ response : dict [str , JsonValue ],
98+ uploads : dict [str , list [ResponseFile ]],
99+ editors : dict [str , EditorData ],
88100 * ,
89101 compute_adjusted_score : bool = False ,
90102 generate_hint : bool = False ,
@@ -95,7 +107,10 @@ def score_attempt(
95107 attempt_state: The `attempt_state` attribute of an attempt which was previously returned by
96108 [start_attempt][].
97109 scoring_state: Not implemented.
98- response: The response currently entered by the student.
110+ response: The response currently entered by the student, excluding uploads and editors.
111+ uploads: Files uploaded by the student in file upload elements (files belonging to editors are passed in
112+ `editors`.)
113+ editors: WYSIWYG editor responses entered by the student.
99114 compute_adjusted_score: TBD
100115 generate_hint: TBD
101116 """
0 commit comments