Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
george-misan committed Jul 27, 2024
1 parent 2e3b170 commit c16756a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ CREATE TABLE chapter_completion_requirements (
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
deleted_at TIMESTAMP WITH TIME ZONE,
completion_points_treshold INTEGER,
completion_number_of_exercises_attempted_treshold INTEGER NOT NULL
completion_points_threshold INTEGER,
completion_number_of_exercises_attempted_threshold INTEGER NOT NULL
);
CREATE TRIGGER set_timestamp BEFORE
UPDATE ON chapter_completion_requirements FOR EACH ROW EXECUTE PROCEDURE trigger_set_timestamp();
Expand All @@ -21,5 +21,5 @@ COMMENT ON COLUMN chapter_completion_requirements.chapter_id IS 'The chapter_id
COMMENT ON COLUMN chapter_completion_requirements.created_at IS 'Timestamp when the record was created.';
COMMENT ON COLUMN chapter_completion_requirements.updated_at IS 'Timestamp when the record was updated.';
COMMENT ON COLUMN chapter_completion_requirements.deleted_at IS 'Timestamp when the record was deleted. If null, the record is not deleted.';
COMMENT ON COLUMN chapter_completion_requirements.completion_points_treshold IS 'The point treshold set for this chapter by the instructor.';
COMMENT ON COLUMN chapter_completion_requirements.completion_number_of_exercises_attempted_treshold IS 'The number of exercises attempted treshold set for this chapter by the instructor.';
COMMENT ON COLUMN chapter_completion_requirements.completion_points_threshold IS 'The point threshold set for this chapter by the instructor.';
COMMENT ON COLUMN chapter_completion_requirements.completion_number_of_exercises_attempted_threshold IS 'The number of exercises attempted threshold set for this chapter by the instructor.';
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ INSERT INTO chapter_completion_requirements(
course_instance_id,
chapter_id,
completion_points_threshold,
completion_number_of_exercises_attempted_threshold,
completion_number_of_exercises_attempted_threshold
)
VALUES(
$1,
Expand Down
2 changes: 0 additions & 2 deletions services/headless-lms/models/src/library/progressing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ async fn user_is_eligible_for_automatic_completion(
&& (total_exercise_attempts as f32) < attempts_threshold
{
return Ok(false);
} else {
return Ok(false);
}
}

Expand Down

0 comments on commit c16756a

Please sign in to comment.