290 likes | 439 Views
A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium. Using SkyCoder.
E N D
A Programmer’s Discussion of SkyCoder and Crystal Reports Presented by Daniel Hornsby and Michael Preslar North East Florida Educational Consortium
Using SkyCoder Learn how to use SkyCoder to embed local, state, and federal validation edits, resulting in fewer data entry errors and cleaner state and federal reporting. JavaScript experience is recommended. Following the SkyCoder presentation, stick around to talkabout the use of Crystal Reports to create complex, customized report cards and other reports.
What is SkyCoder? SkyCoder is a tool in Skyward that allows for the customization of fields and screens by embedding JavaScript code on the page. It allows you to customize how Skyward behaves, to a degree, by adding locally-defined logic in addition to Skyward’s logic. Because of the advanced capabilities of this tool, it should only be utilized by a select few in your district; preferably those with programming experience.
Enabling SkyCoder for a User In order for a user to begin using SkyCoder, they first must be given rights to it. To enable SkyCoder, edit a Secured User’s account, set“Allow User to Access SkyCoder” to ‘Yes’, and then save the changes. That user will then be able to access SkyCoder for any page by clicking the computer monitor icon in the quick access toolbar.
How does SkyCoder work? SkyCoder utilizes JavaScript coding in order to directly manipulate fields in a single window. You are not currently able to code across different pages in Skyward, nor are you able to access the underlying database fields that are used on the page. You can, however, validate fields before committing them to the database, maintaining the integrity of the data.
What can you use SkyCoder for? • Built-in SkyCoder abilities: • Hiding or displaying individual fields. • Changing field labels. • Flagging fields as required fields. • Date validation. Using these provided tools, you can slightly change how Skyward behaves by modifying the page’s normal logic.
What can you use SkyCoder for? (cont) In order to do any advanced programming, you will need to create JavaScript functions and attach them to field events. A function is a series of programming logic that executeswhenever it is called. A function can do anything from changing how fields and data are displayed to directly manipulating data.
What can you use SkyCoder for? (cont) Field events are actions taken on objects on the page. Common events include: • onload – A page has loaded. • onclick – Clicking on an object. • onmouseover – Hovering over an object. • onchange – An object’s value has changed. • onfocus – An object has focus (you are now working with the object). • onblur – An object no longer has focus. Skyward provides the ability to auto-generate code to attach on the onchange and onblur events. All other events need to be coded specifically.
Example #1 – Hiding a Field Using Skyward’s built-in functions, you can hide a field that your district does not use. The field could be a field intended for another state, or just items that your district does not keep track of. In this example, we will look at hiding some Minnesota fields on the Mass Assign Transportation Category utility template screen.
Example #1 – Hiding a Field In this window, in the Processing Options group at the bottom, there are three Minnesota-specific fields that Florida does not use. Instead of instructing your users not to use these fields, you can use SkyCoder to remove them from the page. Once the code is in place, your users never have to know these options were once available.
Example #1 – Hiding a Field To launch SkyCoder, click the SkyCoder icon and look in the bottom left corner for the Add Field Function group. This group contains five premade SkyCoder functions: Hide Fields, Show Fields, Change Labels, Flag Fields as Required, and Validate Date on Save. Select Hide Fields from the list of functions. In the Labels drop-down list, select the first MN label: MN Transportation Category. Finally, in the Field drop-down list, select the matching MN field: MN Transportation Category. When the options are correct, click Insert Field Function and the JavaScript will be automatically generated. Repeat for the other two Minnesota fields, Update MN Transportation Category and Use Transportation Code’s MN Category if Valid. When you are complete, click Save.
Example #1 – Hiding a Field Close the Mass Assign Transportation Category window and then reopen it. When the window reloads, the three Minnesota fields will be gone. Note that the title on the page is now green and italicized. This indicates that there is an active SkyCoder modification on the page, which is useful when trying to remember which pages have been coded.
Example #2 – Adding Hovertext to an Object You can also use custom JavaScript code to customize an object in Skyward. One of the things that you could add to an object is a tooltip. A tooltip is a small box that appears next to an object that you are hovering over with the mouse that will display a message (seen to the right). You can configure a message that will inform the user about how the object is intended to be used by the district, or any other information you may want to convey to the user. Some objects in Skyward already have tooltips linked to them. For the rest that do not, there is a simple and effective single-line of code that can add a tooltip to an object. However, this is code that you must type manually. Skyward does not yet have a way to automatically generate code that will add a tooltip.
Example #2 – Adding Tooltips to an Object To add tooltips to an object, you will need to add an attribute to an object using SkyCoder. We’re going to add tooltips to some Grade and General Information fields, found under Student Profile > General > Profile. Specifically, the Retained, Graduated, and Expelledfields.
Example #2 – Adding Tooltips to an Object To reference an object using JavaScript, use document.getElementById(‘objectName’). To add tooltips to that object, you will need to use the setAttribute function to attach a tooltip to it. setAttribute takes two parameters, the name of the attribute (“tooltip”) and the value of the attribute (what you want the tooltip to display). Using the tooltip attribute, Skyward can generate the tooltip on the page based on what’s coded. The completed line of code for adding tooltips is: document.getElementById(‘objectName’).setAttribute(“tooltip”, “Tooltip text”); Enter this code for each field you want to add a tooltip to, replacing objectName for the name of the field you want to add a tooltip to and the tooltip text with what you would like the tooltip to say. When you are done coding, click Save.
Example #2 – Adding Tooltips to an Object Close the window again and reopen it. Nowwhen you hover over the Retained, Graduated, and Expelled fields, you will see the tooltip display with the text that you entered.
Using SkyCoder for DOE edits. Using SkyCoder, it is possible to code select Florida DOE state reporting rules into Skyward. This results in MIS spending less time correcting data entry errors prior to state reporting. One example of a DOE rule that can be coded into Skyward is rule #26 of the Prior School Status/Student Attendance rules, which states: If the Entry Code is E01, then the Prior School/Location: District must be the same as the District Number, Current Enrollment, the Prior School/Location: State/Territory or Commonwealth must be FL, and the Prior School/Location: Country must be US. Using SkyCoder, it is possible to code this logic into the Entry/Withdrawal Maintenance page.
Example #3Cross-field Validation (Entry Code and Prior District) The fields mentioned in the DOE rule can be found on the Entry/Withdrawal Maintenance page under Student Profile > Entry/With. The fields that will be involved in this SkyCoder script will be: • Entry Code • Prior School’s Distr • Prior School State/Terr • Prior School Country
Example #3Cross-field Validation (Entry Code and Prior District) Totrigger any functions from SkyCoder, you first have to add an event to an object. The object that you will want to attach this code onto is the Entry Codefield. Fortunately, SkyCoder also features a way to easily attach events to objects using the Add Event group. Attaching an event to the ‘onblur’ event guarantees that the programming logic will occur every time the field is visited.
Example #3Cross-field Validation (Entry Code and Prior District) Your SkyCoder code should now have a generated function called addEvent, using the values you gave the generator. It’s only a function call, however, so the function’s coding is called from elsewhere. To code the remaining logic in the DOE edit rule, you will need to programmatically obtain the following data: • Entry code • Prior State • Prior District • Prior Country To do that, you will need the values stored within the fields that contain them.
Example #3Cross-field Validation (Entry Code and Prior District) The resulting code below is a rough draft of the SkyCoder logic that will enforce the DOE rule.
Example #3Cross-field Validation (Entry Code and Prior District)
Example #3Cross-field Validation (Entry Code and Prior District) Once the SkyCoder changes are saved, whenever E01 is entered into the Entry Code field of a new student entry record, the prior district, state, and country fields are automatically updated after exiting the field. Before:
Example #3Cross-field Validation (Entry Code and Prior District) Note the prior district, state, and country fields have been updated. Also note that the description fields to the side of the fields are not populated with the description of the code. After:
Example #3Cross-field Validation (Entry Code and Prior District) Possible improvements to the code could be: • An alert message informing the user of the DOE rule. • Merging other Entry/Withdrawal rules with this one. • Coaxing the description of the prior codes into updating. • Reformatting the code to avoid some programming bad practices. • Instead of a hardcoded (a fixed value), static (does not change) district number, find a way to possibly make the district number validated against dynamic (value can change programmatically). There are many ways to code this one DOE edit. Experiment with different functions and programming styles and find one that suits you best.
Other Possible DOE Edits Some other possible DOE edits that are, theoretically, programmable include: • Validate Social Security numbers so that they are valid numbers as defined by the Social Security Administration. • If a course number equals 2222222, then current instruction/service school number must be a private school. • In Transportation, Days in Term must be greater than zero and less than one hundred. • Grade Promotion Status must be A, D, P, R, N, or Z. • Cumulative, State Grade Point Averages must be greater than or equal to zero, and no higher than 40000, unless it is 99999 (with four decimal places). • If Entry Code is E05, then grade must be either KG or PK.
Advanced Crystal Reports Development • Report Cards, Secondary • Elementary • Middle • High • Student Class History • Test Scores • EOC Grade Verification • Using Command Tables • Dynamic Sorting
Contact Information Michael Preslar, Programmer preslarm@nefec.org (386) 329-3888 Daniel Hornsby, Applications Manager hornsbyd@nefec.org (386) 329-2574