Monday, July 13, 2015

SimpleNav: Custom course format - Part 1

THE GOAL
I recently worked for a client in the food service that wanted users to view a quick overview of their company and complete a couple training exercises. So we setup a Moodle course with about 10 activities and 5 videos in the course the student had to complete. The intended time frame for completion was about 10 minutes or less.

The client asked for a streamlined user experience, eliminating confirmation screens and backtracking to the main course page. So in effect, the user could flow seamlessly between each consecutive activity in the course.

THE SOLUTION
The easiest solution for a new navigation between activities would be a new, custom course format. This would allow me to make custom changes without messing with core Moodle code. So the first thing I did was to build my new course format off of a classic:  the Topics format.
  1. Go into the moodle source code to:   moodle/course/format/
  2. Copy the "topics" folder and rename it to something else. I chose to name mine "simplenav" 
Now the fun part: re-naming everything. 
Open up the course format folder you just renamed. Let's start at the top and work our way down.

Lang Folder
  1. Open the lang folder and navigate to the only file in there:  format_(formatname).php. Rename this file using the new name you picked out like this:  format_simplenav.php
  2.  Open the file with a text editor, like Notepad++
  3. Let's rename some of the strings in there, so it matches our "simplenav" plugin. Here is an example:
              $string['pluginname'] = 'Simple Navigation format';
              $string['page-course-view-simplenav'] = 'Any course main page in simplenav format';          $string['page-course-view-simplenav-x'] = 'Any course page in simplenav format';
format.php
  1. Open this file in a text editor. You only need to change two lines. 
  2. Search for the keyword "topics," since that is the format name we'll be replacing.
  3. Near the end of the file, find these line and update it:
    1. $renderer = $PAGE->get_renderer('format_simplenav'); 
    2. $PAGE->requires->js('/course/format/simplenav/format.js');  
lib.php
  1.  Open this file in a text editor. Search for the keyword "topics"
  2. The first change is the class name, at the top of the file:
    1. class format_simplenav extends format_base {  
  3. Continue to search and replace.
renderer.php
This is the same process. Make sure you rename the class at the top of the file:
             class format_simplenav_renderer extends format_section_renderer_base {    

css.php
Same thing again. Re-name all the css classes from "topics" to "simple nav like this:
             .course-content ul.simplenav {margin:0;}             .course-content ul.simplenav li.section {list-style: none;margin:0 0 5px 0;padding:0;}             .course-content ul.simplenav li.section .content {margin:0 40px;}


version.php
You only need to change the last line:.
$plugin->component = 'format_simplenav';  
INSTALLATION 
Now that everything has been copied and renamed properly, it can be installed within moodle. 
  1. Login to your site as the Administrator. You should be automatically redirected to a new page, where you must install updates within your site. 
    1. If you are not automatically redirected, go to the Site Administration block, and click on "Notifications."
  2. You will be redirected to a page to update your site – the new “simplenav” course format will appear. Update your site to move forward. 
CHANGES TO COURSE ADMINISTRATION
We need to change the settings of our course to enable our new format.
  1.  Login to the Moodle website as an Administrator or Teacher.
  2. Go into your course and go to “Course Administration > Edit Settings.”
  3. Open up the “Course Format” section. If the simplenav format installed correctly, you’ll have a new option called “Simple Navigation.” Click on that one
YOU'RE READY!
Everything is ready to start customizing and using your new, custom course format! In the next blog post, we'll talk about the changes we need to make to have a linear activity flow.

29 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. hanks for sharing such informative peice of work ,Welcome to our for Pinball machines ,At pinball machine for sale, we love fixing, customizing and selling all types pinball machine and have been doing it for over 20 years. With all the innovation and new pinball companies starting up, it’s great that we’re in the epicenter of pinball world, Chicago, buy high quality japanese used car tyres. Pinball machine manufacturers have been forming in Chicago from the earliest days of pinball. That’s probably why we’re able to find great vintage pinballs tor refurbish! Buy pinball machines online such as antique pinball machine,refurbished pinball machines ,stern pinball machine and many more.
    s

    ReplyDelete

  3. Thanks for sharing such informative peice of work ,Welcome to Glock Store ,a Discreet online depot where you can buy firearms and ammunition , Buy guns online ,
    buy ammo discreetly without monotonous deocumentations and ship to your prefered location with no hassle.We are FFL Dealers and stricktly follow the Regulations of the Gun Control Act(GCA).Purchasing Fireamrs and Ammunition online with caution has always been a long process of paperwork because of the inter/Intra state Laws controlling the buying and distribution.At Glock store online shop we cut the Gordian knot and deliver to your location with no hassle.We have a wide range of firearms and ammunition for sale ,buy Ammo such as shotguns,Long guns,Magazines, Optics and accesories which include Century Arms,Kel-Tec,
    Ruger,
    AR15,
    AK47,.Despite the perusal increase in surounding firearms,we issue uncomplicated paths to acquire Firearms for individual and or Family security.If you have ever asked yourself
    how to buy guns and ammunition online with ease and,safety then your question is answered once you are here.All you have to do is choose your firearms, optic, magazine,accessories and add to cart then proceed to check out. READ MORE on how to buy guns and ammunition online discreet.
    Pain management, pain medicine,buy weed strains online and buy research chemicals, pain control or algiatry, is a branch of medicine employing an interdisciplinary approach for easing the suffering and improving the quality of life of those living with chronic pain,
    buy lipitor
    You can also buy weed online, buy cbd oil

    ReplyDelete
  4. Marijuana—also called weed, herb, pot, grass, bud, ganja, Mary Jane, and a vast number of other slang terms—is a greenish-gray mixture of the dried flowers of Cannabis sativa.

    The main active chemical in marijuana is THC (delta-9-tetrahydrocannabinol), the psychoactive ingredient. The highest concentrations of THC are found in the dried flowers, or buds. When marijuana smoke is inhaled, THC rapidly passes from the lungs into the bloodstream and is carried to the brain and other organs throughout the body. THC from the marijuana acts on specific receptors in the brain, called cannabinoid receptors, starting off a chain of cellular reactions that finally lead to the euphoria, or "high" that users experience. Feeling of a relaxed state, euphoria, and an enhanced sensory perception may occur. With higher THC levels in those who are not used to the effects, some people may feel anxious, paranoid, or have a panic attack.
    Cannabis plant used for medical or recreational purposes. The main psychoactive part of cannabis is tetrahydrocannabinol, one of the 483 known compounds in the plant, including at least 65 other cannabinoids. 
    buy real weed online
    how to buy weed online
    buy legal weed online
    buy recreational weed online
    buy weed edibles online
    can i buy weed online
    buy medical weed online
    buy weed online canada
    buying weed online reviews
    buy weed online legit
    buy weed online without medical card
    buy weed seeds online canada
    order marijuana online
    order marijuana seeds online
    how to order marijuana online
    order marijuana online without a medical card
    can you order medical marijuana online
    order marijuana online

    ReplyDelete
  5. dank vapes are the best brand of vape cartridges in the market. These dank vapes cartridges have however suffered a backlash in the recent weeks with multiple reports on how these dank vapes carts cause cancer and other related lung disease.
    dank vapes cart however remain one of the best cartridges. dank vapes are sold in multiple states over the USA. dank vapes cart compost one of the black markets finest vape products. But this backlash has caused a fall in the consumption of the vape by adults.The 710 Kingpen brand is also on the rise in market demands as well as skywalker OG products.
    Recently juul pods also faced a similar backlash. juul starter kits have also fallen in market demand. mango juul pods are refillable juul pods and can be gotten as juul pods bulk. juul skins and juul accessories all come with the juul kits.
    buy juul online at cheap prices buy cocaine online
    buy Keytruda online and other cancer medications such as buy avastin online , buy Herceptin online
    jungle boys , buy weed online

    ReplyDelete

  6. lovely site get you purest research chemicals online and pills at cheap and in a 48 hours delivery time maximum
    buy pills online
    buy fentanyl powder online
    buy scopolamine powder online

    ReplyDelete
  7. FULL GRAM DANK VAPES
    Buying Dank vapes Note that, first things first, and our first red flag, comes beside to how much the price varies depending almost where you are. In authentic states get your dank vapes at https://fullgramdankvapes.com/ . Also ,you can pick occurring Dank vapes cartridges for as low as $25-30 and even as little as $40 in those yet enforcing weed prohibition. No situation how you see at it thats seriously undercutting the rival, and no doubt one of the reasons astern the recent surge in the brands popularity. vapes dank cartridges has beyond 20,000 partners as regards Instagram, vapes dank carts may be known as pre-loaded cannabis oil vape cartridgesthats sufficient to name its own report. Get your authentic vapes from FULL GRAM DANK VAPES
    Call or Text US +1 (669) 221-4197

    VAPE CARTS SHOP
    Buy Best selling Vape Carts Online, Cannabis vaporization is growing in popularity among people interested in consuming cannabis in an easy, dank vapes discreet manner that’s healthier than traditional smoking methods. Both flower and concentrates can be vaporized using a wide range of devices.Get you full gram dank vapes cartridges at https://vapecartsshop.net/ Taking the lead among the ever growing list of vape cartridges is the the dank vapes cartridges for good reason. The leading benefit for vaping weed using Vape dank carts is that it’s a healthier alternative to smoking flower, as vapor doesn’t release the tar and carcinogens created during combustion (the process of burning flower). Instead, vaping Dank vapes carts entails a slightly more complex process that creates a phase transition from liquid to vapor which makes it authentic, Get your authentic dank vapes cartridges from VAPE CARTS SHOP
    Call or text US + 1 (515) 989 – 1212

    ReplyDelete
  8. We are a fully licensed, Limits & Liability Corporation dedicated to raising happy and healthy exotic birds. Species we raise include Bare Eye Cockatoos, Black Palm Cockatoos, Citron Crested Cockatoos, Ducorp Cockatoos, Eleanora Cockatoos, Goffin Cockatoos, Greater Sulpher Crested Cockatoos, Lesser Sulpher Crested Cockatoos, Major Mitchell Cockatoos, Moluccan Cockatoos, Red-Tailed Black Cockatoos, Rose Breasted Cockatoos, Umbrella Cockatoos. All of our baby Cockatoos are abundance weaned, allowed to fully fledge, and are well socialized with other birds and humans. We offer a guarantee on the health of our babies.
    Visit our site for more info
    munchkin cat for sale
    munchkin kittens for sale
    munchkin kittens
    munchkin kitten
    Dank vapes Cartridges
    Dank vapes
    Cockatoos for Sale
    Umbrella Cockatoos for Sale
    Bare Eye Cockatoos for Sale
    Black Palm Cockatoos for Sale
    Citron Crested Cockatoos for Sale
    Cockatoos for sale
    Red Tailed Black Cockatoos for Sale
    Rose Breasted Cockatoos for Sale
    Sulpher Crested Cockatoos for Sale
    Dank Catridges
    Dank vapes
    dank vape flavors
    Dank vapes

    ReplyDelete
  9. Tack Köp legit piller online i sverige på Mundi Apotek

    Tack Köp legit piller online i sverige på   Scandinavia Apotek

    Tack Köp legit piller online i sverige på    battrehalsa-apotek 

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. Thankѕ for another informative website. Where else may I get that type of information written in such an ideal means? Ӏ have a miѕsion that I'm just now working on, and I've been at the glance out for such info.
    Long Guns for Sale Online

    ReplyDelete
  12. https://k2incenseonlineheadshop.com/
    info@k2incenseonlineheadshop.com
    k2incenseonlineheadshop Buy liquid incense cheap Buy liquid incense cheap For Sale At The Best Incense Online Shop

    ReplyDelete

  13. I have joined your rss feed and look forward to webcare
    seeking more of your great post.
    Also, I have shared your site in my social networks!

    ReplyDelete
  14. I’m starting a blog soon but have no coding knowledge so I wanted to get guidance from someone with experience. Fire Alarm Control Panel Price in Pakistan

    ReplyDelete

  15. https://buydocumentation.com/

    Buy Driver’s License online, US driver license, drivers license renewal ca WhatsApp +1 (925) 526-5453


    Here at Buy Documentation, you can buy fake documents at a fraction of a cost. We keep our prices low to meet the needs of all our customers. We provide Best Quality Novelty Real and Fake IDs and Passport, Marriage Certificates and Drivers license online

    https://buydocumentation.com/canada-visa/

    https://buydocumentation.com/buy-real-drivers-license/

    https://buydocumentation.com/buy-real-id-cards/

    https://buydocumentation.com/social-security-number-ssn/

    ReplyDelete
  16. This blog looks just like my old one! It's оn a totally different subject but it has pretty much the same layout and design. Great choice of colours!
    Aerosmith Pro Pinball Machine

    ReplyDelete
  17. While the whole plant produces THC and cannabinoids, cannabis typically smoke the flowers to get high. Different names for different consumable from of marijuana have sprouted from various regions and age groups on top of that there are scores of slang words that have evolved over the years. Below you can learn about all of the different strains we've come across to date.
    canna cavi moon rocks
    ice moonrock
    moonrock pre rolled joints
    animal gas for sale
    gelato #33
    buy super lemon haze cannabis oil
    bichon frise dog
    dankwoods pre roll
    dankwoods for sell
    pre rolls for sale
    teacup poodle puppies for sale near me
    sour gushers
    raw garden live resin
    shrooms for sale
    mushroom for sale
    stiiizy gelato
    choice carts
    krt carts
    oneup
    bicons puppies near me
    jungle boys
    trufflez
    zushi
    frosted flakes
    ice cream cake
    pineapple express
    white widow

    ReplyDelete

  18. CANNABIS DISPENSARY GOALS


    We are the most legit cannabis dispensary with both wholesale and retail weed for sale. Marijuana extract and thc cartridges are also available. We deliver in almost all states in the US and Puerto Rico. We are available in Canada, UK, USA, South America, Europe and Australia

    Buy Krt Carts Online

    Buy Pluto Strain Online

    Buy Sweet Tea Online 

    Buy White Runtz Sungrown Online

    Buy Banana Kush Online 

    Buy Bubbleberry Strain Online

    Buy Pink Panther Online

    Buy White Runtz 

    Packwoods x gashouse Tear gas

    https://cookieswood.com/shop/

     

    ReplyDelete
  19. to the medical condition of most patients. many people suffering from cancer, chronic pain, anxiety and man more have overcome their illment with cannabis. you can order weed from our store





    ReplyDelete