function example_define_calculation_tests
Search API
7.x student_priority.api.php | example_define_calculation_tests(&$arr) |
6.x student_priority.api.php | example_define_calculation_tests(&$arr) |
Implements hook_define_calculation_tests, "METHOD ONE" from above. Accept an array so we can alter. Then, we are just going to add to array (or modify).
File
- modules/
student_priority/ student_priority.api.php, line 63
Code
function example_define_calculation_tests(&$arr) {
$arr ['example__does_student_work_on_campus'] = array(
'title' => 'Does the student work on campus?',
'description' => 'If the student has a campus job, they are generally more engaged
in campus life and their own success.',
'result_scores' => array(// Based on the returned 'result' value, what "score" should we use?
'Y' => 0,
'N' => 0.5
),
'file' => array('example', 'example.calculations.inc'),
'group' => 'FlightPath Core', // groups multiple tests together this way
'weight' => 100, // lighter weights float to the top (get evaluated first)
);
$arr ['example__is_student_gpa_above_250'] = array(
'title' => "Is the student's GPA above 2.50?",
'result_scores' => array(
'Y' => 0,
'N' => 0.9
),
'file' => array('example', 'example.calculations.inc'),
'group' => 'FlightPath Core', // groups multiple tests together this way
'weight' => 110,
);
$arr ['example__does_student_have_more_than_2_d_or_f'] = array(
'title' => "Does the student have more than 2 D's or F's?",
'result_scores' => array(
'Y' => 1,
'N' => 0,
),
'file' => array('example', 'example.calculations.inc'),
'group' => 'FlightPath Core', // groups multiple tests together this way
'weight' => 130,
);
$arr ['example__does_student_have_more_than_2_w'] = array(
'title' => "Does the student have more than 2 W's?",
'result_scores' => array(
'Y' => 0.8,
'N' => 0,
),
'file' => array('example', 'example.calculations.inc'),
'group' => 'FlightPath Core', // groups multiple tests together this way
'weight' => 140,
);
$arr ['example__did_student_score_below_b_on_engl_1001'] = array(
'title' => "Did the student score below a 'B' in ENGL 1001?",
'result_scores' => array(
'Y' => 0.8,
'N' => 0,
'N/A' => 'SKIP',
),
'file' => array('example', 'example.calculations.inc'),
'group' => 'FlightPath Core', // groups multiple tests together this way
'weight' => 150,
);
$arr ['example__does_student_have_federal_financial_aid'] = array(
'title' => "Does the student have federal financial aid?",
'result_scores' => array(
'Y' => 0,
'N' => 0.2,
),
'file' => array('example', 'example.calculations.inc'),
'group' => 'FlightPath Core', // groups multiple tests together this way
'weight' => 105,
);
// No need to return the $arr, since it was passed by reference.
}