GithubHelp home page GithubHelp logo

uclmoodle / moodle-report_myfeedback Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 12.0 2.63 MB

A Moodle Report that shows all user feedback on one page. Please raise tickets in the Moodle Tracker (linked from the plugins page).

Home Page: https://moodle.org/plugins/view/report_myfeedback

PHP 83.88% CSS 5.25% Gherkin 3.33% JavaScript 6.96% Mustache 0.57%
moodle

moodle-report_myfeedback's People

Contributors

anton-catalyst-eu avatar aspark21 avatar daledavies avatar jackson-catalyst avatar jamie-catalyst avatar jgramp avatar opitz avatar safatshahin avatar simonthornett avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-report_myfeedback's Issues

Invalid SQL generated

While attempting to test the functionality, the block failed badly due to multiple WHERE in the generated query:

LEFT JOIN mdl_grading_areas ga ON con.id = ga.contextid
WHERE cm.visible=1 WHERE c.visible = 1 AND c.showgrades = 1 AND cm.visible=1
ORDER BY duedate 

Stack trace:

line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 243 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 706 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 501 of /report/myfeedback/lib.php: call to pgsql_native_moodle_database->get_recordset_sql()
line 85 of /report/myfeedback/index.php: call to report_myfeedback->get_content()

The class report_myfeedback should go to locallib.php

The class report_myfeedback is defined in the index.php file. Custom class definitions should go to locallib.php file, or (in recent versions) ideally into the classes directory so they can be used by the Moodle autoloading mechanism.
Also, is there any reason why the class extends the block_base class? It does not really look natural in this context.

Activities duplicated on PostgreSQL

Steps to reproduce

  1. In a course, prepare an Assignment, Quiz and Workshop
  2. Let a student to submit into the Assignment and the Workshop, and attempt the Quiz
  3. As a teacher, grade the Assignment and the Workshop. Evaluate and close the workshop.

Expected behaviour

  • The report should display 3 entries, each activity on its own row

Actual behaviour

  • There are six rows in the report, each activity is duplicated there.

myreport-bug

Fails on PostgreSQL

The report seems to have MySQL specific custom queries. This leads to fatal errors on PostgreSQL (and probably other DBs that Moodle supports), such as:

ERROR: syntax error at or near ")"
LINE 4: CONVERT(gg.finalgrade,DECIMAL(3,0)) AS grade,
^
SELECT c.id AS courseid,
c.fullname AS coursename,
gi.itemname AS assessmentname,
CONVERT(gg.finalgrade,DECIMAL(3,0)) AS grade,

Do you think it's possible to convert them to queries that are cross-db
compatible? Operations like rounding can be do at the PHP level maybe?

Embedding javascript

The code seems to inject the jQuery code in a very non-standard way by echoing it after $OUTPUT->footer(); I am afraid this leads to the script code being generated only after the closing tag, am I right? Please see https://docs.moodle.org/dev/jQuery for the recommended way to include jQuery in Moodle plugins.

index.php

From @mudrd8mz on February 15, 2016 22:10

The current file index.php

include_once('../../../config.php');
$courseid = required_param('id', PARAM_INT);        // course id
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
    print_error('nocourseid');
}
require_login($course);
$context = context_course::instance($course->id);
require_capability('gradereport/myfeedbacklink:view', $context);
header('location:' . $CFG->wwwroot . '/report/myfeedback/index.php?userid=' . $USER->id);

could read something like

require(__DIR__.'/../../../config.php');
$courseid = required_param('id', PARAM_INT);
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
require_login($course);
$context = context_course::instance($course->id);
require_capability('gradereport/myfeedbacklink:view', $context);
redirect(new moodle_url('report/myfeedback/index.php', array('id' => $USER->id)));

Copied from original issue: jgramp/moodle-gradereport_myfeedbacklink#1

ERROR: UNION types text and bigint cannot be matched

On PostgreSQL, I am getting

Debug info: ERROR: UNION types text and bigint cannot be matched
LINE 88: su.id AS subid,

Stack trace:

line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 243 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 706 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 505 of /report/myfeedback/lib.php: call to pgsql_native_moodle_database->get_recordset_sql()
line 85 of /report/myfeedback/index.php: call to report_myfeedback->get_content()

2.16 breaks moodle 3.9

We just upgraded from 2.15 to 2.16 on Moodle 3.9.20 and it looks like the new amd js files completely break the site - no navigation elements are able to be clicked on and the browser console is full of JS errors.

Show full text general feedback

Show the full text feedback to students directly in the report, so they can expand all the items and see all the feedback on one page.

Empty string is not valid integer (unless you are on MySQL)

MySQL is very benevolent when it comes to data types. In it, SQL like

'' AS assigngradeid

works, but on PostgreSQL this throws

Debug info: ERROR: invalid input syntax for integer: ""
LINE 61: '' AS assigngradeid,

I would suggest to use

NULL AS assigngradeid

in this situation.

Qualification registration error

Hello, please I would like guidance.

I work with Moodle version 3.11.4+ (Build: 20220111) and myfeedback version 2.16 (Build: 2022122100).

I have my own letter grading system but in the reports I load a different one, the one that comes by default in Moodle.
For example, we configure our qualification system to assign other types of letters such as: AD, A, B and C but the letters F,D,D+,C-,C+,B-B,B+,A- and A appear in the reports , this is the default Moodle system.

What should I configure to upgrade to my existing rating system?

Report Image: https://ibb.co/HhMV1nh

Thank you so much!

Review relevance of Academic Year dropdown & links to Snapshot instances

Reverted this to avoid breaking current behaviour - e135185

However, we don't use the Academic Year dropdown, doesn't even seem to work in Snapshots

All relies upon direct database connectivity but this means prod talking to snapshots.
Poor architectural design so Snapshot links should go to defined site URLs.

What of UCL Prod which now has multiple years of content?
Since we're not doing Snapshots anymore

PHP8.0 Required Parameter

Deprecated: Required parameter $modt follows optional parameter $search in /var/www/html/report/myfeedback/lib.php on line 1454

Deprecated: Required parameter $proga follows optional parameter $search in /var/www/html/report/myfeedback/lib.php on line 1454

Show only one link to the feedback

Students can view the submission by clicking the assignment name. Having a submission link is confusing. If there is feedback one 'view feedback' link should display in the feedback column.

Notices and missing div element

The properties "profile_field_year" and "profile_field_programmename" to isn't defined and throws notices. Closing div element missing in the overview.php file caausing layout error.

Screenshot of the issues:
http://screencast.com/t/PS5Qrq9lZmZE

Pull request to solve the issues:
#31

Please update the plugin on moodle.org when issues are fixed :-)

Best regards
Johnny Drud

MySQL specific functions unix_timestamp(current_timestamp))

The queries used MySQL specific unix_timestamp(current_timestamp)) functions. This makes the code non-cross-db compatible. The Moodle way is to use something like $now = time(); and then pass the value of the $now via placeholder into the SQL query - so instead of (e.g.)

AND (gi.hidden = 0 or gi.hidden < unix_timestamp(current_timestamp))

you would have something like

AND (gi.hidden = 0 or gi.hidden < :now)

Add a connection test to the settings page

At the moment there's no way to know if the remote database connection has worked. Although students don't need to see which database is being used, it would be useful to have a connection test on the settings page to feedback to Moodle Admins whether the connection worked and which database is therefore being used for the reports.

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.