generated from wessel/boilerplate
fix(exam_result_generator): Keep generating grades unless told elsewise
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user