studium 0.18.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (821) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +3310 -0
  3. data/bin/all_passed_exams +14 -0
  4. data/bin/check_description_of_these_lectures +7 -0
  5. data/bin/curriculum_module_displayer +7 -0
  6. data/bin/cycle +7 -0
  7. data/bin/d10 +7 -0
  8. data/bin/d100 +7 -0
  9. data/bin/d15 +7 -0
  10. data/bin/d150 +7 -0
  11. data/bin/d20 +7 -0
  12. data/bin/d25 +7 -0
  13. data/bin/d3 +7 -0
  14. data/bin/d30 +7 -0
  15. data/bin/d5 +7 -0
  16. data/bin/determine_curricula +7 -0
  17. data/bin/display_lecture_url +7 -0
  18. data/bin/exam_registration_at +7 -0
  19. data/bin/exam_statistics +7 -0
  20. data/bin/exams_per_month +9 -0
  21. data/bin/finished_exams_at_this_university +7 -0
  22. data/bin/flashcards +7 -0
  23. data/bin/from_curriculum_id_to_university +9 -0
  24. data/bin/location_to_this_exam_topic.rb +7 -0
  25. data/bin/mandatory_continuous_assessment +7 -0
  26. data/bin/mandatory_upcoming_courses +10 -0
  27. data/bin/n_ECTS +7 -0
  28. data/bin/n_exam_questions_already_answered +15 -0
  29. data/bin/names_of_all_solved_exams +7 -0
  30. data/bin/not_completed_exams +7 -0
  31. data/bin/nquestions +7 -0
  32. data/bin/nsolved +7 -0
  33. data/bin/open_last_exam_question_asked_file +7 -0
  34. data/bin/passed_exams +7 -0
  35. data/bin/passed_pr/303/274fungsimmanente_courses +7 -0
  36. data/bin/passed_this_exam_on +10 -0
  37. data/bin/pdf_for +7 -0
  38. data/bin/question_answer +7 -0
  39. data/bin/random_exam_topic +7 -0
  40. data/bin/registered_for_this_exam +15 -0
  41. data/bin/report_solved_topics +7 -0
  42. data/bin/return_n_ects_from_this_file +7 -0
  43. data/bin/return_n_questions_solved_in_total +7 -0
  44. data/bin/rti_conflict +7 -0
  45. data/bin/search_for_n_ects +7 -0
  46. data/bin/show_lectures_on_the_commandline +7 -0
  47. data/bin/show_passed_exams_having_this_grade +7 -0
  48. data/bin/show_themes +7 -0
  49. data/bin/solved +9 -0
  50. data/bin/solved_ects +7 -0
  51. data/bin/studienkennzahl +7 -0
  52. data/bin/studium +7 -0
  53. data/bin/studium_actions +7 -0
  54. data/bin/studium_skeleton +7 -0
  55. data/bin/ufind +7 -0
  56. data/bin/upcoming_exams +7 -0
  57. data/bin/week_parser +7 -0
  58. data/doc/ECTS_CONSIDERATIONS/ECTS_CONSIDERATIONS.md +85 -0
  59. data/doc/HOW_TO_DETERMINE_WHICH_PART_IS_THE_QUESTION_AND_WHICH_PART_IS_THE_ANSWER/HOW_TO_DETERMINE_WHICH_PART_IS_THE_QUESTION_AND_WHICH_PART_IS_THE_ANSWER.md +44 -0
  60. data/doc/README.gen +3263 -0
  61. data/doc/SQL_database_specification/SQL_database_specification.md +46 -0
  62. data/doc/deprecated_components/deprecated_components.md +46 -0
  63. data/doc/documentation_for_the_file_lecture_information/documentation_for_the_file_lecture_information.md +311 -0
  64. data/doc/elegant_colours/elegant_colours.md +21 -0
  65. data/doc/statistics/yearly_statistics.md +8 -0
  66. data/doc/todo/todo_for_the_graphical_parts_of_the_studium_gem_including_www_related_aspects.md +92 -0
  67. data/doc/todo/todo_for_the_studium_gem.md +55 -0
  68. data/img/STUDIES.png +0 -0
  69. data/lib/studium/actions/actions.rb +134 -0
  70. data/lib/studium/autoinclude.rb +7 -0
  71. data/lib/studium/base/base.rb +3554 -0
  72. data/lib/studium/base/commandline_arguments_module/commandline_arguments_module.rb +115 -0
  73. data/lib/studium/base/html_colours_module.rb +632 -0
  74. data/lib/studium/base/runmode_module/runmode_module.rb +103 -0
  75. data/lib/studium/c/README.md +2 -0
  76. data/lib/studium/c/a.out +0 -0
  77. data/lib/studium/c/obtain_random_entry.c +11 -0
  78. data/lib/studium/check_and_sanitize/README.md +15 -0
  79. data/lib/studium/check_and_sanitize/check_curriculum_for_correct_separation_of_bachelor_and_master.rb +141 -0
  80. data/lib/studium/check_and_sanitize/check_for_all_exam_topics_being_registered.rb +118 -0
  81. data/lib/studium/check_and_sanitize/check_for_correct_themes_of_each_course.rb +100 -0
  82. data/lib/studium/check_and_sanitize/check_for_existing_description_of_this_lecture.rb +194 -0
  83. data/lib/studium/check_and_sanitize/check_important_exams.rb +138 -0
  84. data/lib/studium/check_and_sanitize/check_the_lecture_information_file.rb +166 -0
  85. data/lib/studium/check_and_sanitize/correct_all_dates_in_the_file_lecture_information.rb +115 -0
  86. data/lib/studium/check_and_sanitize/date_sanitizer.rb +350 -0
  87. data/lib/studium/check_and_sanitize/find_duplicate_lectures.rb +124 -0
  88. data/lib/studium/check_and_sanitize/missing_priority_entry.rb +44 -0
  89. data/lib/studium/check_and_sanitize/sanitize_lecture_information.rb +434 -0
  90. data/lib/studium/colours/colours.rb +1711 -0
  91. data/lib/studium/commandline/commandline.rb +1848 -0
  92. data/lib/studium/constants/constants.rb +2063 -0
  93. data/lib/studium/css/project.css +273 -0
  94. data/lib/studium/curricula/attribute_lecture_to_curriculum/attribute_boku_lecture_to_curriculum.rb +384 -0
  95. data/lib/studium/curricula/attribute_lecture_to_curriculum/attribute_lecture_to_curriculum.rb +238 -0
  96. data/lib/studium/curricula/curricula_from_this_website/curricula_from_this_website.rb +141 -0
  97. data/lib/studium/curricula/curriculum.rb +213 -0
  98. data/lib/studium/curricula/curriculum_as_string.rb +280 -0
  99. data/lib/studium/curricula/curriculum_module_displayer/constants.rb +33 -0
  100. data/lib/studium/curricula/curriculum_module_displayer/curriculum_module_displayer.rb +417 -0
  101. data/lib/studium/curricula/curriculum_module_displayer/initialize.rb +25 -0
  102. data/lib/studium/curricula/curriculum_module_displayer/menu.rb +45 -0
  103. data/lib/studium/curricula/curriculum_module_displayer/reset.rb +74 -0
  104. data/lib/studium/curricula/curriculum_module_displayer/run.rb +20 -0
  105. data/lib/studium/curricula/curriculum_module_displayer/set_use_this_curriculum.rb +93 -0
  106. data/lib/studium/curricula/curriculum_module_displayer/show_and_report.rb +190 -0
  107. data/lib/studium/curricula/determine_curricula/constants.rb +11 -0
  108. data/lib/studium/curricula/determine_curricula/determine_curricula.rb +36 -0
  109. data/lib/studium/curricula/determine_curricula/help.rb +39 -0
  110. data/lib/studium/curricula/determine_curricula/initialize.rb +48 -0
  111. data/lib/studium/curricula/determine_curricula/menu.rb +151 -0
  112. data/lib/studium/curricula/determine_curricula/misc.rb +403 -0
  113. data/lib/studium/curricula/determine_curricula/report.rb +141 -0
  114. data/lib/studium/curricula/determine_curricula/reset.rb +59 -0
  115. data/lib/studium/curricula/determine_curricula/run.rb +19 -0
  116. data/lib/studium/curricula/determine_elective_courses_in_this_curriculum.rb +112 -0
  117. data/lib/studium/curricula/display_bachelor_curricula.rb +90 -0
  118. data/lib/studium/curricula/handle_curricula/README.md +9 -0
  119. data/lib/studium/curricula/handle_curricula/handle_curricula.rb +99 -0
  120. data/lib/studium/curricula/handle_curricula/misc.rb +798 -0
  121. data/lib/studium/curricula/mitteilungsbl/303/244tter/mitteilungsbl/303/244tter.rb +323 -0
  122. data/lib/studium/curricula/modules/display_on_the_commandline.rb +319 -0
  123. data/lib/studium/curricula/modules/return_n_ects_in_this_module.rb +74 -0
  124. data/lib/studium/curricula/n_percent_solved_in_this_curriculum.rb +73 -0
  125. data/lib/studium/curricula/prepare_individual_curriculum.rb +304 -0
  126. data/lib/studium/curricula/random_curriculum_creator/random_curriculum_creator.rb +164 -0
  127. data/lib/studium/curricula/show_all_unfinished_courses_of_this_curriculum/show_all_unfinished_courses_of_this_curriculum.rb +116 -0
  128. data/lib/studium/curricula/show_lectures_of_this_curriculum.rb +114 -0
  129. data/lib/studium/curricula/show_lectures_of_this_curriculum_id/show_lectures_of_this_curriculum_id.rb +554 -0
  130. data/lib/studium/curricula/show_solved_percentage_among_the_registered_curricula.rb +87 -0
  131. data/lib/studium/curricula/sorted_individual_curricula.rb +121 -0
  132. data/lib/studium/ects/boku_ects_splitter.rb +128 -0
  133. data/lib/studium/ects/ects_per_university/ects_per_university.rb +179 -0
  134. data/lib/studium/ects/ects_scanner.rb +141 -0
  135. data/lib/studium/ects/ects_to_university_parser.rb +142 -0
  136. data/lib/studium/ects/last_entry_is_curriculum.rb +150 -0
  137. data/lib/studium/ects/n_ects_in_these_lectures.rb +196 -0
  138. data/lib/studium/ects/n_ects_points_in_mandatory_presence_courses.rb +47 -0
  139. data/lib/studium/ects/return_n_ects_from_this_file.rb +59 -0
  140. data/lib/studium/ects/return_n_ects_from_this_url.rb +197 -0
  141. data/lib/studium/ects/search_for_n_ects/search_for_n_ects.rb +719 -0
  142. data/lib/studium/ects/show_completed_ects_in_all_curricula.rb +245 -0
  143. data/lib/studium/ects/show_passed_credits_per_curriculum.rb +276 -0
  144. data/lib/studium/ects/simple_total_ects_points.rb +135 -0
  145. data/lib/studium/ects/solved_ects/constants.rb +19 -0
  146. data/lib/studium/ects/solved_ects/reset.rb +50 -0
  147. data/lib/studium/ects/solved_ects/solved_ects.rb +325 -0
  148. data/lib/studium/ects/solved_ects_per_university/reset.rb +25 -0
  149. data/lib/studium/ects/solved_ects_per_university/solved_ects_per_university.rb +116 -0
  150. data/lib/studium/ects/still_missing.rb +129 -0
  151. data/lib/studium/ects/sum_of_ects.rb +144 -0
  152. data/lib/studium/encoding/encoding.rb +109 -0
  153. data/lib/studium/exam_topics/RNAi_siRNA_and_miRNA +100 -0
  154. data/lib/studium/exam_topics/abfall_als_ressource +86 -0
  155. data/lib/studium/exam_topics/advanced_biochemistry +937 -0
  156. data/lib/studium/exam_topics/advanced_biotechnology +234 -0
  157. data/lib/studium/exam_topics/advanced_cellbiology +251 -0
  158. data/lib/studium/exam_topics/advanced_chemistry +547 -0
  159. data/lib/studium/exam_topics/advanced_immunology +225 -0
  160. data/lib/studium/exam_topics/advanced_microbiology +49 -0
  161. data/lib/studium/exam_topics/advanced_topics_in_plant_sciences +117 -0
  162. data/lib/studium/exam_topics/advanced_virology +273 -0
  163. data/lib/studium/exam_topics/ageing +154 -0
  164. data/lib/studium/exam_topics/agrar_ecology +67 -0
  165. data/lib/studium/exam_topics/agrarmarkt +73 -0
  166. data/lib/studium/exam_topics/agrarphysik +35 -0
  167. data/lib/studium/exam_topics/alcohols +30 -0
  168. data/lib/studium/exam_topics/algorithms +104 -0
  169. data/lib/studium/exam_topics/allergie +76 -0
  170. data/lib/studium/exam_topics/allgemeine_genetik +1006 -0
  171. data/lib/studium/exam_topics/allgemeine_mikrobiologie +1012 -0
  172. data/lib/studium/exam_topics/aminoacids +469 -0
  173. data/lib/studium/exam_topics/analytische_chemie_1 +134 -0
  174. data/lib/studium/exam_topics/analytische_chemie_2 +31 -0
  175. data/lib/studium/exam_topics/anatomie +378 -0
  176. data/lib/studium/exam_topics/anorganische_chemie +357 -0
  177. data/lib/studium/exam_topics/anthropologie +239 -0
  178. data/lib/studium/exam_topics/antibodies_and_antigens +790 -0
  179. data/lib/studium/exam_topics/apoptosis +35 -0
  180. data/lib/studium/exam_topics/archaea +112 -0
  181. data/lib/studium/exam_topics/archaeo_viruses +7 -0
  182. data/lib/studium/exam_topics/archaeology +5 -0
  183. data/lib/studium/exam_topics/architecture +8 -0
  184. data/lib/studium/exam_topics/artificial_intelligence +90 -0
  185. data/lib/studium/exam_topics/atomemissionsspektrometrie +6 -0
  186. data/lib/studium/exam_topics/audio +11 -0
  187. data/lib/studium/exam_topics/bacteriophages +266 -0
  188. data/lib/studium/exam_topics/basic_biochemistry +1008 -0
  189. data/lib/studium/exam_topics/basic_biotechnology +1011 -0
  190. data/lib/studium/exam_topics/basic_chemistry +1007 -0
  191. data/lib/studium/exam_topics/basic_virology +1008 -0
  192. data/lib/studium/exam_topics/bauwesen +6 -0
  193. data/lib/studium/exam_topics/betriebssysteme +128 -0
  194. data/lib/studium/exam_topics/betriebswirtschaftslehre +29 -0
  195. data/lib/studium/exam_topics/bioanalytik_und_biosensoren +451 -0
  196. data/lib/studium/exam_topics/biochips +80 -0
  197. data/lib/studium/exam_topics/bioelektrochemie +57 -0
  198. data/lib/studium/exam_topics/biofilms +58 -0
  199. data/lib/studium/exam_topics/bioinformatics +523 -0
  200. data/lib/studium/exam_topics/biological_therapeutics +156 -0
  201. data/lib/studium/exam_topics/biologie +152 -0
  202. data/lib/studium/exam_topics/biomarkers +137 -0
  203. data/lib/studium/exam_topics/biomaterials +90 -0
  204. data/lib/studium/exam_topics/biomedical_studies +16 -0
  205. data/lib/studium/exam_topics/biomembranes +6 -0
  206. data/lib/studium/exam_topics/bionik +65 -0
  207. data/lib/studium/exam_topics/biophysik +34 -0
  208. data/lib/studium/exam_topics/biopolymers +10 -0
  209. data/lib/studium/exam_topics/bioprozesstechnik +149 -0
  210. data/lib/studium/exam_topics/bioressourcenmanagement +78 -0
  211. data/lib/studium/exam_topics/birds +5 -0
  212. data/lib/studium/exam_topics/bodenkunde +384 -0
  213. data/lib/studium/exam_topics/bodenmikrobiologie +40 -0
  214. data/lib/studium/exam_topics/cancerbiology +488 -0
  215. data/lib/studium/exam_topics/cell_cultures +229 -0
  216. data/lib/studium/exam_topics/cellbiology +1011 -0
  217. data/lib/studium/exam_topics/cellular_transport_and_protein_secretion +27 -0
  218. data/lib/studium/exam_topics/cellular_vesicles +11 -0
  219. data/lib/studium/exam_topics/cellulose +6 -0
  220. data/lib/studium/exam_topics/chemische_technologie_anorganischer_stoffe +210 -0
  221. data/lib/studium/exam_topics/chemische_technologie_organischer_stoffe +25 -0
  222. data/lib/studium/exam_topics/chemisches_labor +60 -0
  223. data/lib/studium/exam_topics/chemokines_and_cytokines +45 -0
  224. data/lib/studium/exam_topics/chemotaxis_quorum_sensing_and_motility_in_prokaryotes +116 -0
  225. data/lib/studium/exam_topics/citric_acid_cycle +84 -0
  226. data/lib/studium/exam_topics/clinical_microbiology +520 -0
  227. data/lib/studium/exam_topics/computer_science +309 -0
  228. data/lib/studium/exam_topics/computer_vision_and_computer_graphics +15 -0
  229. data/lib/studium/exam_topics/crispr +51 -0
  230. data/lib/studium/exam_topics/cyanobacteria +45 -0
  231. data/lib/studium/exam_topics/cytogenetics_and_chromosome_biology +598 -0
  232. data/lib/studium/exam_topics/databases_and_sql +126 -0
  233. data/lib/studium/exam_topics/dna_mutation_and_dna_repair +186 -0
  234. data/lib/studium/exam_topics/dna_replication +80 -0
  235. data/lib/studium/exam_topics/ecogenetics +26 -0
  236. data/lib/studium/exam_topics/ecological_agriculture +12 -0
  237. data/lib/studium/exam_topics/ecology +332 -0
  238. data/lib/studium/exam_topics/economy +226 -0
  239. data/lib/studium/exam_topics/electron_microscopy +7 -0
  240. data/lib/studium/exam_topics/elektronenmikroskopie +356 -0
  241. data/lib/studium/exam_topics/elektrophorese +132 -0
  242. data/lib/studium/exam_topics/elektrotechnik_und_elektrizit/303/244t +42 -0
  243. data/lib/studium/exam_topics/elisa +55 -0
  244. data/lib/studium/exam_topics/embryologie_und_entwicklung +657 -0
  245. data/lib/studium/exam_topics/endospores_and_spores +104 -0
  246. data/lib/studium/exam_topics/enzymes_and_cofactors +395 -0
  247. data/lib/studium/exam_topics/epigenetik +188 -0
  248. data/lib/studium/exam_topics/erste_hilfe +414 -0
  249. data/lib/studium/exam_topics/ethik +143 -0
  250. data/lib/studium/exam_topics/evolution_and_evolutionary_genetics +372 -0
  251. data/lib/studium/exam_topics/excel +7 -0
  252. data/lib/studium/exam_topics/fish +19 -0
  253. data/lib/studium/exam_topics/fluorescence_microscopy +10 -0
  254. data/lib/studium/exam_topics/food_microbiology_and_food_biotechnology +92 -0
  255. data/lib/studium/exam_topics/forensik +65 -0
  256. data/lib/studium/exam_topics/forstwirtschaft +53 -0
  257. data/lib/studium/exam_topics/fortgeschrittene_genetik +692 -0
  258. data/lib/studium/exam_topics/fortgeschrittene_gentechnik +221 -0
  259. data/lib/studium/exam_topics/fortgeschrittene_physik +6 -0
  260. data/lib/studium/exam_topics/fungi +119 -0
  261. data/lib/studium/exam_topics/genetische_krankheiten +209 -0
  262. data/lib/studium/exam_topics/genexpression +1008 -0
  263. data/lib/studium/exam_topics/genomics_and_metagenomics +290 -0
  264. data/lib/studium/exam_topics/gentechnik_und_praktische_biochemie +961 -0
  265. data/lib/studium/exam_topics/geochemistry +67 -0
  266. data/lib/studium/exam_topics/geography +9 -0
  267. data/lib/studium/exam_topics/geologie_und_mineralogie +624 -0
  268. data/lib/studium/exam_topics/geometrie +56 -0
  269. data/lib/studium/exam_topics/geschichte +95 -0
  270. data/lib/studium/exam_topics/gluconeogenesis +72 -0
  271. data/lib/studium/exam_topics/glycogen +45 -0
  272. data/lib/studium/exam_topics/glycolysis +118 -0
  273. data/lib/studium/exam_topics/glykomik +131 -0
  274. data/lib/studium/exam_topics/glyoxylatzyklus +31 -0
  275. data/lib/studium/exam_topics/grassland_cultivation +32 -0
  276. data/lib/studium/exam_topics/hormone +152 -0
  277. data/lib/studium/exam_topics/html +8 -0
  278. data/lib/studium/exam_topics/human_ecology +8 -0
  279. data/lib/studium/exam_topics/hygiene +224 -0
  280. data/lib/studium/exam_topics/imaging_and_microscopy +270 -0
  281. data/lib/studium/exam_topics/immunanalytik +94 -0
  282. data/lib/studium/exam_topics/immunologie +1011 -0
  283. data/lib/studium/exam_topics/informatik +117 -0
  284. data/lib/studium/exam_topics/innate_immunity +52 -0
  285. data/lib/studium/exam_topics/insekten +66 -0
  286. data/lib/studium/exam_topics/insulin_and_diabetes +57 -0
  287. data/lib/studium/exam_topics/java +624 -0
  288. data/lib/studium/exam_topics/javascript +29 -0
  289. data/lib/studium/exam_topics/klima +6 -0
  290. data/lib/studium/exam_topics/kryptographie +10 -0
  291. data/lib/studium/exam_topics/landtechnik +26 -0
  292. data/lib/studium/exam_topics/lebensmittel_und_getr/303/244nke +224 -0
  293. data/lib/studium/exam_topics/lebensmitteltechnologie +16 -0
  294. data/lib/studium/exam_topics/light_microscopy +19 -0
  295. data/lib/studium/exam_topics/linux_and_unix +36 -0
  296. data/lib/studium/exam_topics/lipids +145 -0
  297. data/lib/studium/exam_topics/macroeconomics +39 -0
  298. data/lib/studium/exam_topics/marketing +53 -0
  299. data/lib/studium/exam_topics/mathematics +311 -0
  300. data/lib/studium/exam_topics/medizin_und_biomedizinische_technik +254 -0
  301. data/lib/studium/exam_topics/medizinische_chemie_und_pharmazie +441 -0
  302. data/lib/studium/exam_topics/messtechnik_und_regeltechnik +104 -0
  303. data/lib/studium/exam_topics/metabolismus +482 -0
  304. data/lib/studium/exam_topics/meteorologie_und_atmosph/303/244re +120 -0
  305. data/lib/studium/exam_topics/microbial_ecology +37 -0
  306. data/lib/studium/exam_topics/microcontrollers +11 -0
  307. data/lib/studium/exam_topics/mikrobielle_lebensgemeinschaften +58 -0
  308. data/lib/studium/exam_topics/mikrobielle_physiologie +313 -0
  309. data/lib/studium/exam_topics/mitochondria +57 -0
  310. data/lib/studium/exam_topics/mixed +287 -0
  311. data/lib/studium/exam_topics/molecular_biology_of_plants +281 -0
  312. data/lib/studium/exam_topics/molekulare_medizin +133 -0
  313. data/lib/studium/exam_topics/nanotechnologie +456 -0
  314. data/lib/studium/exam_topics/nature_conservation_and_biodiversity +247 -0
  315. data/lib/studium/exam_topics/naturstoffe +9 -0
  316. data/lib/studium/exam_topics/netzwerke +63 -0
  317. data/lib/studium/exam_topics/neuroanatomie +25 -0
  318. data/lib/studium/exam_topics/neurobiology +356 -0
  319. data/lib/studium/exam_topics/nucleotide_sequencing +41 -0
  320. data/lib/studium/exam_topics/nutztierethologie +11 -0
  321. data/lib/studium/exam_topics/object_oriented_modeling +15 -0
  322. data/lib/studium/exam_topics/obstbau +249 -0
  323. data/lib/studium/exam_topics/organische_chemie +1007 -0
  324. data/lib/studium/exam_topics/organische_chemie_2 +137 -0
  325. data/lib/studium/exam_topics/paleobiology +39 -0
  326. data/lib/studium/exam_topics/parasitic_diseases_and_molecular_infection_biology +336 -0
  327. data/lib/studium/exam_topics/patent_law +55 -0
  328. data/lib/studium/exam_topics/pathologie +761 -0
  329. data/lib/studium/exam_topics/pcr +155 -0
  330. data/lib/studium/exam_topics/pentosephosphatweg +61 -0
  331. data/lib/studium/exam_topics/peroxisomes_glycosomes_and_lysosomes +66 -0
  332. data/lib/studium/exam_topics/pflanzenanatomie +262 -0
  333. data/lib/studium/exam_topics/pflanzenbau +24 -0
  334. data/lib/studium/exam_topics/pflanzenschutz +35 -0
  335. data/lib/studium/exam_topics/pflanzenwissenschaften +1009 -0
  336. data/lib/studium/exam_topics/pharmaceutical_biotechnology +252 -0
  337. data/lib/studium/exam_topics/physik +449 -1
  338. data/lib/studium/exam_topics/physikalische_chemie +79 -0
  339. data/lib/studium/exam_topics/physiology_and_histology +592 -0
  340. data/lib/studium/exam_topics/phytochemie +33 -0
  341. data/lib/studium/exam_topics/plant_biotechnology +132 -0
  342. data/lib/studium/exam_topics/plant_breeding +64 -0
  343. data/lib/studium/exam_topics/plant_development +50 -0
  344. data/lib/studium/exam_topics/populationsgenetik +143 -0
  345. data/lib/studium/exam_topics/posttranslationale_modifikation_von_proteinen +198 -0
  346. data/lib/studium/exam_topics/programming +41 -0
  347. data/lib/studium/exam_topics/projektmanagement +226 -0
  348. data/lib/studium/exam_topics/prokaryote_genetics +587 -0
  349. data/lib/studium/exam_topics/protein_engineering +35 -0
  350. data/lib/studium/exam_topics/proteolyse +39 -0
  351. data/lib/studium/exam_topics/proteomik +42 -0
  352. data/lib/studium/exam_topics/protozoans +24 -0
  353. data/lib/studium/exam_topics/prozesstechnik +95 -0
  354. data/lib/studium/exam_topics/psychologie +21 -0
  355. data/lib/studium/exam_topics/python +391 -0
  356. data/lib/studium/exam_topics/quality_management +266 -0
  357. data/lib/studium/exam_topics/rechtsgrundlagen +126 -0
  358. data/lib/studium/exam_topics/research_topics_in_immunobiology +42 -0
  359. data/lib/studium/exam_topics/rna_and_dna +535 -0
  360. data/lib/studium/exam_topics/rna_seq +13 -0
  361. data/lib/studium/exam_topics/robotics +12 -0
  362. data/lib/studium/exam_topics/ruby +240 -0
  363. data/lib/studium/exam_topics/ruby_on_rails +63 -0
  364. data/lib/studium/exam_topics/scientific_writing_and_publishing +38 -0
  365. data/lib/studium/exam_topics/semisynthese_von_proteinen_und_nukleotiden +120 -0
  366. data/lib/studium/exam_topics/sexualbiologie +327 -0
  367. data/lib/studium/exam_topics/signal_transduction_and_laser_systems +215 -0
  368. data/lib/studium/exam_topics/sozialbiologie +17 -0
  369. data/lib/studium/exam_topics/soziologie +5 -0
  370. data/lib/studium/exam_topics/splicing_exons_and_introns +67 -0
  371. data/lib/studium/exam_topics/sport_und_sportverletzungen +6 -0
  372. data/lib/studium/exam_topics/statistik +306 -0
  373. data/lib/studium/exam_topics/stemcells +182 -0
  374. data/lib/studium/exam_topics/stickstofffixierung +91 -0
  375. data/lib/studium/exam_topics/structural_bioinformatics +54 -0
  376. data/lib/studium/exam_topics/strukturbiologie +445 -0
  377. data/lib/studium/exam_topics/system_biology_and_synthetic_biology +108 -0
  378. data/lib/studium/exam_topics/systematische_zoologie +446 -0
  379. data/lib/studium/exam_topics/technical_ecology +144 -0
  380. data/lib/studium/exam_topics/technik +5 -0
  381. data/lib/studium/exam_topics/technische_chemie +208 -0
  382. data/lib/studium/exam_topics/technische_grundlagen_der_informatik +43 -0
  383. data/lib/studium/exam_topics/technische_mikrobiologie +393 -0
  384. data/lib/studium/exam_topics/technisches_zeichnen +5 -0
  385. data/lib/studium/exam_topics/the_bacterial_cell_wall +98 -0
  386. data/lib/studium/exam_topics/the_c_plus_plus_programming_language +531 -0
  387. data/lib/studium/exam_topics/the_c_programming_language +133 -0
  388. data/lib/studium/exam_topics/the_cellcycle +102 -0
  389. data/lib/studium/exam_topics/the_european_union +121 -0
  390. data/lib/studium/exam_topics/the_interferon_system +40 -0
  391. data/lib/studium/exam_topics/the_microbiome +164 -0
  392. data/lib/studium/exam_topics/the_universe +32 -0
  393. data/lib/studium/exam_topics/theoretische_chemie +5 -0
  394. data/lib/studium/exam_topics/theoretische_informatik +161 -0
  395. data/lib/studium/exam_topics/thermodynamics +21 -0
  396. data/lib/studium/exam_topics/tierzucht +139 -0
  397. data/lib/studium/exam_topics/toxikologie +508 -0
  398. data/lib/studium/exam_topics/transcription +188 -0
  399. data/lib/studium/exam_topics/translation_ribosomes_and_translational_control +155 -0
  400. data/lib/studium/exam_topics/umweltbiotechnologie +64 -0
  401. data/lib/studium/exam_topics/umweltchemie +233 -0
  402. data/lib/studium/exam_topics/urbanism_and_traffic +19 -0
  403. data/lib/studium/exam_topics/urea_cycle +56 -0
  404. data/lib/studium/exam_topics/vaccines_and_vaccination +253 -0
  405. data/lib/studium/exam_topics/vectors_and_gene_therapy +247 -0
  406. data/lib/studium/exam_topics/verfahrenstechnik +37 -0
  407. data/lib/studium/exam_topics/verhaltensbiologie +79 -0
  408. data/lib/studium/exam_topics/veterinary_medicine +10 -0
  409. data/lib/studium/exam_topics/vitamine +32 -0
  410. data/lib/studium/exam_topics/wasserkunde +144 -0
  411. data/lib/studium/exam_topics/weinbau +86 -0
  412. data/lib/studium/exam_topics/wissenschaft +20 -0
  413. data/lib/studium/exam_topics/yeast +104 -0
  414. data/lib/studium/exam_topics/zoologie +338 -0
  415. data/lib/studium/exams/afterburn/afterburn.rb +304 -0
  416. data/lib/studium/exams/ask_exam_from_the_upcoming_exams_pool.rb +150 -0
  417. data/lib/studium/exams/ask_exam_topic_question.rb +112 -0
  418. data/lib/studium/exams/ask_question_from_alias.rb +141 -0
  419. data/lib/studium/exams/ask_question_from_any_of_the_still_missing_lectures.rb +130 -0
  420. data/lib/studium/exams/ask_question_from_grouped_themes.rb +141 -0
  421. data/lib/studium/exams/ask_question_from_last_topic.rb +91 -0
  422. data/lib/studium/exams/ask_random_question.rb +195 -0
  423. data/lib/studium/exams/autoinclude.rb +7 -0
  424. data/lib/studium/exams/average_grade/average_grade.rb +404 -0
  425. data/lib/studium/exams/csv/create_csv_passed_exams_file.rb +217 -0
  426. data/lib/studium/exams/cycle.rb +291 -0
  427. data/lib/studium/exams/dataset/dataset.rb +126 -0
  428. data/lib/studium/exams/designate_ten_random_exam_topics/designate_ten_random_exam_topics.rb +88 -0
  429. data/lib/studium/exams/exam/exam.rb +130 -0
  430. data/lib/studium/exams/exam_bubble/exam_bubble.rb +444 -0
  431. data/lib/studium/exams/exam_bubble/menu_for_the_main_loop.rb +111 -0
  432. data/lib/studium/exams/exam_question/README.md +3 -0
  433. data/lib/studium/exams/exam_question/exam_question.rb +434 -0
  434. data/lib/studium/exams/exam_registration_at/constants.rb +49 -0
  435. data/lib/studium/exams/exam_registration_at/exam_registration_at.rb +242 -0
  436. data/lib/studium/exams/exam_registration_at/help.rb +46 -0
  437. data/lib/studium/exams/exam_registration_at/menu.rb +81 -0
  438. data/lib/studium/exams/exam_registration_at/report_and_show.rb +133 -0
  439. data/lib/studium/exams/exam_registration_at/reset.rb +54 -0
  440. data/lib/studium/exams/exam_statistics_from_this_file/exam_statistics_from_this_file.rb +119 -0
  441. data/lib/studium/exams/exam_topics.rb +194 -0
  442. data/lib/studium/exams/exams.rb +20 -0
  443. data/lib/studium/exams/exams_per_month/exams_per_month.rb +2442 -0
  444. data/lib/studium/exams/exams_this_week.rb +182 -0
  445. data/lib/studium/exams/fix_exam_dates.rb +121 -0
  446. data/lib/studium/exams/frozen.rb +36 -0
  447. data/lib/studium/exams/last_exams/last_exams.rb +479 -0
  448. data/lib/studium/exams/lectures_without_exam_entry.rb +137 -0
  449. data/lib/studium/exams/mandatory_continuous_assessment/mandatory_continuous_assessment.rb +1358 -0
  450. data/lib/studium/exams/move_all_unsolved_exam_questions_to_the_top_of_the_file.rb +173 -0
  451. data/lib/studium/exams/move_the_last_exam_question_to_the_top_of_the_file/move_the_last_exam_question_to_the_top_of_the_file.rb +111 -0
  452. data/lib/studium/exams/n_exams_in_these_topics.rb +477 -0
  453. data/lib/studium/exams/next_exam.rb +106 -0
  454. data/lib/studium/exams/next_exams.rb +378 -0
  455. data/lib/studium/exams/not_completed/README.md +5 -0
  456. data/lib/studium/exams/not_completed/not_completed.rb +143 -0
  457. data/lib/studium/exams/open_exam_associated_url/open_exam_associated_url.rb +154 -0
  458. data/lib/studium/exams/open_last_exam_question_asked_file/constants.rb +15 -0
  459. data/lib/studium/exams/open_last_exam_question_asked_file/initialize.rb +29 -0
  460. data/lib/studium/exams/open_last_exam_question_asked_file/open_last_exam_question_asked_file.rb +110 -0
  461. data/lib/studium/exams/push_solved_questions_on_top.rb +180 -0
  462. data/lib/studium/exams/question_answer/question_answer.rb +2936 -0
  463. data/lib/studium/exams/questions_solved_from_day_to_day/questions_solved_from_day_to_day.rb +379 -0
  464. data/lib/studium/exams/remote_ftp_url.rb +52 -0
  465. data/lib/studium/exams/repeat_last_question.rb +78 -0
  466. data/lib/studium/exams/report_total_amount_of_questions_and_answers_for.rb +116 -0
  467. data/lib/studium/exams/show_all_passed_exams_of_this_university.rb +252 -0
  468. data/lib/studium/exams/show_backlog_of_exams/show_backlog_of_exams.rb +114 -0
  469. data/lib/studium/exams/show_exams_for/show_exams_for.rb +172 -0
  470. data/lib/studium/exams/show_themes/constants.rb +28 -0
  471. data/lib/studium/exams/show_themes/menu.rb +61 -0
  472. data/lib/studium/exams/show_themes/misc.rb +538 -0
  473. data/lib/studium/exams/show_themes/reset.rb +62 -0
  474. data/lib/studium/exams/show_themes/show_themes.rb +27 -0
  475. data/lib/studium/exams/show_upcoming_exams/show_upcoming_exams.rb +1537 -0
  476. data/lib/studium/exams/solve_all_questions_from_this_topic.rb +114 -0
  477. data/lib/studium/exams/solved/solved.rb +434 -0
  478. data/lib/studium/exams/timetable/constants.rb +142 -0
  479. data/lib/studium/exams/timetable/timetable.rb +448 -0
  480. data/lib/studium/exams/unsolve_all_questions_from_this_topic.rb +163 -0
  481. data/lib/studium/exams/upcoming_exams/upcoming_exams.rb +555 -0
  482. data/lib/studium/exams/upcoming_exams_at_the_boku/constants.rb +23 -0
  483. data/lib/studium/exams/upcoming_exams_at_the_boku/html.rb +64 -0
  484. data/lib/studium/exams/upcoming_exams_at_the_boku/upcoming_exams_at_the_boku.rb +194 -0
  485. data/lib/studium/exams/upcoming_exams_dataset.rb +247 -0
  486. data/lib/studium/exams/upcoming_registered_exams/upcoming_registered_exams.rb +257 -0
  487. data/lib/studium/exams/upload_exam_topics.rb +360 -0
  488. data/lib/studium/graphviz/README.md +4 -0
  489. data/lib/studium/graphviz/bachelor_vector_based_strategies.dot +160 -0
  490. data/lib/studium/graphviz/master_vector_based_strategies.dot +46 -0
  491. data/lib/studium/gui/gtk3/control_panel/control_panel.rb +40 -0
  492. data/lib/studium/gui/gtk3/lecture_information/lecture_information.rb +191 -0
  493. data/lib/studium/gui/java/exam_question/ExamQuestion$1.class +0 -0
  494. data/lib/studium/gui/java/exam_question/ExamQuestion.class +0 -0
  495. data/lib/studium/gui/java/exam_question/ExamQuestion.java +215 -0
  496. data/lib/studium/gui/javafx/exam_question_widget/exam_question_widget.rb +58 -0
  497. data/lib/studium/gui/jruby/exam_trainer/exam_trainer.rb +637 -0
  498. data/lib/studium/gui/jruby/show_upcoming_exams/show_upcoming_exams.rb +85 -0
  499. data/lib/studium/gui/libui/ask_exam_question/ask_exam_question.rb +347 -0
  500. data/lib/studium/gui/shared_code/control_panel/control_panel_module.rb +305 -0
  501. data/lib/studium/gui/shared_code/exam_trainer/exam_trainer_widget_module.rb +0 -0
  502. data/lib/studium/gui/shared_code/information_about_a_lecture/information_about_a_lecture_module.rb +0 -0
  503. data/lib/studium/gui/shared_code/show_upcoming_exams/show_upcoming_exams_module.rb +129 -0
  504. data/lib/studium/gui/universal_widgets/curriculum_viewer/curriculum_viewer.rb +549 -0
  505. data/lib/studium/gui/universal_widgets/ects_per_university/ects_per_university.rb +302 -0
  506. data/lib/studium/gui/universal_widgets/exam_trainer/exam_trainer.config +6 -0
  507. data/lib/studium/gui/universal_widgets/exam_trainer/exam_trainer.rb +3266 -0
  508. data/lib/studium/gui/universal_widgets/exam_trainer/manifest.yml +12 -0
  509. data/lib/studium/gui/universal_widgets/expand_time_range/expand_time_range.rb +309 -0
  510. data/lib/studium/gui/universal_widgets/information_about_a_lecture/information_about_a_lecture.rb +242 -0
  511. data/lib/studium/gui/universal_widgets/show_upcoming_exams/show_upcoming_exams.rb +252 -0
  512. data/lib/studium/images/libui_ask_exam_question.png +0 -0
  513. data/lib/studium/images/outdated.png +0 -0
  514. data/lib/studium/images/small_logos/DNA.png +0 -0
  515. data/lib/studium/images/small_logos/README.md +2 -0
  516. data/lib/studium/images/small_logos/solved.png +0 -0
  517. data/lib/studium/images/studies_favicon.png +0 -0
  518. data/lib/studium/java/README.md +5 -0
  519. data/lib/studium/java/studium/AskExamQuestion.java +461 -0
  520. data/lib/studium/java/studium/Base.java +123 -0
  521. data/lib/studium/java/studium/Constants.java +122 -0
  522. data/lib/studium/java/studium/EnsureThatTheLogDirectoryExists.java +57 -0
  523. data/lib/studium/java/studium/Mkdir.java +13 -0
  524. data/lib/studium/java/studium/OpenLastExamQuestionurlLinkViaTheBrowser.java +90 -0
  525. data/lib/studium/java/studium/ReturnNQuestionsSolvedInTotal.java +69 -0
  526. data/lib/studium/java/studium/Solved.java +112 -0
  527. data/lib/studium/java/studium/Test.java +60 -0
  528. data/lib/studium/java/studium/studium/AskExamQuestion.class +0 -0
  529. data/lib/studium/java/studium/studium/Base.class +0 -0
  530. data/lib/studium/java/studium/studium/Constants.class +0 -0
  531. data/lib/studium/java/studium/studium/EnsureThatTheLogDirectoryExists.class +0 -0
  532. data/lib/studium/java/studium/studium/Mkdir.class +0 -0
  533. data/lib/studium/java/studium/studium/OpenLastExamQuestionurlLinkViaTheBrowser.class +0 -0
  534. data/lib/studium/java/studium/studium/ReturnNQuestionsSolvedInTotal.class +0 -0
  535. data/lib/studium/java/studium/studium/Solved.class +0 -0
  536. data/lib/studium/java/studium/studium/Test.class +0 -0
  537. data/lib/studium/jobs/jobs.rb +80 -0
  538. data/lib/studium/logging/README.md +2 -0
  539. data/lib/studium/logging/ensure_that_the_log_directory_exists.rb +58 -0
  540. data/lib/studium/logging/html_log_directory.rb +42 -0
  541. data/lib/studium/logging/log_directory.rb +112 -0
  542. data/lib/studium/logging/store_last_question_asked_into_file.rb +138 -0
  543. data/lib/studium/parsers/README.md +2 -0
  544. data/lib/studium/parsers/custom_exam_results_parser.rb +209 -0
  545. data/lib/studium/parsers/parse_remote_lecture.rb +331 -0
  546. data/lib/studium/project/project.rb +88 -0
  547. data/lib/studium/requires/common_popular_requires.rb +37 -0
  548. data/lib/studium/requires/commonly_used_requires.rb +14 -0
  549. data/lib/studium/requires/require_class_exams_solved.rb +7 -0
  550. data/lib/studium/requires/require_ects_scripts.rb +27 -0
  551. data/lib/studium/requires/require_encoding.rb +7 -0
  552. data/lib/studium/requires/require_the_check_and_sanitize_files.rb +31 -0
  553. data/lib/studium/requires/require_the_curricula_files.rb +28 -0
  554. data/lib/studium/requires/require_the_exam_question_class.rb +7 -0
  555. data/lib/studium/requires/require_the_exams_files.rb +46 -0
  556. data/lib/studium/requires/require_the_logging_files.rb +23 -0
  557. data/lib/studium/requires/require_the_parsers.rb +28 -0
  558. data/lib/studium/requires/require_the_studium_constants.rb +7 -0
  559. data/lib/studium/requires/require_the_studium_project.rb +72 -0
  560. data/lib/studium/requires/require_the_toplevel_methods.rb +27 -0
  561. data/lib/studium/requires/require_the_utility_scripts.rb +34 -0
  562. data/lib/studium/requires/require_upcoming_exams.rb +7 -0
  563. data/lib/studium/requires/require_yaml.rb +7 -0
  564. data/lib/studium/requires/return_remote_homepage_of_this_lecture.rb +7 -0
  565. data/lib/studium/requires/with_GUI.rb +13 -0
  566. data/lib/studium/requires/www_mode.rb +17 -0
  567. data/lib/studium/statistics/README.md +4 -0
  568. data/lib/studium/statistics/best_exam_months.rb +92 -0
  569. data/lib/studium/statistics/curriculum_comparer/curriculum_comparer.rb +423 -0
  570. data/lib/studium/statistics/determine_exam_statistics_from_this_file.rb +142 -0
  571. data/lib/studium/statistics/exam_topics_that_are_about_to_be_completed.rb +117 -0
  572. data/lib/studium/statistics/max_stats.rb +169 -0
  573. data/lib/studium/statistics/new_questions_per_year.rb +147 -0
  574. data/lib/studium/statistics/report_how_many_ects_points_per_curriculum_were_completed.rb +167 -0
  575. data/lib/studium/statistics/report_how_many_exam_questions_were_answered.rb +473 -0
  576. data/lib/studium/statistics/show_exam_statistics.rb +75 -0
  577. data/lib/studium/statistics/show_which_courses_are_in_a_bachelor_or_master_curriculum_respectively.rb +104 -0
  578. data/lib/studium/statistics/top_stats.rb +126 -0
  579. data/lib/studium/toplevel_methods/e_and_esystem.rb +34 -0
  580. data/lib/studium/toplevel_methods/find_exam_topic_and_exam_title.rb +3986 -0
  581. data/lib/studium/toplevel_methods/install_the_project_on_the_given_hostsystem.rb +31 -0
  582. data/lib/studium/toplevel_methods/return_remote_homepage_of_this_lecture.rb +11611 -0
  583. data/lib/studium/toplevel_methods/return_remote_moodle_link_of_this_lecture.rb +2405 -0
  584. data/lib/studium/toplevel_methods/roebe.rb +16 -0
  585. data/lib/studium/toplevel_methods/runmode.rb +45 -0
  586. data/lib/studium/toplevel_methods/toplevel_methods.rb +7295 -0
  587. data/lib/studium/universities_in_austria/README.md +2 -0
  588. data/lib/studium/universities_in_austria/boku/README.md +4 -0
  589. data/lib/studium/universities_in_austria/boku/boku_/303/266ffnungszeiten.rb +28 -0
  590. data/lib/studium/universities_in_austria/boku/show_three_pillars_of_these_lectures.rb +110 -0
  591. data/lib/studium/universities_in_austria/boku/three_pillars.rb +237 -0
  592. data/lib/studium/universities_in_austria/tu_vienna/README.md +6 -0
  593. data/lib/studium/universities_in_austria/tu_vienna/tu_ferien.rb +42 -0
  594. data/lib/studium/universities_in_austria/tu_vienna/tu_/303/266ffnungszeiten.rb +34 -0
  595. data/lib/studium/university_course/university_course.rb +409 -0
  596. data/lib/studium/utility_scripts/attribute_lectures_to_university/attribute_lectures_to_university.rb +375 -0
  597. data/lib/studium/utility_scripts/audio_stats.rb +171 -0
  598. data/lib/studium/utility_scripts/auto_stud/auto_stud.rb +252 -0
  599. data/lib/studium/utility_scripts/auto_stud/constants.rb +18 -0
  600. data/lib/studium/utility_scripts/auto_stud/initialize.rb +23 -0
  601. data/lib/studium/utility_scripts/auto_stud/misc.rb +18 -0
  602. data/lib/studium/utility_scripts/autogeneration/autogeneration.rb +158 -0
  603. data/lib/studium/utility_scripts/autopurge_this_lecture_date.rb +100 -0
  604. data/lib/studium/utility_scripts/average_grade_of_this_curriculum.rb +153 -0
  605. data/lib/studium/utility_scripts/blocked_courses.rb +146 -0
  606. data/lib/studium/utility_scripts/calendar/README.md +2 -0
  607. data/lib/studium/utility_scripts/calendar/calendar.rb +251 -0
  608. data/lib/studium/utility_scripts/calendar/misc.rb +35 -0
  609. data/lib/studium/utility_scripts/check_description_of_these_lectures.rb +221 -0
  610. data/lib/studium/utility_scripts/course_registrations/course_registrations.rb +98 -0
  611. data/lib/studium/utility_scripts/courses/courses.rb +177 -0
  612. data/lib/studium/utility_scripts/create/README.md +2 -0
  613. data/lib/studium/utility_scripts/create/webpage_of_university.rb +129 -0
  614. data/lib/studium/utility_scripts/create/webpage_of_university_BOKU.rb +61 -0
  615. data/lib/studium/utility_scripts/create/webpage_of_university_TU.rb +60 -0
  616. data/lib/studium/utility_scripts/create/webpage_of_university_UniWien.rb +60 -0
  617. data/lib/studium/utility_scripts/create_database/create_database.rb +126 -0
  618. data/lib/studium/utility_scripts/current_lectures_belonging_to_both_bachelor_and_master_curriculum.rb +113 -0
  619. data/lib/studium/utility_scripts/currently_participating_in_these_lectures/currently_participating_in_these_lectures.rb +104 -0
  620. data/lib/studium/utility_scripts/display_lecture_url/display_lecture_url.rb +176 -0
  621. data/lib/studium/utility_scripts/expand_time_range/expand_time_range.rb +521 -0
  622. data/lib/studium/utility_scripts/finished_exams_at_this_university/finished_exams_at_this_university.rb +171 -0
  623. data/lib/studium/utility_scripts/foreign_language_percentage/constants.rb +23 -0
  624. data/lib/studium/utility_scripts/foreign_language_percentage/foreign_language_percentage.rb +149 -0
  625. data/lib/studium/utility_scripts/foreign_language_percentage/help.rb +31 -0
  626. data/lib/studium/utility_scripts/foreign_language_percentage/initialize.rb +25 -0
  627. data/lib/studium/utility_scripts/foreign_language_percentage/menu.rb +158 -0
  628. data/lib/studium/utility_scripts/foreign_language_percentage/report.rb +62 -0
  629. data/lib/studium/utility_scripts/foreign_language_percentage/reset.rb +50 -0
  630. data/lib/studium/utility_scripts/foreign_language_percentage/run.rb +19 -0
  631. data/lib/studium/utility_scripts/generate_spreadsheet/generate_spreadsheet.rb +353 -0
  632. data/lib/studium/utility_scripts/generate_spreadsheet/misc.rb +144 -0
  633. data/lib/studium/utility_scripts/holidays/holidays.rb +154 -0
  634. data/lib/studium/utility_scripts/homepage_of_these_courses/homepage_of_these_courses.rb +125 -0
  635. data/lib/studium/utility_scripts/lectures_attributed_to_universities/lectures_attributed_to_universities.rb +336 -0
  636. data/lib/studium/utility_scripts/lva_dates_of_the_important_courses.rb +111 -0
  637. data/lib/studium/utility_scripts/lva_nummer/lva_nummer.rb +427 -0
  638. data/lib/studium/utility_scripts/mandatory_lectures_in_this_month/mandatory_lectures_in_this_month.rb +316 -0
  639. data/lib/studium/utility_scripts/moodle/moodle.rb +214 -0
  640. data/lib/studium/utility_scripts/name_of_this_lva_id/name_of_this_lva_id.rb +110 -0
  641. data/lib/studium/utility_scripts/new_stud.rb +324 -0
  642. data/lib/studium/utility_scripts/next_week/next_week.rb +103 -0
  643. data/lib/studium/utility_scripts/not_yet_registered/not_yet_registered.rb +120 -0
  644. data/lib/studium/utility_scripts/open_last_exam_question_url_link_via_the_browser.rb +76 -0
  645. data/lib/studium/utility_scripts/passed_ects_per_year/passed_ects_per_year.rb +313 -0
  646. data/lib/studium/utility_scripts/passed_pr/303/274fungsimmanente_courses/passed_pr/303/274fungsimmanente_courses.rb +181 -0
  647. data/lib/studium/utility_scripts/pdf/README.md +2 -0
  648. data/lib/studium/utility_scripts/pdf/create_pdf_file_for_this_exam_topic.rb +352 -0
  649. data/lib/studium/utility_scripts/pdf/hexapdf_support.rb +50 -0
  650. data/lib/studium/utility_scripts/preparatory_meetings/preparatory_meetings.rb +317 -0
  651. data/lib/studium/utility_scripts/priority/priority.rb +164 -0
  652. data/lib/studium/utility_scripts/priority_points/priority_points.rb +261 -0
  653. data/lib/studium/utility_scripts/publish_my_exams/publish_my_exams.rb +174 -0
  654. data/lib/studium/utility_scripts/regexes/README.md +1 -0
  655. data/lib/studium/utility_scripts/regexes/generate_regex.rb +314 -0
  656. data/lib/studium/utility_scripts/regexes/generate_regexes_for_the_available_moodle_links.rb +55 -0
  657. data/lib/studium/utility_scripts/regexes/generate_regexes_for_the_registered_lectures.rb +48 -0
  658. data/lib/studium/utility_scripts/report_outdated_timetable_entries/report_outdated_timetable_entries.rb +142 -0
  659. data/lib/studium/utility_scripts/report_whether_this_lecture_is_registered_in_the_file_lecture_information/report_whether_this_lecture_is_registered_in_the_file_lecture_information.rb +129 -0
  660. data/lib/studium/utility_scripts/resolve_practical_courses_date_conflicts/individual_resolve_practical_courses_date_conflicts.rb +254 -0
  661. data/lib/studium/utility_scripts/resolve_practical_courses_date_conflicts/resolve_practical_courses_date_conflicts.rb +265 -0
  662. data/lib/studium/utility_scripts/scrape_remote_university_url.rb +138 -0
  663. data/lib/studium/utility_scripts/semester_schedule_creator/semester_container.rb +144 -0
  664. data/lib/studium/utility_scripts/semester_schedule_creator/semester_schedule_creator.rb +373 -0
  665. data/lib/studium/utility_scripts/semesterplaner/semesterplaner.rb +311 -0
  666. data/lib/studium/utility_scripts/set_aliases_based_on_this_file.rb +96 -0
  667. data/lib/studium/utility_scripts/show_all_passed_master_lectures/show_all_passed_master_lectures.rb +126 -0
  668. data/lib/studium/utility_scripts/show_conflicting_lva_lectures/show_conflicting_lva_lectures.rb +1385 -0
  669. data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/constants.rb +23 -0
  670. data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/menu.rb +63 -0
  671. data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/reset.rb +33 -0
  672. data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/run.rb +50 -0
  673. data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/show_descriptions_of_lectures_belonging_to_this_module.rb +145 -0
  674. data/lib/studium/utility_scripts/show_lecturers/show_lecturers.rb +147 -0
  675. data/lib/studium/utility_scripts/show_lectures/show_lectures.rb +906 -0
  676. data/lib/studium/utility_scripts/show_lectures_fitting_to_this_language/show_lectures_fitting_to_this_language.rb +121 -0
  677. data/lib/studium/utility_scripts/show_lectures_fitting_to_this_theme/show_lectures_fitting_to_this_theme.rb +105 -0
  678. data/lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb +3160 -0
  679. data/lib/studium/utility_scripts/show_lectures_on_this_day/show_lectures_on_this_day.rb +150 -0
  680. data/lib/studium/utility_scripts/show_lva_dates_of_this_lecture/show_lva_dates_of_this_lecture.rb +182 -0
  681. data/lib/studium/utility_scripts/show_mixed_bachelor_master_courses/show_mixed_bachelor_master_courses.rb +92 -0
  682. data/lib/studium/utility_scripts/show_outdated_lva_dates/show_outdated_lva_dates.rb +214 -0
  683. data/lib/studium/utility_scripts/show_passed_exams_having_this_grade/show_passed_exams_having_this_grade.rb +91 -0
  684. data/lib/studium/utility_scripts/show_solved_english_lectures/show_solved_english_lectures.rb +139 -0
  685. data/lib/studium/utility_scripts/steop/README.md +4 -0
  686. data/lib/studium/utility_scripts/steop/show_all_steop_lectures.rb +93 -0
  687. data/lib/studium/utility_scripts/steop/steop_lectures_in_this_curriculum.rb +284 -0
  688. data/lib/studium/utility_scripts/steop/steop_lva_dates.rb +119 -0
  689. data/lib/studium/utility_scripts/studienkennzahl/studienkennzahl.rb +116 -0
  690. data/lib/studium/utility_scripts/studium_skeleton/studium_skeleton.rb +241 -0
  691. data/lib/studium/utility_scripts/stundenplan.rb +600 -0
  692. data/lib/studium/utility_scripts/sync_studium_relevant_entries_one_level_downwards.rb +217 -0
  693. data/lib/studium/utility_scripts/ufind/ufind.rb +106 -0
  694. data/lib/studium/utility_scripts/upcoming_mandatory_presence_courses/constants.rb +26 -0
  695. data/lib/studium/utility_scripts/upcoming_mandatory_presence_courses/run.rb +20 -0
  696. data/lib/studium/utility_scripts/upcoming_mandatory_presence_courses/upcoming_mandatory_presence_courses.rb +187 -0
  697. data/lib/studium/utility_scripts/video_lecture_downloader/video_lecture_downloader.rb +107 -0
  698. data/lib/studium/utility_scripts/week_parser/constants.rb +23 -0
  699. data/lib/studium/utility_scripts/week_parser/help.rb +32 -0
  700. data/lib/studium/utility_scripts/week_parser/menu.rb +59 -0
  701. data/lib/studium/utility_scripts/week_parser/misc.rb +373 -0
  702. data/lib/studium/utility_scripts/week_parser/reset.rb +65 -0
  703. data/lib/studium/utility_scripts/week_parser/run.rb +18 -0
  704. data/lib/studium/utility_scripts/week_parser/show.rb +236 -0
  705. data/lib/studium/utility_scripts/week_parser/week_parser.rb +49 -0
  706. data/lib/studium/utility_scripts/weekday_parser.rb +155 -0
  707. data/lib/studium/utility_scripts/weekly_schedule.rb +198 -0
  708. data/lib/studium/utility_scripts/wochenplanung/wochenplanung.rb +267 -0
  709. data/lib/studium/version/version.rb +46 -0
  710. data/lib/studium/www/exams/exams.cgi +54 -0
  711. data/lib/studium/www/fast_ask_exam_question/fast_ask_exam_question.cgi +156 -0
  712. data/lib/studium/www/handle_curricula/handle_curricula.cgi +154 -0
  713. data/lib/studium/www/next_generation_exam_question_trainer/next_generation_exam_question_trainer.cgi +112 -0
  714. data/lib/studium/www/next_generation_exam_question_trainer/solved.cgi +26 -0
  715. data/lib/studium/www/sinatra/app.rb +231 -0
  716. data/lib/studium/www/sinatra/curriculum_displayer/curriculum_displayer.rb +162 -0
  717. data/lib/studium/www/sinatra/misc.rb +115 -0
  718. data/lib/studium/www/statistics/statistics.cgi +82 -0
  719. data/lib/studium/www/upcoming_exams/upcoming_exams.cgi +36 -0
  720. data/lib/studium/yaml/ad_hoc_trainer/README.md +2 -0
  721. data/lib/studium/yaml/ad_hoc_trainer/exam_topics.md +22 -0
  722. data/lib/studium/yaml/allowed_themes_for_courses/allowed_themes_for_courses.yml +348 -0
  723. data/lib/studium/yaml/array_allowed_entries_for_the_file_lecture_information/array_allowed_entries_for_the_file_lecture_information.yml +71 -0
  724. data/lib/studium/yaml/available_exam_topics/available_exam_topics.yml +234 -0
  725. data/lib/studium/yaml/backlog_of_exams.yml +37 -0
  726. data/lib/studium/yaml/colours/custom_colours.yml +50 -0
  727. data/lib/studium/yaml/colours/use_colours.yml +1 -0
  728. data/lib/studium/yaml/current_exams.yml +30 -0
  729. data/lib/studium/yaml/curricula/README.md +39 -0
  730. data/lib/studium/yaml/curricula/bachelor/bachelor_agrarwissenschaften_033255.yml +147 -0
  731. data/lib/studium/yaml/curricula/bachelor/bachelor_biologie_basisblock_033630.yml +71 -0
  732. data/lib/studium/yaml/curricula/bachelor/bachelor_biologie_botanik_033630.yml +100 -0
  733. data/lib/studium/yaml/curricula/bachelor/bachelor_biologie_ecology_033630.yml +74 -0
  734. data/lib/studium/yaml/curricula/bachelor/bachelor_biologie_mikrobiologie_und_genetik_033630.yml +122 -0
  735. data/lib/studium/yaml/curricula/bachelor/bachelor_biologie_molekulare_biologie_033630.yml +106 -0
  736. data/lib/studium/yaml/curricula/bachelor/bachelor_biologie_zoologie_033630.yml +87 -0
  737. data/lib/studium/yaml/curricula/bachelor/bachelor_chemie_033662.yml +165 -0
  738. data/lib/studium/yaml/curricula/bachelor/bachelor_dummy_curriculum.yml +182 -0
  739. data/lib/studium/yaml/curricula/bachelor/bachelor_elektrotechnik_und_informationstechnik_033235.yml +13 -0
  740. data/lib/studium/yaml/curricula/bachelor/bachelor_forstwirtschaft_033225.yml +115 -0
  741. data/lib/studium/yaml/curricula/bachelor/bachelor_informatik_033521.yml +134 -0
  742. data/lib/studium/yaml/curricula/bachelor/bachelor_ktww_033231.yml +84 -0
  743. data/lib/studium/yaml/curricula/bachelor/bachelor_lmbt_033217.yml +121 -0
  744. data/lib/studium/yaml/curricula/bachelor/bachelor_medizinische_informatik_033533.yml +283 -0
  745. data/lib/studium/yaml/curricula/bachelor/bachelor_molekularbiologie_033665.yml +95 -0
  746. data/lib/studium/yaml/curricula/bachelor/bachelor_nutrition_science_033638.yml +119 -0
  747. data/lib/studium/yaml/curricula/bachelor/bachelor_pharmazie_033305.yml +170 -0
  748. data/lib/studium/yaml/curricula/bachelor/bachelor_technische_chemie_033290.yml +131 -0
  749. data/lib/studium/yaml/curricula/bachelor/bachelor_technische_informatik_033535.yml +23 -0
  750. data/lib/studium/yaml/curricula/bachelor/bachelor_ubrm_033227.yml +142 -0
  751. data/lib/studium/yaml/curricula/bachelor/bachelor_verfahrenstechnik_033273.yml +167 -0
  752. data/lib/studium/yaml/curricula/bachelor/bachelor_wirtschaftsinformatik_033526.yml +29 -0
  753. data/lib/studium/yaml/curricula/experimental/bachelor_informatik_in_den_lebenswissenschaften.yml +137 -0
  754. data/lib/studium/yaml/curricula/individual/bachelor_formale_logik.yml +88 -0
  755. data/lib/studium/yaml/curricula/individual/bachelor_informatik_und_molekulare_biologie.yml +1161 -0
  756. data/lib/studium/yaml/curricula/individual/bachelor_vector_based_strategies_in_life_sciences_molecular_medicine_and_biotechnology.yml +1157 -0
  757. data/lib/studium/yaml/curricula/individual/master_bioinformatics_and_nanobiotechnology_in_molecular_medicine.yml +306 -0
  758. data/lib/studium/yaml/curricula/individual/master_vector_based_strategies_in_life_sciences_molecular_medicine_and_biotechnology.yml +741 -0
  759. data/lib/studium/yaml/curricula/master/master_bioinformatik_066875.yml +75 -0
  760. data/lib/studium/yaml/curricula/master/master_biologie_molekulare_mikrobiologie_mikrobielle_oekologie_und_immunbiologie_066830.yml +78 -0
  761. data/lib/studium/yaml/curricula/master/master_biologische_chemie_066863.yml +66 -0
  762. data/lib/studium/yaml/curricula/master/master_dummy_curriculum.yml +197 -0
  763. data/lib/studium/yaml/curricula/master/master_genetik_und_entwicklungsbiologie_066877.yml +89 -0
  764. data/lib/studium/yaml/curricula/master/master_lmbt_066418.yml +112 -0
  765. data/lib/studium/yaml/curricula/master/master_molecular_biology_066865.yml +72 -0
  766. data/lib/studium/yaml/curricula/master/master_molekulare_biologie_066834.yml +151 -0
  767. data/lib/studium/yaml/curricula/master/master_pharmazie_066605.yml +176 -0
  768. data/lib/studium/yaml/curricula/master/master_technische_chemie_066490.yml +123 -0
  769. data/lib/studium/yaml/curricula/outdated/master_bioinformatics_and_molecular_biotechnology_including_aspects_from_molecular_medicine.yml +438 -0
  770. data/lib/studium/yaml/curricula/outdated/master_food_science_and_plant_biotechnology.yml +31 -0
  771. data/lib/studium/yaml/curricula.yml +562 -0
  772. data/lib/studium/yaml/daily_questions_solved/daily_questions_solved.yml +2019 -0
  773. data/lib/studium/yaml/daily_questions_solved/daily_questions_solved.yml~ +1983 -0
  774. data/lib/studium/yaml/default_delay.yml +4 -0
  775. data/lib/studium/yaml/default_encoding.yml +1 -0
  776. data/lib/studium/yaml/directory_to_the_exam_topics.yml +0 -0
  777. data/lib/studium/yaml/editor.yml +1 -0
  778. data/lib/studium/yaml/exams/next_exams_to_do.md +9 -0
  779. data/lib/studium/yaml/file_for_exam_questions.yml +1 -0
  780. data/lib/studium/yaml/german/README.md +2 -0
  781. data/lib/studium/yaml/german/german_to_english_month_names.yml +16 -0
  782. data/lib/studium/yaml/grouped_themes/grouped_themes.yml +264 -0
  783. data/lib/studium/yaml/holidays/holidays.yml +201 -0
  784. data/lib/studium/yaml/important_exams.yml +286 -0
  785. data/lib/studium/yaml/inscription_dates_of_universities.yml +60 -0
  786. data/lib/studium/yaml/lecture_aliases.yml +138 -0
  787. data/lib/studium/yaml/lecture_information/lecture_information.yml +66145 -0
  788. data/lib/studium/yaml/log_dir.yml +1 -0
  789. data/lib/studium/yaml/main_topic/main_topic.yml +11 -0
  790. data/lib/studium/yaml/max_stats/max_stats.yml +262 -0
  791. data/lib/studium/yaml/max_stats.yml +263 -0
  792. data/lib/studium/yaml/meta_themes +1 -0
  793. data/lib/studium/yaml/mitbelegung/README.md +4 -0
  794. data/lib/studium/yaml/mitbelegung/mitbelegung.yml +21 -0
  795. data/lib/studium/yaml/mitteilungsbl/303/244tter/mitteilungsbl/303/244tter.yml +363 -0
  796. data/lib/studium/yaml/n_total_questions.yml +1 -0
  797. data/lib/studium/yaml/rename_konsole_tab.yml +1 -0
  798. data/lib/studium/yaml/roebe/ad_hoc_exam_topics.md +19 -0
  799. data/lib/studium/yaml/roebe/sommersemester_2024_opportunities.md +441 -0
  800. data/lib/studium/yaml/semester_planner/README.md +4 -0
  801. data/lib/studium/yaml/semester_planner/semester_planner.yml +189 -0
  802. data/lib/studium/yaml/show_topic.yml +1 -0
  803. data/lib/studium/yaml/statistics/lecture_information.yml +1 -0
  804. data/lib/studium/yaml/statistics/max_stats.yml +239 -0
  805. data/lib/studium/yaml/statistics/statistics.yml +77 -0
  806. data/lib/studium/yaml/week/01_monday.yml +25 -0
  807. data/lib/studium/yaml/week/02_tuesday.yml +68 -0
  808. data/lib/studium/yaml/week/03_wednesday.yml +63 -0
  809. data/lib/studium/yaml/week/04_thursday.yml +20 -0
  810. data/lib/studium/yaml/week/05_friday.yml +31 -0
  811. data/lib/studium/yaml/week/06_saturday.yml +16 -0
  812. data/lib/studium/yaml/week/07_sunday.yml +0 -0
  813. data/lib/studium/yaml/week/README.md +10 -0
  814. data/lib/studium.rb +5 -0
  815. data/studium.gemspec +82 -0
  816. data/test/testing_colourized_question_and_answer.rb +18 -0
  817. data/test/testing_studium.rb +244 -0
  818. data/test/testing_studium_base_class.rb +31 -0
  819. data/test/testing_the_file_lecture_information.rb +18 -0
  820. data/test/testing_time_component.rb +29 -0
  821. metadata +1042 -0
