Struct umm::grade::DiffGrader
source · pub struct DiffGrader {
pub req_name: String,
pub out_of: f64,
pub project: Project,
pub file: String,
pub expected: Array,
pub input: Array,
pub ignore_case: bool,
}
Expand description
string. Any difference results in a 0
grade.
A grader that grades by diffing an expected
string with an actual
Fields§
§req_name: String
name of requirement
out_of: f64
points to give if all tests pass
project: Project
the project to grade
file: String
Java file to run
expected: Array
the expected output
input: Array
the actual output
ignore_case: bool
ignore case when comparing
Implementations§
source§impl DiffGrader
impl DiffGrader
sourcepub fn set_req_name(self, req_name: String) -> Self
pub fn set_req_name(self, req_name: String) -> Self
sets the req_name
field
sourcepub fn set_out_of(self, out_of: f64) -> Self
pub fn set_out_of(self, out_of: f64) -> Self
sets the out_of
field
sourcepub fn set_expected(self, expected: Array) -> Self
pub fn set_expected(self, expected: Array) -> Self
sets the expected
field
sourcepub fn set_project(self, project: Project) -> Self
pub fn set_project(self, project: Project) -> Self
sets the project
field
sourcepub fn ignore_case(&mut self) -> bool
pub fn ignore_case(&mut self) -> bool
gets the ignore_case
field
sourcepub fn set_ignore_case(self, ignore_case: bool) -> Self
pub fn set_ignore_case(self, ignore_case: bool) -> Self
sets the ignore_case
field
sourcepub fn grade_by_diff(&mut self) -> Result<GradeResult>
pub fn grade_by_diff(&mut self) -> Result<GradeResult>
Grades by diffing the expected
and actual
strings.
sourcepub fn grade_by_diff_script(
&mut self
) -> Result<GradeResult, Box<EvalAltResult>>
pub fn grade_by_diff_script( &mut self ) -> Result<GradeResult, Box<EvalAltResult>>
Macro generated variant of #fn_name that returns EvalAltResult. This allows the function to be used in scripts.
Trait Implementations§
source§impl Clone for DiffGrader
impl Clone for DiffGrader
source§fn clone(&self) -> DiffGrader
fn clone(&self) -> DiffGrader
Returns a copy 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 CustomType for DiffGrader
impl CustomType for DiffGrader
Allows registering custom types with Rhai.
source§impl Default for DiffGrader
impl Default for DiffGrader
source§fn default() -> DiffGrader
fn default() -> DiffGrader
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DiffGrader
impl Send for DiffGrader
impl Sync for DiffGrader
impl Unpin for DiffGrader
impl !UnwindSafe for DiffGrader
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