Giter Site home page Giter Site logo

evasys-community / moodle-block_onlinesurvey Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 4.0 22.6 MB

The evasys Moodle Block allows students to display links to evasys online surveys on their home page, which are available for them to participate.

License: GNU General Public License v3.0

PHP 34.91% JavaScript 2.27% CSS 5.45% Less 27.95% SCSS 28.31% Mustache 1.11%
moodle moodle-block moodle-plugin

moodle-block_onlinesurvey's Introduction

moodle-block_onlinesurvey

Moodle Plugin CI

Moodle block plugin which allows you to quickly and easily integrate survey information data from evasys into Moodle. With this block, you can place links to evasys online surveys directly on the Moodle frontpage and dashboard as well as on course overview pages.

Moodle requirements

This plugin requires Moodle 4.0+

evasys requirements

Please note that this plugin requires a commercial subscription of evasys and a running instance of at least evasys version 7.1 (2151).

For details about evasys, please see https://en.evasys.de/ (english) or https://www.evasys.de/ (german).

Plugin description

This plugin allows you to quickly and easily integrate survey information data from evasys into Moodle. With this block, you can place links to evasys online surveys directly on the Moodle frontpage and dashboard as well as on course overview pages.

Two types of connection are available: Data can be exchanged either via an LTI interface or via SOAP web services. Depending on the type of connection, different functions are at your disposal. When using LTI, you can display survey information in the learner view as well as in the instructor view. When using SOAP, survey information can only be displayed in the learner view.

By implementing a single sign-on solution, learners as well as instructors only have to register with Moodle. It is not necessary to enter evasys PSWDs to participate in surveys.

Installation

Install the plugin like any other plugin to folder /blocks/onlinesurvey

See http://docs.moodle.org/en/Installing_plugins for details on installing Moodle plugins

Usage & Settings

To configure the plugin and its behaviour, please visit: Site administration -> Plugins -> Blocks -> Evaluations (evasys).

There, you find multiple sections:

Appearance

The settings in this section define how the evasys block will be displayed.

Communication

The settings in this section define how the evasys block will communicate with evasys.

SOAP settings

The settings in this section define how the evasys block will communicate with evasys. These settings are only required if you selected "SOAP" in the "Communication protocol" setting.

LTI settings

The settings in this section define how the evasys block will communicate with evasys. These settings are only required if you selected "LTI" in the "Communication protocol" setting.

Expert settings

The settings in this section normally don't need any modification and are provided for special usage scenarios.

Documentation

An in-depth documentation of the plugin's settings and its usage is provided as PDF on https://github.com/evasys-community/moodle-block_onlinesurvey/blob/master/DOCUMENTATION.en.pdf (english) and https://github.com/evasys-community/moodle-block_onlinesurvey/blob/master/DOCUMENTATION.de.pdf (german).

Theme support

This plugin has been developed on and tested with Moodle Core's Boost and Clean (until Moodle 3.6) and Classic (from Moodle 3.7 on) themes. While this plugin should also work with other Bootstrap-based third party themes, we can't support any other theme than Boost, Clean and Classic.

Plugin repositories

This plugin is published and regularly updated in the Moodle plugins repository: http://moodle.org/plugins/view/block_onlinesurvey

The latest development version can be found on Github: https://github.com/evasys-community/moodle-block_onlinesurvey

Bug and problem reports / Support requests

Please report bugs and problems on Github: https://github.com/evasys-community/moodle-block_onlinesurvey/issues

Feature proposals

Please issue feature proposals on Github: https://github.com/evasys-community/moodle-block_onlinesurvey/issues

Please create pull requests on Github: https://github.com/evasys-community/moodle-block_onlinesurvey/pulls

Translating this plugin

