fix(exam_result_generator): Keep generating grades unless told elsewise

This commit is contained in:
2025-09-25 09:32:04 +02:00
parent 13eb01bdf8
commit 04cd7afb7b
2 changed files with 2 additions and 3 deletions

View File

@@ -52,9 +52,9 @@ static const std::string SQL_SELECT_MISSING_RESULTS = R"(
static const std::string SQL_INSERT_EXAM_RESULT = R"(
INSERT INTO exam_results (student_name, lecture_name, exam_grade)
VALUES ($1, $2, $3)
ON CONFLICT (student_name, lecture_name)
DO UPDATE SET exam_grade = EXCLUDED.exam_grade, created_at = CURRENT_TIMESTAMP
)";
// ON CONFLICT (student_name, lecture_name)
// DO UPDATE SET exam_grade = EXCLUDED.exam_grade, created_at = CURRENT_TIMESTAMP
static const std::string SQL_INSERT_STUDENT_ENROLLMENT = R"(
INSERT INTO student_enrollments (student_name, lecture_name)

View File

@@ -58,7 +58,6 @@ void ExamResultGenerator::generate_random_result() {
std::uniform_int_distribution<> index_dist(0, operations_queue_.size() - 1);
int random_index = index_dist(gen_);
auto selected = operations_queue_[random_index];
operations_queue_.erase(operations_queue_.begin() + random_index);
int grade = grade_dist_(gen_);