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

🧪generatingQLCs for level 1 test #5542

Closed
wants to merge 5 commits into from

Conversation

alexpaascual
Copy link

@alexpaascual alexpaascual commented May 17, 2024

** This code defines a function generate_question that analyzes a student's code to help them reflect on their work. The function takes an input string representing the student's code, identifies various commands within the code (such as print, ask, echo, play, forward, and turn) LEVEL 1, and generates a list of relevant questions. It then randomly selects and returns one of these questions to prompt the student to think about and self-explain their code.
I am aware that it won't work as intended as I need to make more changes in other files for it to work properly :)**

Checklist
Done? Check if you have it all in place using this list: (mark with x if done)

  • [x ] Contains one of the PR categories in the name
  • [x ] Describes changes in the format above
  • Links to an existing issue or discussion
  • [x ] Has a "How to test" section

@Felienne Felienne marked this pull request as draft May 24, 2024 12:18
@Felienne
Copy link
Member

Marking this as draft unutil it is ready!

@Felienne
Copy link
Member

Hi @alexpaascual!

I am looking at your code and I see you are doing the analysis with string manipulation. This works but it is not very performant or elegant and it will be a lot of work for you. You can repurpose some of the work we have done!

We have a parser that already transforms a program into a tree (see here)

This can be used from program analysis! For example, in this PR you can see that Julia created a new function to determine roles, based on the transpiler. She used the function all_variables:

hedy/hedy.py

Line 1168 in 0d0d159

def all_variables(input_string, level, lang='en'):

Tree traversal will be a bit more complex than what you are doing now, but it will be better and easier in the end.

If you help me see what functions you need (by completing the list we talked about) I can help you along a bit more if needed!

@alexpaascual
Copy link
Author

alexpaascual commented May 28, 2024 via email

@alexpaascual
Copy link
Author

Updated the analyze_code and generate_question functions to avoid using string manipulation. Instead of slicing strings, now using structured parsing and specific functions for each command(AST). This makes the code cleaner and easier to understand.

@Felienne
Copy link
Member

Hi @alexpaascual!

Since you are not going to implement, I am closing this for now (you can always reopen it if you want!)

@Felienne Felienne closed this Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants