Mathematical and Physical Journal
for High Schools
Issued by the MATFUND Foundation
Already signed up?
New to KöMaL?

Problem I. 315. (February 2013)

I. 315. Your task is to rank schools participating in the KoMaL contest. For each year, a separate list should be compiled and sorted according to the number of participating students from the schools. The link http://www.komal.hu/eredmeny/eredmeny.h.shtml?a=isklist&ev=2010 contains results of the school year 2010/2011, for example, but by modifying its last 4 characters, one can obtain data for the other years (= ``ev'') as well from 2001. The rankings should be displayed by using tables similar to the example (``Város'' is city and ``Létszám'' is the number of participating students).

Since this task would be quite time consuming if performed manually, you got some advice from an experienced IT colleague saying that a program in PHP language could easily solve the problem. Although control structures and some commands seemed familiar, your programming repertoire does not include PHP yet, so, as a sketch of the solution, you also got some useful keywords like strip_tags, explode, or associative array. To develop your program, the XAMPP multiplatform tool is recommended. In addition, the link www.php.net contains an extensive online documentation on PHP.

Summarizing, your task is to create a PHP program that displays the rankings, say, for the 2009/2010 school year in your browser at the address i315.php?ev=2009.

The source code of your program (i315.php) together with a short documentation (i315.txt, i315.pdf, ...) should be submitted, describing the main ideas of your solution and the actual PHP version used.

(10 pont)

Deadline expired on March 11, 2013.


Sorry, the solution is available only in Hungarian. Google translation

A feladat nem volt túlságosan nehéz, a kitűzéskor megadott segítség elegendő volt működő program készítéséhez, ennek ellenére kevés megoldás érkezett.

A megoldás során problémát jelentett, hogy a 2007 előtti éveket másképpen kellett - volna - kezelni a fővárosi iskolák miatt. Ezt sajnos csak egy beküldő vette észre, de ő sem kezelte.

Egy rendezési feladatnál mindig felmerül, mi határozza meg a sorrendet holtverseny esetén. A többség sem a programban, sem a dokumentációban nem utalt erre a problémára.

A php script HTML dokumentumot állít elő, így vizsgáltuk, hogy szerepel-e title tag - a feladathoz köthető tartalommal - és a http://validator.w3.org/ oldal segítségével megnéztük azt is, hogy az oldal helyes-e. A validálás során egy-egy error előfordult, de ezek olyan helyen jelentkeztek (doctype, meta tag), amit túl szigorú lett volna pontlevonással büntetni az egyik első php próbálkozás esetén.

A maximális pontszámmal értékelt Fényes Balázs kódját tesszük közé. (Ő a 2007 előtti adatok problémájára utalt a dokumentációban.) i315.php.zip


Statistics:

5 students sent a solution.
10 points:Fényes Balázs.
8 points:2 students.
7 points:1 student.
5 points:1 student.

Problems in Information Technology of KöMaL, February 2013