Code Monkey home page Code Monkey logo

adapt-contrib-pagelevelprogress's Introduction

adapt-contrib-pageLevelProgress

Page Level Progress is an extension bundled with the Adapt framework.

page level progress bar clicked and drawer opening, showing completion status of components

This extension displays the learner's progress through a page via a progress bar displayed in the top navigation area. Progress is calculated as the percentage of child components that have been completed. Clicking on the progress bar opens the drawer to reveal buttons showing the title and completion status of individual components in the page; these buttons can be clicked to scroll directly to the component in the page (if it is available and not hidden by trickle/similar).

Page progress may also be displayed on menu items representing the page.

Visit the Page Level Progress wiki for more information about its functionality and for explanations of key properties.

Installation

As one of Adapt's core extensions, Page Level Progress is included with the installation of the Adapt framework and the installation of the Adapt authoring tool.

  • If Page Level Progress has been uninstalled from the Adapt framework, it may be reinstalled. With the Adapt CLI installed, run the following from the command line: adapt install adapt-contrib-pageLevelProgress

    Alternatively, this extension can also be installed by adding the following line of code to the *adapt.json* file:
    `"adapt-contrib-pageLevelProgress": "*"`
    Then running the command:
    `adapt install`
    (This second method will reinstall all plug-ins listed in *adapt.json*.)
    
  • If Page Level Progress has been uninstalled from the Adapt authoring tool, it may be reinstalled using the Plug-in Manager.

Settings Overview

The attributes listed below are used in components.json to configure Page Level Progress, and are properly formatted as JSON in example.json.

The absence of the _pageLevelProgress object in a component model is interpreted as that component having Page Level Progress disabled ("_isEnabled": false).

By default, calculation of the percentage of child components that have been completed includes all components, even those that have pageLevelProgress disabled and those with no _pageLevelProgress object in the component model. In order to have a component ignored in this calculation, you must set either _isOptional to true in the component model (components.json) or set the _showPageCompletion property (see Attributes) to false in either course.json or contentObjects.json

The same _pageLevelProgress object may be added to components (components.json), blocks (blocks.json) and articles (articles.json). At this level "_isEnabled" adds a bar to the list of progress items appearing in the drawer. Adding "_isCompletionIndicatorEnabled" at this level adds a progress bar next to the title of element in the page.

The same _pageLevelProgress object may be added to contentObjects (contentObjects.json). At this level "_isEnabled" governs whether a progress bar will be displayed on the menu item. It does not act to provide defaults for its child components. It does not override their settings. Setting "_excludeAssessments" to true will prevent assessments from being included in calculations for page level progress. Adding "_isCompletionIndicatorEnabled" at this level adds a progress bar next to the title of element in the menu.

The same _pageLevelProgress object may be added to the course (course.json). At this level, "_isEnabled" can be used to disable Page Level Progress on components and contentObjects that have "_isEnabled": true. In some cases, indicators are required on the page but not in the drawer, "_isShownInNavigationBar" is used to turn off the drawer button.

Note: Setting the _pageLevelProgress object in course.json does not provide defaults for components, blocks, articles or contentObjects. It cannot be used to enable Page Level Progress on components or contentObjects that have "_isEnabled": false or that do not have the _pageLevelProgress object in their model json. Visit the Page Level Progress wiki for more information about how they appear in the authoring tool.

Attributes

Add to course.json under _globals._extensions.

_pageLevelProgress (object): The Page Level Progress object

_navOrder (number): Determines the order in which the page level progress is displayed in the navigation bar. Negative numbers (e.g. -100) are left-aligned. Positive numbers (e.g. 100) are right-aligned.

navLabel (string): The text for the button label. Used when navigation labels are enabled globally

_drawerPosition (string): The position that the button appears in the drawer. Position options include 'auto', 'left', and 'right'. Defaults to 'auto'

_navTooltip (object): The tooltip object. Used when tooltips are enabled globally

_isEnabled (boolean): Enables tooltips on the button

text (string): The text of the tooltip

Add to course.json.

_pageLevelProgress (object): The Page Level Progress object that contains a value for _isEnabled.

_isEnabled (boolean): Turns Page Level Progress on and off. Acceptable values are true and false.

title (string): Alternate course title to display when using _showAtCourseLevel: true.

_isCompletionIndicatorEnabled (boolean): Adds a completion indicator next to the title of a component, block, article, page or menu. Acceptable values are true and false.

_isShownInNavigationBar (boolean): Allows Page Level Progress to appear in the navigation bar. Acceptable values are true and false.

_showPageCompletion (boolean): Set to false to have the overall progress calculated only from components that have been set to display in Page Level Progress (ignoring the completion of those that haven't). Defaults to true.

_showAtCourseLevel (boolean): Allows Page Level Progress to display all content objects and the current page components together, or just the current page components as before. Acceptable values are true and false. Defaults to false.

_useCourseProgressInNavigationButton (boolean): Allows Page Level Progress to use course-level completion for the navigation button instead of page-level completion. Defaults to false.

Add to contentObjects.json.

_pageLevelProgress (object): The Page Level Progress object that contains a value for _isEnabled.

_isEnabled (boolean): Turns Page Level Progress on and off. Acceptable values are true and false.

_isCompletionIndicatorEnabled (boolean): Adds a completion indicator next to the title of a component, block, article, page or menu. Acceptable values are true and false.

_showPageCompletion (boolean): Set to false to have the overall progress calculated only from components that have been set to display in Page Level Progress (ignoring the completion of those that have not).

_excludeAssessments (boolean): If true, prevents assessments from being included in calculations for page level progress.

Add to components.json, blocks.json or articles.json.

_pageLevelProgress (object): The Page Level Progress object that contains a value for _isEnabled.

_isEnabled (boolean): Turns Page Level Progress on and off. Acceptable values are true and false.

_isCompletionIndicatorEnabled (boolean): Adds a completion indicator next to the title of a component, block, article, page or menu. Acceptable values are true and false.

Accessibility

Several elements of Page Level Progress have been assigned a label using the aria-label attribute: pageLevelProgress, pageLevelProgressIndicatorBar and pageLevelProgressMenuBar. These labels are not visible elements. They are utilized by assistive technology such as screen readers. Should the label texts need to be customised, they can be found within the globals object in properties.schema.

Limitations

No known limitations.


adapt learning logo Author / maintainer: Adapt Core Team with contributors
Accessibility support: WAI AA
RTL support: Yes
Cross-platform coverage: Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, IE11, Safari 12+13 for macOS/iOS/iPadOS, Opera

adapt-contrib-pagelevelprogress's People

Contributors

andrewhosgood avatar brian-learningpool avatar cahirodoherty-learningpool avatar chris-steele avatar chucklorenz avatar dancgray avatar danielghost avatar darylhedley avatar dependabot[bot] avatar guywillis avatar himanshu1618 avatar jamesrea83 avatar jamieshepherd avatar joe-allen-89 avatar kirsty-hames avatar lc-thomasberger avatar lemmyadams avatar moloko avatar nayankhedkar avatar nilslp avatar oliverfoster avatar olivermartinfoster avatar ryan-lynch avatar ryanrolds avatar semantic-release-bot avatar simondate avatar swashbuck avatar taylortom avatar tomgreenfield avatar zenduo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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

adapt-contrib-pagelevelprogress's Issues

Page Level Progress and Accordion component

Hi, I have been using the latest version of the Adapt framework and builder, and I am having an issue regarding the page level progress component. I have noticed that the second time you visit a page with the page level progress, it doesn't seem to log when you complete an accordion component. I have noticed that it is only the accordion one that is having a hard time and ONLY on the second time through the course. You will see the other components on the page mark complete as you go through but the accordions no.

Convert block elements to inline

Block level elements fails the w3c validator when they are children of button or label elements.

Convert block level elements to inline to pass w3c validator checks.

Nav bar button aria-label is too long

Subject of the issue

The .nav__pagelevelprogress-btn aria-label is too long. As a general rule, alt text or aria should be as succinct as possible, without sacrificing accuracy.

Current nav bar button aria-label:
"Page progress. Use this to listen to the list of regions in this topic and whether they're completed. You can jump directly to any that are incomplete or which sound particularly interesting. {{percentageComplete}}%"

nav_btn_aria

Current PLP drawer aria-label (this is read when the PLP drawer is opened before you interact with the PLP items):
"Page sections"

drawer_list_aria

Expected behaviour

I think the .nav__pagelevelprogress-btn should have a shorter label and additional instruction to be added to the drawer instruction instead.

Suggestion example:

"pageLevelProgressIndicatorBar": "Page progress. {{percentageComplete}}%. Open page sections."
"pageLevelProgress": "List of page sections and completion status. Select incomplete sections to jump directly to the content."

calculateCompletion / overlapping scope of variables?

Using frame work 5.18.6 with AT 0.10.5 and adapt-contrib-pageLevelProgress-5.3.0 on an older freshly imported course the progress level indication seemed to be completely messed up.

So I had to start some more extensive trouble-shooting. There may be some error in the code of completionCalculations.js with regard to the function calculateCompletion(contentObjectModel) and its recursive call in line 62.

I think a problem arises as for instance completion.nonAssessmentTotal shares the same name

in line 34: completion.nonAssessmentTotal = nonAssessmentComponents.length;; and
in line 65: completion.nonAssessmentTotal += completionObject.nonAssessmentTotal;

In line 65 a sum is calculated. However this sum is always reset when line 34 is calculated during the recursive call of the function.

I was able to see that by using console.log quite a bit in conjunction with a newly created simple dummy course. The same is true for the other related variables.

After basically correcting this error I got correct progress level indications on my course again.

However, after renaming the variables I had to adapt the initialization and calculatePercentageComplete accordingly, as well.

Why this error did not pop-up in my older (pre 5 framework) version, I do not understand at this moment, as the code remained more or less unchanged since then.

Kind regards,
Wolfgang

Add alt text for accessibility

  • Add altText string to course.json file
  • Append this to the percentage of completed components in a page and add as alt text

no longer jumping to block

Is it now a feature that clicking a link in the popout panel that it doesn't jump to the component until exiting?

Your environment

  • version (AT v11.1 Framework v5.24.00)
  • which browser and its version
  • device(s) + operating system(s)

Steps to reproduce

Tell us how to reproduce this issue.

Expected behaviour

The page used to move on click in the popout window

Actual behaviour

After clicking the component link, it automatically jumps to the component after the X button is clicked.

Screenshots (if you can)

Level progress menu after completing a section

Complete a section and go back to main manu, enter the section you just completed again. Click on level progress bar to display progress menu. Result is all of the completed componenets are not marked as complete in the menu.

Level progress bar appears completed but componenets in the menu don't and interacting with them again in the section doesn't do anything.

Replace progress bars with icons in certain cases

Subject of the enhancement

In the PLP drawer, component completion is only represented by two states: "incomplete" or "complete". Presentation components like Accordion do not show partial completion when, for example, one of three items have been visited. The progress bar is either empty (incomplete) or full (complete).

If we were to switch the component progress bars to completion icons, this may increase the user's comprehension of what has been completed and what is still left. Furthermore, a lock icon could be used to indicate a locked state.

This could be a new, configurable option or we could replace the current behavior entirely.

Drawer example

Component title example

Remove nav PLP btn line height

Subject of the issue

The line-height: 0; style applied to the .nav__pagelevelprogress-btn selector can cause an issue with accessibility options that alter the line height display within a course.

This line height style is required to ensure the height of the parent container matches that of its children. With a small amendment this line height style can be removed and replaced with alternative styling that achieves the same effect.

Your environment

  • 5.x FW / AAT

Option to make PLP drawer open from the left side

Subject of the issue

By default, the PLP drawer opens from the right side. Now that we can rearrange the navigation buttons via config, we can move the PLP nav button to the left. In this case, it seems to make more sense to have the PLP drawer open from the left since it's closer in proximity to the PLP nav button.

It would be nice to have this as a configurable option that's also separate from other drawer functionality. For instance, the PLP drawer could open from the left while the Resources drawer opens from the right.

Related:
adaptlearning/adapt-contrib-core#219

Enhancement - Course Level Progress

Subject of the issue/enhancement/features

I have received feedback from a large set of user survey data that the current PLP settings give learners the false impression they have nearly completed the course. In actuality, they are almost done with the current page. I will be evaluating the recent addition _showAtCourseLevel, in a live setting. But additionally, I am adding a course level progress meter in the menu header that may trigger the PLP drawer.

If there is an appetite for this visual indicator, I am happy to add my work to a PR. I believe even screen reader users may benefit from something like this.

Lastly, this plug-in now adds progress meters to various elements through the course experience and is not solely focused on a page-level experience anymore. I would suggest changing the name to adapt-contrib-progression.

Rough Visual Draft

course-progress

pageLevelProgressEnd aria-label isn't used

Subject of the issue

I can't see that pageLevelProgressEnd aria-label is used by the plugin. When I search for this it only returns the README and schema files. Was this removed at some point (I couldn't see anything in the blame history) or has this just been overlooked and never utilised?

Expected behaviour

As per the aria-label, "You have reached the end of the list of page sections", I'd expect this to read when you reach the bottom of the drawer.

_showAtCourseLevel: Add CSS classes

Subject of the enhancement

When using _showAtCourseLevel: true, it would be helpful to have a class like is-selected that indicates which item in the PLP drawer is the current item (content object or menu).

In the following screenshot, it's difficult to tell that the user is currently in the "Adapt components" topic. Ideally, we would be able to style that button differently.

It may also be useful to have a class added to the .pagelevelprogress element that indicates if course level is being used (ex. .is-course-level).

Component progress colours reversal

Is it just me or does it not look feel natural that the non completed sections are filled white and the completed ones look empty, this also looks the opposite of the main page progress bar
I realise this is a styling issue that can be fixed with theme

Drawer not closing when switching between content objects

Subject of the issue/enhancement/features

Drawer not closing automatically when switching between content objects.

Your environment

  • FW v5.22.8
  • Chrome

Steps to reproduce

Open PLP with _showAtCourseLevel set to true
Select a different content object from the current.

Expected behaviour

Navigates to the new content object/menu and drawer automatically closes

Actual behaviour

Navigates to the new content object/menu as expected. Drawer clears but does not close automatically, can still be closed manually.

Navigation padding variable, when changed the error is thrown at the page-level-progress-navigation

