Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
moodle-mod_individualfeedback
===========================

Changes
-------

### v1.1.2

* 2024-09-16 - On Base of m4.5 imported many privacy providers, two more item elements (label and captcha) as well as better output elements.
* 2024-09-15 - Combining outdated JS structrue from old YUI architecture into modern RequireJS architecture.
* 2024-09-14 - Removing many errors all across the code, adding missing vars and definitions and globals where necessary.

### v1.1

* 2024-09-13 - Removing individualfeedback.js callback function to now folder, refactoring it as Base JS. Refactoring more depreached print_textarea();
* 2024-09-12 - Removing 3 depreached methods $menu->set_constraint, $menu->set_alignment and x. Repairing JS-Drag-Drop Slider feature. Inhousing of external edit_movequestions.js to reduce overall file count.


### v3.3.2 Based on content from upgrade.txt file

* 2024-09-01 - Existing codebase received from ByCS, still based on moodle v3.0
61 changes: 61 additions & 0 deletions MODIFICATIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# MODIFICATIONS
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really appreciate this description of the modifications!


This document records all functional and structural changes made to the mod_individualfeedback plugin compared to the original mod_feedback plugin.

## JavaScript

### Logic changes in `amd/src/edit.js`
- Added logic to detect when the item to be deleted is a question group and, in this case, display a specific confirmation string (`confirmdeleteitem_questiongroup`).
- In the original, only the standard `confirmdeleteitem` string was used for all items.

### New JavaScript files in `amd/src/`
- `movequestiongroup.js`: Implements drag-and-drop reordering of question groups.
- `filterquestiongroup.js`: Adds filtering functionality to show/hide question groups in the analysis UI.

## Mustache

### Modified templates
- `summary.mustache`:
- All references to `feedback` were changed to `individualfeedback` (template name, CSS classes, string components).
- The context and example block were updated to reflect the new plugin's data structure.
- Additional fields and logic may have been added to support new features (e.g., `timeopen`, `timeclose`).

## PHP Files with new code (hack was not possible)

- ajax.php
- analysis.php
- analysis_to_excel.php
- classes/form/create_template_form.php
- classes/responses_anon_table.php
- edit.php
- edit_item.php
- item/captcha/captcha_form.php
- item/multichoice/lib.php
- item/multichoice/multichoice_form.php
- item/multichoicerated/multichoicerated_form.php
- item/numeric/numeric_form.php
- item/questiongroup/questiongroup_form.php
- item/textarea/textarea_form.php
- item/textfield/textfield_form.php
- lib.php
- manage_templates.php

## Files with hack

The following files use the hack-based extraction/refactorization model. In these cases, the main logic was moved to static methods in hack classes (e.g., `mod_individualfeedback\hack\lib`), and the original file contains only conditional calls to these methods. This approach was used to maximize code reuse and maintainability while ensuring independence from the original plugin.

- classes/output/edit_action_bar.php
- edit.php
- edit_form.php
- item/fivelevelapproval/lib.php
- item/fourlevelapproval/lib.php
- item/fourlevelfrequency/lib.php
- item/individualfeedback_item_class.php
- item/info/lib.php
- item/multichoice/lib.php
- item/multichoicerated/lib.php
- item/numeric/lib.php
- item/textarea/lib.php
- item/textfield/lib.php
- lib.php
- manage_templates.php
120 changes: 120 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
moodle-mod_individualfeedback
===========================


Requirements
------------

This plugin requires Moodle 4.5+


Motivation for this plugin
--------------------------

The motivation of this plugin was to create new options to original feedback plugin. Things like new types of questions and comparisons of reports were added.


Installation
------------

Install the plugin like any other plugin to folder
/mod/individualfeedback

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

You may install using the command "git clone https://github.com/lernlink/moodle-mod_individualfeedback.git".


Usage & Settings
----------------

After installing the plugin, it creates tables associated with it. There is only one configuration related to anonymous surveys. If the option is set to 'yes', users can complete a individual feedback activity on the front page without being required to log in.


Security implications
---------------------

This tool will only work within the moodle context. Therefore no external sources, scripts or code is being loaded. No security issues for potential breaching or cross site scripting are given.


Theme support
-------------

This plugin acts behind the scenes, therefore it should work with all Moodle themes.
This plugin is developed and tested on Moodle Core's Boost theme.
It should also work with Boost child themes, including Moodle Core's Classic theme. However, we can't support any other theme than Boost.


Plugin repositories
-------------------

The latest development version can be found on Github:
https://github.com/lernlink/moodle-mod_individualfeedback

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am currently not aware of our contract, but we need to talk about, who is maintaining the plugin in the future.


Bug and problem reports
-----------------------

This plugin is carefully developed and thoroughly tested, but bugs and problems can always appear.

Please report bugs and problems on Github:
https://github.com/lernlink/moodle-mod_individualfeedback/issues



Community feature proposals
---------------------------

The functionality of this plugin is primarily implemented for the needs of our clients and published as-is to the community. We are aware that members of the community will have other needs and would love to see them solved by this plugin.

