function system_school_data_form

6.x system.module system_school_data_form($school_id = 0)
4.x system.module system_school_data_form()
5.x system.module system_school_data_form()

This form is for the school-data, like subject code descriptions, colleges, etc.

File

modules/system/system.module, line 730

Code

function system_school_data_form() {
  $form = array();



  $form ["ignore_courses_from_hour_counts"] = array(
    "type" => "textfield",
    "label" => t("Ignore courses from hour counts (CSV):"),
    "value" => variable_get("ignore_courses_from_hour_counts", ""),
    "description" => t("List courses, separated by comma, 
                which should be ignored in hours counts.  This helps
                remedial courses from being applied to hour counts.
                Ex: MATH 093, ENGL 090, UNIV 1001"),
  );



  $form ["term_id_structure"] = array(
    "type" => "textarea",
    "label" => t("Structure of term ID's:"),
    "value" => variable_get("term_id_structure", ""),
    "description" => t("Use this space to define termID structures, one per line.
                Please see the FlightPath documentation on how to set up this field.") . "
                <br>" . t("Ex:") . " 
                <br>[Y4]60, Spring, Spring of [Y4], Spr '[Y2]
                <br>[Y4]40, Fall, Fall of [Y4-1], Fall '[Y2-1]",
  );





  // Let's load the subjects...
  $subjects = "";
  $query = "SELECT DISTINCT b.subject_id, a.title, a.college FROM courses b LEFT JOIN subjects a
              ON (a.subject_id = b.subject_id)
              WHERE exclude = 0              
              ORDER BY b.subject_id
              ";


  $result = db_query($query);
  while ($cur = db_fetch_array($result)) 
   {
    //fpm($cur);
    $title = trim($cur ["title"]);
    $subject_id = trim($cur ["subject_id"]);
    $college = trim($cur ["college"]);

    $subjects .= $subject_id . " ~ " . $college . " ~ " . $title . "\n";
  }


  $form ["subjects"] = array(
    "type" => "textarea",
    "label" => t("Subjects:"),
    "value" => $subjects,
    "rows" => 15,
    "description" => t("Enter subjects known to FlightPath (for use
                        in popups and the Course Search, for example), one per line
                        in this format:") . "<br>SUBJ ~ COLLEGE ~ Title<br>" . t("For example:") . "
                        <br>&nbsp; ACCT ~ BA ~ Accounting<br>&nbsp; BIOL ~ AS ~ Biology<br>" . t("Notice
                        the separator between the code, college, and title is 1 tilde (~). Whatespace is ignored."),
  );


  // Load the colleges...
  $colleges = "";
  $res = db_query("SELECT * FROM colleges ORDER BY college_code");
  while ($cur = db_fetch_array($res)) {
    $colleges .= $cur ["college_code"] . " ~ " . $cur ["title"] . "\n";
  }

  $form ["colleges"] = array(
    "type" => "textarea",
    "label" => t("Colleges:"),
    "value" => $colleges,
    "description" => t("Enter colleges known to FlightPath, one per line, in this format:
                       ") . "<br>COLLEGE_CODE ~ Title<br>" . t("For example:") . "
                       <br>&nbsp; AE ~ College of Arts, Science, and Education
                       <br>&nbsp; PY ~ College of Pharmacy<br>" . t("Notice
                        the separator between the code and title is 1 tilde (~). Whitespace is ignored."),
  );




  // Load the degree_college data....
  $degree_college = "";

  $res = db_query("SELECT DISTINCT(major_code) FROM draft_degrees ORDER BY major_code");
  while ($cur = db_fetch_array($res)) {
    $major_code = $cur ["major_code"];

    // Is there an assigned college already?
    $res2 = db_query("SELECT college_code FROM degree_college WHERE major_code = '?' ", $major_code);
    $cur2 = db_fetch_array($res2);
    $college_code = $cur2 ["college_code"];

    $degree_college .= $major_code . " ~ " . $college_code . "\n";

  }


  $form ["degree_college"] = array(
    "type" => "textarea",
    "label" => t("Degree Colleges:"),
    "value" => $degree_college,
    "rows" => 15,
    "description" => t("Enter the degree's college, one per line, in this format:
                       ") . "<br>MAJOR_CODE ~ COLLEGE_CODE<br>" . t("For example:") . "
                       <br>&nbsp; ACCT ~ AE
                       <br>&nbsp; BUSN ~ SB<br>" . t("Notice
                        the separator between the codes is 1 tilde (~). Whitespace is ignored."),
  );



  // How many decimal places allowed in substitutions?

  $form ["sub_hours_decimals_allowed"] = array(
    "type" => "select",
    "label" => t("Substitution hours decimal places allowed:"),
    "options" => array(1 => t("1 (ex: 1.1 hrs)"), 2 => t("2 (ex: 1.15 hrs)"), 3 => t("3 (ex: 1.155 hrs)"), 4 => t("4 (ex: 1.1556 hrs)")),
    "value" => variable_get("sub_hours_decimals_allowed", 2),
    "no_please_select" => TRUE,
    "description" => t("For hours with decimals (like 2.25 hours), how many numbers
                      after the decimal place will be allowed?  Affects users performing
                      substitutions.  For example, if you select \"2\" here, then
                      a value of 1.2555 will be rejected, and the user will be asked to re-enter.
                      1.25, would be accepted, since it has 2 decimal places.
                      <br>If you are unsure what to select, set to 2."),
  );


  // Auto-correct course titles?
  $form ["autocapitalize_course_titles"] = array(
    "type" => "select",
    "label" => t("Auto-capitalize course titles?"),
    "options" => array("yes" => "Yes", "no" => "No"),
    "hide_please_select" => TRUE,
    "value" => variable_get("autocapitalize_course_titles", "yes"),
    "description" => t("If set to yes, course titles in FlightPath will be run through a capitalization
                        filter, so that 'INTRO TO ACCOUNTING' becomes 'Intro to Accounting'.
                        Generally, this makes the course names more attractive, but it can
                        incorrectly capitalize acronyms and initials.  Disable if you would like
                        complete control over capitalization.
                        <br>If unsure, set to Yes."),
  );



  $form ["retake_grades"] = array(
    "type" => "textfield",
    "label" => t("Retake grades (CSV):"),
    "value" => variable_get("retake_grades", ""),
    "description" => t("List grades, separated by comma, which means 'the student must
                retake this course. They did not earn credit.' Ex: F,W,I"),
  );

  $form ["enrolled_grades"] = array(
    "type" => "textfield",
    "label" => t("Enrolled grades (CSV):"),
    "value" => variable_get("enrolled_grades", ""),
    "description" => t("List grades, separated by comma, which means 'the student is
                currently enrolled in this course.' Ex: E,AMID,BMID "),
  );

  $form ["b_or_better"] = array(
    "type" => "textfield",
    "label" => t("B or better grades (CSV):"),
    "value" => variable_get("b_or_better", ""),
    "description" => t("List grades, separated by comma, which are either a B or better."),
  );

  $form ["c_or_better"] = array(
    "type" => "textfield",
    "label" => t("C or better grades (CSV):"),
    "value" => variable_get("c_or_better", ""),
    "description" => t("List grades, separated by comma, which are either a C or better."),
  );

  $form ["d_or_better"] = array(
    "type" => "textfield",
    "label" => t("D or better grades (CSV):"),
    "value" => variable_get("d_or_better", ""),
    "description" => t("List grades, separated by comma, which are either a D or better."),
  );


  $form ["calculate_cumulative_hours_and_gpa"] = array(
    "label" => t("Calculate student cumulative hours and GPA?"),
    "type" => "checkbox",
    "value" => variable_get("calculate_cumulative_hours_and_gpa", FALSE),
    "description" => t("If checked, student cumulative hours and GPA will not be read from the
                          'students' database table, but will instead be calculated on the fly
                          each time a student is loaded.  If unsure what to do, check this box."),
  );

  $form ["quality_points_grades"] = array(
    "label" => t("Quality points and grades:"),
    "type" => "textarea",
    "value" => variable_get("quality_points_grades", "A ~ 4\nB ~ 3\nC ~ 2\nD ~ 1\nF ~ 0\nI ~ 0"),
    "description" => t("Enter a grade, and how many quality points it is worth, separated by
                        tilde (~), one per line.  You must include every grade which should count
                        for (or against) a GPA calculation, even if it is worth zero points.  For example,
                        if an 'F' should cause a GPA to lower (which normally it would), it should be
                        listed here.  If a 'W' grade should simply be ignored, then DO NOT list it here.
                        Any grade you do not list here will be IGNORED in all GPA calculations.") . "
                        <br>
                        Ex:<blockquote style='margin-top:0; font-family: Courier New, monospace;'>                        
                        A ~ 4<br>B ~ 3<br>C ~ 2<br>D ~ 1<br>F ~ 0<br>I ~ 0</blockquote>",
  );





  return $form;
}