Add Discussion from Main page

Add Discussion from Main page

by Chris Kenniburg -
Number of replies: 12
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello All,

I am trying to add a Title, Message, and Attachment form items to the main page of the Social Course Format. I have attached a mockup of what I am trying to achieve. 

Any suggestions?

My goal is to try and develop a Course Format for Moodle that would be similar to how Edmodo or Facebook acts with the user able to post directly from the main page and then also leave comments in a similar fashion for the posts.

See the attached photo.

Attachment moo-modo.jpg
Average of ratings: -
In reply to Chris Kenniburg

Easypost Course Format

by ca2si Etan -

Hi Chris,

Sorry that it has taken so long to get a response. I put together the attached course format based on your idea. 

It uses the default editor and there are a few other differences. If I have time, I will look in to changing them (and commenting the code better...).

As always, any feedback is appreciated.

Thanks,
Ca2si

In reply to ca2si Etan

Re: Easypost Course Format

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ca2si,

This is exactly the course format I am looking for! 

I did notice that if you try to leave a comment on a posting it gives you an error.  Clicking "Discuss this Topic" gives you:

Can not find data record in database table course.

More information about this error

 

Thank you very very much for the initial work!

Chris

 

In reply to Chris Kenniburg

Re: Easypost Course Format

by ca2si Etan -

Hi Chris,

Thanks for the feedback smile

I found the bug. The new version is posted here: http://moodle.org/plugins/view.php?plugin=format_easypost

Thanks,
Ca2si

In reply to ca2si Etan

Re: Easypost Course Format

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ca2si,

I just tried the new version and I am still getting the error when I try to reply to a posting.  The other thing I noticed that will be confusing to end users is the "Add a New Discussion Topic" button appearing just below the "Save Changes" button.

I add a new topic using your new post form on the main page.  Then I click on the "Discuss this Topic" link next to the new posting and it gives the error listed above.

It seems the front page post form isn't registering the forum topic properly somehow.

In reply to Chris Kenniburg

Re: Easypost Course Format

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ca2si,

Here are my initial suggestions if you are willing to work on this...

Functionality:

  • Fix the discussion issue to make sure everything works as expected.
  • Remove the "Add a New Discussion Topic" button that appears below the post form on the main page.  This can be confusing to see this button and the Save Changes button right next to eachother.

Cosmetics (If Possible):

  • Remove the html editor and shrink the height of the text input box to be about 5-7 lines in height similar to facebook. 
  • I am hoping that once this is committed to the core (MDL- 29766) that it will allow for drag and drop file upload into new posts.  If drag and drop happens this EasyPost course format can really shine with a quick and easy way for teachers to quickly post homework and lessons.
In reply to Chris Kenniburg

Re: Easypost Course Format

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Chris,

You may well need to Purge all caches as it is quite possible your Moodle install is using a cached version and NOT the new as you thought.

To purge caches go to Site Administration > Development > Purge all caches once done you can return to your course page and do a Ctrl + F5 to refresh the page and you should see the changes.

HTH

Mary

In reply to Chris Kenniburg

Re: Easypost Course Format

by ca2si Etan -

Hi Chris,

Discussions started with the old version have a missing database entry that causes the error. Delete them, and any discussions created with the new version should work properly (at least they do in my test environments with moodle 2.1)

If this does not solve the issue, could you turn debugging on fully and send me the full errors?

I will see what I can do with the suggestions though I might not get to them until this weekend.

The drag and drop feature would be really nice to have. Both for the user and for the sysadmin (me smile...  It will force people to finally move to a modern browser).

Thanks,
Ca2si

In reply to ca2si Etan

Re: Easypost Course Format

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks Mary and Ca2si,

I will try clearing my cache on both moodle and the browser.  I am still getting an error using the EasyPost 1.2 version. 

I have moodle 2.1.2.  Don't know if there is a difference between 2.1.1 and 2.1.2 that would affect this.

When I try to edit a post created using your form I get this error:

You are trying to use an invalid course ID: ({$a})

More information about this error

 

Here is a screencapture video of my issue:

In reply to ca2si Etan

Re: Easypost Course Format

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi ca2si

I'm getting an ERROR which makes me wonder if you forgot to change the calback function name in lib.php. I think you need to change 'social' to 'easypost'.

Here's the ERROR message:

Fatal error: Cannot redeclare callback_social_load_content() (previously declared in C:\wamp\www\moodle\course\format\easypost\lib.php:36) in C:\wamp\www\moodle\course\format\social\lib.php on line 38

 

EDIT: After posting the above ERROR I am now getting this error with a stack trace, after changing social to read easypost in the callback function in lib.php.

Up until this message all seemed to be working OK.

Debug info: SELECT * FROM {course} WHERE id = ?
[array (
0 => '0',
)]
Stack trace:
  • line 1265 of \lib\dml\moodle_database.php: dml_missing_record_exception thrown
  • line 1242 of \lib\dml\moodle_database.php: call to moodle_database->get_record_select()
  • line 43 of \mod\forum\discuss.php: call to moodle_database->get_record()

Cheers

Mary

In reply to Mary Evans

Re: Easypost Course Format

by ca2si Etan -

Hi Chris and Mary,

It seems that I uploaded the wrong version of easypost/post_form.php

The correct version is now in the plugins repository (version 1.3).

*Note to Self: Double-check files before uploading black eye *

Thanks for your help and patience,
Ca2si

In reply to ca2si Etan

Re: Easypost Course Format

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

AWESOME Ca2si!  I just tested and it seems to work just fine now.

Thank you.

In reply to Chris Kenniburg

Re: Easypost Course Format

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I am noticing that by default there is only one attachment allowed on new courses?  I also noticed that the default "News" forum created with new courses only allows 1 attachment instead of adhering to the Forum Activity default for attachments set by site admin.  Maybe a bug has crept into the 2.1.2 branch for default forums.