Please issue feature proposals on Github:
https://github.com/lernlink/moodle-mod_individualfeedback/issues

Please create pull requests on Github:
https://github.com/lernlink/moodle-mod_individualfeedback/pulls


Moodle release support
----------------------

This plugin is only maintained for the most recent major release of Moodle as well as the most recent LTS release of Moodle. Bugfixes are backported to the LTS release. However, new features and improvements are not necessarily backported to the LTS release.

Apart from these maintained releases, previous versions of this plugin which work in legacy major releases of Moodle are still available as-is without any further updates in the Moodle Plugins repository.

There may be several weeks after a new major release of Moodle has been published until we can do a compatibility check and fix problems if necessary. If you encounter problems with a new major release of Moodle - or can confirm that this plugin still works with a new major release - please let us know on Github.

If you are running a legacy version of Moodle, but want or need to run the latest version of this plugin, you can get the latest version of the plugin, remove the line starting with $plugin->requires from version.php and use this latest plugin version then on your legacy Moodle. However, please note that you will run this setup completely at your own risk. We can't support this approach in any way and there is an undeniable risk for erratic behavior.


Translating this plugin
-----------------------

This Moodle plugin is shipped with an english and german 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 for our own local needs 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
-----------

lern.link GmbH


Copyright
---------

lern.link GmbH\
Marcelo Augusto Rauh Schmitt
Vadym Nersesov


Credits
-------
This plugin is based on the feedback plugin from Moodle 4.5.3
19 changes: 15 additions & 4 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# mod_individualfeedback Upgrade notes

## 4.5
## 4.6.1

- As we relay on the same DB structure as before, we DO NOT need to run a /db/upgrade.php script. All we actually only need to do, is to rename / move the current directory.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As already mentioned, the code should be able to use existing database tables. So we need to rename the tables: indfeedback_sitecourse_map, indfeedback_completedtmp to your new names: individualfeedback_sitecourse_map, individualfeedback_completedtmp

- And clone from github-repo ( https://github.com/lernlink/moodle-mod_individualfeedback) or copy the code manually into the /mod/individualfeedback/ directory.

## 4.6

- From 4.5 to 4.6 we have a major leap as the main sourcecode was uplifted to the base version of the newest moodle 4.5.
- With the introduction of version 2024101500 and later all the deperached code that was build upon the base version of mod_feedback for moodle 3.2+ has been replaced.
- The bugs have been removed (like not working drap-and drop function etc.) and all the prior self developed functionality of ByCS has been added and verified.

## 4.5dev+

### Deprecated

- The `\individualfeedback_check_is_switchrole()` function has been deprecated as it didn't work.
- The `individualfeedback_check_is_switchrole` method has been deprecated as it didn't work

For more information see [MDL-72424](https://tracker.moodle.org/browse/MDL-72424)
- The method `\mod_individualfeedback\output\renderer::create_template_form()` has been deprecated. It is not used anymore.
- The method `mod_feedback\output\renderer::create_template_form()` has been deprecated. It is not used anymore.

For more information see [MDL-81742](https://tracker.moodle.org/browse/MDL-81742)
For more information see [MDL-81742](https://tracker.moodle.org/browse/MDL-81742)
68 changes: 68 additions & 0 deletions ajax.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Process ajax requests
*
* @copyright Andreas Grabs
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package mod_individualfeedback
*/

if (!defined('AJAX_SCRIPT')) {
define('AJAX_SCRIPT', true);
}

require(__DIR__.'/../../config.php');
require_once('lib.php');

$id = required_param('id', PARAM_INT);
$action = optional_param('action', '', PARAM_ALPHA);
$sesskey = optional_param('sesskey', false, PARAM_TEXT);
$itemorder = optional_param('itemorder', false, PARAM_SEQUENCE);

$cm = get_coursemodule_from_id('individualfeedback', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$feedback = $DB->get_record('individualfeedback', array('id' => $cm->instance), '*', MUST_EXIST);

require_sesskey();

$context = context_module::instance($cm->id);
require_login($course, true, $cm);
require_capability('mod/individualfeedback:edititems', $context);

$return = false;

switch ($action) {
case 'saveitemorder':
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be necessary any more (was called by the deprecated YUI-Module, which should have been removed (see edit.php)

$itemlist = explode(',', trim($itemorder, ','));
if (count($itemlist) > 0) {
$return = individualfeedback_ajax_saveitemorder($itemlist, $feedback);
}
break;
// +++ NEW CODE
case 'savequestiongroupitemorder':
alert("salvando question group");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please at least remove this alert.

According to moodle guidelines ajax calls should be implemented by using external services.
Please see /external/question/reorder.php as an example.

$itemlist = explode(',', trim($itemorder, ','));
if (count($itemlist) > 0) {
$return = individualfeedback_ajax_saveitemorder($itemlist, $feedback);
}
break;
// --- NEW CODE
}

echo json_encode($return);
die;
2 changes: 1 addition & 1 deletion amd/build/createtemplate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading