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

Wrap Question Number in span tag #7622

Closed
valiceops opened this issue Jul 1, 2024 · 5 comments · Fixed by #7738
Closed

Wrap Question Number in span tag #7622

valiceops opened this issue Jul 1, 2024 · 5 comments · Fixed by #7738
Milestone

Comments

@valiceops
Copy link

Steps to Reproduce

Quiz questions are no longer translating using TranslatePress so the request is to wrap the question number within the h2 heading that outputs the question title, in a span tag.

We are using a translation plugin (TranslatePress) which is fairly popular. We ran into an issue which, in the interest of time, we had just resolved by modifying the /woothemes-sensei/plugins/sensei-lms/includes/class-sensei-question.php file to wrap the output of the question number ($title_html .= sprintf( esc_html__( '%d. ', 'sensei-lms' ), sensei_get_the_question_number() );) in a span tag.

The reason for the request is that the translation plugin identifies the entire content, including the number, as a string so it wasn't finding our 100+ question translations because prior to a year or so I go I guess now, Sensei didn't output the question numbers. We also, FYI use the random order feature so it would be very daunting to re-translate every possible combination of numbers and questions in the translation file/plugin.

PHP / WordPress / Sensei LMS version

WP 6.5.4 / Sensei LMS 4.24.1

@valiceops valiceops added [Status] Needs Triage Issue needs to be triaged [Type] Bug labels Jul 1, 2024
@donnapep donnapep self-assigned this Sep 10, 2024
@valiceops
Copy link
Author

Just checking in to see if there is any movement here. It's a pretty small change, and doesn't seem like this request would have any impact on the majority of users but would make it compatible with TranslatePress and randomly ordering quiz questions. Or is there at least some other suggestion besides modifying the core template file?

@donnapep donnapep removed their assignment Jan 15, 2025
@donnapep
Copy link
Collaborator

donnapep commented Jan 15, 2025

@valiceops Hello, and thanks for your inquiry. Would you mind confirming whether Learning Mode is enabled on your site?

Note that there is currently a Quiz question points format setting that can be set to Don't show quiz question points. Unfortunately, that setting doesn't appear to be working. If it was working, would that meet your needs?

Please ignore. I just realized that setting does not control the question number format, but rather the points format.

@valiceops
Copy link
Author

Hi @donnapep - Yes, we are using Learner Mode

@donnapep
Copy link
Collaborator

@valiceops Thanks. Can you confirm that #7738 will resolve the TranslatePress issue?

@valiceops
Copy link
Author

I wasn't able to load the playground but viewing the commit, yes, this is what we have in our override and works for translating the randomly ordered questions. Thank you!

@donnapep donnapep added this to the 4.24.5 milestone Jan 15, 2025
@donnapep donnapep removed the [Status] Needs Triage Issue needs to be triaged label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants