Skip to content

Commit 3f9722c

Browse files
committed
feat: more detailed question info
1 parent ef082fa commit 3f9722c

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/agents/utils/parse_json_to_prompt.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
""" File not to be modified. This file contains the conversion logic between the agent API and the Lambda Feedback backend."""
2-
31
from typing import List, Optional, Union, Dict
42

53
# questionSubmissionSummary type
@@ -85,13 +83,21 @@ def __init__(
8583
class QuestionDetails:
8684
def __init__(
8785
self,
86+
setNumber: Optional[int] = None,
87+
setName: Optional[str] = None,
88+
setDescription: Optional[str] = None,
89+
questionNumber: Optional[int] = None,
8890
questionTitle: Optional[str] = None,
8991
questionGuidance: Optional[str] = None,
9092
questionContent: Optional[str] = None,
9193
durationLowerBound: Optional[int] = None,
9294
durationUpperBound: Optional[int] = None,
9395
parts: Optional[List[PartDetails]] = [],
9496
):
97+
self.setNumber = setNumber
98+
self.setName = setName
99+
self.setDescription = setDescription
100+
self.questionNumber = questionNumber
95101
self.questionTitle = questionTitle
96102
self.questionGuidance = questionGuidance
97103
self.questionContent = questionContent
@@ -161,7 +167,7 @@ def format_response_area_details(responseArea: ResponseAreaDetails, studentSumma
161167
{submissionDetails}"""
162168

163169
def format_part_details(part: PartDetails, currentPart: CurrentPart, summary: List[StudentWorkResponseArea]) -> str:
164-
if not part or not part.publishedResponseAreas:
170+
if not part:
165171
return ''
166172

167173
responseAreas = "\n".join(
@@ -187,9 +193,9 @@ def format_part_details(part: PartDetails, currentPart: CurrentPart, summary: Li
187193
"""
188194

189195
questionDetails = f"""This is the question I am currently working on. I am currently working on Part ({convert_index_to_lowercase_letter(questionAccessInformation.currentPart.position)}). Below, you'll find its details, including the parts of the question, my responses for each response area, and the feedback I received. This information highlights my efforts and progress so far. Use this this information to inform your understanding about the question materials provided to me and my work on them.
190-
Maths equations are in KaTex format, preserve them the same.
191-
192-
# Question: {questionInformation.questionTitle};
196+
Maths equations are in KaTex format, preserve them the same. Use British English spellings.
197+
{f'# Question Set {questionInformation.setNumber + 1}: {questionInformation.setName};' if questionInformation.setName and questionInformation.setNumber else ''}
198+
# Question{f' {questionInformation.setNumber + 1}.{questionInformation.questionNumber + 1}' if questionInformation.setNumber and questionInformation.questionNumber else ''}: {questionInformation.questionTitle};
193199
Guidance to Solve the Question: {questionInformation.questionGuidance or 'None'};
194200
Description of Question: {questionInformation.questionContent};
195201
Expected Time to Complete the Question: {f'{questionInformation.durationLowerBound} - {questionInformation.durationUpperBound} min;' if questionInformation.durationLowerBound and questionInformation.durationUpperBound else 'No specified duration.'}

0 commit comments

Comments
 (0)