This Moodle plugin is shipped with an english language pack only. All translations into other languages must be managed through AMOS (https://lang.moodle.org) by what they will become part of Moodle's official language pack.

As the plugin creator, we manage the translation into german on AMOS. Please contribute your translation into all other languages in AMOS where they will be reviewed by the official language pack maintainers for Moodle.

Right-to-left support

This plugin has not been tested with Moodle's support for right-to-left (RTL) languages. If you want to use this plugin with a RTL language and it doesn't work as-is, you are free to send us a pull request on Github with modifications.

Maintainers & Copyright

Product owner:
evasys GmbH
www.evasys.de

Current maintainer and developer:
Moodle partner lern.link
www.lernlink.de

Credits

This plugin was initially developed by:
Soon-Systems-GmbH
www.soon-systems.de

moodle-block_onlinesurvey's People

Contributors

abias avatar ak-evasys avatar amrita1991 avatar evasys avatar evasys-pm avatar jaybraker avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

moodle-block_onlinesurvey's Issues

Block height is not enough for users having with both Learner and instructor roles

In our moodle system, there is a possibility that a user can be an instructor in one course and a learner in another. However, in such situations the height the Evasys block gets messed up. The code firstly checks for the number of survey a user has as a learner. Then it counts the number of surveys the user has as an Instructor ONLY if there are no surveys as a a learner. This makes, for users who have both roles,
total surveycount = surveycount as a learner ....instead of
total surveycount = surveycount as a leaner + surveycount as a instructor.

The CSS governing the height of the block is dependant on the total survey count of a user and hence in this scenario the height is reduced.

The best way to correct this is to remove the IF condition which check if the surveycount for the user as learner is zero. Refer to Pullrequest #32

Evasys popup doesnt allow to open html links with left click

Hi,

when using the popup option provided by the plugin (block_onlinesurvey | survey_show_popupinfo), links added to the html content cant be opened with a simple left click, while it does work with middle and right click.
Can be easily reproduced with this simple setup :
image

After some research the issue seems to be caused by the e.preventDefault() here :
https://github.com/evasys-community/moodle-block_onlinesurvey/blob/master/amd/src/modal-zoom.js#L150
Commentating the line fixes the problem.
The issue affects versions 3 and 4.

Simplify mechanism to show the block if there are surveys and hide it otherwise

Currently, the block_onlinesurvey/survey_hide_empty settings works in a way that the block is hidden by default (https://github.com/EPPlugin/moodle-block_onlinesurvey/blob/master/onlinesurvey/style/block_onlinesurvey_hide.css) and shown by some small inline JavaScript if surveys are detected (https://github.com/EPPlugin/moodle-block_onlinesurvey/blob/master/onlinesurvey/lib.php#L441-L443).

This feels somehow weird as it would be easier to just add some 'hidden' CSS class to the block if it should be hidden. However, the described approach was necessary as theme_boost did not render custom block classes - until now! https://tracker.moodle.org/browse/MDL-58315 seems to get rid of this limitation and was integrated to 3.5, 3.6 and 3.7 recently.

It would be worthwhile to check if the JavaScript code can be replaced by a simple CSS class show/hide mechanism or not.

Replace the background images with CSS solutions in compact mode

In compact mode, the displayed content consists of a background image and a number which is placed on the background image.
The background image itself consists of a blue circle, a light computer icon and the magnifier icon:
Dashboard_und_Dashboard

The fact that the layout is dictated by a background image makes it difficult to adapt the compact mode's look and feel to local identity needs without quirky solutions.

We especially want to control modify these elements of the compact view:

  • The color of the circle
  • The size of the circle and the number which is placed in the circle
  • The type if the icon and the fact that there is an additional icon at all

I would propose to drop the background image completely and rebuilt the layout in pure CSS which can then be overwritten by the admin in block_onlinesurvey | additionalcss.

What are the intended applicable_formats() ?

The current implementation of the applicable_formats() does not look intuitive to me:

    public function applicable_formats() {
        $context = context_system::instance();
        if (has_capability('moodle/site:config', $context)) {
            return array('all' => true);
        } else {
            return array(
                'all' => false,
                'admin' => true
            );
        }
    }

what are you trying to achieve here?

Improve look & feel of the SOAP survey list

The SOAP survey list is generated in Moodle based on the survey list which is returned from EvaSys via SOAP.

The look & feel of this survey list can be improved.

Currently, the not-zoomed list looks like this:
Dashboard
I propose to

  • Remove the background color and present the list like a standard list in Moodle looks like
  • Respect the link colors which are used in the Moodle theme.
  • Respect the font family which is set in the Moodle theme.
  • Show the list items in an appropriate font size which matches other lists in Moodle.

Currently, the zoomed list looks like this:
Dashboard
I propose to

  • Implement all proposals of the non-zoomed list here as well.
  • Add a heading to the modal window
  • Maybe add a short information text to the modal window like we see it in the LTI mode below the survey list

Boilerplate: Files do not have the expected header

Your files do not have the correct Moodle bolierplates added. All Moodle plugin files must have the Moodle boilerplate gpl text added that starts with:

// This file is part of Moodle - http://moodle.org/

As previously mentioned:
https://tracker.moodle.org/browse/CONTRIB-6899?focusedCommentId=470465&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-470465

You can also check your compliance with this using the moodle local_codechecker plugin.

Improve the magnifier icon below the survey list

There is a magnifier icon below the survey list which is used to open the zoomed survey list in a modal window.

Currently, the not-zoomed list looks like this:
image

In other areas of Moodle, buttons or text links are used to link to detail pages like the zoomed survey list.

I propose to evaluate if the magnifier icon should be replaced by a button labeled with "All surveys". The benefit would especially be that the clickable area would be bigger and more mobile friendly.

Block loading issue

Sometimes when the block is loading, the loading icon keeps running without actually loading the content. It gets fixed if you refresh your browser after a while. The cause according to me is a timeout issue where the content gets loaded before registration of the 'load' event listener.(spinner.js)

Remove magnifier icons in compact mode when no surveys are available

In compact mode, there are two magnifier icons shown in the block even when no surveys are available: One icon at the bottom right end of the block which lets you open the zoomed popup where you only get the same information that no surveys are available. And another icon as part of the blue circle picture in the middle of the block even though this area is not clickable when no surveys are available:
Dashboard

I propose to remove both magnifier icons in compact mode when no surveys are available.

Having said that, if there is a valid use case to open the zoomed popup even if there is no open survey, I would propose to at least remove the magnifier icon in the bottom right end of the block like I have proposed in #19.

Remove one of the two magnifier icons in compact mode when surveys are available

In compact mode, there are two magnifier icons shown in the block when surveys are available: One icon at the bottom right end of the block. And another icon as part of the blue circle picture in the middle of the block:
Dashboard

I propose to remove one of these two magnifier icons in compact mode when surveys are available.

As the blue circle is completely clickable and thus is the bigger clickable area, I would propose to remove the magnifier icon in the bottom right end of the block.

missing require_login check in show_surveys.php

show_surveys.php should have a require_login check added.

this should also be moved to the top of the page so you can use it in the require_login check:
$courseid = optional_param('cid', 1, PARAM_INT);

LTI Invalid request for moodle block 3.9

Hi,

I'm using moodle block version 3.9 and having trouble connecting to Evasys 8.2 (using LTI). The error is "Invalid request" when you click on the magnifier icon.
However it has no connection issue to Evasys 7.1. The survey can load fine.
Are you able to advise?

Regards,
Fran

missing privacy api support

moodle has recently added a privacy API for GDPR compliance - it would be good if you could implement the new privacy api in your plugin.

This is not currently a blocker for approval in the plugins db, but will be a blocker for many organisations that may want to use your plugin. Moodle's core unit tests fail when a plugin is installed that does not comply with the privacy api so organisations that rely on Continuous Integration to deploy their site will also not be able to use your plugin until this is fixed.

Please add further detail about the commercial subscription requirements to the plugins db entry.

This is an integration plugin but no information on the subscription conditions (or even a link to such a page) is provided.
At the very least, please add a prominent statement to the plugins db description to state that to use your plugin a commercial level subscription is required, with a link to your pricing information on your main site.

As previously mentioned:
https://tracker.moodle.org/browse/CONTRIB-6899?focusedCommentId=470465&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-470465

Improve look & feel of the LTI survey list

EvaSys ships with a preconfigured LTI template which provides already everything which has to be shown to the user in Moodle.

However, the look & feel of this survey list can be improved.

Currently, the not-zoomed list looks like this:
Dashboard_und__LMS-2063__EvaSys_Integration_-Nachbesserungen_am_EvaSys-Plugin-Besseres_Alternatives_EvaSys-Template_für_Plugin__LTI_-_kiz_JIRA

I propose to

  • Remove the header (which says "My Survey Dashboard" and has the EvaSys logo) in this view as it costs too much real estate and does not provide any value to the user here.

Currently, the zoomed list looks like this:
Dashboard

I propose to

  • Test if the heading term "My Survey Dashboard" can be relabeled as "Dashboard" is already a used term in Moodle and might produce confusion.

For both views, I propose to:

  • Try to adapt the font colors, background colors and font families to Moodle standard styles to produce a even more seamless user experience.

All changes could be realized by providing a dedicated EvaSys LTI Template for Moodle which can be shipped with this plugin package.

Survey block is hidden, even in edit mode

Hey,

Looks like if the option to hide the survey block is enabled, the block is hidden in edit mode as well.

This means that if we need to update where the block is on a page, we need to unhide it, then do the modification, then re-hide the block. This can't be done by most staff at universities, and can only be done by admins.

Could we get this amended so it's no longer hidden when edit mode is active?

Thanks

incorrect title in moodle.org plugins db entry

in your moodle.org plugins db entry you use the title "Moodle Plugin-in for EvaSys" - the moodle.org plugins database is only for moodle plugins. Can you please rename this in the moodle plugins database to something like "Evasys"

incorrect file structure in github.

Plugins in git repositories should have the code sitting in the root directory of the git repo (not inside the "onlinesurvey" folder you have included in this repository)- this allows sites to use git subtrees/submodules to add your code to their existing moodle sites. Please move all the code into the root of this repository.

Invalid Request error

Hi

actually we had error on the evasys plugin, since awhile it only show "Invalid request." on the block.
But the funny thing is with the same setting the external tool (LTI) connection from Moodle activity works without any problem.

Our current Moodle: 4.0.5
Evaluations(evasys) : v4.0-r1
Evasys+ version: 9

is there any tips? to solve this problem... or is anyone has the same problem?

Thank you in advance!

Missing Height

In our Moodle 3.8.2 the plugin was not displayed because the height was not defined correctly. The following snipped solves the problem:

.block_onlinesurvey #block_onlinesurvey_contentframe {
min-height: 250px;
height: 250px;
}

Moodle block showed an incorrect number of open polls

Hi,

the moodle block showed an incorrect number of open polls. There, twice the number of actually open surveys was always displayed. If you had 2 open surveys, 4 were displayed in the block.
So we debugged and came across a change in "locallib.php" about line 516 from version "2021112501" to "2021112502".
We exchanged the following lines again with the old programming and it works again as before.

The following part is new and generates the error (with default regex):

if (!empty($reinstructor)) {
$surveycount += preg_match_all($reinstructor, $content2, $matches, PREG_SET_ORDER, 0);
}

We changed it as it was in the old version:

if (empty($matches) && !empty($reinstructor)) {
$surveycount = preg_match_all($reinstructor, $content2, $matches, PREG_SET_ORDER, 0);
}

Debug notices during installation

Notice: Undefined property: stdClass::$block_onlinesurvey_survey_debug in .../blocks/onlinesurvey/block_onlinesurvey.php on line 58

I suspect this is because the code is executed early during the installation when the configuration has not yet been stored.

incorrect repository name in github

As previously reported by David (https://tracker.moodle.org/browse/CONTRIB-6899?focusedCommentId=470465&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-470465)

The github repository name "EvaSys_Moodle-Block" is incorrect. The correct naming convention is "Moodle-block_onlinesurvey" as per the name you have used in your block. You may also want to consider renaming the block completely from "block_onlinesurvey" to "block_evasys" as this more accurately reflects the purpose of your block.

consider adding travis-ci support to github repo

once you have fixed the structure of your code (see issue #6) it would be good if you added travis-ci support to your plugin so that you can improve your code to meet the moodle coding guidelines.

More information on this is here:
https://moodle.org/mod/forum/discuss.php?d=323384

but the short version:
grab this file:
https://github.com/moodlerooms/moodle-plugin-ci/blob/master/.travis.dist.yml
rename it as .travis.yml and put in the root of your github directory.
Go to:
https://travis-ci.org/profile/EPPlugin
Flick the switch for this repo.

then on every commit you make to github it will fire off a request to travis to run the tests in .travis.yml and will give you traffic lights beside each commit and generate a report.

something else you might want to change:
in .travis.yml the default file has this line:

env:
global:

MOODLE_BRANCH=MOODLE_32_STABLE
you might want to add other branches to that list (or remove 32_STABLE because it's not supported.) so you might want to change it something like:

env:
global:

MOODLE_BRANCH=MOODLE_33_STABLE
MOODLE_BRANCH=MOODLE_34_STABLE
MOODLE_BRANCH=MOODLE_35_STABLE

doing this also makes it much easier for us to review your code.

invalid use of curl

As previously mentioned in https://tracker.moodle.org/browse/CONTRIB-6899?focusedCommentId=470465&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-470465

The onlinesurvey_soap_client class should use the Moodle core inbuilt wrapper instead of the native curl calls to respect the site network settings, proxies etc

Please use Moodle core APIS to perform curl calls instead of using native PHP functions - you may find that the onlinesurvey_soap_client file isn't needed at all.

Switch implementation of popups to a more standard implementation

The implementation of the plugin's popups which appear for the login message and for the detailed view of the survey list is currently a custom implementation.

Moodle core already has an implementation for modals which is derived from Bootstrap modals and which is, for example, used in the user tours
Banners_and_Alerts_und_Dashboard
or in the calendar interface
Banners_and_Alerts_und_Sandbox__Calendar__Detailed_month_view__March_2019

You will see differences in the modal's appearance, edges, shadow and close button.

I would propose to switch the implementation of the plugin's popups to a more standard implementation which is based on Moodle core's modals and which is only modified where necessary (in terms of size or for the iframe in the popup).

No Install candidate for Moodle 4.2

HI,

Looks like there has not been a Moodle plugin release in some time, we are on version 4.2 and there is no install candidate.

git branch -vv

  • MOODLE_402_STABLE e4919b0feb4 [origin/MOODLE_402_STABLE] weekly release 4.2.1+
    master a1d5d1b2f75 [origin/master] weekly release 4.3dev

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"

php --version
PHP 8.1.2-1ubuntu2.14 (cli) (built: Aug 18 2023 11:41:11) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.14, Copyright (c), by Zend Technologies

Evaluations (evasys) v3.5-r6
Moodle 3.5, 3.7
Released: Thursday, November 25, 2021, 1:21 PM

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.