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

[Frontend] Adding line offset for code problems #976

Merged
merged 12 commits into from
Dec 15, 2023

Conversation

AlexandreDoneux
Copy link
Contributor

This PR adds the possibility through the task edit form to have a line offset for the code blocks in code problems. Adding a field to the form, checking it's value and applying the changes to the particular problem. An error will be displayed if the user inputs something other than a number.

@CLAassistant
Copy link

CLAassistant commented Oct 19, 2023

CLA assistant check
All committers have signed the CLA.

@anthonygego
Copy link
Member

Can you rebase this PR so that only your commits appear here ? Otherwise it's pretty hard to review.

A teacher could need to change the code lines offset in order to send back correct review when parsing student code into a template.

Problem : changing the first_line parameter in the template_helper.render() function is effective only after restarting the server.
Was checking the value of data-x-first-line only for textareas with code-editor class. Now doing it in registerCodeEditor() function for every case.
…ubmit and apply it to the problem's code block
Was changing the firstline value into a integer or set it to 1 if it was not given. Was oing it outside the registerCodeEditor() function. But as it is used in other places this action wasn't performed each time. Doing this transformation inside the function now.
When the line offset was empty it was retrieved as an empty string. It couldn't be transformed into an integer so an error message appeared. Fixed that.
@AlexandreDoneux
Copy link
Contributor Author

AlexandreDoneux commented Dec 8, 2023

Rebase on 2e692aa.

Instead of setting it to 1 (default value) we do not store it

Co-authored-by: Anthony Gégo <anthony.gego@uclouvain.be>
@anthonygego anthonygego merged commit 11cda54 into UCL-INGI:master Dec 15, 2023
2 of 3 checks passed
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

Successfully merging this pull request may close these issues.

3 participants