@@ -0,0 +1,2442 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Studium::ExamsPerMonth
6
+ #
7
+ # This class will display how many exams I have passed per given month.
8
+ #
9
+ # Usage example:
10
+ #
11
+ # Studium::ExamsPerMonth.new
12
+ #
13
+ # =========================================================================== #
14
+ # require 'studium/exams/exams_per_month/exams_per_month.rb'
15
+ # Studium.exams_per_month(ARGV)
16
+ # =========================================================================== #
17
+ require 'studium/base/base.rb'
18
+
19
+ module Studium
20
+
21
+ class ExamsPerMonth < Base # === Studium::ExamsPerMonth
22
+
23
+ require 'studium/ects/n_ects_points_in_mandatory_presence_courses.rb'
24
+ require 'studium/ects/ects_per_university/ects_per_university.rb'
25
+
26
+ # ======================================================================= #
27
+ # === TITLE
28
+ # ======================================================================= #
29
+ TITLE = 'Exams per Month'
30
+
31
+ # ======================================================================= #
32
+ # === LAST_YEAR
33
+ # ======================================================================= #
34
+ LAST_YEAR = Time.now.year
35
+
36
+ # ========================================================================= #
37
+ # === N_LJUST
38
+ # ========================================================================= #
39
+ N_LJUST = 82
40
+
41
+ # ======================================================================= #
42
+ # === SHOW_N_BEST_MONTHS
43
+ #
44
+ # Determine how many "best months" to show, by default.
45
+ # ======================================================================= #
46
+ SHOW_N_BEST_MONTHS = 30
47
+
48
+ # ======================================================================= #
49
+ # === ARRAY_REGISTERED_MONTHS
50
+ #
51
+ # The months are stored in both the german and the english language.
52
+ # ======================================================================= #
53
+ ARRAY_REGISTERED_MONTHS = %w(
54
+ januar
55
+ februar
56
+ feb
57
+ märz
58
+ april
59
+ mai
60
+ juni
61
+ juli
62
+ august
63
+ september
64
+ oktober
65
+ november
66
+ dezember
67
+
68
+ january
69
+ february
70
+ march
71
+ april
72
+ may
73
+ june
74
+ july
75
+ october
76
+ december
77
+ )
78
+
79
+ # ========================================================================= #
80
+ # === initialize
81
+ # ========================================================================= #
82
+ def initialize(
83
+ commandline_arguments = nil,
84
+ run_already = true
85
+ )
86
+ reset
87
+ case commandline_arguments
88
+ when :dont_run_yet,
89
+ :do_not_run_yet
90
+ run_already = false
91
+ else
92
+ set_input(commandline_arguments)
93
+ end
94
+ # ======================================================================= #
95
+ # === Handle blocks next
96
+ # ======================================================================= #
97
+ if block_given?
98
+ yielded = yield
99
+ case yielded
100
+ # ===================================================================== #
101
+ # === --yearly-average-grades
102
+ # ===================================================================== #
103
+ when /^-?-?yearly(-|_)?average(-|_)?grades$/
104
+ sanitize_dataset
105
+ do_show_yearly_average_grades
106
+ report
107
+ end
108
+ end
109
+ try_to_require_the_open_gem
110
+ run if run_already
111
+ end
112
+
113
+ # ========================================================================= #
114
+ # === report_how_many_exams_were_passed_in_total
115
+ # ========================================================================= #
116
+ def report_how_many_exams_were_passed_in_total(
117
+ i = @n_exams_in_total_passed,
118
+ ljust_n_times = N_LJUST,
119
+ n_rjust = 4
120
+ )
121
+ if ljust_n_times == :default
122
+ ljust_n_times = N_LJUST
123
+ end
124
+ e (
125
+ "#{rev}In total, #{slategray('n exams')} #{rev}have been passed:"
126
+ ).ljust(ljust_n_times+7)+
127
+ sfancy(i.to_s.rjust(n_rjust))
128
+ end
129
+
130
+ # ========================================================================= #
131
+ # === report_how_many_hours_were_passed_in_total
132
+ #
133
+ # This method will report how many hours were passed in total.
134
+ # ========================================================================= #
135
+ def report_how_many_hours_were_passed_in_total(
136
+ i = @n_hours_passed_in_total,
137
+ n_ljust = N_LJUST,
138
+ n_rjust = 6
139
+ )
140
+ if n_ljust == :default
141
+ n_ljust = N_LJUST
142
+ end
143
+ left_side_string = "#{rev}In total, #{slategray('n hours')} "\
144
+ "#{rev}were completed: ".ljust(n_ljust+7)
145
+ # ======================================================================= #
146
+ # Since as of 04.03.2020 the result is rounded, since otherwise the
147
+ # display may include parts such as "00001", which we don't want here.
148
+ # ======================================================================= #
149
+ i = i.round(1) if i.is_a? Float
150
+ e left_side_string+
151
+ sfancy(i.to_s.rjust(n_rjust))
152
+ end
153
+
154
+ # ========================================================================= #
155
+ # === report_how_many_of_these_ects_points_required_mandatory_presence
156
+ #
157
+ # Report how many ECTS points have been passed that required a
158
+ # mandatory presence (aka "prüfungsimmanent" in german).
159
+ # ========================================================================= #
160
+ def report_how_many_of_these_ects_points_required_mandatory_presence(
161
+ n_ects_points_in_mandatory_presence_courses =
162
+ Studium.n_ects_points_in_mandatory_presence_courses,
163
+ n_ljust = N_LJUST
164
+ )
165
+ case n_ljust
166
+ when :default
167
+ n_ljust = N_LJUST
168
+ end
169
+ n_total_ects = @n_ects_points_in_total.to_f
170
+ percentage_value = (
171
+ n_ects_points_in_mandatory_presence_courses.to_f * 100
172
+ ) / n_total_ects
173
+ rounded_percentage_value = percentage_value.round(2)
174
+ e (
175
+ "#{rev}Of these, #{slategray('n ECTS points')} #{rev}are \"prüfungsimmanent\": "
176
+ ).ljust(n_ljust+8)+
177
+ sfancy(
178
+ n_ects_points_in_mandatory_presence_courses.to_s.rjust(5)
179
+ )+
180
+ orange(' ('+rounded_percentage_value.to_s+'%)')
181
+ end
182
+
183
+ # ========================================================================= #
184
+ # === report_how_many_ects_points_have_been_gathered_so_far
185
+ # ========================================================================= #
186
+ def report_how_many_ects_points_have_been_gathered_so_far(
187
+ n_ljust = N_LJUST
188
+ )
189
+ e "#{rev}In total, #{slategray('n ECTS points')} #{rev}have been "\
190
+ "gathered so far: ".ljust(n_ljust+8)+
191
+ "#{sfancy(@n_ects_points_in_total.to_s)}"
192
+ end
193
+
194
+ # ========================================================================= #
195
+ # === report_the_average_grade
196
+ #
197
+ # This method will report the average grade.
198
+ # ========================================================================= #
199
+ def report_the_average_grade(
200
+ n_ljust = N_LJUST,
201
+ n_rjust = 4
202
+ )
203
+ if n_ljust == :default
204
+ n_ljust = N_LJUST
205
+ end
206
+ e "#{rev}The #{slategray('average grade')} #{rev}for these "\
207
+ "exams is: ".ljust(n_ljust+10)+
208
+ sfancy(
209
+ average_grade.to_s.rjust(n_rjust)
210
+ )
211
+ end
212
+
213
+ # ========================================================================= #
214
+ # === colour_for_hours
215
+ #
216
+ # Mediumorchid is the colour for hours.
217
+ # ========================================================================= #
218
+ def colour_for_hours(i)
219
+ return mediumorchid(i) if use_colours? # Delegate into mediumorchid() here in this file.
220
+ return i
221
+ end; alias colourize_hours colour_for_hours # === colourize_hours
222
+
223
+ # ========================================================================= #
224
+ # === colourize_year
225
+ # ========================================================================= #
226
+ def colourize_year(i)
227
+ return swarn(i) if use_colours?
228
+ return i
229
+ end
230
+
231
+ # ========================================================================= #
232
+ # === colourize_month_year
233
+ #
234
+ # This method will colourize strings such as '04.2017'.
235
+ #
236
+ # The current colour used here is 'goldenrod'.
237
+ # ========================================================================= #
238
+ def colourize_month_year(i)
239
+ return goldenrod(i) if use_colours?
240
+ return i
241
+ end
242
+
243
+ # ========================================================================= #
244
+ # === colourize_ects_points
245
+ #
246
+ # No need to check inside this method for konsole support because
247
+ # we already do so before that.
248
+ # ========================================================================= #
249
+ def colourize_ects_points(i)
250
+ return dodgerblue(i) if use_colours?
251
+ return i
252
+ end; alias colourize_ects colourize_ects_points # === colourize_ects
253
+ alias colour_ects colourize_ects_points # === colour_ects
254
+
255
+ # ========================================================================= #
256
+ # === colourize_n_exams
257
+ #
258
+ # Combound method to allow different colours.
259
+ # ========================================================================= #
260
+ def colourize_n_exams(
261
+ i,
262
+ use_this_colour = :lightslategray
263
+ )
264
+ if use_colours?
265
+ case use_this_colour # case tag
266
+ when :lightslategray # This is the default; we will use lightslategray.
267
+ i = lightslategray(i)
268
+ when :oldlace
269
+ i = oldlace(i)
270
+ when :mediumseagreen
271
+ i = mediumseagreen(i)
272
+ when :papayawhip
273
+ i = papayawhip(i)
274
+ end
275
+ end
276
+ return i
277
+ end
278
+
279
+ # ========================================================================= #
280
+ # === obtain_dataset
281
+ #
282
+ # The default value for the first argument derives from
283
+ # Studium.file_passed_exams_per_month, which is represented by
284
+ # the method called main_file?.
285
+ # ========================================================================= #
286
+ def obtain_dataset(
287
+ use_this_file = main_file?
288
+ )
289
+ set_dataset(
290
+ raw_dataset?(use_this_file)
291
+ )
292
+ end
293
+
294
+ # ========================================================================= #
295
+ # === dataset?
296
+ # ========================================================================= #
297
+ def dataset?
298
+ @dataset
299
+ end
300
+
301
+ # ========================================================================= #
302
+ # === use_only_master_lectures
303
+ # ========================================================================= #
304
+ def use_only_master_lectures
305
+ set_dataset(
306
+ dataset?.select {|entry| entry[5].include? 'M' }
307
+ )
308
+ reset_main_hash
309
+ sanitize_dataset(dataset?)
310
+ end
311
+
312
+ # ========================================================================= #
313
+ # === set_dataset
314
+ # ========================================================================= #
315
+ def set_dataset(i)
316
+ @dataset = i
317
+ end
318
+
319
+ # ========================================================================= #
320
+ # === raw_dataset?
321
+ #
322
+ # This method will return an Array. The Array came from the file
323
+ # 'passed_exams_per_month.csv'.
324
+ # ========================================================================= #
325
+ def raw_dataset?(
326
+ use_this_file = main_file?
327
+ )
328
+ readlines_from_this_input_file(use_this_file).reject! {|entry|
329
+ entry.start_with? '#'
330
+ }.map(&:chomp).reject(&:empty?)
331
+ end
332
+
333
+ # ========================================================================= #
334
+ # === draw_image_with_gruff
335
+ #
336
+ # If we wish to draw an image with gruff then we use this method here.
337
+ # ========================================================================= #
338
+ def draw_image_with_gruff
339
+ begin
340
+ require 'gruff'
341
+ rescue LoadError; end
342
+ opne 'Startup of class '+sfancy(self.class.name)+'.'
343
+ @g = Gruff::Line.new(800)
344
+ @g.theme_keynote
345
+ @g.title_font_size = 25
346
+ @g.title = title?
347
+ @g.labels = {
348
+ 1 => '25.10.2005',
349
+ #10 => '13.11.2006',
350
+ 11 => '08.04.2014',
351
+ 20 => Time.now.strftime('%d.%m.%Y')
352
+ }
353
+ @g.data('Amount of exams per month',
354
+ [
355
+ 274,340,851,1114,1168,1195,1230,
356
+ 1245,1270,1315,1352,2524,2621],
357
+ 'slateblue')
358
+ @g.minimum_value = 1
359
+ # Finally, write down the results.
360
+ store_result
361
+ open_result_in_gimp
362
+ end
363
+
364
+ # ========================================================================= #
365
+ # === store_where?
366
+ # ========================================================================= #
367
+ def store_where?
368
+ @store_where
369
+ end
370
+
371
+ # ========================================================================= #
372
+ # === set_store_where
373
+ # ========================================================================= #
374
+ def set_store_where(i)
375
+ @store_where = i
376
+ end
377
+
378
+ # ========================================================================= #
379
+ # === store_result
380
+ # ========================================================================= #
381
+ def store_result
382
+ set_store_where '/SOURCE_FILES.png'
383
+ opne "We will store at `#{sfile(store_where?)}`."
384
+ @g.write(store_where?)
385
+ end
386
+
387
+ # ========================================================================= #
388
+ # === title?
389
+ # ========================================================================= #
390
+ def title?
391
+ TITLE
392
+ end
393
+
394
+ # ========================================================================= #
395
+ # === input?
396
+ # ========================================================================= #
397
+ def input?
398
+ @input
399
+ end
400
+
401
+ # ========================================================================= #
402
+ # === set_last_year
403
+ # ========================================================================= #
404
+ def set_last_year(i = current_year?)
405
+ @last_year = i
406
+ end
407
+
408
+ # ========================================================================= #
409
+ # === last_year?
410
+ # ========================================================================= #
411
+ def last_year?
412
+ @last_year
413
+ end; alias last_year last_year? # === last_year
414
+
415
+ # ========================================================================= #
416
+ # === current_year?
417
+ # ========================================================================= #
418
+ def current_year?
419
+ @current_year
420
+ end; alias current_year current_year? # === current_year
421
+
422
+ # ========================================================================= #
423
+ # === n_exams_passed?
424
+ # ========================================================================= #
425
+ def n_exams_passed?(for_this_year = @current_year)
426
+ @n_exams_passed
427
+ end
428
+
429
+ # ========================================================================= #
430
+ # === set_current_year
431
+ #
432
+ # This must be an Integer.
433
+ # ========================================================================= #
434
+ def set_current_year(
435
+ i = Time.now.strftime('%Y').to_i
436
+ )
437
+ i = i.to_i
438
+ @current_year = i
439
+ end
440
+
441
+ # ========================================================================= #
442
+ # === set_input
443
+ #
444
+ # The input can be an Array such as ["2013", "2015"], in which case we
445
+ # will only output certain numbers matching these criteria.
446
+ # ========================================================================= #
447
+ def set_input(i = nil)
448
+ if i.is_a? Array
449
+ unless i.empty? # We don't care about empty Arrays.
450
+ # ===================================================================== #
451
+ # === Determine whether our given input consists of only numbers.
452
+ # ===================================================================== #
453
+ only_numbers = i.all? {|number|
454
+ number.to_s =~ /^\d+$/ # Only numbers.
455
+ }
456
+ # ===================================================================== #
457
+ # If we compare only some numbers, we will check here.
458
+ # That is the whole point of the above check.
459
+ # ===================================================================== #
460
+ if only_numbers
461
+ @compare_these_numbers = i.map(&:to_i)
462
+ end
463
+ end
464
+ i = i.join(' ').strip
465
+ end
466
+ @input = i
467
+ end
468
+
469
+ # ========================================================================= #
470
+ # === do_show_only_grade_for
471
+ # ========================================================================= #
472
+ def do_show_only_grade_for(
473
+ i = nil
474
+ )
475
+ i = i.to_i if i
476
+ @show_only_grade_for = i
477
+ end
478
+
479
+ # ========================================================================= #
480
+ # === do_show_yearly_average_grades
481
+ # ========================================================================= #
482
+ def do_show_yearly_average_grades
483
+ @show_yearly_average_grades = true
484
+ end
485
+
486
+ # ========================================================================= #
487
+ # === show_ects_points?
488
+ # ========================================================================= #
489
+ def show_ects_points?
490
+ @show_ects_points
491
+ end
492
+
493
+ # ========================================================================= #
494
+ # === do_show_ects_points
495
+ # ========================================================================= #
496
+ def do_show_ects_points
497
+ @show_ects_points = true # If true then we will show the ECTS points as well.
498
+ end
499
+
500
+ # ========================================================================= #
501
+ # === output_the_csv_file
502
+ #
503
+ # We will either use Cat[], if it is available, or just File.read().
504
+ # ========================================================================= #
505
+ def output_the_csv_file
506
+ e File.read(csv_file?)
507
+ end
508
+
509
+ # ========================================================================= #
510
+ # === is_this_sommersemester_or_wintersemester?
511
+ #
512
+ # This method will return SS or WS, as String.
513
+ #
514
+ # The following months are Sommersemester (SS):
515
+ #
516
+ # März, April, Mai, Juni, Juli, August, September (3-9)
517
+ #
518
+ # The following months are Wintersemester (WS):
519
+ #
520
+ # Oktober, November, Dezember, Jänner, Februar (10-2)
521
+ # ========================================================================= #
522
+ def is_this_sommersemester_or_wintersemester?(i)
523
+ return_this_string = '' # Default zero.
524
+ case i.to_i # Need to have an Integer at this point.
525
+ when 3..9
526
+ return_this_string = 'SS'
527
+ when 10,11,12,1,2 # Has to be that way.
528
+ return_this_string = 'WS'
529
+ end
530
+ return return_this_string
531
+ end
532
+
533
+ # ========================================================================= #
534
+ # === output_colourized_year_and_colourized_hours
535
+ # ========================================================================= #
536
+ def output_colourized_year_and_colourized_hours(year)
537
+ unless @compare_these_numbers and !@compare_these_numbers.include?(year)
538
+ e colourize_year(year.to_s) # <- This will usually be red.
539
+ e " "\
540
+ "#{colourize_hours('n hours')}"
541
+ end
542
+ end
543
+
544
+ # ========================================================================= #
545
+ # === report_month_year_hours_ects_n_exams_passed_in_this_month
546
+ # ========================================================================= #
547
+ def report_month_year_hours_ects_n_exams_passed_in_this_month(
548
+ month, year, n_hours, n_ECTS, n_exams_passed_in_this_month
549
+ )
550
+ result = (
551
+ colourize_month_year(month.to_s.rjust(2,'0')+'.'+year.to_s)+
552
+ ':'+(' ' * 13)+ # <- Add n_hours next.
553
+ colourize_hours(n_hours.to_s.rjust(6))+' '
554
+ ).dup
555
+ # ======================================================================= #
556
+ # Conditionally add n_ECTS next.
557
+ # ======================================================================= #
558
+ if show_ects_points?
559
+ result << colourize_ects('('+n_ECTS.to_f.to_s.rjust(4)+' ECTS points)')
560
+ end
561
+ result << colourize_n_exams(' (n exams passed that month: '+
562
+ n_exams_passed_in_this_month.to_s.rjust(2)+')')
563
+ e result
564
+ end
565
+
566
+ # ========================================================================= #
567
+ # === show_help (help tag)
568
+ #
569
+ # To invoke this method, do:
570
+ #
571
+ # emo --help
572
+ #
573
+ # ========================================================================= #
574
+ def show_help
575
+ left_indent = (' ' * 26)+'# ' # For proper paragraph-indenting.
576
+ opne 'Currently these options are supported:'
577
+ e
578
+ e ' input numbers only to compare years, such as: '
579
+ e
580
+ e " #{sfancy('emo 2013 2015')}"
581
+ e
582
+ e ' --disable-colours # Do not use colours'
583
+ e ' --gruff # draw an image with gruff'
584
+ e ' --nl # show a numbered listing of the '\
585
+ 'passed exams, starting from 1 (== most recent exam)'
586
+ e ' --only-bachelor # show only Bachelor exams'
587
+ e ' --open # open the .csv file in the editor'
588
+ e ' --show # show / output the .csv file on '\
589
+ 'the terminal'
590
+ e ' --semesters # show the amount of ECTS points passed '\
591
+ 'per (full) semester'
592
+ e " --übungen # show only practical courses that were "\
593
+ "passed (#{sfancy('--practical')} is an alias to this)"
594
+ e ' --grades # show a distribution of my grades (1,2,3,4)'
595
+ e ' --grade={1,2,3,4,5] # show only grades that qualify for this'
596
+ e ' --yearly-average-grades # show the yearly average grades'
597
+ e ' --year=(dddd) # show only this specific year, such '\
598
+ 'as "year=2016"; year=1996-2013 is also'
599
+ e left_indent+'supported; you can also omit --"year" such as '\
600
+ 'in: emo --2005'
601
+ e ' --master # show only entries registered in '\
602
+ 'a master curriculum'
603
+ e ' --boku # show only exams at this given '\
604
+ 'university; also works with TU, UniWien etc'
605
+ e ' --summary # show only the summary over the '\
606
+ 'exam-dataset'
607
+ e ' --only-master-lectures # show only lectures that are part '\
608
+ 'of a (at the least one) master-curriculum.'
609
+ e ' --show-best-months # This will show the best 10-'+
610
+ SHOW_N_BEST_MONTHS.to_s+' months '\
611
+ 'or so, in regards to'
612
+ e left_indent+'n ECTS points accumulated'
613
+ e ' --years # show only the amount of ECTS '\
614
+ 'passed per year'
615
+ e ' --month # show the month, such as "emo --february"'
616
+ e ' "since 18.01.2013" # show only exams past this '\
617
+ 'specified date (in the mandatory format dd.mm.yyyy)'
618
+ e ' "before 18.01.2013" # show only exams before this '\
619
+ 'specified date (in the mandatory format dd.mm.yyyy)'
620
+ e
621
+ e 'The next options show how many exams were passed already '\
622
+ 'in a given curriculum:'
623
+ e
624
+ e ' emo --agrarwissenschaften'
625
+ e ' emo --lmbt'
626
+ e
627
+ end
628
+
629
+ # ========================================================================= #
630
+ # === menu (menu tag)
631
+ # ========================================================================= #
632
+ def menu(
633
+ i = input?
634
+ )
635
+ case i # case tag
636
+ # ======================================================================= #
637
+ # === emo --open
638
+ # ======================================================================= #
639
+ when /^-?-?OPEN$/i
640
+ open_the_main_files_in_the_editor
641
+ exit
642
+ # ======================================================================= #
643
+ # === emo --universities
644
+ #
645
+ # This entry point can be used to compare the different universities,
646
+ # in regards to solved ECTS.
647
+ # ======================================================================= #
648
+ when /^-?-?universities$/i,
649
+ /^-?-?unis$/i
650
+ show_ects_passed_per_university
651
+ exit
652
+ # ======================================================================= #
653
+ # === emo --boku
654
+ # ======================================================================= #
655
+ when /^-?-?boku$/,'BOKU'
656
+ show_only_exams_at_the_boku
657
+ # ======================================================================= #
658
+ # === emo "since 18.08.2013"
659
+ # ======================================================================= #
660
+ when /^-?-?since (\d{1,4}\.?\d{0,2}\.?\d{0,4})$/, # See: http://rubular.com/r/JMqr7aw3fs
661
+ /^-?-?after (\d{1,4}\.?\d{0,2}\.?\d{0,4})$/ # Or: emo "after 01.10.2018"
662
+ show_only_exams_past_this_date($1.to_s.dup)
663
+ # ======================================================================= #
664
+ # === emo --best-month-stats
665
+ # ======================================================================= #
666
+ when /^-?-?best(_|-)?month(_|-)?stats$/,
667
+ /^-?-?show(_|-)?best(_|-)?months?$/,
668
+ /^-?-?best(_|-)?months?$/
669
+ show_best_months
670
+ exit
671
+ # ======================================================================= #
672
+ # === emo --master
673
+ # ======================================================================= #
674
+ when /^-?-?master$/
675
+ @hash.clear
676
+ use_only_master_lectures
677
+ # ======================================================================= #
678
+ # === emo --years
679
+ # ======================================================================= #
680
+ when /^-?-?years$/,
681
+ /^-?-?table/,
682
+ /^-?-?short$/
683
+ show_the_years_in_a_short_table_overview
684
+ exit
685
+ # ======================================================================= #
686
+ # === emo --summary
687
+ # ======================================================================= #
688
+ when /^-?-?summary$/i
689
+ e; show_only_the_summary; e
690
+ exit
691
+ # ======================================================================= #
692
+ # === emo --half-split
693
+ # ======================================================================= #
694
+ when /--half-split/
695
+ show_half_split_exams_per_year
696
+ exit
697
+ # ======================================================================= #
698
+ # === emo --nl
699
+ # ======================================================================= #
700
+ when /nl/,
701
+ /^-?-?show(_|-)?numbered(_|-)?exams$/, # Simplified. emo --show-numbered-exams
702
+ /^-?-?show(_|-)?passed(_|-)?lectures$/i
703
+ show_numbered_exams
704
+ exit
705
+ # ======================================================================= #
706
+ # === emo --only-bachelor-lectures
707
+ # ======================================================================= #
708
+ when /^-?-?only(_|-)?bachelor$/,
709
+ /^-?-?only(_|-)?bachelor(_|-)?lectures$/,
710
+ /^-?-?only(_|-)?bachelorcurricula$/,
711
+ /^-?-?show(_|-)?only(_|-)?bachelor(_|-)?lectures$/,
712
+ /^-?-?show(_|-)?bachelor(_|-)?lectures$/
713
+ show_only_bachelor_lectures
714
+ exit
715
+ # ======================================================================= #
716
+ # === emo --only-master-lectures
717
+ # ======================================================================= #
718
+ when /^-?-?only(_|-)?master$/,
719
+ /^-?-?only(_|-)?master(_|-)?lectures$/,
720
+ /^-?-?only(_|-)?mastercurricula$/,
721
+ /^-?-?show(_|-)?only(_|-)?master(_|-)?lectures$/,
722
+ /^-?-?show(_|-)?master(_|-)?lectures$/
723
+ show_only_master_lectures
724
+ exit
725
+ # ======================================================================= #
726
+ # === emo --nocol
727
+ # ======================================================================= #
728
+ when /-?-?disable-?colours/,
729
+ /-?-?nocolours/,
730
+ /-?-?dcolours/,
731
+ /-?-?nocol/
732
+ disable_colours
733
+ show_n_exams_passed_per_month
734
+ # ======================================================================= #
735
+ # === emo --yearly-average-grades
736
+ # ======================================================================= #
737
+ when /^-?-?yearly(_|-)?average(_|-)?grades$/,
738
+ /^-?-?yearly(_|-)?grades$/
739
+ do_show_yearly_average_grades
740
+ # ======================================================================= #
741
+ # === emo --grades
742
+ # ======================================================================= #
743
+ when /-?-?grades/
744
+ do_show_the_grades_statistics
745
+ exit
746
+ # ======================================================================= #
747
+ # === emo --grade=4
748
+ # ======================================================================= #
749
+ when /--grade=(\d+)/
750
+ do_show_only_grade_for($1.to_s.dup)
751
+ show_n_exams_passed_per_month
752
+ # ======================================================================= #
753
+ # === emo --TU
754
+ # ======================================================================= #
755
+ when /-?-?TU$/,
756
+ /-?-?tu$/,
757
+ /-?-?tuwien/
758
+ show_only_exams_at_the_tu
759
+ # ======================================================================= #
760
+ # === emo "before 18.08.2013"
761
+ # ======================================================================= #
762
+ when /-?-?before (\d{1,4}\.?\d{0,2}\.?\d{0,4})/, # Sync this with the regex including "since".
763
+ /-?-?until (\d{1,4}\.?\d{0,2}\.?\d{0,4})/
764
+ show_only_exams_before_this_date($1.to_s.dup)
765
+ # ======================================================================= #
766
+ # === emo --year=2016
767
+ # ======================================================================= #
768
+ when /-?-?year=(\d+-?\d*)/,
769
+ /-?-?(\d{4})/,
770
+ /-?-?(\d{4}-?\d*)/ # See: http://rubular.com/r/JzUhbWSzKx
771
+ do_show_only_this_year_here($1.to_s.dup)
772
+ # ======================================================================= #
773
+ # === emo --uniwien
774
+ # ======================================================================= #
775
+ when /-?-?uniwien/,'--uniw',/-?-?wien/,'UNIWIEN','WIEN',
776
+ /-?-?vienna/
777
+ show_only_exams_at_the_uniwien
778
+ # ======================================================================= #
779
+ # === emo --meduni
780
+ # ======================================================================= #
781
+ when /-?-?meduni$/,'--medu','--med','MEDUNI','MED','meduniwien',
782
+ 'meduni'
783
+ show_only_exams_at_the_meduni
784
+ # ======================================================================= #
785
+ # === emo --vetmed
786
+ # ======================================================================= #
787
+ when /-?-?vetmed/,'--vet','VET','VETMED'
788
+ show_only_exams_at_the_vetmed_uni
789
+ # ======================================================================= #
790
+ # === emo --only-bachelor
791
+ # ======================================================================= #
792
+ when /-?-?only-?bachelor/ # Simplified. Should work for now.
793
+ show_only_bachelor_exams
794
+ # ======================================================================= #
795
+ # === emo --individuell_bachelor
796
+ # ======================================================================= #
797
+ when /-?-?(individuell(_|-| )?bachelor)/
798
+ show_how_many_exams_we_have_passed_in_this_curriculum($1.to_s.dup)
799
+ exit
800
+ # ======================================================================= #
801
+ # === emo --übungen
802
+ # ======================================================================= #
803
+ when /-?-?übungen/,
804
+ /--practical/
805
+ show_only_practical_courses_that_were_passed_already
806
+ # ======================================================================= #
807
+ # === emo --semesters
808
+ # ======================================================================= #
809
+ when /-?-?semesters\??/
810
+ show_exam_ects_points_passed_per_semester
811
+ exit
812
+ # ======================================================================= #
813
+ # === emo --reversed-nl
814
+ # ======================================================================= #
815
+ when /-?-?reversed?-?nl/
816
+ show_numbered_exams(:reversed)
817
+ exit
818
+ # ======================================================================= #
819
+ # === emo --master-lmbt
820
+ # ======================================================================= #
821
+ when /-?-?(master-?lmbt)/
822
+ show_how_many_exams_we_have_passed_in_this_curriculum($1.to_s.dup)
823
+ exit
824
+ # ======================================================================= #
825
+ # === emo --lmbt
826
+ # ======================================================================= #
827
+ when /-?-?(lmbt)/,/-?-?(lbt)/
828
+ show_how_many_exams_we_have_passed_in_this_curriculum($1.to_s.dup)
829
+ exit
830
+ # ======================================================================= #
831
+ # === emo --agrarwissenschaften
832
+ # ======================================================================= #
833
+ when /-?-?(agrarwissenschaften)/,/-?-?(AW)/
834
+ show_how_many_exams_we_have_passed_in_this_curriculum($1.to_s.dup)
835
+ exit
836
+ # ======================================================================= #
837
+ # === emo --show
838
+ # ======================================================================= #
839
+ when '--show','--output'
840
+ output_the_csv_file
841
+ exit
842
+ # ======================================================================= #
843
+ # === emo --help
844
+ # ======================================================================= #
845
+ when 'HELP',/^-?-?help$/
846
+ show_help
847
+ exit
848
+ # ======================================================================= #
849
+ # === emo --gruff
850
+ # ======================================================================= #
851
+ when 'gruff','--gruff','image'
852
+ draw_image_with_gruff # We could also create an image with gruff.
853
+ else # Else use the default here. (else tag)
854
+ # ===================================================================== #
855
+ # === emo /Agrarökolog/
856
+ # ===================================================================== #
857
+ if i and i.is_a?(String) and i.start_with?('/') and
858
+ (i.count('/') > 1) # <-- To check for pseudo-regexes here.
859
+ use_this_regexp = Regexp.new(i.delete('/'), Regexp::IGNORECASE)
860
+ Studium.try_to_report_exams_that_match_to_this_regexp(use_this_regexp)
861
+ exit
862
+ # ===================================================================== #
863
+ # === emo --januar
864
+ # ===================================================================== #
865
+ elsif i and ARRAY_REGISTERED_MONTHS.include?(i.delete('-').downcase)
866
+ show_all_exams_from_this_month(i.downcase)
867
+ exit
868
+ else # In the past, we used to report here, but since as of May 2017,
869
+ # we will actually default to the "report" method being called
870
+ # from within run().
871
+ # show_n_exams_passed_per_month
872
+ end
873
+ end
874
+ end; alias check_against_menu menu # === check_against_menu
875
+
876
+ # ========================================================================= #
877
+ # === file_lecture_information?
878
+ #
879
+ # On Roebe, we will use the file in the home system.
880
+ # ========================================================================= #
881
+ def file_lecture_information?(
882
+ _ = Studium.file_lecture_information
883
+ )
884
+ if is_on_roebe?
885
+ # ===================================================================== #
886
+ # On roebe we have to modify this a little bit:
887
+ # ===================================================================== #
888
+ _ = "#{RUBY_STUDIUM_HOME_DIR}yaml/"\
889
+ "lecture_information/#{File.basename(_)}"
890
+ end
891
+ return _
892
+ end
893
+
894
+ # ========================================================================= #
895
+ # === main_file?
896
+ # ========================================================================= #
897
+ def main_file?
898
+ self.class.main_file?
899
+ end
900
+
901
+ # ========================================================================= #
902
+ # === menu_file?
903
+ # ========================================================================= #
904
+ def menu_file?
905
+ self.class.menu_file?
906
+ end
907
+
908
+ # ========================================================================= #
909
+ # === open_the_curricula_assigned_exams_file_in_the_editor
910
+ # ========================================================================= #
911
+ def open_the_curricula_assigned_exams_file_in_the_editor
912
+ _ = Studium::ExamsPerMonth.curricula_assigned_exams_file?
913
+ Open.in_editor(_) if File.exist? _
914
+ end
915
+
916
+ # ========================================================================= #
917
+ # === open_the_main_file_in_the_editor
918
+ # ========================================================================= #
919
+ def open_the_main_file_in_the_editor
920
+ Open.in_editor(main_file?)
921
+ end
922
+
923
+ # ========================================================================= #
924
+ # === open_the_menu_file_in_the_editor
925
+ # ========================================================================= #
926
+ def open_the_menu_file_in_the_editor
927
+ Open.in_editor(menu_file?)
928
+ end
929
+
930
+ # ========================================================================= #
931
+ # === open_the_file_lecture_information_in_the_editor
932
+ # ========================================================================= #
933
+ def open_the_file_lecture_information_in_the_editor(
934
+ i = file_lecture_information?
935
+ )
936
+ Open.in_editor(i)
937
+ end
938
+
939
+ # ========================================================================= #
940
+ # === Studium::ExamsPerMonth.open_main_files_in_the_editor
941
+ #
942
+ # In the past file_theme_of_exams? was part of the Array defined
943
+ # below, but as of 26.03.2019 I decided that this file is no
944
+ # longer useful to me - it will eventually be phased out.
945
+ #
946
+ # Invocation example to use this method from the commandline:
947
+ #
948
+ # studium --open
949
+ #
950
+ # ========================================================================= #
951
+ def self.open_main_files_in_the_editor
952
+ array_open_these_files = [
953
+ main_file?,
954
+ curricula_assigned_exams_file?
955
+ ]
956
+ unless Object.const_defined? :Open
957
+ begin
958
+ require 'open'
959
+ rescue LoadError; end
960
+ end
961
+ array_open_these_files.each {|file|
962
+ Open.in_editor(file)
963
+ }
964
+ end
965
+
966
+ # ========================================================================= #
967
+ # === open_result_in_gimp
968
+ #
969
+ # This method is, quite obviously, for image-files.
970
+ # ========================================================================= #
971
+ def open_result_in_gimp
972
+ esystem "gimp #{store_where?} &"
973
+ end
974
+
975
+ # ========================================================================= #
976
+ # === reset (reset tag)
977
+ # ========================================================================= #
978
+ def reset
979
+ super() # Initialize the instance variables of the parent-class reset() method.
980
+ do_show_ects_points
981
+ infer_the_namespace
982
+ # ======================================================================= #
983
+ # === @shall_we_report
984
+ # ======================================================================= #
985
+ @shall_we_report = true # Whether to output anything or not.
986
+ # ======================================================================= #
987
+ # === @show_only_grade_for
988
+ # ======================================================================= #
989
+ @show_only_grade_for = nil # Set the initial state.
990
+ # ======================================================================= #
991
+ # === @total_grade
992
+ # ======================================================================= #
993
+ @total_grade = 0
994
+ # ======================================================================= #
995
+ # === @n_exams_in_total_passed
996
+ # ======================================================================= #
997
+ @n_exams_in_total_passed = 0
998
+ # ======================================================================= #
999
+ # === @n_ects_points_belonging_to_mandatory_presence_courses
1000
+ #
1001
+ # The next variable keeps track over how many ECTS points belong to
1002
+ # a "prüfungsimmanente" lecture, aka one requiring mandatory presence.
1003
+ # ======================================================================= #
1004
+ @n_ects_points_belonging_to_mandatory_presence_courses = 0
1005
+ # ======================================================================= #
1006
+ # === @total_ects_points
1007
+ # ======================================================================= #
1008
+ @total_ects_points = 0 # The total amount of ECTS points per given month.
1009
+ # ======================================================================= #
1010
+ # === @n_ects_points
1011
+ # ======================================================================= #
1012
+ @n_ects_points = 0 # How many ECTS points this exam has.
1013
+ # ======================================================================= #
1014
+ # === @n_ects_points_in_total
1015
+ # ======================================================================= #
1016
+ @n_ects_points_in_total = 0 # The total amount of ECTS points altogether.
1017
+ # ======================================================================= #
1018
+ # === @n_hours_passed_in_total
1019
+ # ======================================================================= #
1020
+ @n_hours_passed_in_total = 0 # How many hours of exams did we pass.
1021
+ # ======================================================================= #
1022
+ # === @compare_these_numbers
1023
+ # ======================================================================= #
1024
+ @compare_these_numbers = nil
1025
+ # ======================================================================= #
1026
+ # === @show_only_this_year
1027
+ # ======================================================================= #
1028
+ @show_only_this_year = nil
1029
+ enable_colours
1030
+ # ======================================================================= #
1031
+ # === @show_average_ects_passed_per_exam
1032
+ # ======================================================================= #
1033
+ @show_average_ects_passed_per_exam = true
1034
+ # ======================================================================= #
1035
+ # === @show_yearly_average_grades
1036
+ # ======================================================================= #
1037
+ @show_yearly_average_grades = false
1038
+ # ======================================================================= #
1039
+ # === @show_n_best_months
1040
+ # ======================================================================= #
1041
+ @show_n_best_months = SHOW_N_BEST_MONTHS
1042
+ # ======================================================================= #
1043
+ # === @dataset_from_the_file_lecture_information
1044
+ # ======================================================================= #
1045
+ @dataset_from_the_file_lecture_information =
1046
+ return_dataset_from_the_file_lecture_information
1047
+ set_current_year(Time.now.strftime('%Y').to_i)
1048
+ set_last_year
1049
+ reset_main_hash
1050
+ obtain_dataset # This will set the @dataset variable.
1051
+ end
1052
+
1053
+ # ========================================================================= #
1054
+ # === reset_main_hash
1055
+ # ========================================================================= #
1056
+ def reset_main_hash
1057
+ @hash = {}
1058
+ @hash.default = []
1059
+ end
1060
+
1061
+ # ========================================================================= #
1062
+ # === reset_n_hours
1063
+ # ========================================================================= #
1064
+ def reset_n_hours
1065
+ @n_hours_passed_in_total = 0
1066
+ end; alias reset_hours reset_n_hours # === reset_hours
1067
+
1068
+ # ========================================================================= #
1069
+ # === reset_ects_points
1070
+ # ========================================================================= #
1071
+ def reset_ects_points
1072
+ @n_ects_points = 0
1073
+ end; alias reset_ects reset_ects_points # === reset_ects
1074
+
1075
+ # ========================================================================= #
1076
+ # === sanitize_dataset
1077
+ #
1078
+ # Purpose of this method is to give us a sorted hash with the specific
1079
+ # entries. In order for this to work, simply pass in your dataset into
1080
+ # this method. By default, we will use the dataset? object, which
1081
+ # is essentially just the @dataset instance variable.
1082
+ #
1083
+ # The initial dataset should have 6 entries, thus 5 occurrences of '|'.
1084
+ #
1085
+ # Example for such a dataset/line:
1086
+ #
1087
+ # "06.07.2018 | 1.0 | 1.0 | 1 | UniWien | M | VO | 270073 | 2018S | Nukleinsäureanalytik-Genomics"
1088
+ #
1089
+ # ========================================================================= #
1090
+ def sanitize_dataset(
1091
+ i = dataset?,
1092
+ modify_time_entry = true
1093
+ )
1094
+ @n_ects_points_belonging_to_mandatory_presence_courses = 0 # Reset it here.
1095
+ case modify_time_entry
1096
+ # ======================================================================= #
1097
+ # === :leave_time_entry_alone
1098
+ # ======================================================================= #
1099
+ when :leave_time_entry_alone
1100
+ modify_time_entry = false
1101
+ end
1102
+ # ======================================================================= #
1103
+ # Re-assign the @dataset here.
1104
+ # ======================================================================= #
1105
+ @dataset = i.map {|entry|
1106
+ if entry.is_a? Array
1107
+ splitted = entry
1108
+ else
1109
+ # =================================================================== #
1110
+ # Ensure that the encoding is proper here.
1111
+ # =================================================================== #
1112
+ encoding_to_use = ::Studium.encoding?
1113
+ unless entry.encoding.to_s.include? encoding_to_use
1114
+ entry = entry.force_encoding(encoding_to_use)
1115
+ end
1116
+ splitted = entry.split(' | ') # .reverse
1117
+ end
1118
+ if splitted.size <= 2 # Assume this to be an invalid entry.
1119
+ splitted = nil
1120
+ else
1121
+ # =================================================================== #
1122
+ # Modify the time-entry which is the first entry.
1123
+ # We don't need the day, only the specific month. But this is not
1124
+ # always wanted, so we also must honour an option passed into this
1125
+ # method.
1126
+ # =================================================================== #
1127
+ if modify_time_entry
1128
+ formatted_time = splitted[0].split('.')[1..-1].join('.') # This entry is now something such as "10.2001"
1129
+ splitted[0] = formatted_time
1130
+ end
1131
+ # =================================================================== #
1132
+ # === Compare only specific years
1133
+ #
1134
+ # If the user wants to compare only specific years, we enter
1135
+ # the next section.
1136
+ # =================================================================== #
1137
+ if @compare_these_numbers and formatted_time
1138
+ the_year = formatted_time.split('.').last.to_i
1139
+ unless @compare_these_numbers.include? the_year
1140
+ splitted = nil
1141
+ end
1142
+ end
1143
+ end
1144
+ splitted
1145
+ }
1146
+ @dataset.compact! # Weed out nil-values.
1147
+ @n_exams_passed = 0
1148
+ # ======================================================================= #
1149
+ # Next we populate our hash, which is used to report stuff.
1150
+ #
1151
+ # We will store the amount of hours passed, the amount of ECTS points
1152
+ # that were achieved, and count up for the amount of exams that were
1153
+ # passed.
1154
+ # ======================================================================= #
1155
+ @dataset.each {|entry|
1156
+ entry.map!(&:strip)
1157
+ month_and_year = entry[0] # Month and Year is the first entry.
1158
+ n_hours = entry[1].to_f # n hours is the second entry.
1159
+ n_ects_points = entry[2].to_f # n ects points is the third entry.
1160
+ # ===================================================================== #
1161
+ # The grade is a bit problematic. It has to be kept as an Array.
1162
+ # ===================================================================== #
1163
+ grade = entry[3] # The grade, the fourth entry. Can be 1,2,3,4,5 or '+'.
1164
+ university = entry[4].strip.downcase # The university at fifth position.
1165
+ _curriculum_type = entry[5].strip # The curriculum type such as Bachelor or Master. Currently not used here.
1166
+ lecture_type = entry[6].strip # The lecture type such as VO, UE, VU, SE.
1167
+ if is_a_prüfungsimmanent_course?(lecture_type)
1168
+ @n_ects_points_belonging_to_mandatory_presence_courses += n_ects_points
1169
+ end
1170
+ @n_exams_passed += 1
1171
+ # ===================================================================== #
1172
+ # === Put the dataset into the @hash instance variable next
1173
+ # ===================================================================== #
1174
+ if @hash.has_key? month_and_year
1175
+ # =================================================================== #
1176
+ # In this case, add it because we already did initialize it.
1177
+ # =================================================================== #
1178
+ new_n_hours = @hash[month_and_year][0]+n_hours
1179
+ new_n_ects_points = @hash[month_and_year][1]+n_ects_points
1180
+ array_grade = @hash[month_and_year][2] << grade
1181
+ @hash[month_and_year] = [
1182
+ new_n_hours, new_n_ects_points, array_grade, university, @n_exams_passed
1183
+ ]
1184
+ else # Else simply append it, as it is a new month.
1185
+ @n_exams_passed = 0 # And reset it here again.
1186
+ @n_exams_passed += 1 # Must be at least one.
1187
+ @hash[month_and_year] = [
1188
+ n_hours, n_ects_points, [grade], university, @n_exams_passed
1189
+ ]
1190
+ end
1191
+ }
1192
+ end
1193
+
1194
+ # ========================================================================= #
1195
+ # === calculate_the_average_amount_per_passed_exam
1196
+ # ========================================================================= #
1197
+ def calculate_the_average_amount_per_passed_exam
1198
+ ects_per_exams_passed = # This is: total ects / n_exams
1199
+ (
1200
+ @n_ects_points_in_total.to_f / @n_exams_in_total_passed.to_f
1201
+ ).round(2)
1202
+ return ects_per_exams_passed
1203
+ end
1204
+
1205
+ # ========================================================================= #
1206
+ # === show_half_split_exams_per_year
1207
+ #
1208
+ # This method can be used to show how many exams were passed, per
1209
+ # year, in each half of that year.
1210
+ #
1211
+ # Invocation example:
1212
+ #
1213
+ # emo --half-split
1214
+ #
1215
+ # ========================================================================= #
1216
+ def show_half_split_exams_per_year
1217
+ array_early_months = %w( 1 2 3 4 5 6 ).map(&:to_i)
1218
+ array_late_months = %w( 7 8 9 10 11 12 ).map(&:to_i)
1219
+ hash = {}
1220
+ raw_dataset?.each {|this_line|
1221
+ next unless this_line.include? '|'
1222
+ splitted = this_line.strip.split('|').map(&:strip)
1223
+ first_element = splitted.first # e. g. '25.11.1997'
1224
+ n_ects = splitted[2].to_f
1225
+ year = first_element.split('.').last
1226
+ hash[year] = {
1227
+ :early_months => 0,
1228
+ :late_months => 0
1229
+ } unless hash.has_key? year
1230
+ month = first_element.split('.')[1].to_i
1231
+ if array_early_months.include? month
1232
+ hash[year][:early_months] += n_ects
1233
+ elsif array_late_months.include? month
1234
+ hash[year][:late_months] += n_ects
1235
+ end
1236
+ }
1237
+ # ======================================================================= #
1238
+ # Next, we will display that Hash, but only if we have any ECTS
1239
+ # points to report..
1240
+ # ======================================================================= #
1241
+ hash.each_pair {|year, value|
1242
+ n_ljust = 28
1243
+ first_half_ects_points = value[:early_months].to_f
1244
+ second_half_ects_points = value[:late_months].to_f
1245
+ unless ( (first_half_ects_points == 0) and (second_half_ects_points == 0) )
1246
+ e slateblue(year+':')
1247
+ e
1248
+ if first_half_ects_points > 0
1249
+ e (' Start of the year '+year+': ').ljust(n_ljust)+
1250
+ orange(first_half_ects_points.to_s.rjust(4)+' ECTS points')
1251
+ end
1252
+ if second_half_ects_points > 0
1253
+ e (' End of the year '+year+':').ljust(n_ljust)+
1254
+ orange(second_half_ects_points.to_s.rjust(4)+' ECTS points')
1255
+ end
1256
+ e
1257
+ end
1258
+ }
1259
+ end
1260
+
1261
+ # ========================================================================= #
1262
+ # === do_show_only_this_year_here
1263
+ #
1264
+ # Use this method if you only want to show a specific year, such as
1265
+ # 2013 or 2017 and so forth.
1266
+ # ========================================================================= #
1267
+ def do_show_only_this_year_here(i)
1268
+ @show_only_this_year = i # This variable may also contain a '-' character.
1269
+ # ======================================================================= #
1270
+ # Next, select only these entries from the dataset that have
1271
+ # a matching year entry.
1272
+ # ======================================================================= #
1273
+ _ = dataset?.select {|entry| # === emo --year=1997-2009
1274
+ the_year = entry.first.strip.split('.').last.to_s
1275
+ is_it_included = false
1276
+ is_it_included = true if @show_only_this_year == the_year
1277
+ # =================================================================== #
1278
+ # === Range input
1279
+ #
1280
+ # First, handle '-' input given.
1281
+ # =================================================================== #
1282
+ if @show_only_this_year.include? '-'
1283
+ # ================================================================= #
1284
+ # Then we turn it into a range, in order to look whether the
1285
+ # year is within that given Range.
1286
+ # ================================================================= #
1287
+ range = Range.new(*@show_only_this_year.split('-').map(&:to_i))
1288
+ if range.include? the_year.to_i # Since we work with numbers past this point.
1289
+ is_it_included = true
1290
+ end
1291
+ end
1292
+ is_it_included
1293
+ }
1294
+ reset_main_hash # Empty @hash again.
1295
+ sanitize_dataset(_, :leave_time_entry_alone)
1296
+ end
1297
+
1298
+ # ========================================================================= #
1299
+ # === show_only_exams_at_the_vetmed_uni
1300
+ #
1301
+ # Invoke this method like so:
1302
+ # emo --vetmed
1303
+ # ========================================================================= #
1304
+ def show_only_exams_at_the_vetmed_uni
1305
+ opne 'Showing all exams passed at the Vetmed Uni.'
1306
+ _ = dataset?.select {|entry|
1307
+ name_of_university = entry[4]
1308
+ (name_of_university.strip.downcase == 'vetmed')
1309
+ }
1310
+ reset_main_hash
1311
+ sanitize_dataset(_, :leave_time_entry_alone)
1312
+ end
1313
+
1314
+ # ========================================================================= #
1315
+ # === show_numbered_exams
1316
+ #
1317
+ # This method will output the passed exams.
1318
+ #
1319
+ # To output this method, try this:
1320
+ # emo --show-numbered-exams
1321
+ # emo --reversed-nl
1322
+ # ========================================================================= #
1323
+ def show_numbered_exams(normal_or_reversed = :normal)
1324
+ dataset = File.readlines(csv_file?).reject {|entry|
1325
+ entry.start_with? '#'
1326
+ }.reject {|entry|
1327
+ entry.to_s.strip.empty?
1328
+ }
1329
+ size_of_the_dataset = dataset.size
1330
+ e; dataset.each_with_index {|line, index|
1331
+ index += 1
1332
+ if normal_or_reversed == :reversed
1333
+ index = (size_of_the_dataset - index)+1
1334
+ end
1335
+ e ' '+orange(index.to_s.rjust(4))+') '+simp(line.chomp)
1336
+ }; e
1337
+ end
1338
+
1339
+ # ========================================================================= #
1340
+ # === show_only_exams_at_the_uniwien
1341
+ #
1342
+ # Invoke this method like so:
1343
+ #
1344
+ # emo --uniwien
1345
+ #
1346
+ # ========================================================================= #
1347
+ def show_only_exams_at_the_uniwien
1348
+ opne 'Showing all exams passed at the UniWien.'
1349
+ _ = dataset?.select {|entry|
1350
+ name_of_university = entry[4]
1351
+ (name_of_university.strip.downcase == 'uniwien')
1352
+ }
1353
+ reset_main_hash
1354
+ sanitize_dataset(_, :leave_time_entry_alone)
1355
+ end
1356
+
1357
+ # ========================================================================= #
1358
+ # === show_only_exams_at_the_meduni
1359
+ #
1360
+ # Invoke this method like so:
1361
+ # emo --meduni
1362
+ # ========================================================================= #
1363
+ def show_only_exams_at_the_meduni
1364
+ opne 'Showing all exams passed at the MedUni Wien.'
1365
+ _ = dataset?.select {|entry|
1366
+ name_of_university = entry[4]
1367
+ (name_of_university.strip.downcase == 'meduni')
1368
+ }
1369
+ reset_main_hash
1370
+ sanitize_dataset(_, :leave_time_entry_alone)
1371
+ end
1372
+
1373
+ # ========================================================================= #
1374
+ # === show_all_exams_from_this_month
1375
+ #
1376
+ # Use this method to show all exams from a given month only.
1377
+ #
1378
+ # We also support english names for the months, since as of April 2017.
1379
+ #
1380
+ # Usage example:
1381
+ # emo --januar
1382
+ # ========================================================================= #
1383
+ def show_all_exams_from_this_month(i = 'januar')
1384
+ i.delete!('-') if i.include? '-'
1385
+ i.downcase!
1386
+ # ======================================================================= #
1387
+ # Next, sanitize the month.
1388
+ # ======================================================================= #
1389
+ case i # case tag
1390
+ when 'januar','january'
1391
+ i = '01'
1392
+ when 'februar','february',/feb/
1393
+ i = '02'
1394
+ when 'märz','march'
1395
+ i = '03'
1396
+ when 'april'
1397
+ i = '04'
1398
+ when 'mai','may'
1399
+ i = '05'
1400
+ when 'juni','june'
1401
+ i = '06'
1402
+ when 'juli','july'
1403
+ i = '07'
1404
+ when 'august'
1405
+ i = '08'
1406
+ when 'september'
1407
+ i = '09'
1408
+ when 'oktober','october'
1409
+ i = '10'
1410
+ when 'november'
1411
+ i = '11'
1412
+ when 'dezember','december'
1413
+ i = '12'
1414
+ end
1415
+ _ = dataset?.select {|inner_array|
1416
+ month_and_year = inner_array.first
1417
+ splitted = month_and_year.split('.')
1418
+ month = splitted.first
1419
+ month == i
1420
+ }
1421
+ reset_main_hash
1422
+ sanitize_dataset(_, :leave_time_entry_alone)
1423
+ end
1424
+
1425
+ # ========================================================================= #
1426
+ # === show_only_practical_courses_that_were_passed_already
1427
+ #
1428
+ # Use this method if you wish to show only practical courses that
1429
+ # were passed already.
1430
+ #
1431
+ # The currently acknowledged practical courses include UE, PR and LU.
1432
+ #
1433
+ # Invocation example:
1434
+ # emo --übungen
1435
+ # ========================================================================= #
1436
+ def show_only_practical_courses_that_were_passed_already
1437
+ @show_average_ects_passed_per_exam = false # This method won't report average amount of ECTS per exam.
1438
+ _ = dataset?
1439
+ _.select! {|entry|
1440
+ type_of_lecture = entry[6].strip
1441
+ type_of_lecture.include?('UE') or
1442
+ type_of_lecture.include?('PR') or
1443
+ type_of_lecture.include?('LU')
1444
+ }
1445
+ reset_main_hash
1446
+ sanitize_dataset(_, :leave_time_entry_alone)
1447
+ report_main_hash
1448
+ end
1449
+
1450
+ # ========================================================================= #
1451
+ # === show_exam_ects_points_passed_per_semester
1452
+ # ========================================================================= #
1453
+ def show_exam_ects_points_passed_per_semester
1454
+ # ======================================================================= #
1455
+ # First, we need a way to group months into "sommersemester" or
1456
+ # "wintersemester.
1457
+ # ======================================================================= #
1458
+ hash = {}
1459
+ _ = dataset?
1460
+ opne 'We will next show how many exams were passed in a given semester.'
1461
+ # ======================================================================= #
1462
+ # Each entry in the dataset looks like this:
1463
+ # ["10.2001", "3.0"," xxx","4", "UniWien", " D ", " 898249 ","Allgemeine Biologie III"],
1464
+ # SWS ECTS
1465
+ # And it is already sorted.
1466
+ # ======================================================================= #
1467
+ _.each {|inner_array|
1468
+ _n_wochenstunden = inner_array[1]
1469
+ n_ects_points = inner_array[2]
1470
+ _name_of_the_lecture = inner_array.last
1471
+ month_year = inner_array.first
1472
+ year = month_year.dup
1473
+ if month_year.include? '.'
1474
+ splitted = month_year.split('.')
1475
+ month_year = splitted.first
1476
+ year = splitted.last.to_i
1477
+ end
1478
+ sommersemester_or_wintersemester = is_this_sommersemester_or_wintersemester?(
1479
+ month_year
1480
+ )
1481
+ # ======================================================================= #
1482
+ # Note that the Wintersemester may be from the last year, so we
1483
+ # may have to deduct 1. This will be the case only for January
1484
+ # and February though.
1485
+ # ======================================================================= #
1486
+ month_as_number = month_year.split('.').first.to_i
1487
+ if (sommersemester_or_wintersemester == 'WS') and
1488
+ [1,2].include?(month_as_number)
1489
+ year -= 1
1490
+ end
1491
+ # ======================================================================= #
1492
+ # Every time a toggle from SS to WS happens, we populate it into
1493
+ # another Hash. Note that we only care for when the exam was
1494
+ # officially registered and simply count this as a "sommersemester"
1495
+ # or "wintersemester" lecture.
1496
+ # ======================================================================= #
1497
+ hash_key_to_use = sommersemester_or_wintersemester+' '+year.to_s
1498
+ if hash.has_key? hash_key_to_use # Then add to it.
1499
+ hash[hash_key_to_use] = hash[hash_key_to_use]+n_ects_points.to_f
1500
+ else
1501
+ hash[hash_key_to_use] = n_ects_points.to_f
1502
+ end
1503
+ }
1504
+ e 'We have determined these ECTS points per semester:'; e
1505
+ hash.each_pair {|semester_and_year, n_ects_points|
1506
+ e ' '+simp(semester_and_year.ljust(8))+' '+
1507
+ sfancy(((n_ects_points.to_s.rjust(4))+' ECTS').rjust(8))
1508
+ }
1509
+ e; e 'Total ECTS points: '+simp(hash.values.sum.to_s)
1510
+ end
1511
+
1512
+ # ========================================================================= #
1513
+ # === show_only_exams_before_this_date
1514
+ #
1515
+ # The argument to this method should be the starting time, the day at
1516
+ # which you wish to keep track of exams made BEFORE this date.
1517
+ #
1518
+ # To invoke this method, do:
1519
+ # emo "before 10.01.2011"
1520
+ # ========================================================================= #
1521
+ def show_only_exams_before_this_date(this_date)
1522
+ unless this_date.include? '.'
1523
+ this_date.prepend('01.01.') # In this case, we assume this to mean the first January.
1524
+ end
1525
+ opne 'Showing only passed exams before the date '+simp(this_date.to_s)+'.'
1526
+ # ======================================================================= #
1527
+ # Convert a String into a time object.
1528
+ # ======================================================================= #
1529
+ this_date = Time.parse(this_date) if this_date.is_a? String
1530
+ a = this_date # Shorter to type. :)
1531
+ _ = dataset?
1532
+ new_array_with_matches = []
1533
+ _.each {|entry|
1534
+ date = Time.parse('01.'+entry.first.strip) # Must insert date here.
1535
+ b = date
1536
+ if a > b
1537
+ new_array_with_matches << entry
1538
+ end
1539
+ }
1540
+ reset_main_hash
1541
+ sanitize_dataset(new_array_with_matches, :leave_time_entry_alone)
1542
+ end
1543
+
1544
+ # ========================================================================= #
1545
+ # === show_only_bachelor_exams
1546
+ #
1547
+ # Use this method to show only exams relevant for the Bachelor.
1548
+ #
1549
+ # Invocation example:
1550
+ # emo --show-only-bachelor
1551
+ # ========================================================================= #
1552
+ def show_only_bachelor_exams
1553
+ opne 'Showing only Bachelor exams.'
1554
+ _ = dataset?.select {|entry|
1555
+ curriculum_type = entry[5].strip # The sixth entry is the bachelor/master distinction.
1556
+ curriculum_type.include? 'B'
1557
+ }
1558
+ reset_main_hash
1559
+ sanitize_dataset(_, :leave_time_entry_alone)
1560
+ end
1561
+
1562
+ # ========================================================================= #
1563
+ # === show_only_master_lectures
1564
+ #
1565
+ # This method is tasked to show only master lectures. For this purpose,
1566
+ # we define a lecture to be a "master" lecture if it is part of at the
1567
+ # least one master-curriculum. With this definition, a lecture that
1568
+ # is registered in both a bachelor and a master curriculum, will
1569
+ # satisfy this defintion and thus be listed.
1570
+ #
1571
+ # We will take the file passed_exams_per_month.csv for this.
1572
+ #
1573
+ # That file will have entries such as:
1574
+ #
1575
+ # 28.11.2016 | 3.0 | 6.0 | 1 | UniWien | M | 330011 | Zell- und Molekularbiologie
1576
+ #
1577
+ # So we can pick field number 6. If that field has an upcased 'M' then
1578
+ # it qualifies.
1579
+ #
1580
+ # To invoke this method from the commandline, do:
1581
+ # emo --show-only-master-lectures
1582
+ # ========================================================================= #
1583
+ def show_only_master_lectures
1584
+ _ = @dataset.select {|array|
1585
+ bachelor_or_master_curriculum = array[5].strip
1586
+ bachelor_or_master_curriculum.include? 'M'
1587
+ }
1588
+ total_ects_points = 0
1589
+ e
1590
+ _.each_with_index {|lecture_data, index|
1591
+ index += 1
1592
+ n_ects = lecture_data[2]
1593
+ total_ects_points += n_ects.to_f
1594
+ name_of_the_lecture = lecture_data.last
1595
+ leistung_erbracht_am = lecture_data.first
1596
+ which_university = mediumturquoise(lecture_data[4])
1597
+ show_number_then_name_of_the_lecture_then_n_ECTS_points_then_leistung_erbracht_then_which_university(
1598
+ index, name_of_the_lecture, n_ects, leistung_erbracht_am, which_university
1599
+ )
1600
+ }
1601
+ report_total_amount_of_ects_points(total_ects_points, :master)
1602
+ end
1603
+
1604
+ # ========================================================================= #
1605
+ # === show_only_bachelor_lectures
1606
+ #
1607
+ # As the variant for master lectures, just for bachelor lectures.
1608
+ #
1609
+ # To invoke it, do:
1610
+ # emo --show-only-bachelor-lectures
1611
+ # ========================================================================= #
1612
+ def show_only_bachelor_lectures
1613
+ _ = @dataset.select {|array|
1614
+ bachelor_or_master_curriculum = array[5].strip
1615
+ bachelor_or_master_curriculum.include? 'B'
1616
+ }
1617
+ total_ects_points = 0
1618
+ e
1619
+ _.each_with_index {|lecture_data, index|
1620
+ index += 1
1621
+ n_ects = lecture_data[2]
1622
+ total_ects_points += n_ects.to_f
1623
+ name_of_the_lecture = lecture_data.last
1624
+ leistung_erbracht_am = lecture_data.first
1625
+ which_university = mediumturquoise(lecture_data[4])
1626
+ show_number_then_name_of_the_lecture_then_n_ECTS_points_then_leistung_erbracht_then_which_university(
1627
+ index, name_of_the_lecture, n_ects, leistung_erbracht_am, which_university
1628
+ )
1629
+ }
1630
+ report_total_amount_of_ects_points(total_ects_points, :bachelor)
1631
+ end
1632
+
1633
+ # ========================================================================= #
1634
+ # === report_total_amount_of_ects_points
1635
+ # ========================================================================= #
1636
+ def report_total_amount_of_ects_points(
1637
+ total_ects_points,
1638
+ bachelor_or_master = :bachelor,
1639
+ ljust_to_use = 41 # Reason for this value is so that it aligns.
1640
+ )
1641
+ bachelor_or_master = bachelor_or_master.to_s.capitalize # Capitalization is nicer.
1642
+ e
1643
+ e 'Total ECTS points from '+bachelor_or_master+' lectures: '.
1644
+ ljust(ljust_to_use)+
1645
+ slateblue(total_ects_points.to_s+' ECTS')
1646
+ e
1647
+ end
1648
+
1649
+ # ========================================================================= #
1650
+ # === show_number_then_name_of_the_lecture_then_n_ECTS_points_then_leistung_erbracht_then_which_university
1651
+ #
1652
+ # This long compound method is only used from within the following two
1653
+ # methods:
1654
+ #
1655
+ # show_only_bachelor_lectures
1656
+ # show_only_master_lectures
1657
+ #
1658
+ # ========================================================================= #
1659
+ def show_number_then_name_of_the_lecture_then_n_ECTS_points_then_leistung_erbracht_then_which_university(
1660
+ index, name_of_the_lecture, n_ects, leistung_erbracht_am, which_university
1661
+ )
1662
+ e lightgreen((index.to_s+')').rjust(6))+' '+
1663
+ orange(name_of_the_lecture.ljust(74))+' '+
1664
+ slateblue(n_ects.to_s+' ECTS')+crimson(
1665
+ ' '+leistung_erbracht_am.to_s
1666
+ )+' '+which_university
1667
+ end
1668
+
1669
+ # ========================================================================= #
1670
+ # === show_only_exams_past_this_date
1671
+ #
1672
+ # The argument to this method should be the starting time, the day at
1673
+ # which you wish to keep track of exams made afterwards.
1674
+ #
1675
+ # To invoke this method, do:
1676
+ # emo "since 10.02.2014"
1677
+ # ========================================================================= #
1678
+ def show_only_exams_past_this_date(this_date)
1679
+ unless this_date.include? '.'
1680
+ this_date.prepend('01.01.') # In this case, we assume this to mean the first January.
1681
+ end
1682
+ # ======================================================================= #
1683
+ # The variable this_date will be something like "18.08.2013".
1684
+ # ======================================================================= #
1685
+ opne 'Showing only passed exams past the date '+simp(this_date.to_s)+'.'
1686
+ # ======================================================================= #
1687
+ # Convert a String into a time object.
1688
+ # ======================================================================= #
1689
+ this_date = Time.parse(this_date) if this_date.is_a? String
1690
+ a = this_date # Shorter to type. :)
1691
+ _ = dataset?
1692
+ new_array_with_matches = []
1693
+ _.each {|entry|
1694
+ # ======================================================================= #
1695
+ # We simply assume the first day of the given month next.
1696
+ # ======================================================================= #
1697
+ first = '01.'+entry.first.strip
1698
+ date = Time.parse(first) # Must insert date here.
1699
+ b = date
1700
+ if a < b
1701
+ new_array_with_matches << entry # Only add entries that are relevant.
1702
+ end
1703
+ }
1704
+ reset_main_hash # Reset for a clean state again.
1705
+ sanitize_dataset(new_array_with_matches, :leave_time_entry_alone)
1706
+ end
1707
+
1708
+ # ========================================================================= #
1709
+ # === show_only_exams_at_the_tu
1710
+ #
1711
+ # Show only exams at the TU.
1712
+ # ========================================================================= #
1713
+ def show_only_exams_at_the_tu
1714
+ opne 'Showing all exams passed at the TU.'
1715
+ _ = dataset?.select {|entry|
1716
+ name_of_university = entry[4]
1717
+ (name_of_university.strip.downcase.start_with? 'tu')
1718
+ }
1719
+ reset_main_hash
1720
+ sanitize_dataset(_, :leave_time_entry_alone)
1721
+ end
1722
+
1723
+ # ========================================================================= #
1724
+ # === do_show_the_grades_statistics
1725
+ #
1726
+ # Show all grade statistics.
1727
+ #
1728
+ # Invocation example:
1729
+ # emo --grades
1730
+ # ========================================================================= #
1731
+ def do_show_the_grades_statistics
1732
+ _ = dataset?
1733
+ # ======================================================================= #
1734
+ # The dataset will have entries such as:
1735
+ # ["05.1998","2.0"," xxx","4","UniWien"," D "," 854623 ","1998W","Biologische Physik II (Physik für Biologen II)"]
1736
+ # So for our purpose, we are only interested in entry at position
1737
+ # 2, 3 and 4.
1738
+ # ======================================================================= #
1739
+ hash_containing_the_relevant_entries = {}
1740
+ # ======================================================================= #
1741
+ # The following data structures are of interest:
1742
+ # - How many exams were passed for this grade
1743
+ # - The total amount of ECTS points passed
1744
+ # - The total amount of hours passed
1745
+ # ======================================================================= #
1746
+ hash_containing_the_relevant_entries[1] = [0,0,0]
1747
+ hash_containing_the_relevant_entries[2] = [0,0,0]
1748
+ hash_containing_the_relevant_entries[3] = [0,0,0]
1749
+ hash_containing_the_relevant_entries[4] = [0,0,0]
1750
+ # ======================================================================= #
1751
+ # Iterate over the dataset.
1752
+ # ======================================================================= #
1753
+ _.each {|line|
1754
+ this_grade = line[3].to_i
1755
+ if this_grade == 0
1756
+ # pp 'DEBUG'; pp line # For entries that have a '+' evaluation rather.
1757
+ else
1758
+ n_ects_points = line[1].to_f
1759
+ n_hours = line[2].to_f
1760
+ array = hash_containing_the_relevant_entries[this_grade]
1761
+ array[0] += 1
1762
+ array[1] += n_ects_points # For ECTS points.
1763
+ array[2] += n_hours # For Semesterwochenstunden.
1764
+ hash_containing_the_relevant_entries[this_grade] = array
1765
+ end
1766
+ }
1767
+ e
1768
+ e lightgreen('The grades that were passed successfully, are as follows:')
1769
+ e
1770
+ average_grade = 0
1771
+ average_grade_weighted_by_ects_points = 0
1772
+ n_total_exams = hash_containing_the_relevant_entries.values.map {|array|
1773
+ array.first
1774
+ }.sum
1775
+ hash_containing_the_relevant_entries.each_pair {|grade, array_dataset|
1776
+ n_exams_passed = array_dataset.first
1777
+ total_n_ects_points = array_dataset[1]
1778
+ total_n_hours = array_dataset.last
1779
+ n_percent = (n_exams_passed.to_i * 100 / n_total_exams).round(3).to_s
1780
+ e "For the grade #{simp(grade)} #{crimson(n_exams_passed.to_s)} "\
1781
+ "exams were passed successfully. (#{crimson(n_percent.to_s+'%')})"
1782
+ e " n ECTS points: #{mediumorchid(total_n_ects_points.to_s.rjust(5))}"
1783
+ e " n hours: #{mediumpurple(total_n_hours.to_s.rjust(5))}"
1784
+ e
1785
+ }
1786
+ hash = hash_containing_the_relevant_entries
1787
+ average_grade = (1 * hash[1][0]+
1788
+ 2 * hash[2][0]+
1789
+ 3 * hash[3][0]+
1790
+ 4 * hash[4][0])
1791
+ total_n_ects_points = hash[1][1].to_f+
1792
+ hash[2][1].to_f+
1793
+ hash[3][1].to_f+
1794
+ hash[4][1].to_f
1795
+ average_grade_weighted_by_ects_points = (
1796
+ 1 * hash[1][1].to_f+
1797
+ 2 * hash[2][1].to_f+
1798
+ 3 * hash[3][1].to_f+
1799
+ 4 * hash[4][1].to_f
1800
+ )
1801
+ average_grade_weighted_by_ects_points =
1802
+ average_grade_weighted_by_ects_points.to_f / total_n_ects_points.to_f # Gesamtzahl an ECTS
1803
+ average_grade = average_grade.to_f / (
1804
+ hash[1][0]+
1805
+ hash[2][0]+
1806
+ hash[3][0]+
1807
+ hash[4][0]
1808
+ ) # Have to divide it by the amount of exams.
1809
+ average_grade = average_grade.round(2)
1810
+ # ======================================================================= #
1811
+ # Next, show some statistics.
1812
+ # ======================================================================= #
1813
+ e 'This means that the average grade is: '+
1814
+ slateblue(average_grade.to_s)
1815
+ e 'And the average grade, weighted per single (1.0) ECTS point, is: '+
1816
+ lightblue(average_grade_weighted_by_ects_points.round(2).to_s)
1817
+ e
1818
+ end
1819
+
1820
+ # ========================================================================= #
1821
+ # === show_how_many_exams_we_have_passed_in_this_curriculum
1822
+ #
1823
+ # This method will show how many exams we have already passed for
1824
+ # a given curriculum xyz.
1825
+ #
1826
+ # To invoke this, do:
1827
+ #
1828
+ # emo --agrarwissenschaften
1829
+ #
1830
+ # ========================================================================= #
1831
+ def show_how_many_exams_we_have_passed_in_this_curriculum(i)
1832
+ require 'studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb'
1833
+ i = i.to_s.delete('_')
1834
+ _ = ::Studium::ShowLecturesOnTheCommandline.new(
1835
+ i, :do_not_run_yet
1836
+ )
1837
+ _.do_not_report_anything
1838
+ _.iterate_over_the_lectures
1839
+ _.report_how_many_exams_have_been_passed_already
1840
+ end
1841
+
1842
+ # ========================================================================= #
1843
+ # === set_n_exams_in_total_passed
1844
+ # ========================================================================= #
1845
+ def set_n_exams_in_total_passed(i)
1846
+ @n_exams_in_total_passed = i.to_f
1847
+ end
1848
+
1849
+ # ========================================================================= #
1850
+ # === set_n_ects_points_in_total
1851
+ # ========================================================================= #
1852
+ def set_n_ects_points_in_total(i)
1853
+ @n_ects_points_in_total = i.to_f
1854
+ end
1855
+
1856
+ # ========================================================================= #
1857
+ # === determine_n_ects_points_in_total
1858
+ #
1859
+ # The main Hash will look like this:
1860
+ #
1861
+ # {"07.2018"=>[9.0, 14.0, ["+", "4", "1", "1"], "uniwien", 4]
1862
+ #
1863
+ # The relevant ECTS entries are in the value part, at the second
1864
+ # position, so [1].
1865
+ # ========================================================================= #
1866
+ def determine_n_ects_points_in_total
1867
+ n_ects_points = @hash.values.map {|entry| entry[1] }.sum
1868
+ set_n_ects_points_in_total(n_ects_points)
1869
+ end
1870
+
1871
+ # ========================================================================= #
1872
+ # === determine_n_exams_in_total_were_passed
1873
+ # ========================================================================= #
1874
+ def determine_n_exams_in_total_were_passed
1875
+ n_exams = @hash.values.map {|entry| entry.last }.sum
1876
+ set_n_exams_in_total_passed(n_exams)
1877
+ end
1878
+
1879
+ # ========================================================================= #
1880
+ # === show_the_years_in_a_short_table_overview
1881
+ #
1882
+ # To invoke this method, do:
1883
+ # emo --years
1884
+ # ========================================================================= #
1885
+ def show_the_years_in_a_short_table_overview
1886
+ total_ects = 0
1887
+ _ = dataset? # Prepare the dataset a bit.
1888
+ _.map! {|inner_array|
1889
+ n_ects_points = inner_array[2] # Grab the amount of ECTS of this exam.
1890
+ [inner_array[0].split('.').last, n_ects_points]
1891
+ }
1892
+ # ======================================================================= #
1893
+ # Determine the current year automatically.
1894
+ # ======================================================================= #
1895
+ current_year = Date.today.year # 2017
1896
+ total_ects_points_in_that_year = 0
1897
+ e
1898
+ e steelblue('Year')+
1899
+ sfancy(' n ECTS points')
1900
+ show_colourized_line
1901
+ _.each {|year, n_ects_points|
1902
+ year = year.to_i
1903
+ n_ects_points = n_ects_points.to_f
1904
+ total_ects += n_ects_points
1905
+ if current_year == year
1906
+ total_ects_points_in_that_year += n_ects_points
1907
+ else
1908
+ e ' '+
1909
+ steelblue(( (current_year.to_s+': ') ).ljust(15))+
1910
+ sfancy(total_ects_points_in_that_year.to_s.rjust(5)+' ECTS points')
1911
+ total_ects_points_in_that_year = 0
1912
+ current_year = year
1913
+ total_ects_points_in_that_year += n_ects_points
1914
+ end
1915
+ }
1916
+ show_colourized_line
1917
+ e (' ' * 16)+sfancy(total_ects.to_s+' ECTS points')
1918
+ e
1919
+ end
1920
+
1921
+ # ========================================================================= #
1922
+ # === show_colourized_line
1923
+ # ========================================================================= #
1924
+ def show_colourized_line(n_times = 34)
1925
+ e simp('-' * n_times)
1926
+ end
1927
+
1928
+ # ========================================================================= #
1929
+ # === show_best_months
1930
+ #
1931
+ # This method will show the best months, sorted. Best comes first.
1932
+ #
1933
+ # Invocation example:
1934
+ #
1935
+ # emo --show-best-months
1936
+ #
1937
+ # ========================================================================= #
1938
+ def show_best_months(
1939
+ do_show_n_months = @show_n_best_months
1940
+ )
1941
+ opne 'Showing the '+slateblue(do_show_n_months.to_s)+' best '\
1942
+ 'months next, sorted by n ECTS points passed:'
1943
+ e
1944
+ hash_month_statistics = {}
1945
+ _ = @hash.sort_by {|key, inner_array|
1946
+ n_ECTS_points = inner_array[1].to_f
1947
+ n_ECTS_points
1948
+ }.reverse
1949
+ # ======================================================================= #
1950
+ # Next we must determine the sub-array which we will display.
1951
+ # ======================================================================= #
1952
+ array_to_display = []
1953
+ _.each {|month, inner_array|
1954
+ array_to_display << [ month, inner_array[1].to_f ]
1955
+ }
1956
+ # ======================================================================= #
1957
+ # How many months to analyze will be determined next:
1958
+ # ======================================================================= #
1959
+ array_to_display = array_to_display[0..(do_show_n_months - 1)]
1960
+ # ======================================================================= #
1961
+ # Now we have our dataset - array_to_display keeps track of it.
1962
+ # ======================================================================= #
1963
+ exam_number_n = 0 # <- Keep track of which exam is in use.
1964
+ array_to_display.each {|month, n_ECTS_points_passed|
1965
+ # ===================================================================== #
1966
+ # The dataset may look like this:
1967
+ #
1968
+ # [["01.2017", 41.0],
1969
+ # ["06.2015", 35.0],
1970
+ #
1971
+ # ===================================================================== #
1972
+ exam_number_n += 1
1973
+ left_pad = ((exam_number_n.to_s+')').rjust(5)).ljust(6)
1974
+ # ======================================================================= #
1975
+ # Report this to the user:
1976
+ # ======================================================================= #
1977
+ rounded_n_ECTS_points_passed = n_ECTS_points_passed.to_s.to_f.round(1)
1978
+ e yellow(left_pad)+'In the month '+
1979
+ sfancy(month)+', '+
1980
+ violet(rounded_n_ECTS_points_passed.to_s.rjust(4))+
1981
+ ' ECTS points were completed.'
1982
+ # ======================================================================= #
1983
+ # Also add to the hash that keeps track about the month-statistics.
1984
+ # ======================================================================= #
1985
+ this_month = month.split('.').first.to_i # <- Example input: "01.2017"
1986
+ this_month = Studium::MONTH_NUMBER_TO_MONTH_NAME[this_month]
1987
+ hash = {
1988
+ :n_ects => n_ECTS_points_passed,
1989
+ :n_times_mentioned => 1
1990
+ }
1991
+ if hash_month_statistics.has_key? this_month
1992
+ hash_month_statistics[this_month][:n_ects] += n_ECTS_points_passed
1993
+ hash_month_statistics[this_month][:n_times_mentioned] += 1
1994
+ else
1995
+ hash_month_statistics[this_month] = hash
1996
+ end
1997
+ }
1998
+ e
1999
+ # ======================================================================= #
2000
+ # Next, we will also show some month statistics.
2001
+ # ======================================================================= #
2002
+ colourized_n_best_months = orange(do_show_n_months)
2003
+ opne "The best #{colourized_n_best_months} (top) months "\
2004
+ "seem to be the following ones:"
2005
+ e
2006
+ _ = hash_month_statistics
2007
+ # ======================================================================= #
2008
+ # The variable name_of_the_month keeps track of the month at hand,
2009
+ # e. g. "January" or "March".
2010
+ # ======================================================================= #
2011
+ _ = _.sort_by {|name_of_the_month, hash_containing_n_ects_and_n_times_mentioned|
2012
+ n_ects = hash_containing_n_ects_and_n_times_mentioned[:n_ects]
2013
+ n_ects
2014
+ }.reverse
2015
+ counter = 0
2016
+ # ======================================================================= #
2017
+ # Now we have the entry properly sorted. We will display only up to
2018
+ # n times specified as above (e. g. 8 times right now).
2019
+ # ======================================================================= #
2020
+ _.each {|name_of_the_month, hash_containing_n_ects_and_n_times_mentioned|
2021
+ next if counter > 7 # <- Sync it with the above value of 8.
2022
+ n_ects = hash_containing_n_ects_and_n_times_mentioned[:n_ects]
2023
+ n_times_mentioned = hash_containing_n_ects_and_n_times_mentioned[:n_times_mentioned]
2024
+ counter += 1
2025
+ e ' '+
2026
+ sfancy((name_of_the_month+':').ljust(12))+
2027
+ orange(n_times_mentioned.to_s.rjust(2))+ # <- n_times mentioned
2028
+ olivedrab(' (ECTS in total: ')+
2029
+ colourize_ects_points(n_ects.to_s.rjust(5))+
2030
+ olivedrab('; average ECTS in that month: ')+
2031
+ colourize_ects_points(
2032
+ (n_ects.to_f / n_times_mentioned.to_i).round(1).to_s.rjust(4)
2033
+ )+
2034
+ olivedrab(')')
2035
+ }
2036
+ e
2037
+ end
2038
+
2039
+ # ========================================================================= #
2040
+ # === show_total_summary_for_year_hours_ects_n_exams
2041
+ #
2042
+ # This method will show the total summary for a given year.
2043
+ # ========================================================================= #
2044
+ def show_total_summary_for_year_hours_ects_n_exams(
2045
+ last_year,
2046
+ total_n_hours_passed_in_this_year,
2047
+ total_n_ects_passed_in_this_year,
2048
+ total_n_exams_passed_in_this_year,
2049
+ optional_average_grade_per_exam = nil # The average grade per exam in a given year. Optional entr.y
2050
+ )
2051
+ if @show_only_this_year and
2052
+ @show_only_this_year.include?('-') and
2053
+ @show_only_this_year.split('-').last.to_i < last_year
2054
+ # This is the case here when we show a range.
2055
+ elsif @show_only_this_year and
2056
+ (@show_only_this_year != last_year)
2057
+ else
2058
+ e # And a newline too.
2059
+ result = "#{rev}Total Summary in #{sfancy(last_year.to_s)}#{rev}: "+
2060
+ # Add n_hours next.
2061
+ colourize_hours(
2062
+ total_n_hours_passed_in_this_year.to_s.rjust(4)
2063
+ )+' '
2064
+ # ======================================================================= #
2065
+ # Add n_ECTS next.
2066
+ # ======================================================================= #
2067
+ if show_ects_points?
2068
+ result << colourize_ects(
2069
+ total_n_ects_passed_in_this_year.to_f.to_s.rjust(5)+
2070
+ ' ECTS passed'
2071
+ )
2072
+ end
2073
+ # ======================================================================= #
2074
+ # We will use papayawhip here instead.
2075
+ # ======================================================================= #
2076
+ result << colourize_n_exams(' (n exams passed that year: '+
2077
+ total_n_exams_passed_in_this_year.to_s.rjust(3)+')',
2078
+ :mediumseagreen
2079
+ )
2080
+ e result
2081
+ if @show_yearly_average_grades and optional_average_grade_per_exam
2082
+ if block_given?
2083
+ yielded = yield
2084
+ if yielded.is_a? Hash
2085
+ if yielded.has_key? :exclude_n_exams_from_the_grade_list
2086
+ total_n_exams_passed_in_this_year -= yielded[:exclude_n_exams_from_the_grade_list].to_i
2087
+ end
2088
+ end
2089
+ end
2090
+ _ = (
2091
+ optional_average_grade_per_exam.to_f / total_n_exams_passed_in_this_year.to_f
2092
+ ).round(2)
2093
+ _ = _.to_s.ljust(4,'0')
2094
+ padded_result = _.to_s.rjust(50)
2095
+ e "#{rev}The average grade of the exams passed in this year is: "\
2096
+ "#{sfancy(padded_result)}"
2097
+ end
2098
+ end
2099
+ end
2100
+
2101
+ # ========================================================================= #
2102
+ # === show_only_exams_at_the_boku
2103
+ #
2104
+ # Show only exams at the BOKU.
2105
+ # ========================================================================= #
2106
+ def show_only_exams_at_the_boku
2107
+ opne 'Showing all exams passed at the BOKU.'
2108
+ _ = dataset?.select {|entry|
2109
+ name_of_university = entry[4]
2110
+ (name_of_university.strip.downcase == 'boku')
2111
+ }
2112
+ reset_main_hash
2113
+ sanitize_dataset(_, :leave_time_entry_alone)
2114
+ end
2115
+
2116
+ # ========================================================================= #
2117
+ # === show_n_exams_passed_per_month (report tag)
2118
+ #
2119
+ # This is the main report-method for this class.
2120
+ #
2121
+ # Make sure that the input to this method is correct.
2122
+ # ========================================================================= #
2123
+ def show_n_exams_passed_per_month(
2124
+ i = @hash
2125
+ )
2126
+ month = 0
2127
+ year = 0
2128
+ n_hours = 0
2129
+ n_ECTS = 0
2130
+ grade = 0
2131
+ # ======================================================================= #
2132
+ # We must initialize some variables here.
2133
+ # ======================================================================= #
2134
+ n_exams_passed_in_this_month = 0
2135
+ total_n_ects_passed_in_this_year = 0
2136
+ total_n_hours_passed_in_this_year = 0
2137
+ total_n_exams_passed_in_this_year = 0
2138
+ total_grade_count_in_this_year = 0
2139
+ exclude_n_exams_from_the_grade_list = 0
2140
+
2141
+ last_year = LAST_YEAR # Will point to the current year actually.
2142
+ this_year = Time.now.year.to_i
2143
+ # ======================================================================= #
2144
+ # Check whether we shall only show certain grades.
2145
+ # ======================================================================= #
2146
+ if @show_only_grade_for
2147
+ opne "We will only show grades that are equal to "\
2148
+ "#{simp(@show_only_grade_for.to_s)}."
2149
+ end
2150
+ e
2151
+ opne 'We will show how many hours / ECTS we passed per '\
2152
+ 'given month and then year.'
2153
+ e
2154
+ spacer
2155
+ # ======================================================================= #
2156
+ # Header:
2157
+ # ======================================================================= #
2158
+ if @show_only_this_year and
2159
+ @show_only_this_year.include?('-') and
2160
+ @show_only_this_year.split('-').last.to_i < last_year
2161
+ # ===================================================================== #
2162
+ # In this case, do not show the last year.
2163
+ # ===================================================================== #
2164
+ elsif @show_only_this_year and
2165
+ (@show_only_this_year != last_year) and
2166
+ (this_year != last_year)
2167
+ # ===================================================================== #
2168
+ # In this case we will also not show the last year.
2169
+ # ===================================================================== #
2170
+ else # This here is the main clause - most conditions lead to this case.
2171
+ output_colourized_year_and_colourized_hours(last_year)
2172
+ end
2173
+ # ======================================================================= #
2174
+ # We iterate through our hash. Each entry processed through .each
2175
+ # is the dataset for a whole month.
2176
+ #
2177
+ # The entries are:
2178
+ #
2179
+ # - On the left side, the month.year entry.
2180
+ #
2181
+ # - On the right side, an Array with n hours, n ects points,
2182
+ # the grade, n exams passed and the university .
2183
+ # ======================================================================= #
2184
+ i.each {|month_year, n_hours_n_ECTS_grade_university_n_exams_passed|
2185
+ month, year = month_year.split('.').map(&:to_i)
2186
+ # ===================================================================== #
2187
+ # First we deconstruct the information stored in our Array:
2188
+ # n_hours | n_ECTS | grade | university | n_exams_passed
2189
+ # ===================================================================== #
2190
+ n_hours, n_ECTS, grade, _university, n_exams_passed_in_this_month =
2191
+ n_hours_n_ECTS_grade_university_n_exams_passed
2192
+ # ===================================================================== #
2193
+ # Currently, the grade is not output as it is not so important. It
2194
+ # can, however had, be used for showing the average grade per year.
2195
+ # ===================================================================== #
2196
+ # Next, the case will be handled when we only show exams that have a
2197
+ # specific grade.
2198
+ # ===================================================================== #
2199
+ if @show_only_grade_for
2200
+ next unless grade == @show_only_grade_for
2201
+ end
2202
+ # ===================================================================== #
2203
+ # Switch to another year in that event.
2204
+ # ===================================================================== #
2205
+ if year != last_year
2206
+ # =================================================================== #
2207
+ # Show the total summary per given year. The last entry showing the
2208
+ # average grade is optional.
2209
+ # =================================================================== #
2210
+ show_total_summary_for_year_hours_ects_n_exams(
2211
+ last_year, total_n_hours_passed_in_this_year,
2212
+ total_n_ects_passed_in_this_year,
2213
+ total_n_exams_passed_in_this_year,
2214
+ total_grade_count_in_this_year
2215
+ ) {{ exclude_n_exams_from_the_grade_list: exclude_n_exams_from_the_grade_list }}
2216
+ # =================================================================== #
2217
+ # Reset various variables next, in order to prepare for the dataset
2218
+ # from a new year.
2219
+ # =================================================================== #
2220
+ total_n_ects_passed_in_this_year = 0
2221
+ total_n_hours_passed_in_this_year = 0
2222
+ total_n_exams_passed_in_this_year = 0
2223
+ total_grade_count_in_this_year = 0
2224
+ exclude_n_exams_from_the_grade_list = 0
2225
+ # =================================================================== #
2226
+ # Show the spacer after the summary.
2227
+ # =================================================================== #
2228
+ spacer unless @show_only_this_year and (@show_only_this_year != last_year)
2229
+ # =================================================================== #
2230
+ # Red year.
2231
+ # =================================================================== #
2232
+ output_colourized_year_and_colourized_hours(year)
2233
+ # =================================================================== #
2234
+ # New year starts here. We will display end-of-year stuff,
2235
+ # before resetting other counters.
2236
+ # =================================================================== #
2237
+ last_year = year
2238
+ end
2239
+ total_n_hours_passed_in_this_year += n_hours
2240
+ @n_hours_passed_in_total += n_hours
2241
+ total_n_ects_passed_in_this_year += n_ECTS
2242
+ @n_ects_points_in_total += n_ECTS
2243
+ total_n_exams_passed_in_this_year += n_exams_passed_in_this_month
2244
+ @n_exams_in_total_passed += n_exams_passed_in_this_month.to_i
2245
+ # ===================================================================== #
2246
+ # Before we can add to the total grade count in this year, we must
2247
+ # first ensure that the input is not a '+', since this would mean
2248
+ # passing an exam without getting a grade such as 1, 2, 3, 4 or 5.
2249
+ #
2250
+ # Note that grade is an Array.
2251
+ # ===================================================================== #
2252
+ if grade.include? '+'
2253
+ exclude_n_exams_from_the_grade_list += grade.count('+')
2254
+ grade.reject! {|entry| entry == '+' }
2255
+ end
2256
+ # ===================================================================== #
2257
+ # Next, we can push it into the variable total_grade_count_in_this_year
2258
+ # ===================================================================== #
2259
+ add_this_number = grade.map(&:to_i).sum
2260
+ total_grade_count_in_this_year += add_this_number
2261
+ # ===================================================================== #
2262
+ # We can always display the dataset for the given month.
2263
+ # ===================================================================== #
2264
+ report_month_year_hours_ects_n_exams_passed_in_this_month(
2265
+ month, year, n_hours, n_ECTS, n_exams_passed_in_this_month
2266
+ )
2267
+ }
2268
+ # ======================================================================= #
2269
+ # Must display it one more time, for the last year:
2270
+ # ======================================================================= #
2271
+ show_total_summary_for_year_hours_ects_n_exams(
2272
+ last_year,
2273
+ total_n_hours_passed_in_this_year,
2274
+ total_n_ects_passed_in_this_year,
2275
+ total_n_exams_passed_in_this_year,
2276
+ total_grade_count_in_this_year
2277
+ ) {{ exclude_n_exams_from_the_grade_list: exclude_n_exams_from_the_grade_list }}
2278
+ # ======================================================================= #
2279
+ # Last but not least, we also say how many exams we have passed
2280
+ # in total, and how many ECTS points these are.
2281
+ # ======================================================================= #
2282
+ e
2283
+ ljust_it_n_times = :default
2284
+ report_how_many_exams_were_passed_in_total(@n_exams_in_total_passed, ljust_it_n_times)
2285
+ if show_ects_points? # We here will also assume that the user wants to show the amount of hours as well.
2286
+ # ===================================================================== #
2287
+ # Hours, total ects and ects-per-passed-exam:
2288
+ # ===================================================================== #
2289
+ ects_per_exams_passed = # This is: total ects / n_exams
2290
+ (
2291
+ @n_ects_points_in_total.to_f / @n_exams_in_total_passed.to_f
2292
+ ).round(2)
2293
+ report_how_many_hours_were_passed_in_total(
2294
+ @n_hours_passed_in_total, ljust_it_n_times
2295
+ )
2296
+ report_how_many_ects_points_have_been_gathered_so_far
2297
+ report_how_many_of_these_ects_points_required_mandatory_presence(
2298
+ @n_ects_points_belonging_to_mandatory_presence_courses
2299
+ )
2300
+ if @show_average_ects_passed_per_exam
2301
+ report_the_average_amount_of_ects_per_passed_exam(
2302
+ ects_per_exams_passed, ljust_it_n_times
2303
+ )
2304
+ end
2305
+ report_the_average_grade(ljust_it_n_times)
2306
+ end
2307
+ end; alias report_main_hash show_n_exams_passed_per_month # === report_main_hash
2308
+ alias report show_n_exams_passed_per_month # === report
2309
+
2310
+ # ========================================================================= #
2311
+ # === report_the_average_amount_of_ects_per_passed_exam
2312
+ # ========================================================================= #
2313
+ def report_the_average_amount_of_ects_per_passed_exam(
2314
+ ects_per_exams_passed = calculate_the_average_amount_per_passed_exam,
2315
+ ljust_n_times = N_LJUST,
2316
+ rjust_n_times = 12
2317
+ )
2318
+ case ljust_n_times
2319
+ when :default
2320
+ ljust_n_times = N_LJUST
2321
+ end
2322
+ left_padded_side = "#{rev}On average, the "\
2323
+ "#{slategray('ECTS per passed exam')} "\
2324
+ "#{rev}are: ".ljust(ljust_n_times+7)
2325
+ e left_padded_side+
2326
+ sfancy(
2327
+ (ects_per_exams_passed.to_s+' ECTS').rjust(rjust_n_times)
2328
+ )
2329
+ end
2330
+
2331
+ # ========================================================================= #
2332
+ # === show_the_summary
2333
+ #
2334
+ # To use this method from the commandline, do:
2335
+ #
2336
+ # emo --summary
2337
+ #
2338
+ # ========================================================================= #
2339
+ def show_the_summary
2340
+ determine_n_ects_points_in_total
2341
+ determine_n_exams_in_total_were_passed
2342
+ determine_n_hours_were_passed_in_total # <- How many hours were passed in total.
2343
+ # ======================================================================= #
2344
+ # Next report our findings:
2345
+ # ======================================================================= #
2346
+ report_how_many_exams_were_passed_in_total(@n_exams_in_total_passed)
2347
+ report_how_many_hours_were_passed_in_total
2348
+ report_how_many_ects_points_have_been_gathered_so_far
2349
+ if @show_average_ects_passed_per_exam
2350
+ report_the_average_amount_of_ects_per_passed_exam
2351
+ end
2352
+ report_the_average_grade
2353
+ end; alias show_only_the_summary show_the_summary # === show_only_the_summary
2354
+
2355
+ # ========================================================================= #
2356
+ # === determine_n_hours_were_passed_in_total
2357
+ # ========================================================================= #
2358
+ def determine_n_hours_were_passed_in_total
2359
+ i = @hash.values.map {|entry| entry[0].to_f }.sum.to_f
2360
+ @n_hours_passed_in_total = i
2361
+ end
2362
+
2363
+ # ========================================================================= #
2364
+ # === show_ects_passed_per_university
2365
+ # ========================================================================= #
2366
+ def show_ects_passed_per_university
2367
+ Studium::EctsPerUniversity.new { :sort_by_highest_first }
2368
+ end
2369
+
2370
+ # ========================================================================= #
2371
+ # === open_the_main_files_in_the_editor (open tag)
2372
+ #
2373
+ # This method bundles together some other open-related methods. It
2374
+ # should ideally come last in this file here, so that it can be
2375
+ # updated at a later time if my use case has changed.
2376
+ # ========================================================================= #
2377
+ def open_the_main_files_in_the_editor
2378
+ open_the_main_file_in_the_editor
2379
+ open_the_file_lecture_information_in_the_editor
2380
+ # open_the_menu_file_in_the_editor # Not sure if we need this.
2381
+ end
2382
+
2383
+ # ========================================================================= #
2384
+ # === run
2385
+ # ========================================================================= #
2386
+ def run
2387
+ sanitize_dataset
2388
+ check_against_menu
2389
+ report if @shall_we_report
2390
+ end
2391
+
2392
+ # ========================================================================= #
2393
+ # === Studium::ExamsPerMonth.show_passed_master_lectures
2394
+ # ========================================================================= #
2395
+ def self.show_passed_master_lectures
2396
+ Studium::ExamsPerMonth.new('--show_only_master_lectures')
2397
+ end
2398
+
2399
+ # ========================================================================= #
2400
+ # === Studium::ExamsPerMonth.show_passed_bachelor_lectures
2401
+ # ========================================================================= #
2402
+ def self.show_passed_bachelor_lectures
2403
+ Studium::ExamsPerMonth.new('--show_only_bachelor_lectures')
2404
+ end
2405
+
2406
+ # ========================================================================= #
2407
+ # === Studium::ExamsPerMonth.curricula_assigned_exams_file?
2408
+ # ========================================================================= #
2409
+ def self.curricula_assigned_exams_file?
2410
+ FILE_CURRICULA_ASSIGNED_EXAMS
2411
+ end
2412
+
2413
+ # ========================================================================= #
2414
+ # === Studium::ExamsPerMonth.menu_file?
2415
+ # ========================================================================= #
2416
+ def self.menu_file?
2417
+ MENU_FILE
2418
+ end
2419
+
2420
+ # ========================================================================= #
2421
+ # === ExamsPerMonth.main_file?
2422
+ # ========================================================================= #
2423
+ def self.main_file?
2424
+ Studium.file_passed_exams_per_month # This is passed_exams_per_month.csv.
2425
+ end
2426
+
2427
+ end
2428
+
2429
+ # =========================================================================== #
2430
+ # === Studium.exams_per_month
2431
+ #
2432
+ # Easier module-method to instantiate a new ExamsPerMonth object.
2433
+ # =========================================================================== #
2434
+ def self.exams_per_month(i = ARGV, &block)
2435
+ ::Studium::ExamsPerMonth.new(i = ARGV, &block)
2436
+ end; self.instance_eval { alias exams? exams_per_month } # === Studium.exams?
2437
+
2438
+ end
2439
+
2440
+ if __FILE__ == $PROGRAM_NAME
2441
+ Studium::ExamsPerMonth.new(ARGV)
2442
+ end # examspermonth