-
Notifications
You must be signed in to change notification settings - Fork 67
Add AI grading statistics/feedback and refined AI comment persistence workflow #1345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tzj04
wants to merge
71
commits into
source-academy:master
Choose a base branch
from
tzj04:feat/ai-comment-workflow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 48 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
864560d
feat(ai): implement versioning and finalization for AI comments
tzj04 88593a1
feat(ai_comments): add comment selection and word-level version tracking
tzj04 3190d3e
dependencies
leongyiquan 025938d
dependencies
tzj04 64c1bcd
Merge remote-tracking branch 'yiquan/ai-button-improvements' into fea…
tzj04 30ad398
feat: add LLM usage logs and feedback schema
tzj04 dcd39c2
feat: implement LLM stats context and models
tzj04 2f00d6b
feat: add admin controller for LLM stats management
tzj04 4668677
feat: integrate LLM stats tracking into assessments
tzj04 ce5769d
feat: add LLM stats routes and views
tzj04 aaf6a26
feat: implement AI comment generation controller
tzj04 9a869f4
refactor(ai-comments): remove redundant final_comment endpoint and co…
tzj04 7fc9ba6
refactor(ai-comments): drop myers diff generation and diff columns fr…
tzj04 1274299
Stop tracking config/cadet.exs
tzj04 a999538
fix: Potential crash if a non-numeric key is provided
tzj04 3529738
Potential fix for pull request finding
tzj04 d253c61
fix: persist and restore AI comment selections correctly
tzj04 d279faa
fix: prevent race condition in create_comment_version using advisory …
tzj04 284939d
test: update assessment controller expectations for isLlmGraded field
tzj04 4ab4e78
refactor(migrations): fold ai_comment_versions diff-column removal in…
tzj04 fd9f615
fix: swagger generation
tzj04 d5a513b
Validate and safely parse answer_id in save_chosen_comments to preven…
tzj04 2370ab4
Merge branch 'master' into feat/ai-comment-workflow
tzj04 394302e
Merge branch 'feat/ai-comment-workflow' of https://github.com/tzj04/S…
tzj04 c102625
refactor(deps): migrate arc/arc_ecto to waffle/waffle_ecto
tzj04 23cefca
Fix: isLlmGraded to ignore empty assessment prompts
tzj04 5d89995
test(assessments): add has_llm_questions aggregation coverage
tzj04 85a2682
test(llm-stats): add coverage for usage logging, stats aggregation, a…
tzj04 a4eb931
test(admin): add request tests for LLM stats and feedback endpoints
tzj04 eddad92
Fix: Handle LLM usage log insert failures in AI comments controller
tzj04 7dfed65
Fix: formatting issues
tzj04 7eddeb0
Fix: more formatting issues
tzj04 b2b6fce
fix: remove unreachable parse_answer_id fallback to satisfy Dialyzer
tzj04 56b9cb6
Fix: save_chosen_comments order to validate edits before persisting s…
tzj04 657383d
Fix: formatting issue
tzj04 4556433
feat: implement AI token cost tracking and stats UI
leongyiquan 0083876
chore: save remaining backend assessments and migration files
leongyiquan 6cdbed4
refactor: reduce cyclomatic complexity in LLM cost calculator
leongyiquan a9dd2f3
pass testcases for llmcost calculations
leongyiquan 425fd63
pass testcases for llmcost calculations
leongyiquan fa939fb
pass testcases for llmcost calculations
leongyiquan 4dd4ed3
pass testcases for llmcost calculations
leongyiquan 261e799
pass testcases for llmcost calculations
leongyiquan 17670d5
pass testcases for llmcost calculations
leongyiquan cadf106
pass testcases for llmcost calculations
leongyiquan 1c7fa09
pass testcases for llmcost calculations
leongyiquan 970cda2
pass testcases for llmcost calculations
leongyiquan 73f5869
pass testcases for llmcost calculations
leongyiquan 058b836
pass testcases for llmcost calculations
leongyiquan e766b82
pass testcases for llmcost calculations
leongyiquan bd8a82b
pass testcases for llmcost calculations
leongyiquan 70c50ff
pass testcases for llmcost calculations
leongyiquan 296cd17
pass testcases for llmcost calculations
leongyiquan 4da9d4f
pass testcases for llmcost calculations
leongyiquan bcf078b
Added a new tab for coursewide summary for LLM stats
leongyiquan a9d1a8b
fixed possible type mismatch
leongyiquan c011c04
fixed potential silent data logging failure
leongyiquan 304e633
fixed source errors
leongyiquan 9721dc7
fixed MCQ question embed handling
leongyiquan 0f4a7d4
fix invalid cours id crash path
leongyiquan 043280d
fixed formatting
leongyiquan 40f23a9
fixed ai code analysis test file
leongyiquan 1403530
fixed pattern match error
leongyiquan c81065a
added has_llm_content to assessment
leongyiquan 0755dc3
fixing coverage for string course ID
leongyiquan ab7d85a
fixing public LLMStats functions
leongyiquan 0e9c429
fixed readability
leongyiquan 7fe996a
fix(xml-parser): support LLM_QUESTION_PROMPT and legacy LLM_GRADING_P…
tzj04 f0b6c82
fix(grading): require course enable plus mission and task prompts bef…
tzj04 70d9e03
fix: formatting
tzj04 121d864
fix: credo alias
tzj04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import Config | ||
|
|
||
| # This file is executed after the code compilation on all environments. | ||
| # It contains runtime configuration that's evaluated when the system starts. | ||
|
|
||
| # Configure the port from environment variable if set | ||
| if port = System.get_env("PORT") do | ||
| config :cadet, CadetWeb.Endpoint, http: [:inet6, port: String.to_integer(port)] | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| defmodule Cadet.AIComments.AICommentVersion do | ||
| @moduledoc """ | ||
| Defines the schema and changeset for AI comment versions. | ||
| Tracks per-comment edits made by tutors. | ||
| """ | ||
|
|
||
| use Ecto.Schema | ||
| import Ecto.Changeset | ||
|
|
||
| schema "ai_comment_versions" do | ||
| field(:comment_index, :integer) | ||
| field(:version_number, :integer) | ||
| field(:content, :string) | ||
|
|
||
| belongs_to(:ai_comment, Cadet.AIComments.AIComment) | ||
| belongs_to(:editor, Cadet.Accounts.User, foreign_key: :editor_id) | ||
|
|
||
| timestamps() | ||
| end | ||
|
|
||
| @required_fields ~w(ai_comment_id comment_index version_number content)a | ||
| @optional_fields ~w(editor_id)a | ||
|
|
||
| def changeset(version, attrs) do | ||
| version | ||
| |> cast(attrs, @required_fields ++ @optional_fields) | ||
| |> validate_required(@required_fields) | ||
| |> foreign_key_constraint(:ai_comment_id) | ||
| |> foreign_key_constraint(:editor_id) | ||
| |> unique_constraint([:ai_comment_id, :comment_index, :version_number]) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.