medal::contestreader_yaml

Struct ContestYaml

Source
struct ContestYaml {
Show 21 fields name: Option<String>, duration_minutes: Option<i32>, public_listing: Option<bool>, protected: Option<bool>, requires_login: Option<bool>, requires_contest: Option<Vec<String>>, participation_start: Option<String>, participation_end: Option<String>, review_start: Option<String>, review_end: Option<String>, min_grade: Option<i32>, max_grade: Option<i32>, team_participation: Option<bool>, category: Option<String>, image: Option<String>, language: Option<String>, tags: Option<Vec<String>>, message: Option<String>, position: Option<i32>, secret: Option<String>, tasks: Option<Mapping>,
}
Expand description

ContestYaml defines the content of a YAML file describing a contest.

Example:

name: "Funny contest"
duration_minutes: 0
public_listing: true
protected: false
requires_login: true
requires_contest:
  - "Another contest"
  - "Yet another contest"
participation_start: "2019-03-28T00:00:01+01:00",
participation_end: "2019-04-05T23:59:59+01:00",
review_start: "2019-03-28T00:00:01+01:00",
review_end: "2019-04-05T23:59:59+01:00",
min_grade: 1,
max_grade: 8,
team_participation: true,
category: "contests",
image: "funny.png",
language: blockly,
tags:
  - funny
  - contest
  - blockly
message: "This is a <em>really</em> funny contest!"
position: 1,
secret: "telefonbuch",
tasks:
  "Task 1": "task/for/three/stars"
  "Task 2":
    - "subtask/for/two/stars"
    - "subtask/for/three/stars"
  "Task 3":
    "task/for/four/stars": {stars: 4}
  "Task 4":
    "subtask/for/four/stars": {stars: 4}
    "subtask/for/five/stars": {}

Fields§

§name: Option<String>

The name of the contest.

This value must be set!

§duration_minutes: Option<i32>

The duration of the contest, in minutes. If set to 0, the contest can be accessed indefinitely. If set to something else, the contest will require a login to participate in order to enforce the time limit.

This value must be set!

§public_listing: Option<bool>

Set to true to show the contest in the list of contest. Note that contests might still be hidden immediately or later after participation_end has passed.

§protected: Option<bool>

Set to true to protect contest participations. Protected contest participations can not be deleted by teachers – only by admins.

§requires_login: Option<bool>

Set to true to require a login for participations. Useful for contests with duration_minutes set to 0.

§requires_contest: Option<Vec<String>>

List of contests, of which one the users is required to have a participation in, in order to participate in the contest defined by this very config.

§participation_start: Option<String>

Date and time of the start of the contest. If not set, the contest can be started at any time before participation_end.

§participation_end: Option<String>

Date and time of the end of the contest. If not set, the contest can be started at any time after participation_start. Started contests can stil accessed during their duration even if participation_end is in the past.

§review_start: Option<String>

Start of the review mode. Sensible values are the same value as participation_start to allow users to review their submissions right after participating, or the same value as participation_end to allow users to review their submissions after the contest has ended. One of review_start and review_end must be set to enable the review mode!

§review_end: Option<String>

End of the review mode. One of review_start and review_end must be set to enable the review mode!

§min_grade: Option<i32>

The minimum grade of the user for this contest to participate in.

§max_grade: Option<i32>

The maximum grade of the user for this contest to participate in.

§team_participation: Option<bool>

Set to true to allow for team participations.

§category: Option<String>

The category for this contest to be shown in.

§image: Option<String>

An image to be shown for this contest in the list of contests.

§language: Option<String>

The language of the contest. Can be set to blockly or python.

§tags: Option<Vec<String>>

A list of tags to annotate the contest with. Contests can be filtered by tag on the contest list pages.

§message: Option<String>

A message to be displayed at the contest (in a box or similar). Might contain HTML, which will not be escaped by the platform.

§position: Option<i32>

A number to order the contests by in the contest list. Contest will be ordered by DESCENDING position number.

§secret: Option<String>

A password required to start a participation in this contest. Also allows contests to be searched by this value, so this secret should be reused between contests ONLY if the intended audience is exactly the same.

§tasks: Option<Mapping>

The mapping of task names to task information.

A task information can be either:

  • A path of a task. The task will be worth 3 stars.
  • A list of paths to subtasks. The first subtask will be worth 2 stars, each additional subtask will be worth one additional star.
  • A mapping of paths to additional information. The additional information is a mapping that currently only has one pemitted key, stars with the value being the number of stars for this task/subtask.

If language is not set, each path for an algorea-style task has to be prefixed with either B or P in order to enable the algorea task wrapper for Blockly or Python, respectively.

Trait Implementations§

Source§

impl Debug for ContestYaml

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ContestYaml

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T> AsTaggedExplicit<'a> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self>

§

impl<'a, T> AsTaggedImplicit<'a> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PersistentInto<Arc<Mutex<T>>> for T

§

fn persistent_into(self) -> Arc<Mutex<T>>

Convert self into a value of type T.
§

impl<T> PersistentInto<Arc<RwLock<T>>> for T

§

fn persistent_into(self) -> Arc<RwLock<T>>

Convert self into a value of type T.
§

impl<T> PersistentInto<Arc<T>> for T

§

fn persistent_into(self) -> Arc<T>

Convert self into a value of type T.
§

impl<T> PersistentInto<T> for T

§

fn persistent_into(self) -> T

Convert self into a value of type T.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Err = <U as TryFrom<T>>::Err

§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>

§

impl<T> Typeable for T
where T: Any,

§

fn get_type(&self) -> TypeId

Get the TypeId of this object.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DebugAny for T
where T: Any + Debug,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> UnsafeAny for T
where T: Any,