pub struct StudentExerciseTaskSubmission {
pub exercise_task_id: Uuid,
pub answer_kind: Option<AnswerKind>,
pub data_json: Option<Value>,
pub data_files: Option<Vec<Uuid>>,
}Fields§
§exercise_task_id: Uuid§answer_kind: Option<AnswerKind>Absent means json, so a client that only ever answers with JSON never sends it.
data_json: Option<Value>The plugin’s own JSON: the whole answer for a json answer, the plugin’s metadata about the
files for a file one.
data_files: Option<Vec<Uuid>>The uploads that are the answer, in the order they are to be graded and displayed. Every id must be an upload this user made for this exercise.
Implementations§
Source§impl StudentExerciseTaskSubmission
impl StudentExerciseTaskSubmission
Sourcepub fn json(exercise_task_id: Uuid, data: Value) -> Self
pub fn json(exercise_task_id: Uuid, data: Value) -> Self
A JSON answer, the shape a submit takes when no files are involved.
Sourcepub fn files(
exercise_task_id: Uuid,
data_files: Vec<Uuid>,
data_json: Option<Value>,
) -> Self
pub fn files( exercise_task_id: Uuid, data_files: Vec<Uuid>, data_json: Option<Value>, ) -> Self
A file answer naming host-stored uploads, in the order they are to be graded and displayed.
Sourcepub fn named_file_ids(&self) -> &[Uuid]
pub fn named_file_ids(&self) -> &[Uuid]
The uploads this answer names, empty unless it is a file answer.
Sourcepub fn to_submitted_answer(&self) -> ModelResult<SubmittedAnswer>
pub fn to_submitted_answer(&self) -> ModelResult<SubmittedAnswer>
The internal form of the answer, rejecting the one combination the flat fields allow but the answer model does not: a JSON answer that also names files, which would silently drop them.
Trait Implementations§
Source§impl Clone for StudentExerciseTaskSubmission
impl Clone for StudentExerciseTaskSubmission
Source§fn clone(&self) -> StudentExerciseTaskSubmission
fn clone(&self) -> StudentExerciseTaskSubmission
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for StudentExerciseTaskSubmission
impl ComposeSchema for StudentExerciseTaskSubmission
Source§impl<'de> Deserialize<'de> for StudentExerciseTaskSubmission
impl<'de> Deserialize<'de> for StudentExerciseTaskSubmission
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StudentExerciseTaskSubmission
impl PartialEq for StudentExerciseTaskSubmission
Source§fn eq(&self, other: &StudentExerciseTaskSubmission) -> bool
fn eq(&self, other: &StudentExerciseTaskSubmission) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl ToSchema for StudentExerciseTaskSubmission
impl ToSchema for StudentExerciseTaskSubmission
impl StructuralPartialEq for StudentExerciseTaskSubmission
Auto Trait Implementations§
impl Freeze for StudentExerciseTaskSubmission
impl RefUnwindSafe for StudentExerciseTaskSubmission
impl Send for StudentExerciseTaskSubmission
impl Sync for StudentExerciseTaskSubmission
impl Unpin for StudentExerciseTaskSubmission
impl UnsafeUnpin for StudentExerciseTaskSubmission
impl UnwindSafe for StudentExerciseTaskSubmission
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more