Needs Testing >> New Script >> Course List Display Images

Needs Testing >> New Script >> Course List Display Images

by W Page -
Number of replies: 25
Hello All!

I figured out how to get the server path into a script I was working on. The script adds images to the Course display on "Course List by Category" page.This script was originally submitted by Alvaro Corugedo. I just fixed a bug and tightened up the path part of the script. It was tested on v1.3.1 but I cannot see any reason why it would not work with v1.4DEV.

Enclosed in the attached ZIP file you will find the following 5 files,
README__course_list_display_images_01.doc
README__course_list_display_images_01.pdf
README__course_list_display_images_01.txt
courseimage.html
courseimagealt.html

The three "README" files contain the instructions and example images for the script. The text "README" file is just the code and basic instructions for those "Advanced" folks. The two "HTML" files are empty. I still need to write these out.

An image of how the images should display on the course page is below,

Please leave any comments at this thread. They will be appreciated. This is my first "semi" contribution to
Moodle so please be gentle. smile

WP1

course_images_01.gif
Average of ratings: -
In reply to W Page

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
Moodlers please help me out with this script.  I need at least one more person to test it before I can ask Martin to consider including it into v1.4.  The instructions are very explicit so it should not take long to test it.

Suggest you backup your original,
moodle/config.php
moodle/course/edit.html
moodle/course/edit.php
moodle/course/lib.php
moodle/lang/en/moodle.php

WP1

In reply to W Page

Re: Needs Testing >> New Script >> Course List Display Images

by Bryan Williams -
You know Ms. Page, I think I'm gonna just try this out and report back to you.tongueout  I like what you have done here!
In reply to Bryan Williams

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
Thanks Bryan,

I need an experienced Moodler like yourself to check it out for me. smile

I hope to eventually try to incorporate the image with the following at,
http://englishsuite.brisksolutions.com/course/category.php?id=17

Chardelle told me about this.  The author of the code has posted some code here,
http://moodle.org/mod/forum/discuss.php?d=6414

I think both the educational and business communities at Moodle would like to have the ability /option of placing images and/or text into their course descriptions this way.

WP1
In reply to W Page

Re: Needs Testing >> New Script >> Course List Display Images

by Bryan Williams -

WP,

23_28_119.gifDoes this come with a money back guarantee? big grin  What's happening here, I can't get the image to display on the left side as you have done. And what is that gobbly-gook in the image file field after the name?  File by the way is 200x150 pixels.  

Bryan

Attachment catimage.gif
In reply to Bryan Williams

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
Hi Bryan!

Thank you so much for testing the script.

The layout in your "Course Settings" page looks correct.  I do not know why there is the [1] after the image name.  You should however, also have a choice of  "no image" in the drop down menu for "Associated Image" if you do not want an image to display.

Now, take a look at your list of courses on the Category page where you would have your demo course listed.  You should see the image  under the course name and to the left the course description.  You do not need the "HTML Editor" to place the image, but, you do need it for the course description.

You just need to check the Category page and you should see the image. smile

Let me know what happens.

WP1
In reply to W Page

Re: Needs Testing >> New Script >> Course List Display Images

by Bryan Williams -

WP,

Well, naturally the first thing I did was to check the course category description page to see if things worked, which they don't. I had an image originally included in the course description, which appears on the right as default. Even tried removing this image and just going with your properties setting, but no luck, the image won't appear.

We are probably close here. I would suggest that you rewrite your help file, describing exactly where you placed code in various files that get changed. For example, insert this on line 1157 on so and so file, without a reference (i.e. between this and that snippet), leaves too much margin for error. Let's get this thing working, I think it adds much needed visual aesthetics to Moodle. Bravo WP! smile

Bryan

In reply to Bryan Williams

Re: Needs Testing >> New Script >> Course List Display Images

by Chardelle Busch -
Picture of Core developers

Hi Guys,

I am so glad that somebody is working on the Moodle home page.  But what you are doing WP is way beyond me at this point. 

I have a suggestion/question.  Another thing that would be nice to add to the course description (in both displays?) a Learn more.. type of link that would bring up a summary pop up like the info icon does right now when courses are displayed by category.  This link would then bring up more info about the course, e.g. you would be able to add html into the text editor as an optional summary popup separate from the course description which could be additional info aside from what you put in the course description, i.e. a syllabus, a link to pay...

In reply to Chardelle Busch

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
OK folks,

I will take a fresh look at this tomorrow. Thanks for the feedback.

Bryan, please post an image of what your course/category page looks like (post code insertion) if you get the time.

WP1
In reply to W Page

Re: Needs Testing >> New Script >> Course List Display Images

by Bryan Williams -

WP,

Here is what my course category page looks like, with top image showing nothing inserted in the HTML editor and Associated Image set to the image I want. As you can see, nothing gets diplayed. The bottom image is with my selection inserted in the HTML editor and the image selected in Associated Image field.  This is simply displaying things as I have them in the HTML editor.

Questions: Where is Associated Image looking for its source? I'm puzzled why the image I'm using here is the only one being displayed in the Associated Image field. Why is this so?  Should Associated Image be looking in the course Files directory?

Bryan

prop1

Attachment prop2.gif
In reply to Bryan Williams

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
Hi Bryan!

Thank you for taking the time to post the images.

I had a similar problem when I initially installed the code, but, I made some changes and the image visualized.  I have to review some code and figure out what is going on.  Also I reviewed your previous post and have a better understanding of what you were referring to after the name of the selected image.  Will also look into that. 

Still working on it.  Just hope I can get it together to submit for consideration before v1.4 is final.

WP1

In reply to Bryan Williams

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
Hi Bryan!

I think I know what may be happening.

I am getting the following type message in "debug" mode,

