-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update remover.py #5
base: master
Are you sure you want to change the base?
Conversation
-- Added combability to remove text answers written in red colour. As common in some courses, instead of unmarking multiple choice answers. Usually, these tests could have C/C++/Assembly code as part of the question. Which should be ignored and not removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Gil, see my review.
I didn't change them myself as I want this PR to be yours.
@@ -78,7 +79,7 @@ def _getColorTargetOperationType(self, color_index, operations): | |||
def getMinimumRectangleWidth(self, fontSize, minimumNumberOfLetters = 1.5): | |||
return fontSize * minimumNumberOfLetters | |||
|
|||
def removeWordStyle(self, ignoreByteStringObject=False): | |||
def removeWordStyle(self, is_default, ignoreByteStringObject=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add default value for backwards compatibility
def remove_images2(): | ||
writer = PdfEnhancedFileWriter() | ||
# output_filename = asksaveasfilename(filetypes = (('PDF File', '*.pdf'), ('All Files','*.*'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what's the reason for the second remove_images?
if you split cases- give it an indicative name,
better if you are able to find a way to make some condition testing that will automatically tell which one to choose.
if you are struggling- send me an example pdf of it, we can think together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to push quickly a fix.
Should've find a better option.
Like, changing remove_images(), that you call in the main action button to receive an argument with default value.
Then, instead of another wrapper function, using a lambda expression in line 274.
Or using the partial() function and etc, like suggested here:
https://stackoverflow.com/questions/6920302/how-to-pass-arguments-to-a-button-command-in-tkinter
The suggestion of yours, that instead of the user informing which state to be, to detect by itself.
I will think about it.
But like the original purpose of the functions, were fitted to a certain type of tests. (Multiple answers marked without explanations tests.)
Also my suggested feature is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the major problems are, that tests don't have a uniform types, or canonical forms.
@@ -245,7 +270,8 @@ def remove_images(): | |||
#photo= PhotoImage(file=resource_path('./button_pic.png')) | |||
|
|||
#Button(root, text="Remove answers",image=photo, command=remove_images, width=100, height=120).grid(row=1, column=2,sticky=E) | |||
Button(root, text="Remove answers", command=remove_images, font='Helvetica 12 bold', fg="red", height=4).grid(row=1, column=2, sticky=E) | |||
Button(root, text="Remove marking answers", command=remove_images, font='Helvetica 12 bold', fg="red", height=4).grid(row=1, column=2, sticky=E) | |||
Button(root, text="Remove red answers without deleteing code", command=remove_images2, font='Helvetica 12 bold', fg="red", height=4).grid(row=2, column=2, sticky=E) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment about #246
-- Added combability to remove text answers written in red colour. As common in some courses, instead of unmarking multiple choice answers. Usually, these tests could have C/C++/Assembly code as part of the question. Which should be ignored and not removed.