moodle-format_periods's People
Forkers
kathrin84 davosmith hartmut1s andrewhancox redbisektor troscoe barancev moodle-isc christina-ropertomoodle-format_periods's Issues
format_periods daylight saving time issue
Hi
I just noticed that daylight saving time on March 11, 2018 is causing a calculation error in format_periods plugin.
public function get_default_section_name($section) {
$section = $this->get_section($section);
if ($section->section == 0) {
// Return the general section.
return get_string('section0name', 'format_periods');
}
$dates = $this->get_section_dates($section);
$course = $this->get_course();
if (empty($course->datesformat)) {
$dateformat = get_string('strftimedateshort', 'langconfig');
} else if ($course->datesformat === 'custom') {
$dateformat = $course->datesformatcustom;
} else {
$dateformat = get_string($course->datesformat, 'langconfig');
}
$weekday = userdate($dates->start, $dateformat);
$endweekday = userdate($dates->end - 1, $dateformat);
if ($weekday === $endweekday) {
return $weekday;
} else {
return $weekday.' - '.$endweekday;
}
}
=======================================================
The formula for $endweekday is working everyday except March 11, 2018. It starts a problem and on March 24, goes back to normal. It didn't make any sense since there is no logic or code issue in this function. Eventually it hit me; I changed the line
$endweekday = userdate($dates->end - 3601, $dateformat);
and it worked like a charm. In this time format, when you subtract 1, 10, 100... end date becomes still 1 day ahead and section title looks like
11 March - 12 March
which is a big problem for daily format. I'm not an Moodle or even PHP expert, so I believe there should be a better fix for this little issue.
Thanks
Kurt Aykut
Compatibility with Moodle 3.9+
Is Periods v3.3 compatible with Moodle 3.9?
Compatibility with Moodle 3.5?
Is Periods v3.3 compatible with Moodle 3.5? I cannot migrate to the latest version of Moodle if not.
Thanks
MarkP
enroll date instead of course start date
Is it possible to use the enroll date of each user instead of the course start date?
strtolower of string months has side effects on other Translations
Hi Marina,
we installed your course format and contributed a german translation.
I was wondering if I made a typo in the translation because in the dropdown field the options are displayed correct except for the option 'months'.
This string is displayed in lower case, but should begin with a capital letter, too.
As I didn't find the string in your language pack, I did some code research and found out that you added a strtolower to solely the month string in periodduration.php:
I wondered why you did this and I had a look at the language pack and found out that the naming convention there is not consistent. Days, weeks and years are written in lower case and only month is written with a capital letter:
So, would you please delete the strtolower in your code so that other languages can display their strings in their correct way.
As you probably have a closer contact to the english language maintainers, you could make a suggestion to name the date labels in a consistent way.
Best regards
Kathrin
Missing translation of a label
Hi Marina,
I've got a next issue. As we translated your course format plugin into german, it showed up that there's an information label within the section that is not translated:
This label is just part of the language pack as the following placeholder: {$a->duration}. So I cannot translate this placeholder within your language pack.
I searched the code but unfortunately did not find the place where this variable duration comes from.
Could have a look at this?
Furthermore there's no plural version of the labels if the number is > 1.
Best regards
Kathrin
Format periods does not add sections to the new flat navigation in theme Boost when setting "Show all periods on one page" is set
Hi Marina,
at the moment we're testing our instance for Moodle 3.2 with theme Boost, respectively with an own child theme of Boost.
We encountered, that your course format does not add the sections as menu items to the new flat navigation when the setting "Show all periods on one page" ist active. The core formats like Topics and Weeks do add the sections to the flat navigation as menu items when the equivalent setting "show all sections on one page" is active.
Do you think that it's possible that you could extend your plugin in that direction? This would be great because the fast access to all available sections in the menu is a very good feature and then the user's expectation will also be satisfied with same behaviour like the core course formats have.
Best regards,
Kathrin
Deleting sections not possible
Hi Marina,
it's me again... Since Moodle 2.9 it's at last possible to delete course sections. However, when using your course format, I detected that this is neither possible with Moodle version 2.9 nor with 3.0.
Cheers,
Kathrin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.