Skip to content
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

Teacher Regrading #12

Open
bugranaimacar opened this issue Dec 19, 2024 · 8 comments
Open

Teacher Regrading #12

bugranaimacar opened this issue Dec 19, 2024 · 8 comments

Comments

@bugranaimacar
Copy link

Hi,

I believe I've encountered a bug. When a teacher regrades a student's attempt, it updates the marks correctly new from the AI response but doesn't save the new feedback comment generated by the AI. However, performing a dry run (which processes everything from scratch) works as expected.

While debugging the grade_response function, I noticed that the array was null when regrading without a dry run. Since we're manually adding comments to question_attempt_step_data, it seems the insertion process might be where the issue lies. I couldn't fully figure it out.

@bugranaimacar bugranaimacar changed the title Teacher ReGreading Teacher Regrading Dec 19, 2024
@marcusgreen
Copy link
Owner

Thank you for your feedback. Can you confirm which branch you are working with. I am about to move a large about of updates from this branch https://github.com/marcusgreen/moodle-qtype_aitext/tree/405_core_ai into main. That code has been worked on by another organisation with a large number of users so it may be more robust.

@bugranaimacar
Copy link
Author

I've been working on the main branch.

@marcusgreen
Copy link
Owner

OK, well I will be incorporating the big set of changes into main within the next two weeks (probably) I hope to keep what is in the main branch as a new branch called legacy. I'm not in a position to look into the bug you reported as moving to the new version will be very time consuming. However I can give you access to an installation with the new branch as a teacher and you can experiment with that if it would help.

@bugranaimacar
Copy link
Author

That would be great.

@bugranaimacar
Copy link
Author

bugranaimacar commented Dec 22, 2024

Hi There Again,

I have solved the issue with AI-generated feedback (-comment) during the regrading process finally.

Initially, -comment was being manually inserted into the step_data table, but this caused problems because in the regrading process it deletes and reinserts all question_attempt_step_data which we can not interrupt it from function grade_response or any other function from question type functions. (I even tried to set_qt_var from grade_response function and many other functions but they were all read only)

To address this, I created a new database table named qtype_aitext_feedbacks to store feedback using questionattempt IDs. This approach ensures feedback is preserved and rendered like normal in the renderer using feedback function in renderer. During regrading, the grade_response function seamlessly inserts or updates feedback in the qtype_aitext_feedbacks table, resolving the issue without errors.

@marcusgreen
Copy link
Owner

Thanks for the feedback.
Send an email to marcusgreen at gmail.com and I will create a teacher account on a site with the new branch.

@marcusgreen
Copy link
Owner

I have now switched the main branch to contain a lot of code from mebis-lp. I have not tried regrading by hand with this. I suggest upgrading to the lastest version of master and let me know if it works as you expect. Best wishes Marcus

@bugranaimacar
Copy link
Author

Thank you Marcus for your update. I've been developing the legacy branch for a while for our own needs. I will implement the new changes into my code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants