-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7c74f2
commit 26e86ac
Showing
6 changed files
with
120 additions
and
100 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
class ProgrammingExerciseSolutionEntry: | ||
def __init__( | ||
self, | ||
file_path: str, | ||
previous_line: int, | ||
line: int, | ||
previous_code: str, | ||
code: str, | ||
): | ||
self.file_path = file_path | ||
self.previous_line = previous_line | ||
self.line = line | ||
self.previous_code = previous_code | ||
self.code = code | ||
from pydantic import BaseModel | ||
|
||
|
||
class CodeHint: | ||
def __init__( | ||
self, | ||
title: str, | ||
description: str, | ||
content: str, | ||
solution_entries: [ProgrammingExerciseSolutionEntry], | ||
): | ||
self.title = title | ||
self.description = description | ||
self.content = content | ||
self.solution_entries = solution_entries | ||
class ProgrammingExerciseSolutionEntry(BaseModel): | ||
file_path: str | ||
previous_line: int | ||
line: int | ||
previous_code: str | ||
code: str | ||
|
||
def __str__(self): | ||
return ( | ||
f'ProgrammingExerciseSolutionEntry(file_path="{self.file_path}", previous_line={self.previous_line}, ' | ||
f'line={self.line}, previous_code="{self.previous_code}", code="{self.code}")' | ||
) | ||
|
||
|
||
class CodeHint(BaseModel): | ||
title: str | ||
description: str | ||
content: str | ||
solution_entries: [ProgrammingExerciseSolutionEntry] | ||
|
||
def __str__(self): | ||
return ( | ||
f'CodeHint(title="{self.title}", description="{self.description}", content="{self.content}", ' | ||
f"solution_entries={self.solution_entries})" | ||
) |
This file contains 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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
class Course: | ||
def __init__(self, title, description): | ||
self.title = title | ||
self.description = description | ||
from pydantic import BaseModel | ||
|
||
|
||
class Course(BaseModel): | ||
title: str | ||
description: str | ||
|
||
def __str__(self): | ||
return f'Course(title="{self.title}", description="{self.description}")' |
This file contains 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 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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
class ProgrammingExercise: | ||
def __init__(self, title: str, problem_statement: str): | ||
self.title = title | ||
self.problem_statement = problem_statement | ||
from pydantic import BaseModel | ||
|
||
|
||
class ProgrammingExercise(BaseModel): | ||
title: str | ||
problem_statement: str | ||
|
||
def __str__(self): | ||
return f'ProgrammingExercise(title="{self.title}", problem_statement="{self.problem_statement}")' |
This file contains 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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
from enum import Enum | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class IrisMessageRole(Enum): | ||
USER = "user" | ||
ASSISTANT = "assistant" | ||
SYSTEM = "system" | ||
|
||
|
||
class IrisMessage: | ||
class IrisMessage(BaseModel): | ||
role: IrisMessageRole | ||
text: str | ||
|
||
def __init__(self, role: IrisMessageRole, text: str): | ||
self.role = role | ||
self.text = text | ||
super().__init__(role=role, text=text) | ||
|
||
def __str__(self): | ||
return f"IrisMessage(role={self.role.value}, text='{self.text}')" |
This file contains 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 |
---|---|---|
@@ -1,13 +1,21 @@ | ||
class BuildLogEntry: | ||
def __init__(self, time: str, message: str): | ||
self.time = time | ||
self.message = message | ||
|
||
|
||
class ProgrammingSubmission: | ||
def __init__( | ||
self, commit_hash: str, build_failed: bool, build_log_entries: [BuildLogEntry] | ||
): | ||
self.commit_hash = commit_hash | ||
self.build_failed = build_failed | ||
self.build_log_entries = build_log_entries | ||
from pydantic import BaseModel | ||
|
||
|
||
class BuildLogEntry(BaseModel): | ||
time: str | ||
message: str | ||
|
||
def __str__(self): | ||
return f'BuildLogEntry(time="{self.time}", message="{self.message}")' | ||
|
||
|
||
class ProgrammingSubmission(BaseModel): | ||
commit_hash: str | ||
build_failed: bool | ||
build_log_entries: [BuildLogEntry] | ||
|
||
def __str__(self): | ||
return ( | ||
f'ProgrammingSubmission(commit_hash="{self.commit_hash}", build_failed={self.build_failed}, ' | ||
f"build_log_entries={self.build_log_entries})" | ||
) |