Skip to content
Snippets Groups Projects
Commit f829f42d authored by Alexander Kruschewsky's avatar Alexander Kruschewsky
Browse files

Tests for Open/Closed-Cases no longer neccessary

parent 7f8c2aeb
No related branches found
No related tags found
2 merge requests!45Merge branch 'release/v1.2.0' into 'master',!43Neue Prüfungsordnung
......@@ -204,116 +204,3 @@ TEST_P(ConfiguredExamTest, PointsGiveGrades) {
}
}
}
// final grade between open and closed grade
TEST_P(ConfiguredExamTest, GradeBetweenGrades) {
const auto &graph = GetParam().second;
for (int i = 0; i < graph.getGradeList(GradingType::Combined).size(); ++i) {
auto dClosed =
gradeToDouble(graph.getGradeList(GradingType::Closed)[i]);
auto dOpen = gradeToDouble(graph.getGradeList(GradingType::Open)[i]);
auto dCombined =
gradeToDouble(graph.getGradeList(GradingType::Combined)[i]);
EXPECT_LE(dCombined, std::max(dClosed, dOpen));
EXPECT_GE(dCombined, std::min(dClosed, dOpen));
}
}
// Analyze values of the split test more closely
TEST(ConfiguredExamTest, SplitValues) {
using enum GradingType;
for (const auto &[name, graph] : exams()) {
if (name == "split") {
// DynexiteExam
EXPECT_EQ(graph.mExam.mIdentifier[0], "300001");
EXPECT_EQ(graph.mExam.mIdentifier[5], "300007");
EXPECT_EQ(graph.mExam.mTaskItems.size(), 43);
// Combined max
EXPECT_EQ(graph.mExam.mTaskItems[0].mMaxPoints[Combined].p, 10.);
EXPECT_EQ(graph.mExam.mTaskItems[4].mMaxPoints[Combined].p, 6.);
EXPECT_EQ(graph.mExam.mTaskItems[6].mMaxPoints[Combined].p, 8.);
EXPECT_EQ(graph.mExam.mTaskItems[42].mMaxPoints[Combined].p, 4.);
// Closed max
EXPECT_EQ(graph.mExam.mTaskItems[0].mMaxPoints[Closed].p, 10.);
EXPECT_EQ(graph.mExam.mTaskItems[4].mMaxPoints[Closed].p, 0.);
EXPECT_EQ(graph.mExam.mTaskItems[6].mMaxPoints[Closed].p, 3.);
// Open max
EXPECT_EQ(graph.mExam.mTaskItems[0].mMaxPoints[Open].p, 0.);
EXPECT_EQ(graph.mExam.mTaskItems[4].mMaxPoints[Open].p, 6.);
EXPECT_EQ(graph.mExam.mTaskItems[6].mMaxPoints[Open].p, 5.);
EXPECT_FALSE(graph.mExam.mTaskItems[0]
.mEarnedPoints[GradingType::Closed][3]);
EXPECT_EQ(graph.mExam.mTaskItems[0]
.mEarnedPoints[GradingType::Closed][14]
->p,
8.);
EXPECT_EQ(graph.mExam.mTaskItems[4]
.mEarnedPoints[GradingType::Open][3]
->p,
4.);
EXPECT_EQ(graph.mExam.mTaskItems[0]
.mEarnedPoints[GradingType::Combined][14]
->p,
8.);
EXPECT_EQ(graph.getMaxPoints(GradingType::Closed).p, 89.);
EXPECT_EQ(graph.getMaxPoints(GradingType::Open).p, 91.);
EXPECT_EQ(graph.getMaxPoints(GradingType::Combined).p, 180.);
EXPECT_EQ(graph.getPointsWithoutBonus(GradingType::Closed)[0].p,
86.);
EXPECT_EQ(graph.getPointsWithoutBonus(GradingType::Open)[0].p, 59.);
EXPECT_EQ(graph.getPointsWithoutBonus(GradingType::Combined)[0].p,
145.);
// UserGradeConfig
EXPECT_EQ(graph.mUserGradeConfig.mRequirePassAllParts,
defaults::requirePassAllParts);
EXPECT_EQ(graph.mUserGradeConfig.mPassDueToBonus,
defaults::passDueToBonus);
// UserPointConfig
EXPECT_EQ(graph.mUserPointConfig.mGradeBoundaryStepSize,
GradeBoundaryStepSize::Min1_00);
EXPECT_EQ(graph.mUserPointConfig.mGradeBoundaryRounding,
defaults::boundaryRounding);
EXPECT_EQ(graph.mUserPointConfig.mCountZerothAttemptAsFirstAttempt,
defaults::countZerothAttemptAsFirstAttempt);
// PassingLimits
EXPECT_EQ(graph.getOriginalMaxPointsBoundary(GradingType::Closed)
.mMultiple,
89);
EXPECT_EQ(graph.getChangedMaxPointsBoundary(GradingType::Closed)
.mMultiple,
89);
EXPECT_EQ(graph.getMaxPassingLimit(GradingType::Closed).mMultiple,
static_cast<int>(
89. * 0.6)); // in this particular unit test, the
// absolute passing limit applies
EXPECT_EQ(
graph.getOriginalMaxPointsBoundary(GradingType::Open).mMultiple,
91);
EXPECT_EQ(
graph.getChangedMaxPointsBoundary(GradingType::Open).mMultiple,
91);
EXPECT_EQ(graph.getMaxPassingLimit(GradingType::Open).mMultiple,
static_cast<int>(
91 * defaults::openPointsStartingPassingLimit));
// todo: manually calculate grade boundaries and check
return;
}
}
ADD_FAILURE() << "Split test data not found";
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment