Instructions

This page offers instructions for creating the following accessory files from data in the kwt-cms system.
Generate full curriculum JSON
Generate getByGradeWeek JSON
Assign audio files to image files

This page was updated 12/12/18 to replace dev-cms with kwt-cms.

  • To generate the full curriculum JSON (asn:nid sequence for each grade)
    Follow this link: http://kwt-cms.hwtears.com/HWTscripts-http/createFullCurriculum.php
    Example:

    {"curriculum":[{"sequence":{"1":146,"2":135,"3":241,"4":148,"5":136,"6":155,"7":242,"8":173,"9":243,"10":156,"11":174,"12":244,"13":143,"14":137,"15":175,"16":157,"17":245,"18":176,"19":158,"20":144,"21":138,"22":159,"23":177,"24":246,"25":191,"26":207,"27":178,"28":160,"29":247,"30":179,"31":161,"32":192,"33":208,"34":162,"35":180,"36":251,"37":193,"38":209,"39":181,"40":163,"41":252,"42":182,"43":164,"44":194,"45":210,"46":165,"47":183,"48":254,"49":195,"50":211,"51":184,"52":166,"53":255,"54":185,"55":167,"56":196,"57":212,"58":168,"59":186,"60":256,"61":197,"62":213,"63":187,"64":169,"65":258,"66":188,"67":170,"68":198,"69":214,"70":199,"71":139,"72":171,"73":215,"74":702,"75":189,"76":147,"77":200,"78":216,"79":203,"80":771,"81":201,"82":204,"83":172,"84":217,"85":772,"86":190,"87":205,"88":202,"89":218,"90":206,"91":773,"92":269,"93":260,"94":220,"95":229,"96":774,"97":225,"98":230,"99":270,"100":262,"101":231,"102":775,"103":271,"104":263,"105":221,"106":232,"107":776,"108":226,"109":233,"110":272,"111":264,"112":234,"113":777,"114":273,"115":265,"116":222,"117":235,"118":778,"119":227,"120":236,"121":274,"122":266,"123":237,"124":780,"125":275,"126":267,"127":223,"128":238,"129":782,"130":228,"131":239,"132":276,"133":268,"134":240,"135":783,"136":1964,"137":365,"138":1770,"139":1762,"140":1955,"141":1758,"142":1965,"143":1620,"144":1771,"145":382,"146":1956,"147":1763,"148":1622,"149":3523,"150":1966,"151":366,"152":1772,"153":1764,"154":1960,"155":1759,"156":1967,"157":1624,"158":1773,"159":383,"160":1961,"161":1765,"162":1628,"163":1968,"164":367,"165":1774,"166":1766,"167":1958,"168":1760,"169":1969,"170":1635,"171":1775,"172":384,"173":1959,"174":1767,"175":1630,"176":1970,"177":368,"178":1776,"179":1768,"180":1962,"181":1761,"182":1631,"183":1971,"184":1777,"185":385,"186":1963,"187":1769,"188":1632,"189":3524,"190":1939,"191":1977,"192":1985,"193":369,"194":1935,"195":1981,"196":1633,"197":1891,"198":1978,"199":386,"200":1923,"201":1982,"202":1986,"203":1892,"204":1637,"205":1940,"206":1979,"207":1987,"208":370,"209":1936,"210":1983,"211":1638,"212":1893,"213":1980,"214":387,"215":1925,"216":1984,"217":1988,"218":1894,"219":1639,"220":1895,"221":3217,"222":3254,"223":3233,"224":1640,"225":1943,"226":1896,"227":3324,"228":3164,"229":1937,"230":3239,"231":3134,"232":1641,"233":1944,"234":3525,"235":3878,"236":1898,"237":3218,"238":3255,"239":3234,"240":1642,"241":3112,"242":1899,"243":3325,"244":3165,"245":1938,"246":3286,"247":3240,"248":1643,"249":1945,"250":3113,"251":3219,"252":3114,"253":3235,"254":1644,"255":3360,"256":3115,"257":3326,"258":3364,"259":3241,"260":3365,"261":3287,"262":1645,"263":3166,"264":3361,"265":3220,"266":3366,"267":3526,"268":1646,"269":3236,"270":3327,"271":3197,"272":3362,"273":3288,"274":3367,"275":1647,"276":3363,"277":3879,"278":3221,"279":3116,"280":3256,"281":3237,"282":1648,"283":3328,"284":3172,"285":3117,"286":3242,"287":3135,"288":3289,"289":1649,"290":341,"291":3199,"292":3222,"293":3118,"294":3257,"295":3238,"296":1650,"297":3329,"298":3173,"299":3119,"300":3319,"301":3136,"302":3290,"303":1651,"304":342,"305":3200,"306":3223,"307":3009,"308":3120,"309":1652,"310":3258,"311":3527,"312":3174,"313":3330,"314":3121,"315":3291,"316":3243,"317":3348,"318":1655,"319":3332,"320":3866,"321":3224,"322":3259,"323":1656,"324":3010,"325":3175,"326":3331,"327":3198,"328":3244,"329":3292,"330":1657,"331":3349,"332":3011,"333":3138,"334":3260,"335":3225,"336":3122,"337":3176,"338":3293,"339":3245,"340":3270,"341":3350,"342":3201,"343":3280,"344":3012,"345":3137,"346":3261,"347":3226,"348":3123,"349":3294,"350":3246,"351":3528,"352":3271,"353":3351,"354":3203,"355":3177,"356":3880,"357":3013,"358":3141,"359":3262,"360":3227,"361":3124,"362":3178,"363":3297,"364":3247,"365":3272,"366":3186,"367":3202,"368":3281,"369":3352,"370":3014,"371":3140,"372":3228,"373":3125,"374":3179,"375":3298,"376":3248,"377":3273,"378":3263,"379":3204,"380":3282,"381":3353,"382":3015,"383":3143,"384":3333,"385":3264,"386":3229,"387":3126,"388":3624,"389":3620,"390":3180,"391":3249,"392":3158,"393":3621,"394":3631,"395":3187,"396":3274,"397":3283,"398":3205,"399":3195,"400":3299,"401":3881,"402":3016,"403":3142,"404":3265,"405":3230,"406":3127,"407":3284,"408":3181,"409":3159,"410":3628,"411":3190,"412":3275,"413":3300,"414":3206,"415":3196,"416":3250,"417":3917,"418":3017,"419":3231,"420":3285,"421":3144,"422":3182,"423":3130,"424":3128,"425":3160,"426":3626,"427":3191,"428":3276,"429":3253,"430":3207,"431":3266,"432":3529,"433":3018,"434":3232,"435":3625,"436":3627,"437":3145,"438":3183,"439":3267,"440":3129,"441":3161,"442":3622,"443":3632,"444":3192,"445":3277,"446":3323,"447":3209,"448":3131,"449":3530,"450":3918,"451":3019,"452":3132,"453":3268,"454":3162,"455":3531,"456":3322,"457":3619,"458":3623,"459":3184,"460":3278,"461":3208,"462":3193,"463":3020,"464":3133,"465":3210,"466":3269,"467":3532,"468":3194,"469":3630,"470":3629,"471":3185,"472":3163,"473":3279,"474":3211,"475":3321,"476":3919},"themes":"JumpIntoKeyboarding,JumpIntoKeyboarding,JumpIntoKeyboarding,JumpIntoKeyboarding,JumpIntoKeyboarding,JumpIntoKeyboarding,LetsEat,OffToWork,OnGo,LetsEat,OffToWork,OnGo,LetsEat,OffToWork,OnGo,LetsEat,OffToWork,OnGo,LetsEat,OffToWork,OnGo,LetsEat,OffToWork,OnGo,LetsEat,OffToWork,OnGo,LetsEat,OffToWork,OnGo,LetsEat,OffToWork,OnGo,LetsEat,OffToWork,OnGo","ASNstarts":"1,10,22,34,46,58,70,81,92,103,114,125,136,150,163,176,190,205,220,236,251,265,278,292,306,321,332,344,357,370,382,402,418,433,451,463,477","spotChecks":"19,22,25,28,31,32,34,36"},

  • To generate JSON of activities per week for each grade (activity name, asn and nid by day:week:grade). Used to key teachers on upcoming activities.
    Process:
    1. Save Lesson Plans into Production
      Start at http://kwt-cms.hwtears.com/?q=lesson_plans (be sure to press Save at the bottom of this page if you make changes).
      Click link to “Save Lesson Plans into Production”: http://kwt-cms.hwtears.com/?q=update_curriculum_activites
      This will bring you to the Update Curriculum Activities page.
    2. Select the desired grade and press" Update the Curriculum".
    3. Paste the following into the browser window and substitute the number for the grade you want (0=Kindergarten, 1=first grade, etc.)
      http://kwt-cms.hwtears.com/HWTscripts-http/getByGradeWeek-dhr.php?grade=0
    4. This will display a JSON file you can copy and paste as necessary.

    Example:

    {
       "grade": "1",
       "weeks": [
           {
               "week": "1",
               "name": "JumpIntoKeyboarding",
               "days": [
                   {
                       "day": "1",
                       "activities": [
                           {
                               "name": "Puzzle Pieces",
                               "asn": "1",
                               "nid": "279"
                           },
                           {
                               "name": "Letters with Wood Pieces",
                               "asn": "2",
                               "nid": "287"
                           },
                           {
                               "name": "Mat Man Match",
                               "asn": "3",
                               "nid": "296"
                           },
                           {
                               "name": "Build a Keyboard",
                               "asn": "4",
                               "nid": "311"
                           }
                       ]
                   },
    

  • Assign audio files to image files
    1. After uploading new images to the CMS, click on the Update Audio File Lookup Table page, to initiate a script that looks for the new image files and adds them to the Audio File Lookup Table. This step will follow rules to assign audio files to image files. You must visit this page after uploading new image files to the CMS in order for the new images to appear in the Lookup Table.
    2. Manually override the rules by assigning an audio file to an image file on the http://kwt-cms.hwtears.com/HWTscripts/audio.php page. Select a single letter from the alphabet at the top of the page. For example, if you are associating the "fleet-mt.mp3" audio file to the image file "two_ships_in_water.jpg" image file, select the letter T at the top of the page to view only the image files that begin with T. If you skip this step, you run the risk that the manual change will not be saved. After selecting the appropriate letter from the menu, locate the image file of interest. Enter the name of the male teen and/or female teen audio files in the appropriate column and click the "Submit This Form" button at the bottom of the page.

    Initial Requirements of this function:

    1. Create a look-up table with the three fields: image_name, mt_audio, ft_audio
    2. Create a list of all images in the /sites/default/files subfolders.
    3. If the second character in the file name is a dash, remove it from list of images. (a-slate.jpg gets deleted from the image name column of the audio lookup table)
    4. Remove duplicate files names from the image_name column.
    5. Populate list in the image_name column.
    6. Programmatically, populate the mt_audio and ft_audio fields if there is a match of the root of the file names. To get the root,
      1. Strip the file extensions of the image file names. (astronaut.jpg becomes astronaut)
      2. Strip numbers and jointer (either underscore or dash) that are appended to the image names (astronaut_03.jpg becomes astronaut, astronaut3.jpg becomes astronaut)
      3. Convert name to all lower case (Astronaut.jpg becomes astronaut)
      4. Space and underscore become a dash (astronaut helmet.jpg becomes astronaut-helmet, Astronaut_helmet.jpg becomes astronaut-helmet.)
      5. Dashes remain as-is (astronaut-helmet.jpg stays astronaut-helmet)
      6. Append ‘–mt.mp3’ or ‘–ft.mp’ to the end of the stripped file name.
    7. Compare what you are left with against the list of files in the /var/www/html/vhosts/kwt-cms.hwtears.com/sites/default/files/voice/words-phrases/ folder. If there is a match, put the matched audio file name in the appropriate audio column.
    8. At end of each day, repeat steps 2 and 5 for image files that were added within the past 24 hours. We do not care if the audio file timestamp has changed as long as the image filename did not change. This means if a file has been replaced with another image of the same name, nothing in the table will be changed. For each new image file, add the file name to the image_name field. **The cron job created for this step was suspected of causing problems so it was deactivated. In its place, there is a manual step to include images added to the system in the last 24 hours. Update Audio File Lookup Table
    9. After the list of image_name has been updated, follow steps 6 and 7 for each mt_audio and ft_audio cell that is empty. We are looking for any new voice files that have been added.
    10. Provide an interface to view the table.
    11. Allow the mt_audio and ft_audio fields to be manually entered, modified and saved. Once the mt_audio or ft_audio fields have been manually altered, the program will not go back and change the entries. The only way to update audio entries is to manually change them via the interface.
    12. JSON file generator will look up the correct audio files to include based on rules that Bryce provides and are coded into the JSON file generator.