Filter Courses by Progress in Chamilo LMS - chamilo-lms

I am new to chamilo lms learning system. I had created my portal on Chamilo and added courses also. Now I want to add filters on course home page from where i can filter courses according to their course progress.Filter like completed button filter will filter all the courses who gets completed and partial completed filter will filter process which are not completed yet.
Is there any way from which i can add a course progress filter on course home page ? Any kind of help either suggestion or technical will be appreciated.

It is not clear what you call courses. You seem to be mixing the notion of course (like the course space that offers a homepage) and of learning paths (that have a progress indicator). It is not clear either whether you want to filter courses or only show the tracking information and whether you want to do that as a teacher or as a student. This all makes it very difficult to answer you, but I'll guess.
The progress in the different learning paths can be seen on the learning paths list page. Chamilo is a relatively procedural language, with still relatively few friendly URLs, so it is very easy to understand where to look for examples in the code.
The tracking of learning paths is shown on the main/lp/lp_controller.php page (for your own progress, in chamilo 1.11.0 and above) and can be seen on the same page if you load the script with the "&action=report&lp_id=x" parameters. That should give you a first idea of where to look for the function calls that get the data you want.
Then showing this information on the course homepage is mostly a question of checking the main/course_home/ folder and see where you want to put it. You might need to modify templates in main/template/default/, but not all pages are supported by templates yet.

Related

How to get custom functionality in Django admin. Are there cases where it's recommended to do your own admin page from scratch?

This is a quick question for any experienced Django developers.
I have been trying to implement an admin page for 'Products' for an e-commerce store.
My vision for it was to have the top half of that form being used to enter information about a product which is a model I have defined. In the bottom part, I wanted to create some kind of inline to create ProductVariant (which is also a model I have) objects. Within the ProductVariant, I need some type of JavaScript behavior which displays or hides fields based on information entered at the Product section.
My question is would you recommend just completely throwing away the admin framework provided for that specific page and doing my own thing from scratch because I have just been struggling to get the custom functionality I want.
Yes to get the custom functionality you are describing, you’d probably need to implement, on your own, certain parts of the admin site (most likely overriding the templates). Some people even go as far as creating an entirely new admin site if they intend to work with frameworks like React.
That said, I’d look into the templates of the admin site in the Django libraries and, perhaps, copy most parts of the template then style and and add JavaScript as desired because you might miss certain key elements of the original if you do your own from scratch.

Website Architecture Rethink