"Notice: Undefined property: image in /homepages/22/d12345999/htdocs/moodle3/course/lib.php on line 1140"

That line is,

if ($course->image) {

Now I have to figure out what is going on here. With my limited PHP skills this is definately going to be a learning experience.


I'll be back!! smile

WP1
In reply to Bryan Williams

Re: Needs Testing >> New Script >> Course List Display Images

by Juan Martinez -

Hi Bryan,

I would like to know How can I do that, what code do I have to add and where. I`m a roockie,  sorry for the question.

Warms Regards,

Juan Martinez

In reply to Juan Martinez

Re: Needs Testing >> New Script >> Course List Display Images

by Bryan Williams -

Hi Juan,

This is WP's project and there is some instructions in the file which can be downloaded on her original post.

In reply to Bryan Williams

Re: Needs Testing >> New Script >> Course List Display Images

by Juan Martinez -

Hi Bryan,

Thanks for your answer, but what I asking for its do about I install the module by W Page but the image only its statics and your image show when the cursors pass thru text. About something you did in wanna of your page.

Best Regards,

Juan Martinez

Dominican Republic 

In reply to Juan Martinez

Re: Needs Testing >> New Script >> Course List Display Images

by Bryan Williams -
WP,
Help me out here, what is Juan asking? 
In reply to Juan Martinez

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
Hi Juan & Bryan,

Please see the first post on this thread for the "ZIP" file. 

It should work "OK" on v1.3.1plus.  Having some problems with v1.4DEV.

DO NOT PLACE ON A PRODUCTION SITE YET!!!!

Please report any problems on this thread.

WP1
In reply to W Page

Re: Needs Testing >> New Script >> Course List Display Images

by Juan Martinez -

Hi W Page,

Please check your module because the image doesn`t show when the format in the front page are in Course List. Please check it also I gonna check again by my side.

Thanks,

Juan Martinez

In reply to Bryan Williams

Re: Needs Testing >> New Script >> Course List Display Images

by Juan Martinez -

Hi Bryan,

Sorry to be not understood, but what I talking about its about images below that I would like to do the same. You reply this on this forum

"WP,Here is what my course category page looks like, with top image showing nothing inserted in the HTML editor and Associated Image set to the image I want. As you can see, nothing gets diplayed. The bottom image is with my selection inserted in the HTML editor and the image selected in Associated Image field.  This is simply displaying things as I have them in the HTML editor."

prop2.gifprop1

In reply to Juan Martinez

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
Hi Juan and Bryan!

I think I understand Juan's question.
I will answer within the next hour.

Pienso que entiendo la pregunta de Juan.
Contestaré dentro de la hora próxima.

WP1

In reply to Juan Martinez

Re: Needs Testing >> New Script >> Course List Display Images

by Bryan Williams -

Hi Juan,

Adding an image to the course description is very easy. Click "Settings" within the Administration block and add the image in the description area using the HTML editor, just as you do when making a forum post. Hope this is what you are looking for. 

In reply to Bryan Williams

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
Hi Juan,

Bryan's last post to me with the image was to show me that the script I submitted was not doing what I wanted it to do.

The main way to add images to a Course Description is by the method outlined by Bryan in the previous post.  The script I am working on would also add an image to the Course Description but in a different location.

Take a look at the image in the first post in this thread.  You see that the image I want is displayed on the left in the Course Description.  The script I am working on would place an imaget there.   In Bryan's post the image is on the right, within the course description.

See the image below and you will see an example of how I would like the Category Course List page to look.  There is an image on the left and the right of the page.  The left image is from the code "hack" I am trying to do and the right image is created within the HTML editor in the Course Settings page.

The Course Category list I am referring to in this thread is not found on the Home page.  This page is located in a Moodle site at an address like,
http://YourWebSiteAddress.com/moodle/course/category.php?id=Course Number
for example,
http://YourWebSiteAddress.com/moodle/course/category.php?id=1

The number "1" indicates the number
Moodle has given to a course.  The number assigned to the course in  "Scientific Method" under the category "Basic Information" is "1".  Therefore, the course number is "1".

The Home page for My
Moodle Test site with the Courses listed looks like the following,
http://s94988317.onlinehome.us/moodle/

The Category Course List page I am trying to hack looks like the following,
http://s94988317.onlinehome.us/moodle/course/category.php?id=1

Hope this helps.

WP1



Attachment left_right_images_01.gif
In reply to W Page

Re: Needs Testing >> New Script >> Course List Display Images

by Juan Martinez -

Thanks WP1 & Bryan,

Thanks a lot both and WP1 keep go ahead with the spanish language if you need any help on this count with me without not doubt,

Juan Martinez

Dom. Rep. 

In reply to Juan Martinez

Re: Needs Testing >> New Script >> Course List Display Images

by W Page -
Gracias Juan.

WP1
In reply to W Page

Re: Needs Testing >> New Script >> Course List Display Images

by Kevin Douglass -

Hey Guys'

I just implemented this script which causes no error messages but displays no image. I am running 1.4+. It does show the image on the enrol page but not the when the course block is shown on the main page??

Any suggestions, brilliant script by the way, I have long wondered about this functionality.

In reply to W Page

Re: Needs Testing >> Course List Display Images - v2.0

by W Page -
Hello Everyone!

Attached is v2.0 of the Course Image Script. I want to thank Janne Mikkonen 
for helping me with this script. Again extensive instructions are in the Zip. Please read the "README_FIRST_02.TXT" first.

This script can be used in v1.3.1, 1.3.3 & 1.4DEV.

DO NOT USE ON A PRODUCTION SITE
.
Please test and let me know as soon as possible what your results are. I would like to submit it as soon as possible to Martin for possible inclusion into v1.4DEV.

Thanks in advance.

WP1-