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

Feature request: Total Questions and Course Attempts tags #137

Open
PhineasDD opened this issue Nov 14, 2020 · 4 comments
Open

Feature request: Total Questions and Course Attempts tags #137

PhineasDD opened this issue Nov 14, 2020 · 4 comments
Labels
backlog We might get to it in the future but not currently a priority feature request New features, enhancements

Comments

@PhineasDD
Copy link

Would it be possible to add the following filters to future updates?

  • Current date
  • Total questions in the course
  • Total questions in Moodle
  • Total of course attempts

I propose these ideas because I think it would be interesting to be able to show users automatic phrases in course descriptions. In this way, those who offer a paid course will be able to attract more clients:

  • "As of 11/14/2020 there are 200 students taking this course"
  • "As of 11/14/2020 this course has 300 questions"
  • "This quiz has been complete by 300 students"

I also have another proposition about being able to insert the codes in PHP pages. Apart from the Moodle installation, I have pages created with php to show contact forms, course descriptions, who we are, etc. I have noticed that the filters are not working on these pages, is there a way to fix it?

THX!

@michael-milette
Copy link
Owner

Hi @PhineasDD

Where do you put these pages? The reason I ask is because course related tags only show information for the current course. If you try to use them in a site page or in course listings, they will report information for the site and not the course as you would hope. So, as long as that page is an activity in the course, it could work.

You asked for a current date tag but did not include an example of how you would use it.

As for how to make your custom PHP pages be processed through Moodle filters like FilterCodes, you need to always pass your content through the format_text() or format_string() functions before you output it. I recommend you build up all your content first and then put it through one of these functions just before you output it for efficiency.

Student entered content should never be processed through filters but should be just cleaned (a.k.a. sanitized) before it is stored in the database.

For more information on these output functions, see:

https://docs.moodle.org/dev/Output_functions

Best regards,

Michael

@PhineasDD
Copy link
Author

PhineasDD commented Nov 15, 2020

Well, for example, if I have a course A, I would like to be able to put a striking description that would attract new clients using the filters that I have listed.

They would be phrases like:
"As of {date} this course has a total of {totalquestions} questions"
And it would result in:
"As of 10/15/2020 this course has a total of 2000 questions.

Currently on my moodle page I show this phrase in many areas and I also have more than 10 courses, so having to manually change all the phrases every week is a lot of effort. For this reason I wanted to know if it would be possible to implement those filters.

I also wanted to propose if custom filters can be made, so that the user could choose a name for the filter and the result that would be displayed, for example:
Filter name: {custom-1}
Result to display: 1000

In this way the sentences on the total of questions could also be created such that:

"As of {date} this course has a total of {custom-1} questions"
And it would result in:
"As of 10/15/2020 this course has a total of 1000 questions.

@michael-milette
Copy link
Owner

Hi @PhineasDD ,

Please open a separate issue ticket for each suggestion. Otherwise the conversations van get complicated to follow.

With regards to your {custom-1} suggestion, you might want to consider taking a look at the Generico plugin. If I understand what you are asking, that is pretty much what it does and it does so so much better than FilterCodes ever would.

Thank you for providing an example for the usage of a {date} tag.

Please remember to answer my question about where you would use the tags. You will not be able to use most of them in course descriptions (course summary).

@michael-milette
Copy link
Owner

Hi @PhineasDD ,

Please note that I recently added a new {now} tag. See the documentation in the README.md file for optional date/time formatting options. This feature is currently only available on the version of FilterCodes here on GitHub and will be included in the next release of FilterCodes on Moodle.org within the next few days.

As for the rest of the tags you suggested, they will need to wait for a future release of FilterCodes. I usually release a new version of FilterCodes with each new major release of Moodle (i.e. every 6 months). If you can't wait, please feel free to contact me through my website at https://www.tngconsulting.ca/contact for paid development.

Thank you again for your suggestions! :-)

Best regards,

Michael

@michael-milette michael-milette self-assigned this Nov 18, 2020
@michael-milette michael-milette added backlog We might get to it in the future but not currently a priority feature request New features, enhancements labels Nov 18, 2020
@michael-milette michael-milette changed the title Ideas for next update Feature request: Total Questions and Course Attempts tags Nov 24, 2020
@michael-milette michael-milette removed their assignment May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We might get to it in the future but not currently a priority feature request New features, enhancements
Projects
None yet
Development

No branches or pull requests

2 participants