function _AdvisingScreen::build_test_scores

4.x _AdvisingScreen.php _AdvisingScreen::build_test_scores()
5.x _AdvisingScreen.php _AdvisingScreen::build_test_scores()

Constructs the HTML to show the student's test scores.

1 call to _AdvisingScreen::build_test_scores()
_AdvisingScreen::build_screen_elements in classes/_AdvisingScreen.php
This function calls the other "build" functions to assemble the View or What If tabs in FlightPath.

File

classes/_AdvisingScreen.php, line 1384

Class

_AdvisingScreen

Code

function build_test_scores() 
 {
  // This function will build our Test Scores box.
  // Only do this if the student actually has any test scores.

  if ($this->student->list_standardized_tests->is_empty) 
   {
    return;
  }

  $top_scores = array();

  $pC = "";
  $pC .= $this->draw_semester_box_top(t("Test Scores"), TRUE);

  $pC .= "<tr><td colspan='8' class='tenpt'>
					";

  $fsC = "";

  // Go through and find all the test scores for the student...
  $this->student->list_standardized_tests->reset_counter();
  while ($this->student->list_standardized_tests->has_more()) {
    $st = $this->student->list_standardized_tests->get_next();

    $extra_date_css = "";

    if (!$st->bool_date_unavailable) {
      $dt = strtotime($st->date_taken);
      $ddate = format_date($dt, "just_date");
    }
    else {
      // The date was not available!
      $ddate = t("N/A");
      $extra_date_css = " test-date-unavailable";
    }

    $fsC .= "<div class='test-section'>
						<b class='test-description'>$st->description</b> - <span class='test-date $extra_date_css'>$ddate</span>
						<ul>";
    foreach ($st->categories as $position => $cat_array) 
     {
      $fsC .= "<li><span class='test-cat-desc'>{$cat_array ["description"]}</span> - <span class='test-cat-score'>{$cat_array ["score"]}</span></li>";

    }
    $fsC .= "</ul>
					</div>";

  }

  $pC .= fp_render_c_fieldset($fsC, t("Click to view/hide standardized test scores"), TRUE);

  $pC .= "</td></tr>";


  $pC .= $this->draw_semester_box_bottom();

  $this->add_to_screen($pC, "TEST_SCORES");
}