Text doesn't appear in Moodle Forum

Text doesn't appear in Moodle Forum

by Matt Dieter -
Number of replies: 7

My students type their postings in the forum.  It appears as they want it to look, text is fine and in place.  After that they hit post to the forum and everything is still ok.  However, the post they typed does not appear on the forum.  Their name appears as if they have posted, but it is an empty box.  The same thing happens when they reply to other's postings.  Any ideas for how to solve this?

Average of ratings: -
In reply to Matt Dieter

Re: Text doesn't appear in Moodle Forum

by Purnendu Dash -
Picture of Plugin developers

Dear Matt,

It seems like the forum posts made by students are not saved in the forum table in the Moodle database. As a result the posts do not appear in the forum.

Kindly turn on the debugging mode from Settings > Site administration > Development > Debugging, then post in a forum as student and check whether any error is displayed.

Also check the mdl_forum_posts table in the moodle databse and see if your post exists.

Warm regards

DualCube

In reply to Purnendu Dash

Re: Text doesn't appear in Moodle Forum

by Matt Dieter -

Which debugging settings should be turned on?  I see several under that section.

In reply to Matt Dieter

Re: Text doesn't appear in Moodle Forum

by Purnendu Dash -
Picture of Plugin developers

Dear Matt,

Here is how you turn on your debugging process. Go to this particular page in your website  http://www.deutsch-online.it/admin/settings.php?section=debugging .Log in with your username and password. You will see a Debug Message option with a drop down facility. Click on the drop down button and select the last option, that says, "DEVELOPER: extra Moodle debug messages for developers". After you have done this, look for 'Display debug message' in the next line, and select the checkbox right beside it, such that it shows a tick mark. Now go to the bottom of the page and save your changes.

Warm Regards

DualCube

 

In reply to Matt Dieter

Re: Text doesn't appear in Moodle Forum

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

May sound silly - but have you checked that its not a colours issue and something daft like white text on a white background? smile

In reply to Richard Oelmann

Re: Text doesn't appear in Moodle Forum

by Matt Dieter -

Yes, I considered that as well.  With students you never know!  But that is not the case.

In reply to Matt Dieter

Re: Text doesn't appear in Moodle Forum

by Edgar Garcia -

Hi I am experiencing the same issue (please see Forum NG:CANNOT SEE FORUM POSTS).  Has this been resolved?

 

Ran Debugger and got the following fatal error:

 

Strict Standards: Declaration of plagiarism_plugin_crot::get_form_elements_module() should be compatible with that of plagiarism_plugin::get_form_elements_module() in .\MoodlePath\moodle\plagiarism\crot\lib.php on line 38
 
Notice: Undefined index: file in .\MoodlePath\moodle\plagiarism\crot\lib.php on line 50
 
Notice: Trying to get property of non-object in .\MoodlePath\moodle\plagiarism\crot\lib.php on line 52
 
Fatal error: Call to a member function get_id() on a non-object in .\MoodlePath\moodle\plagiarism\crot\lib.php on line 55

 

 

Here is the Class & function it is referring to (Crot plugin):

Line 38 (Class):

class plagiarism_plugin_crot extends plagiarism_plugin {

 

Lines 45 - 76 (Function it is referencing):

public function get_links($linkarray) {         //$userid, $file, $cmid, $course, $module         global $DB, $CFG;         $cmid = $linkarray['cmid'];         $userid = $linkarray['userid'];         $file = $linkarray['file'];         $course = $linkarray['course'];         $cid = $course->id;         $output = '';         //add link/information about this file to $output             if (!$plagiarism_crot_files_rec = $DB->get_record("plagiarism_crot_files", array("file_id"=>$file->get_id()))) {                 $output .= '';// if there is no record in plagiarism_crot_files about this file then nothing to show             }             else {                 if (!$crot_doc_rec = $DB->get_record("plagiarism_crot_documents", array("crot_submission_id"=>$plagiarism_crot_files_rec->id))) {                     $output .= '';// if there is no record in plagiarism_crot_documents about this file then nothing to show                 }                 else {                     $sql_query = "SELECT max(number_of_same_hashes) as max FROM {$CFG->prefix}plagiarism_crot_submission_pair WHERE submission_a_id ='$crot_doc_rec->id' OR  submission_b_id = '$crot_doc_rec->id'";                     if (!$similarity = $DB->get_record_sql($sql_query)) {// get maximum number of same hashes for the current document                         $output .= '<br><b>'.get_string('no_similarities','plagiarism_crot').'</b>';                     }                     else {                         $sql_query = "SELECT count(*) as cnt from {$CFG->prefix}plagiarism_crot_fingerprint where crot_doc_id = '$crot_doc_rec->id'";                         $numbertotal = $DB->get_record_sql($sql_query);// get total number of hashes for the current document                         $perc =  round(($similarity->max / $numbertotal->cnt) * 100, 2);                         $output .= "<br><b> <a href=\"../../plagiarism/crot/index.php?id_a=$crot_doc_rec->id&user_id=$userid&cid=$cid\">".$perc."%</a></b>";                     }                 }             }         return $output;     }

 

 

 

In reply to Edgar Garcia

Re: Text doesn't appear in Moodle Forum

by Edgar Garcia -

This is by no means a fix, but it is a work-around.  Given the aforementioned debug messages, I decided to kill the CROT plugin -- and voila, it worked! 

 

So then, I decided to look for clues inside the CROT lib.php file, and noticed a syntax error with the library path:

//get global class from the original plugin showed (line 33-35)
global $CFG;
require_once($CFG->dirroot.'/plagiarism/lib.php');

 

This was the wrong path!  What tipped me off was looking further down in the code; I noticed this line (which made more sense):

$output .= "<br><b> <a href=\"../../plagiarism/crot/index.php?id_a=$crot_doc_rec->id&user_id=$userid&cid=$cid\">".$perc."%</a></b>";

 

Long story short, I needed to add /crot/ to the code:

//get global class
global $CFG;
require_once($CFG->dirroot.'/plagiarism/crot/lib.php');

 

 

Moral of the story, again, RUN DEBUGGING to isolate the issue!!!