[−][src]Struct lab_grader::criteria::Criteria
The Criteria struct, just a collection of Criterion
Implementations
impl Criteria
[src]
pub fn add(&mut self, criterion: Criterion)
[src]
Add a Criterion
to the collection
pub fn get(&mut self, stub: &str) -> Option<&mut Criterion>
[src]
Gets Some(Criterion)
that has the given stub. Returns
None
if there isn't one at that index
Example
let mut crit = Criterion::new("test criterion").build(); crit.stub = String::from("test-crit-1"); let mut criteria = Criteria::from(vec![crit]); assert!(criteria.get("test-crit-1").is_some()); assert!(criteria.get("doesnt-exist").is_none());
pub fn attach(&mut self, stub: &str, func: Box<dyn Fn(&TestData) -> bool>)
[src]
Attached a function onto the criterion with the given stub
pub fn from(criteria: Vec<Criterion>) -> Self
[src]
Creates a Criteria
collection from a Vec<Criterion>
Example
use lab_grader::*; let critiera = Criteria::from(vec![ Criterion::new("name").build() ]);
pub fn len(&self) -> usize
[src]
Returns the amount of Criterion
s in this collection
pub fn total_points(&self) -> usize
[src]
Returns the total points value of all the criteria, ie. the maximum score possible for all criteria
This is not a grade, but the maximum possible grade.
Only a Submission
holds a grade.
pub fn sorted(&mut self) -> &mut Vec<Criterion>
[src]
Returns the criterion vector, sorted by index
pub fn points(&self) -> usize
[src]
Returns the amount of points earned
If you haven't graded a submission against these criteria, then this will return 0.
pub fn print_short(&self)
[src]
Prints only the criterion name and status. An
alternative to println!("{}", criteria)
Trait Implementations
impl Display for Criteria
[src]
impl FromIterator<Criterion> for Criteria
[src]
fn from_iter<I: IntoIterator<Item = Criterion>>(iter: I) -> Self
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Criteria
impl !Send for Criteria
impl !Sync for Criteria
impl Unpin for Criteria
impl !UnwindSafe for Criteria
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,