Workshop

 
 
Picture of Flavio Manganello
Workshop activity - error (Moodle 2.5)
 

Hello.

I am trying to use the workshop activity but it results in an error when students try to assess any submission.

The error is displayed at the url: .../mod/workshop/exassessment.php

and the error message is: 

Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() no fields found.

 

I have already activated the debugging mode which provided me with the further information about the error: 

Debug info:
Error code: codingerror
Stack trace:
• line 1177 of \lib\dml\mysqli_native_moodle_database.php: coding_exception thrown
• line 1227 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
• line 129 of \mod\workshop\exassessment.php: call to mysqli_native_moodle_database->update_record()

 

I am experiencing the error on the following versions of Moodle 2.5:

- Moodle 2.5.2+ (Build: 20130920)
- Moodle 2.5.1+ (Build: 20130708)

 

Thanks in advance for any helpful suggestions.


 
Average of ratings: -
Walking on the snow towards Lago Nero...
Re: Workshop activity - error (Moodle 2.5)
Group DevelopersGroup Particularly helpful Moodlers

Hi Flavio,
technically speaking, it means that the code is not able to find SQL data to be saved in the given SQL table: that's not the normal behavior.

To start the investigations, please activate the debugging at DEVELOPER level and then re-execute the same steps with the same user: hopefully more info should be returned.

It would be useful to know where the instance is hosted: OS, Web Server and related modules, PHP version.

Matteo

 
Average of ratings: -
Picture of Flavio Manganello
Re: Workshop activity - error (Moodle 2.5)
 

Hello Matteo,

thank you for you prompt reply.

Debugging was already activated at developer level.

Here are the steps:

1. I log in as teacher, I create 2 groups of students (Group 01: stud01, stud02; Group 02: stud03, stud04), and then I create the workshop activity, with the following main settings:

  • grading settings --> accumulative grading
  • feedback --> disabled
  • example submissions --> use examples and examples must be assessed before own submission
  • common module settings --> visible show; group mode: visible groups.

2. In the "Setup phase" I edit the assessment form (I use a customized scoring scale for grading) AND I change this permission from the workshop administration panel: View authors name --> X students (students are disabled).

3. I prepare the example submission, then back again to edit setting from the workshop administration panel and I check Availability to make sure the activity is open for submission and for assessment.

4. I open "Submission phase".

5. I log out.

6. I log in as student (stud01) and click "Assess" in the "Example submissions to assess" box.

7. I assess the example submission and click "Save and close".

8. Error! I click "Continue" and the system sends me to the main page.

 

As further information, I can say that in the db - with particular reference to the table "mdl_workshop_assessments" - I see some data are saved (in particular, some of the fields (such as id, submissionid, reviewerid, weight, timecreated, timemodified, grade) display a value.

Here some information about the hosting instance where I run this last test (which is a local host): 

  • OS: Windows 7 Ultimate SP1 64-bit
  • XAMPP Version: 1.8.1
  • A fresh installation of Moodle 2.5.2+ (Build: 20130927)

 

I attach again the screenshot with the error.

 

Hope this help.

Thank you very much for your interest.


 
Average of ratings: -
Walking on the snow towards Lago Nero...
Re: Workshop activity - error (Moodle 2.5)
Group DevelopersGroup Particularly helpful Moodlers

Hi Flavio,
thanks to your testing instructions I was able to replicate it even in Moodle 2.6: I'll look at the code though I'm not familiar with that module.

In the mean time you could change the code using the workaround below:

$ git diff mod/workshop/exassessment.php
diff --git a/mod/workshop/exassessment.php b/mod/workshop/exassessment.php
index 32b5485..4515de2 100644
--- a/mod/workshop/exassessment.php
+++ b/mod/workshop/exassessment.php
@@ -126,7 +126,10 @@ if ($mform->is_cancelled()) {
         // Remember the last one who edited the reference assessment.
         $coredata->reviewerid = $USER->id;
     }
-    $DB->update_record('workshop_assessments', $coredata);
+    // Update the assessment data if there is something other than just the 'id'.
+    if (count((array)$coredata) > 1 ) {
+        $DB->update_record('workshop_assessments', $coredata);
+    }

     if (!is_null($rawgrade) and isset($data->saveandclose)) {
         if ($canmanage) {

@Howard Miller: could you move this discussion to the Workshop forum? I think David Mudrák could better reply to the OP. TIA!

Matteo

 
Average of ratings:Useful (1)
Walking on the snow towards Lago Nero...
Re: Workshop activity - error (Moodle 2.5)
Group DevelopersGroup Particularly helpful Moodlers

FYI: MDL-42167.

Matteo

 
Average of ratings:Useful (2)
Picture of Flavio Manganello
Re: Workshop activity - error (Moodle 2.5)
 

Hello Matteo,

I have tested the workaround you implemented and it worked smoothly, both for the exassessment.php page and the assessment.php page.

I will be following the tracker.

Thank you very much for your help and for the time you spent on this.

f.

 

 
Average of ratings: -
Picture of David Mudrák
Re: Workshop activity - error (Moodle 2.5)
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Translators
Yay! Thanks Flavio for the perfect report and well done Matteo for debugging and analysing this! I just commented in the tracker. I was able to reproduce the bug. It affects Moodle 2.5 and higher.
 
Average of ratings: -