I will try and be succinct and you can ask for further information if you feel it would help.
We have designed and built a website for delivering training courses. We are continuing to add Courses and Lessons. Our design approach has been to design the Lessons in a similar way to designing a book in that each Lesson contains many 'pages' with no scrolling, of a fixed size, and the text and images carefully laid out individually with attention to the flow of the content and the use of white space. A navigation bar at the bottom allows the user to go to the next or previous 'page', jump to any of the sub-sections of the Lesson or jump to a specific 'page'.
We have created hundreds of Lessons and each Lesson has been approximately 20 'pages' in length. Our simple but effective approach has been to have a single html file for each Lesson and create each 'page' within its own Div. The visibility of the Divs are controlled by JavaScript functions called by the navigation bar at the bottom of the window (swf file). This way when managing and laying out all of the content we don't have thousands of individual html files and navigating a Lesson is simple. Also we can easily open up a complete Lesson and review it in isolation in a browser.
Just to complete the picture we have developed Course html files which act as a wrapper to pull in and display collections of Lessons. The Lessons are displayed within an iFrame in the Course html file and xml files are used to determine which Lessons a Course contains.
The project has been very successful (here comes the 'but') but our client is now increasing the length of new Lessons and it is this which is forcing us to re-consider our approach. Our client has a very managed corporate intranet and all Users have IE8. When viewing a Course and clicking to view a Lesson the whole Lesson has to be downloaded just to view the first 'page' (you knew that of course!). It was slow but acceptable before, now it is becoming a real problem.
So, eventually, here is the question: how could we evolve our approach to delivering our content more efficiently, asking the server to deliver page by page rather than a whole Lesson up front?
When the project started we were told by our client hosting the website that we could not create a dynamic website accessing SQL or similar so we went static with xml data. We have more freedom now and could employ a more dynamic approach. However I would prefer not to start again as we have a huge amount of legacy content. An ideal would be to evolve our current approach but to manage the downloading better.
I look forward to hearing your thoughts.
Regards
Chris
So you have some javascript like
openPage(pageId);
That takes a div id, hides the current "page" and opens the new one. You probably have a collection of those "pageIds" somewhere that provides the inter-page navigation (or you could be building it dynamically from the div ID's, but that would be tricky, distinguishing "page" div ids from normal div ids, so I'm sticking with my first assertion, you are keeping a list of ids.
I'd suggest adding a url to each id, and having the javascript check the iFrame's location against the requested pageId, and if it's different, load the new html file. It could default to "current location" so you don't have to modify all the existing content, just the javascript.
This would allow you to put the first page in a different html file then all the others, and to shred them into appropriately sized files.
If you are clever, you will kick off a process after you load the first page to go ahead and start pulling the other pages for the lesson into the browser cache so that they are quick to display once the user is done with the first page.

Using a list of dynamic links throughout website

By "dynamic links", I mean a list of links that will constantly be updated.
To illustrate my question, I have a website that I am constantly writing new articles for. I currently have about 10 articles. If someone is to read article #5, there is a list of links to all 10 articles in the right panel of the page. As I update the site, and article #1 becomes out of date, I'd like to replace article #1 with article #11. Rather than updating the links within every article (so 10 times), is there a way to update the links once and have them all update simultaneously to every page?? Could I create an iframe for this??
Thanks for any and all help!
What's your goal? Do you want to learn to be a web developer? Or are you mostly concerned with getting your articles published?
If you want to be a web developer, I'd recommend steering clear of large CMS system like Wordpress or Drupal. Those are great products. But you want to learn the basics first. I think starting a PHP tutorial is the way to go.
If you just want to publish your articles, I'd recommend you find a nice place to create a blog. There are so many to choose from. It all depends on how much you want to spend.
Feel free to ask follow up questions. Web development sounds simple. But it's really a complex topic. I can't imagine what is must be like starting out these days with so many choices and competing technologies.
One way to do it would be to use Server-side includes. (Wikipedia) They work like this:
<!--#include file="some-content.html" -->
or
<!--#include virtual="some-folder/some-content.html" -->
The difference is file="" finds a file relative to the current page, whereas virtual="" finds it from the domain root. Either way, this method can use any type of regular text file as a source. The actual addition of the content is done by the server (hence the name) so its contents will be parsed as regular HTML and all CSS will apply to it as if the file were part of your page. I don't know about compatibility with different hosts, but if your web server supports it, this is probably the easiest way to go.

Go Dynamically Removing HTML onClick

I'm new to Go. I'm understanding the basics more and more but now I'm trying to learn how to interface the code with HTML.
My simple scenario is that I have a single web page with a list that's created by Go fetching information from a database, then building the html page from a group of templates. All I want is to make a simple list that will allow me to somehow mark it as complete/done when the <div> is clicked or something. Also, to be able to fully delete a "row" in my webpage list, a div basically.
So my list will indicate something is complete (I assume I must use Go to alter the css) and delete an item (completely remove that block of html). And remember, these items are stored in a database, so I must be able to identify the specific item.
Any help, ideas, resources, pseudocode, pointers would be greatly appreciated!
In web development, there are two "ends" where code executes; the browser and the server, aka. the front-end and the back-end.
A "click" happens in the browser and will execute code in the browser. That "browser-code" in turn may or may not contact the server for additional information and then render that information to the browser.
That means; the server has no control over what happens in the browser* and vice versa. That's the basics of web development.
Go is a language good for building servers. Javacript is the language that most browsers understand. What you need is Javascript, not Go.
* this is not entirely true but good enough as a base to start learning.

jQuery Mobile -- how to lay out my pages

I have an app that I'm building which is for completing a work order. The main page shows the details of the work order (site address, what needs to be done, etc.) and then there are a couple of listviews which show product and labour for that work order. At the start, there is no labour nor product attached to the work order, so these listviews are empty. When the employee is finished the work order, they can click Add Labour or Add Product to, well, add labour or product to the work order to reflect what work they've done.
I should point out that the main work order, the labour items, and the products are all distinct records in a database, all connected by the work order's primary key.
My question is about how I've laid this out. Currently, I have 3 distinct pages - one for the main work order, another for adding/editing labour and another for adding/editing product. When I say 'distinct page' I don't mean the <div data-role="page">, I mean, clicking "Add Labour" takes the user to a different website URL entirely.
I'm starting to question my logic in this design. Should I have all three (main, labour & product) on the same page, separated only by the <div data-role="page">? Then, when the user adds labour, it just takes them to that 'page' and, upon hitting "Save Labour" the main div (page) is dynamically updated (the labour listview gets an item added to it).
Not entirerly sure how I should have this built - I'm new to jQuery mobile.
Thanks
First let me tell you, you are not doing anything wrong.
There are 2 common ways of creating jQuery Mobile applications.
Single HTMl / multiple pages
Multiple HTML files
Each way has few good and few bad sides to it. From my experience people usually choose multiple HTML files solution and it is to be expected. Single HTML / multiple pages is a new paradigm created by jQuery Mobile developers and it will take some time for people to accept it as a normal/common way.
Because you didn't say what kind of app are you creating I cant advise you which approach is the best one. Usually if you are creating a classic web page it is best to use a multiple HTML solution. In case you are creating a Phonegap mobile hybrid app it is best to use single HTML file with multiple pages (this will make sure page transitions are smooth).
If you have more questions feel free to ask.