Giter Club home page Giter Club logo

Comments (6)

marcusgreen avatar marcusgreen commented on May 23, 2024

Thanks Richard, any chance you can give me access to a course where this happens?

from moodle-report_advancedgrading.

Richardvi avatar Richardvi commented on May 23, 2024

That is kinda difficult to realize as we do not create accounts in our own Moodle, everyone logs in using ADFS.

What I could do is create a backup from this specific assignment and send it to you? Would that help?

Also, we are using multiple attempts in assignments. Could that be a problem in the report?

from moodle-report_advancedgrading.

marcusgreen avatar marcusgreen commented on May 23, 2024

Yes a backup/restore would probably help and yes multiple attempts might be an issue (though I have a vague recollection of testing against that).
This report does a similar thing and it would be interesting to know if it runs without error on your site..
https://github.com/brickfield/moodle-gradereport_rubrics

from moodle-report_advancedgrading.

CristhianBohorquez avatar CristhianBohorquez commented on May 23, 2024

Error message

Exception - count(): Argument #1 ($value) must be of type Countable|array, null given

More information about this error

Debug info:
Error code: generalexceptionmessage×Dismiss this notification
Stack trace:
line 54 of /report/advancedgrading/guide.php: TypeError thrown
×Dismiss this notification
Output buffer:

Error: mdb->get_record() found more than one record!
  • line 1691 of /lib/dml/moodle_database.php: call to debugging()
  • line 50 of /report/advancedgrading/locallib.php: call to moodle_database->get_record_sql()
  • line 178 of /report/advancedgrading/locallib.php: call to get_grading_definition()
  • line 39 of /report/advancedgrading/guide.php: call to init()
Invalid get_string() identifier: 'pluginname' or component 'gradingform_'. Perhaps you are missing $string['pluginname'] = ''; in /lang/en/gradingform_.php?
  • line 356 of /lib/classes/string_manager_standard.php: call to debugging()
  • line 7414 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
  • line 99 of /report/advancedgrading/locallib.php: call to get_string()
  • line 186 of /report/advancedgrading/locallib.php: call to header_fields()
  • line 39 of /report/advancedgrading/guide.php: call to init()
Error: mdb->get_record() found more than one record!
  • line 1691 of /lib/dml/moodle_database.php: call to debugging()
  • line 50 of /report/advancedgrading/locallib.php: call to moodle_database->get_record_sql()
  • line 187 of /report/advancedgrading/locallib.php: call to get_grading_definition()
  • line 39 of /report/advancedgrading/guide.php: call to init()

Looking into the plugin function
https://github.com/marcusgreen/moodle-report_advancedgrading/blob/main/locallib.php#L41

/**

  • Get the structure of this grading definition
  • @param int $assignid
  • @return \stdClass
    */
    function get_grading_definition(int $assignid): \stdClass {
    global $DB;
    $sql = "SELECT gdef.id AS definitionid, ga.activemethod, gdef.name AS definition
    FROM {assign} assign
    JOIN {course_modules} cm ON cm.instance = assign.id
    JOIN {context} ctx ON ctx.instanceid = cm.id
    JOIN {grading_areas} ga ON ctx.id=ga.contextid
    JOIN {grading_definitions} gdef ON ga.id = gdef.areaid
    WHERE assign.id = :assignid";
    $definition = $DB->get_record_sql($sql, ['assignid' => $assignid]);
    return $definition;
    }

The current query has the potential to join to unrelated course module or context records, that is why it is happening the error.

$sql = "SELECT gdef.id AS definitionid, ga.activemethod, gdef.name AS definition
FROM {assign} assign
JOIN {course_modules} cm ON cm.instance = assign.id
JOIN {modules} m ON m.id = cm.module AND m.name = 'assign'
JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = 70
JOIN {grading_areas} ga ON ctx.id=ga.contextid
JOIN {grading_definitions} gdef ON ga.id = gdef.areaid
WHERE assign.id = :assignid"

from moodle-report_advancedgrading.

marcusgreen avatar marcusgreen commented on May 23, 2024

I will investigate

from moodle-report_advancedgrading.

Richardvi avatar Richardvi commented on May 23, 2024

I still had this on my to do list, but unfortunately I was unable to share the backup as there's personalized data inside the course.

So thanks to @CristhianBohorquez for sharing additional info.

I think the trouble is the many 0 points in the rubric.

from moodle-report_advancedgrading.

Related Issues (19)

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.