Code Monkey home page Code Monkey logo

moodle-format_topcoll's People

Contributors

anupamatd avatar badmechanic avatar davosmith avatar doctorlard avatar gjb2048 avatar golenkovm avatar kiratskitizing avatar lucaboesch avatar ninaherrmann avatar olivabigyo avatar phmemmel avatar rhell4 avatar sk-unikent avatar tobiasreischmann avatar tonyjbutler avatar topstone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-format_topcoll's Issues

Incorrect logic for after_restore_course() causes other course formats to throw exception on restore_numsections()

When restoring an mbz (made after moodle 3.3) to a Moodle 3.9.1 site we get this exception using the latest version of this plugin:

Default exception handler: Exception - Call to undefined method format_topics::restore_numsections() Debug: 
Error code: generalexceptionmessage
* line 156 of /course/format/topcoll/backup/moodle2/restore_format_topcoll_plugin.class.php: Error thrown
* line 115 of /backup/moodle2/restore_plugin.class.php: call to restore_format_topcoll_plugin->after_restore_course()
* line 445 of /backup/util/plan/restore_structure_step.class.php: call to restore_plugin->launch_after_restore_methods()
* line 106 of /backup/util/plan/restore_task.class.php: call to restore_structure_step->launch_after_restore_methods()
* line 205 of /backup/util/plan/restore_plan.class.php: call to restore_task->execute_after_restore()
* line 135 of /backup/moodle2/restore_final_task.class.php: call to restore_plan->execute_after_restore()
* line 819 of /backup/moodle2/restore_stepslib.php: call to restore_final_task->launch_execute_after_restore()
* line 34 of /backup/util/plan/restore_execution_step.class.php: call to restore_execute_after_restore->define_execution()
* line 181 of /backup/util/plan/base_task.class.php: call to restore_execution_step->execute()
* line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
* line 168 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
* line 384 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
* line 219 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
* line 143 of /backup/restore.php: call to restore_ui->execute()
, referer: https://oursite/backup/restore.php

restore_numsections() was removed a long time ago (see https://tracker.moodle.org/browse/MDL-57769), but this plugin still calls it in the restore logic but it seems to be inverted.

If we look at other course formats, they have code like this:

    public function after_restore_course() {
        global $DB;

        if (!$this->need_restore_numsections()) {
            // Backup file was made in Moodle 3.3 or later, we don't need to process 'numsecitons'.
            return;
        }

However format_topcoll has this:

    public function after_restore_course() {
        if (!$this->need_restore_numsections()) {
            /* Backup file was made in Moodle 3.3 or later and does not contain 'numsections',
               so we don't need to process 'numsections' but we do need to set it! */
            $courseid = $this->task->get_courseid();

            global $DB;
            if (!($course = $DB->get_record('course', array('id' => $courseid)))) {
                print_error('invalidcourseid', 'error');
            } // From /course/view.php.
            $courseformat = course_get_format($course);

            $maxsection = $DB->get_field_sql('SELECT max(section) FROM {course_sections} WHERE course = ?', [$courseid]);

            $courseformat->restore_numsections($courseid, $maxsection);
            return;
        }

I think this code should only be executed if $this->need_restore_numsections() is true, not false. The call to $courseformat->restore_numsections() needs to be replaced with whatever logic it provides, because this is causing other course format plugins to fail on restore.

Issue with Assignment Meta-information

We have found an issue with the accuracy of the assignment meta information.

A student submitted to an assignment, subsequently restrict access conditions were set on the assignment, which meant she does not have access now.

image

The assignment is displayed if the conditions are not met, as opposed to being completely hidden.

The meta-information displayed for this is: image
(this appears directly under the 1st image, but there was personally identifiable information in the Restrict Access set that I had to remove).

Which is not strictly accurate, whilst the student may no longer be subject to having to submit, they have submitted, and regardless of this, if they can see the activity but are not eligible to submit, the submissions status is irrelevant and shouldn't be displayed.

I believe the initial cause is an oversight on the RA conditions, but nevertheless under these legitimate conditions (Student submitted, student now cannot submit due to Restrict Access Conditions) that have been set up, I think the meta-information is wrong.

There doesn't appear to be any evaluation of how restrict access conditions could impact the activity meta information.

The plugin should honor MDL-68330 change

Option to display topics in multiple columns uses old Boostrap classes

The option to display topics in multiple columns uses the old Bootstrap 2 column classes (i.e. "row-fluid", "span3", "span4" and "span6". This doesn't work in newer versions of Boostrap (used by the Boost theme).

These should be replaced with the newer Boostrap "col-[xs|sm|md|lg|xl]-*" class names.

Cannot Edit

Moodle 2.7 STABLE - latest release
Plugin Version 2.7.3
The Edit dropdown menu does not appear for the activities / resources across all themes when the course uses the topcoll format. This broke somewhere between version 2.7.1.5 and 2.7.3

Display error with Moodle 2.3

After upgrading to 2.3 and using the Moodle_23 branch the code reports:
Notice: Undefined property: stdClass::$layoutcolumns in /htdocs/course/format/topcoll/renderer.php on line 392
Warning: Division by zero in /htdocs/course/format/topcoll/renderer.php on line 392
Notice: Undefined property: stdClass::$layoutcolumns in /htdocs/course/format/topcoll/renderer.php on line 394

This then displays the collapsed topics as only a tiny portion of the column.

Re-implement Number of sections setting for Moodle 3.3 / 3.4 +

In Moodle 3.3, stealth activities were implemented but in doing so stealth / orphaned activities were also done away with. There is a tracker item to bring these back (https://tracker.moodle.org/browse/MDL-59481) but in the meantime all orphaned sections are being displayed and that tracker wouldn't fix things until 3.6 at the earliest.

It particularly affects us as we used subpages (https://github.com/moodleou/moodle-mod_subpage) so have now over 100 orphaned sections being displayed which shouldn't.

In Moodle 3.2 and prior the topcoll course format had a "Number of sections" setting. Re-implementing this as a filter of the maximum number of topics to display for that course would seem to be the most straightforward way of resolving our current situation.

More accessible open all / close all

Hi Gareth,

as discussed UCL report that open all/ close all buttons do not provide enough info as to what the screen reader user is opening/closing.

Once way to approach this would be to add the string 'Sections' for screen readers.

e.g. $string['topcollopened'] = 'Open all sections';

Alternatively you could add this in at the renderer.php - line 1158ish

$o .= html_writer::tag('span', get_string('topcollopened', 'format_topcoll').' '.get_string('sections'), array('class' => 'on ' . $this->tctoggleiconsize, 'id' => 'toggles-all-opened', 'role' => 'button', 'tabindex' => '0') );

Additional sections created when migrated from 2.5.4 to 3.4

I have migrated Moodle from 2.5.4 to 3.4.1 (ofcourse in stages). I have downloaded the Collapsed Topic format (ver: 2017110300) from the moodle plugin directory for 3.4. I use subpage activity under every section. While it has migrated all the content fine, it has the following issues,

  1. All the sections have been migrated fine (along with the subpages, which has scorm packages / files in it), however there are additional sections created (Section 110, Section 114 etc) which contains the items under the subpages (from initial sections).

  2. Hiding those sections hides the section, but also the packages/files under the section and it is not visible from the subpage in initial sections as well.

  3. Removing those sections removes the section, but also the packages/files under the section.

  4. Also, migrated course does not have the limit to specify for topics in the course settings, while the new course has that option.

I cannot re-add those packages/files since those have some statistics associated with it. So, it is a kind of blocker and I am not able to proceed further. It seems to be a bug, any help would be greatly appreciated.

Section titles in M2.7+

Hi... We're running Moodle 2.7.11+ (2014051211.01), and have been running the Collapsible Topics format a few months without any problems. We installed the latest version -- 2.7.4 (2014092005) for Moodle 2.7 -- on our test server, and now notice that section titles do not display in courses with using this format (new course, too). When we revert back to the previous version, the section titles come back. We are running PHP version 5.5.29. I also installed a fresh Moodle 2.7.11 version on my local machine and installed the collapsible formats topic, and notice the same problem.

Is there something else that we need to do for the update to work properly? Or perhaps is this a problem others have seen?

Thanks much..... Brian

Upgrade problem

When using the latest topcoll master, an upgrade is performed normally,
However doing a second upgrade for something unrelated fails due to a version mismatch in the topcol plugin.

Default exception handler: Cannot downgrade format_topcoll from 2017111301 to 2017110301. Debug:
Error code: cannotdowngrade

  • line 656 of /lib/upgradelib.php: downgrade_exception thrown
  • line 1850 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 181 of /admin/cli/upgrade.php: call to upgrade_noncore()

!!! Cannot downgrade format_topcoll from 2017111301 to 2017110301. !!!
!!
Error code: cannotdowngrade !!
!! Stack trace: * line 656 of /lib/upgradelib.php: downgrade_exception thrown

  • line 1850 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 181 of /admin/cli/upgrade.php: call to upgrade_noncore()
    !!

Return of 'numberofsections' breaks courses with >10 sections

Courses that had more than 10 sections in the pre-numberofsections versions of topcoll suddenly now have only 10 sections along with lots of support calls, "lots of my content has vanished". It's still there, of course, but now in orphaned sections.

in edit mode, the color of the section name is not set

I use essential and moodle 3.2.2
When switching to edit mode, the section name color is not set correctly.
I guess because it becomes an "a" tag while in editmode to have a button etc.
It needs an additional css tag to set the color also in edit mode- but I cant find a solution.
Try with
text color: #ffffff background-color : #000000
hover text color: #000000 background-color: #ffffff

Edit section name button disappearing when moving section and Toggle word added

When editing a course and moving a section, the editing icon used to rename a section disappears. The word - toggle also is appended to the recently moved section.

Steps to replicate:

Create a course.
Use Collapsed Topics as the format.
Turn editing on.
Make sure you have more than 3 sections.
Move section 5 to the first section
Result: The "edit section name" icon will disappear and the word - Toggle will be appended.

Adaptable theme and colours

Message from Alex....

Moodle3.2
Adaptable Theme
Relevant version of Collapsed Topics

The issue: the Course settings related to the Sections title and background colours override the Toggle foreground settings in the plugin.
I have also notices that the toggles are narrower on a different environment (Moodle 2.7, Essential theme and the relevant Collpsed Topic version).

version 3.2.1.1 (2016110102)

BOM in .gitattributes & local modifications upon checkout

There's a BOM at the beginning of .gitattributes which causes git to display the following notice when checking out the repository:

behavior, is not a valid attribute name: .gitattributes:1

Additionally, this may be causing issues with COPYING.txt and .travis.yml. Immediately after cloning the repo those two files are listed as modified--the only changes being line endings. This makes it impossible, for example, to checkout the V2.9.2.2 tag without first getting rid of the modified status of COPYING.txt and .travis.yml. (git complains that it would have to overwrite the local modifications.) A git checkout on those files does not seem to fix the issue either.

Long previous and next topic titles overwrite current topic title

When topics have long titles, the pagination links for the previous and next topics overwrite the current topic title and the Jump to menu when on the specific topic view (i.e. clicking the Topic # link to the right of the collapsed topic title). See attached screen shot. Thank you!
image

Make engagement information optional

Hello everyone,
from our lecturer we got the feedback, that they would like to hide the engagement information such as 'Due to' and 'submitted by x' since they have very large courses with large sections (which might not be recommendable, but it is hard to convince other people to change habits...). Anyway if you think that feature has the potential to be integrated I would provide a pull request.
Cheers,
Nina

Moving sections takes a very long time; >5minutes

I really like this course format, it solved a scroll of death issue we had with a 32 topic course. However we've found that if we need to move a section in Edit mode, it takes forever (10 minutes) for the busy cursor to disappear. It doesn't seem to matter whether the moved section has a lot or no content; the time is about the same.

As a workaround we change the course format back to the generic Topics format, move things around and then change back to your Collapsed Topics format.

Thanks for all your help.
Derek

Accordion/Collapsed Topic aria attributes improvements

Hi Gareth,

One of our clients has conducted an accessibility audit for their site. Below is one of the suggestions.

Description
Headings have been marked up with button roles using aria properties, however the state conveyed
using the aria-pressed property is not indicative of an accordion component.

Implications
Screen reader users may not understand the functionality of the component.

Recommendation
Ensure accordion/expand and collapse components the aria-expanded attribute to convey their state.

<div class="sectionhead toggle toggle-point" id="toggle-2">
<span class="the_toggle tc-small toggle_open" role="button" aria-expanded="true" tabindex="0"
id="yui_3_17_2_1_1546829310401_87">
<h2 class="sectionname" id="yui_3_17_2_1_1546829310401_86">
Topic 2: This is a very long topic title, which sometimes happens
</h2>
<div class="section_availability"></div>
</span>
</div>

The attribute should be set to true when the panel is open and false when closed. Additionally,
ensure the event which is triggered, is fired in the "onclick" event, to allow both keyboard and
screen reader users a method to activate the control.

Will submit pull requests later.

Thank you
John Y

Moodle notice

Hi Gareth,
On Moodle 2.7 I got this notification with full debugging turned on:

$section->showavailability property has been deprecated. You can replace it by checking if $section->availableinfo has content.

Should be an easy fix :)

Managers assigned at Course Category levels cannot change topcoll settings until course exists

To reproduce

  • Create a course category and assign a user (with no site assignments) the Manager role at that category
  • log in as that user
  • create a new course within the category, give it a name and shortname and change the course format to "Collapsable topics'
  • The page automatically refreshes but the collapsable topics settings are not shown (the issue!)
  • save the course settings page (creating the course) and work your way back to the settings page
  • the topcoll settings are now all shown

Analysis:
When a course is in the process of being created (on the settings page for the first time) and the course doesn't exist yet, the courseid defaults to 1 in the class format_topcoll, i.e. the 'front page' course. This is set in the class constructor. These users are assigned the Manager role in subcategories not the site itself. So, at this stage they do not have the 'changelayout' capability (because they have no site rights). Only when the settings page is saved and the course is created do they acquire these rights and can see the settings.

I think the fix is to make the context in which capabilities are checked become that of the parent category if no course currently exists.

Embed dissappears with Collpased topics course format

Hello,

There is a problem with Collapsed topic and H5P Embed -feature (iframe).

Tested with Moodle 3.3, Mod_hvp 1.6 and format_topcoll 3.3.1.0 (2017042202) and Clean-theme

Steps to repeat;

Embed H5P activity to some section f.ex section 1
Click "close all" to fold all sections
Edit some random activity on the course (no need to edit it) and select "save and return to course"
Expand the section 1 and notice how the embedded H5P-activity isn't displayed, it only displays the bottom bar of the embedded H5P-activity
If you refresh the page with F5 then the embedded activity is displayed.
So the problem is that embedded H5P-activity isn't displayed if you fold all sections -> edit something -> return to the cousre frontpage until you manually refresh the page.

h5p1
h5p2
h5p3
h5p4
h5p5
h5p6
h5p7
h5p8
h5p9
h5p10
h5p11

Tests fail on PHP7.4

togglelib::get_toggle_state attempts to access an null as an array. This returned null in PHP7.2, in PHP7.4 it causes the test to fail. I will be submitting a PR for the test shortly.

Crosshair and Edit link overwritten by long activity title

When an activity has a long title, the crosshair to the left (with editing turned on) and the Edit link to the right are overwritten by the activity title.

We are using version 3.6.0.3 2018121902 of the plugin and 3.6.5 of Moodle.

Screen Shot 2019-11-10 at 10 42 33 AM

Due date disappears when moving activities

Hi,

It's been found when you move an activity that is displaying it's due date on the course page, the due date will disappear until you refresh the page.

Initial state:
image

After moving the activity:
image

After page refresh:
image

Toggle Background Transparancy

Hi,

Just wondered if it would be possible to allow "transparent" as a colour option for "Toggle Background". Currently it'll only allow me to choose a hex RGB value.

Use case; making a topic show as "current topic", I'd like the topic title to match the "current topic" style.

Screenshot;
image

I'm happy to use an CSS override, but I thought other users might find this useful too.

Many thanks

private or protected

Hi Gareth

We are using format_topcoll on a project and its working very well. I wanted to add some icons to the header of each section, but I can't do much by overriding the renderer.

This is because the property variables (e.g $courseformat) are all declared "private" so subclasses can't access them. Is there a good reason why they are not declared "protected," which would allow renderer subclasses to use them?

Thanks

Accessible back to main course link.

Hi Gareth,

as discussed screen reader users do not find the select menu useful to return to main course view.

Adding this code :

// When viewing a section page, add a link back to the course. if ($section->section == 0 && $onsectionpage) { $o .= '<a href="' .new moodle_url('/course/view.php', array('id' => $course->id)). '"><span class="fa fa-caret-up"></span> ' .get_string('maincoursepage', 'format_topcoll'). '</a>'; }

to renderer.php line 523 helps with this.

If the link is only for screen reader users you could add the class sr-only and remove the icon.

Best wishes
Stuart

Accessibility

Have you ever considered making the tool more accessible to users with disabilities? As it is now it's fairly good, but there are some improvements that need to be made for screen reader users - for instance, notifying users the status of whether or not a section is collapsed. You can do this with ARIA techniques. It would look something like Example 1 at the following.

http://www.w3.org/WAI/GL/wiki/Using_the_WAI-ARIA_aria-expanded_state_to_mark_expandable_and_collapsible_regions

I'm happy to work with you on this.

Apply MDL-55074

Need to apply MDL-55074 as affects navigation in M3.3 (missing sections in Boost nav drawer), however applies to M3.2 so need there +.

Make show information alert colors accessible

Several of the text/background colors used on the assignment/quiz/choice/etc show information alerts are not accessible. Please consider modifying the styles to meet color contrast requirements.

If you are interested, these are the style overrides I put in place in our theme:

// Collapsed topics success alerts
.format-topcoll .ct-activity-date-submitted {
background-color: #d4edda;
}

.format-topcoll .ct-activity-date-submitted a {
color: #155724;
}

// Collapsed topics warning alerts
.format-topcoll .ct-activity-date-nearly-due {
background-color: #FFF3CD;
}

.format-topcoll .ct-activity-date-nearly-due a {
color: #856404;
}

// Collapsed topics danger alerts
.format-topcoll .ct-activity-date-overdue {
background-color: #f8d7da;
}

.format-topcoll .ct-activity-date-overdue a {
color: #721c24;
}

.format-topcoll .ct-activity-date-overdue .text-warning {
color: #721C24 !important;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.