Work back from View to Data Model

Overview

Gots to get a view on some fresh data.

Want

To work backwards from view to data model building the chain reaction of parts along the way.

  • skin to win
  • layout
  • widget?
  • viewport?
  • façade
  • datter model (uh, that’s data model in hick-tongue)

Have

  • Raw Score to Percentile Mappping.
  • Admin and Section Level Percentiles.
  • Admin and Section Level Mean and Standard Deviation.

1. skin

share/skin/default/layout/student_teacher_report.tt

In this skin layout is where we have html code along some logic such as the phrase:

=for layout $layout_name

where $layout_name is section_stanines in our case.

Note: I am adding a section_percentile_values row which will be based on the section_stanines_values. This will help us both add and follow along as we trace this application stack.

Add

<tr><td style="background: whitesmoke;"><b>Percentile</b></td>[% section_percentile_values %]</tr>

2. Widget

Widgets are pure perl code located under Myapp/UI/Widget

package TPRO::UI::Widget::StudentTeacherReport;

section_percentile_values - I’m feeling fragmented

I add the following two fragments to the Widget in order to get at the percentile scores I want to view.

implements fragment section_percentile_values {
    render 'section_percentile_value' => over $_{viewport}->all_section_scores;
};

implements fragment section_percentile_value {
    arg 'value' => $_->section_percentile_value;
};

Façade

My tags:
 
Popular tags:
 
Powered by MojoMojo