I've been updating the padding for navigation bar from @navigation-padding: 5px;, single value to @navigation-padding: 5px 0px 5px 26px; multi-value form. With this change during the compiling I've got following error:

Running "less:dist" (less) task
>> OperationError: Operation on an invalid type in src/less/adapt.less on line 6
658, column 5:
>> 6657 .page-level-progress-navigation {
>> 6658     padding:(@navigation-padding+6px);
>> 6659     @media all and (max-width:(@device-width-medium - 1px)) {
Warning: Error compiling src/less/adapt.less Use --force to continue.

Aborted due to warnings.

Probably theme should give more granular padding variables for this
adaptlearning/adapt-contrib-vanilla#185

Help texts are inaccurate: properties.schema

Currently the same help text is repeated in three places:
"help": "If set to 'true', this component will be tracked by PageLevelProgress"

Needs to change to something like this:
On course:
"help": "If set to 'false', Page Level Progress will be disabled on all components, pages, and menus"

On contentObject:
"help": "If set to 'true', progress bar will be displayed"

On component, no change is needed. Retain:
"help": "If set to 'true', this component will be tracked by PageLevelProgress"


The same object is being used on three levels, but has very different impact:

"_pageLevelProgress": {
        "_isEnabled": true
    }

Perhaps this could be refactored/renamed in the future.
On course:
"_disablePageLevelProgress"
Currently it is switch that only disables children that have been explicitly enabled. It does not enable children where the PLP object has been set to false ("_isEnabled": false) or where the PLP object has been omitted. It does not provide defaults for children.

On contentObject:
"_displayProgressBar"

On component, no change is needed.
"_isEnabled"

Article + Blocks should be available in plp

If an article or block title describes a series of components with not titles, PLP will still take you to the component and the article / block title will be off the screen.

This looks terrible.

Need to allow articles and block in the PLP

On beta clicking progress icon opens but does not close draw.

When the draw is open, if you could also click the progress icon (in the nav bar) to close the draw this would be a nice little touch.

Same comment from @zmisiak:
"Clicking on a list icon opens a Drawer. It can be closed using the X or by clicking again on list icon - this is OK.

Clicking on progress bar opens tab with items and shows progress - OK. However clicking again on progress bar does not close it, only X works.

Tested with Firefox 28.0"

Remove nav PLP btn line height

Subject of the issue

The line-height: 0; style applied to the .nav__pagelevelprogress-btn selector can cause an issue with accessibility options that alter the line height display within a course.

This line height style is required to ensure the height of the parent container matches that of its children. With a small amendment this line height style can be removed and replaced with alternative styling that achieves the same effect.

Your environment

  • 5.x FW / AAT

JSON code needs to be attached to all COs when installed

Subject of the issue/enhancement/features

Page level progress json is required at content object level, on all content objects, even if it's not being used. If it isn't in causes errors to trigger in the console

Your environment

  • Framework 5.31.7
  • Edge (latest)
  • Windows

Steps to reproduce

I recently tried this (having it attached and enabled to some content objects and not on present on others, where there was no requirement for it), and it threw up lots of errors and stopped some pages from loading. The following error was triggered each time a component was completed, globally.

The fix was to attach the PLP json to each content object but then disable it where it isn't required.

Expected behaviour

This doesn't seem consistent with how it behaves at component level, where if you don't attach it to a component, it just excludes it from the PLP menu with no errors. Please could it be made consistent with component level please? So if you don't include it at CO level, it's not used on the page with no errors?

Screenshots

image

Pages won't load if no PLP components are on it

Subject of the issue/enhancement/features

I've just created a fresh new course in the Framework and added a new page. The page had no components with PLP on it, even with the PLP JSON there but set to disabled and didn't load. I got this error

image

Your environment

  • version (AT/Framework) FW v5.24.8
    PLP v6.2.4

completion calculation issue

A recent project has highlighted a problem with the way completion is calculated, resulting in PageLevelProgressNavigationView not rendering 100%.

Scenario: page has a subset of its components enabled for PLP. All components in this subset are completed. When other (non-optional) components remain incomplete the page remains incomplete. Because completionCalculations uses page completion in its calculation, PageLevelProgressNavigationView therefore does not render 100%.

Missing navigation bar ordering description

Subject of the issue/enhancement/features

The navigation bar order feature is missing description text to explain its purpose.

Related Tickets

#61

Your environment

  • FW v5.24.7
  • AAT v1

Steps to reproduce

Please see project settings in AAT v1.

Expected behaviour

A tooltip descriptor should explain its purpose.

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.