studium 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of studium might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/README.md +1982 -0
- data/bin/ask_exam_question +7 -0
- data/bin/check_description_of_these_lectures +7 -0
- data/bin/curriculum_module_displayer +7 -0
- data/bin/d10 +7 -0
- data/bin/d100 +7 -0
- data/bin/d15 +7 -0
- data/bin/d20 +7 -0
- data/bin/d25 +7 -0
- data/bin/d3 +7 -0
- data/bin/d30 +7 -0
- data/bin/d5 +7 -0
- data/bin/determine_curricula +7 -0
- data/bin/exam_registration_at +7 -0
- data/bin/exam_statistics +7 -0
- data/bin/exams_per_month +9 -0
- data/bin/finished_exams_at_this_university +7 -0
- data/bin/flashcards +7 -0
- data/bin/mandatory_continuous_assessment +7 -0
- data/bin/mandatory_upcoming_courses +7 -0
- data/bin/n_exam_questions_already_answered +16 -0
- data/bin/nquestions +7 -0
- data/bin/nsolved +7 -0
- data/bin/open_last_exam_question_asked_file +7 -0
- data/bin/passed_pr/303/274fungsimmanente_courses +7 -0
- data/bin/return_n_ects_from_this_file +7 -0
- data/bin/show_lectures_on_the_commandline +7 -0
- data/bin/show_themes +7 -0
- data/bin/solved +9 -0
- data/bin/solved_ects +7 -0
- data/bin/studienkennzahl +7 -0
- data/bin/studium +7 -0
- data/bin/studium_skeleton +7 -0
- data/bin/ufind +7 -0
- data/bin/upcoming_exams +7 -0
- data/bin/week_parser +7 -0
- data/doc/ECTS_CONSIDERATIONS.md +81 -0
- data/doc/HOW_TO_ADAPT_THIS_PROJECT.md +43 -0
- data/doc/HOW_TO_DETERMINE_WHICH_PART_IS_THE_QUESTION_AND_WHICH_PART_IS_THE_ANSWER.md +47 -0
- data/doc/README.gen +1965 -0
- data/doc/TODO_FOR_STUDIUM_GEM.md +113 -0
- data/doc/deprecated_components.md +24 -0
- data/doc/documentation_for_the_file_lecture_information.md +294 -0
- data/doc/elegant_colours.md +20 -0
- data/img/STUDIES.png +0 -0
- data/lib/studium.rb +5 -0
- data/lib/studium/autoinclude.rb +7 -0
- data/lib/studium/base/base.rb +84 -0
- data/lib/studium/base/cliner.rb +58 -0
- data/lib/studium/base/colours.rb +307 -0
- data/lib/studium/base/commandline_arguments.rb +64 -0
- data/lib/studium/base/constants.rb +34 -0
- data/lib/studium/base/curriculum.rb +329 -0
- data/lib/studium/base/directory_to_the_exam_topics.rb +23 -0
- data/lib/studium/base/editor.rb +28 -0
- data/lib/studium/base/encoding.rb +36 -0
- data/lib/studium/base/esystem.rb +23 -0
- data/lib/studium/base/minimal_prototype.rb +66 -0
- data/lib/studium/base/misc.rb +854 -0
- data/lib/studium/base/mode.rb +92 -0
- data/lib/studium/base/obtain.rb +145 -0
- data/lib/studium/base/opnn.rb +46 -0
- data/lib/studium/base/prototype.rb +92 -0
- data/lib/studium/base/readlines.rb +55 -0
- data/lib/studium/base/replace.rb +110 -0
- data/lib/studium/base/reset.rb +77 -0
- data/lib/studium/base/run.rb +17 -0
- data/lib/studium/base/src_dir_at_home.rb +20 -0
- data/lib/studium/base/time.rb +634 -0
- data/lib/studium/base/unicode.rb +95 -0
- data/lib/studium/base/word_wrap.rb +58 -0
- data/lib/studium/boku/README.md +4 -0
- data/lib/studium/boku/boku_biotechnology_all_master_lectures.rb +142 -0
- data/lib/studium/boku/boku_/303/266ffnungszeiten.rb +29 -0
- data/lib/studium/boku/show_three_pillars_of_these_lectures.rb +96 -0
- data/lib/studium/boku/three_pillars.rb +232 -0
- data/lib/studium/check_and_sanitize/README.md +11 -0
- data/lib/studium/check_and_sanitize/check_curriculum_for_correct_separation_of_bachelor_and_master.rb +149 -0
- data/lib/studium/check_and_sanitize/check_for_all_exam_topics_being_registered.rb +107 -0
- data/lib/studium/check_and_sanitize/check_for_existing_description_of_this_lecture.rb +197 -0
- data/lib/studium/check_and_sanitize/check_the_lecture_information_file.rb +171 -0
- data/lib/studium/check_and_sanitize/missing_priority_entry.rb +44 -0
- data/lib/studium/check_and_sanitize/sanitize_this_string_containing_the_lva_dates.rb +79 -0
- data/lib/studium/colours/colours.rb +570 -0
- data/lib/studium/colours/sfancy.rb +40 -0
- data/lib/studium/colours/sfile.rb +35 -0
- data/lib/studium/colours/simp.rb +38 -0
- data/lib/studium/colours/use_this_colour_for_exam_questions_and_exam_answers.rb +76 -0
- data/lib/studium/commandline/commandline.rb +25 -0
- data/lib/studium/commandline/constants.rb +16 -0
- data/lib/studium/commandline/help.rb +152 -0
- data/lib/studium/commandline/initialize.rb +27 -0
- data/lib/studium/commandline/menu.rb +760 -0
- data/lib/studium/commandline/misc.rb +707 -0
- data/lib/studium/commandline/reset.rb +24 -0
- data/lib/studium/commandline/run.rb +20 -0
- data/lib/studium/constants/boku_wien.rb +52 -0
- data/lib/studium/constants/constants.rb +25 -0
- data/lib/studium/constants/delay.rb +28 -0
- data/lib/studium/constants/editor.rb +28 -0
- data/lib/studium/constants/exam_topics.rb +183 -0
- data/lib/studium/constants/file_constants.rb +875 -0
- data/lib/studium/constants/image_constants.rb +216 -0
- data/lib/studium/constants/last_question_asked.rb +38 -0
- data/lib/studium/constants/lecture_types_that_are_mandatory_continuous_assessment.rb +47 -0
- data/lib/studium/constants/misc.rb +163 -0
- data/lib/studium/constants/namespace.rb +14 -0
- data/lib/studium/constants/newline.rb +14 -0
- data/lib/studium/constants/regexes.rb +35 -0
- data/lib/studium/constants/return_file_for_this_curriculum.rb +411 -0
- data/lib/studium/constants/roebe.rb +173 -0
- data/lib/studium/constants/time.rb +52 -0
- data/lib/studium/constants/tu_wien.rb +39 -0
- data/lib/studium/constants/uni_wien.rb +24 -0
- data/lib/studium/constants/unicode.rb +27 -0
- data/lib/studium/constants/week.rb +138 -0
- data/lib/studium/constants/www_constants.rb +23 -0
- data/lib/studium/curricula/curriculum.rb +199 -0
- data/lib/studium/curricula/curriculum_as_string.rb +279 -0
- data/lib/studium/curricula/curriculum_module_displayer/constants.rb +38 -0
- data/lib/studium/curricula/curriculum_module_displayer/curriculum_module_displayer.rb +417 -0
- data/lib/studium/curricula/curriculum_module_displayer/initialize.rb +25 -0
- data/lib/studium/curricula/curriculum_module_displayer/menu.rb +45 -0
- data/lib/studium/curricula/curriculum_module_displayer/reset.rb +77 -0
- data/lib/studium/curricula/curriculum_module_displayer/run.rb +20 -0
- data/lib/studium/curricula/curriculum_module_displayer/set_use_this_curriculum.rb +93 -0
- data/lib/studium/curricula/curriculum_module_displayer/show_and_report.rb +190 -0
- data/lib/studium/curricula/determine_curricula/constants.rb +16 -0
- data/lib/studium/curricula/determine_curricula/determine_curricula.rb +36 -0
- data/lib/studium/curricula/determine_curricula/help.rb +39 -0
- data/lib/studium/curricula/determine_curricula/initialize.rb +48 -0
- data/lib/studium/curricula/determine_curricula/menu.rb +138 -0
- data/lib/studium/curricula/determine_curricula/misc.rb +402 -0
- data/lib/studium/curricula/determine_curricula/report.rb +131 -0
- data/lib/studium/curricula/determine_curricula/reset.rb +62 -0
- data/lib/studium/curricula/determine_curricula/run.rb +19 -0
- data/lib/studium/curricula/determine_elective_courses_in_this_curriculum.rb +112 -0
- data/lib/studium/curricula/display_bachelor_curricula.rb +89 -0
- data/lib/studium/curricula/mitteilungsbl/303/244tter.rb +336 -0
- data/lib/studium/curricula/modules/display_on_the_commandline.rb +316 -0
- data/lib/studium/curricula/modules/return_n_ects_in_this_module.rb +74 -0
- data/lib/studium/curricula/n_percent_solved_in_this_curriculum.rb +75 -0
- data/lib/studium/curricula/random_curriculum_creator.rb +171 -0
- data/lib/studium/curricula/show_lectures_of_this_curriculum.rb +114 -0
- data/lib/studium/curricula/show_lectures_of_this_curriculum_id/constants.rb +16 -0
- data/lib/studium/curricula/show_lectures_of_this_curriculum_id/initialize.rb +27 -0
- data/lib/studium/curricula/show_lectures_of_this_curriculum_id/menu.rb +35 -0
- data/lib/studium/curricula/show_lectures_of_this_curriculum_id/misc.rb +242 -0
- data/lib/studium/curricula/show_lectures_of_this_curriculum_id/report.rb +140 -0
- data/lib/studium/curricula/show_lectures_of_this_curriculum_id/reset.rb +67 -0
- data/lib/studium/curricula/show_lectures_of_this_curriculum_id/show_lectures_of_this_curriculum_id.rb +37 -0
- data/lib/studium/curricula/show_solved_percentage_among_the_registered_curricula.rb +87 -0
- data/lib/studium/ects/boku_ects_splitter.rb +127 -0
- data/lib/studium/ects/ects_parser.rb +179 -0
- data/lib/studium/ects/ects_per_university.rb +140 -0
- data/lib/studium/ects/ects_scanner.rb +141 -0
- data/lib/studium/ects/ects_to_university_parser.rb +148 -0
- data/lib/studium/ects/erledigt.rb +131 -0
- data/lib/studium/ects/last_entry_is_curriculum.rb +147 -0
- data/lib/studium/ects/n_ects_in_these_lectures.rb +185 -0
- data/lib/studium/ects/n_ects_points_in_mandatory_presence_courses.rb +50 -0
- data/lib/studium/ects/noch_zu_absolvieren.rb +172 -0
- data/lib/studium/ects/return_n_ects_from_this_file.rb +58 -0
- data/lib/studium/ects/return_n_ects_from_this_url.rb +202 -0
- data/lib/studium/ects/search_for_n_ects.rb +540 -0
- data/lib/studium/ects/show_completed_ects_in_all_curricula.rb +210 -0
- data/lib/studium/ects/show_passed_credits_per_curriculum.rb +254 -0
- data/lib/studium/ects/simple_total_ects_points.rb +143 -0
- data/lib/studium/ects/solved_ects/constants.rb +24 -0
- data/lib/studium/ects/solved_ects/reset.rb +54 -0
- data/lib/studium/ects/solved_ects/solved_ects.rb +325 -0
- data/lib/studium/ects/solved_ects_per_university/reset.rb +25 -0
- data/lib/studium/ects/solved_ects_per_university/solved_ects_per_university.rb +106 -0
- data/lib/studium/ects/still_missing.rb +133 -0
- data/lib/studium/ects/sum_of_ects.rb +150 -0
- data/lib/studium/encoding/encoding.rb +150 -0
- data/lib/studium/exam_topics/RNAi_siRNA_and_miRNA +79 -0
- data/lib/studium/exam_topics/abfall_als_ressource +86 -0
- data/lib/studium/exam_topics/advanced_biochemistry +762 -0
- data/lib/studium/exam_topics/advanced_biotechnology +192 -0
- data/lib/studium/exam_topics/advanced_cellbiology +25 -0
- data/lib/studium/exam_topics/advanced_chemistry +453 -0
- data/lib/studium/exam_topics/advanced_microbiology +44 -0
- data/lib/studium/exam_topics/advanced_topics_in_plant_sciences +51 -0
- data/lib/studium/exam_topics/advanced_virology +52 -0
- data/lib/studium/exam_topics/ageing +101 -0
- data/lib/studium/exam_topics/agrar_ecology +61 -0
- data/lib/studium/exam_topics/agrarmarkt +70 -0
- data/lib/studium/exam_topics/agrarphysik +35 -0
- data/lib/studium/exam_topics/alcohols +29 -0
- data/lib/studium/exam_topics/algorithms +49 -0
- data/lib/studium/exam_topics/allergie +73 -0
- data/lib/studium/exam_topics/allgemeine_genetik +1006 -0
- data/lib/studium/exam_topics/allgemeine_mikrobiologie +855 -0
- data/lib/studium/exam_topics/aminoacids +417 -0
- data/lib/studium/exam_topics/analytische_chemie_1 +131 -0
- data/lib/studium/exam_topics/analytische_chemie_2 +31 -0
- data/lib/studium/exam_topics/anatomie +248 -0
- data/lib/studium/exam_topics/anorganische_chemie +289 -0
- data/lib/studium/exam_topics/anthropologie +115 -0
- data/lib/studium/exam_topics/antibodies_and_antigens +747 -0
- data/lib/studium/exam_topics/apoptosis +35 -0
- data/lib/studium/exam_topics/archaea +41 -0
- data/lib/studium/exam_topics/architecture +8 -0
- data/lib/studium/exam_topics/artificial_intelligence +81 -0
- data/lib/studium/exam_topics/audio +10 -0
- data/lib/studium/exam_topics/bacteriophages +224 -0
- data/lib/studium/exam_topics/basic_biochemistry +1008 -0
- data/lib/studium/exam_topics/basic_biotechnology +1011 -0
- data/lib/studium/exam_topics/basic_chemistry +1007 -0
- data/lib/studium/exam_topics/basic_virology +955 -0
- data/lib/studium/exam_topics/bauwesen +6 -0
- data/lib/studium/exam_topics/betriebssysteme +125 -0
- data/lib/studium/exam_topics/betriebswirtschaftslehre +29 -0
- data/lib/studium/exam_topics/bioanalytik_und_biosensoren +381 -0
- data/lib/studium/exam_topics/biochips +78 -0
- data/lib/studium/exam_topics/bioelektrochemie +56 -0
- data/lib/studium/exam_topics/biofilms +22 -0
- data/lib/studium/exam_topics/bioinformatics +475 -0
- data/lib/studium/exam_topics/biological_therapeutics +152 -0
- data/lib/studium/exam_topics/biologie +134 -0
- data/lib/studium/exam_topics/biomarkers +106 -0
- data/lib/studium/exam_topics/biomaterials +46 -0
- data/lib/studium/exam_topics/biomembranes +6 -0
- data/lib/studium/exam_topics/bionik +65 -0
- data/lib/studium/exam_topics/biophysik +34 -0
- data/lib/studium/exam_topics/biopolymers +10 -0
- data/lib/studium/exam_topics/bioprozesstechnik +139 -0
- data/lib/studium/exam_topics/bioressourcenmanagement +78 -0
- data/lib/studium/exam_topics/bodenkunde +345 -0
- data/lib/studium/exam_topics/bodenmikrobiologie +40 -0
- data/lib/studium/exam_topics/cancerbiology +441 -0
- data/lib/studium/exam_topics/cell_cultures +154 -0
- data/lib/studium/exam_topics/cellbiology +962 -0
- data/lib/studium/exam_topics/cellular_transport_and_protein_secretion +27 -0
- data/lib/studium/exam_topics/chemische_technologie_anorganischer_stoffe +208 -0
- data/lib/studium/exam_topics/chemisches_labor +59 -0
- data/lib/studium/exam_topics/chemotaxis_and_motility_in_prokaryotes +74 -0
- data/lib/studium/exam_topics/citric_acid_cycle +70 -0
- data/lib/studium/exam_topics/clinical_microbiology +486 -0
- data/lib/studium/exam_topics/computer_graphics +5 -0
- data/lib/studium/exam_topics/computer_science +269 -0
- data/lib/studium/exam_topics/crispr +25 -0
- data/lib/studium/exam_topics/cyanobacteria +37 -0
- data/lib/studium/exam_topics/cytogenetics_and_chromosome_biology +506 -0
- data/lib/studium/exam_topics/databases_and_sql +105 -0
- data/lib/studium/exam_topics/dna_mutation_and_dna_repair +33 -0
- data/lib/studium/exam_topics/dna_replication +53 -0
- data/lib/studium/exam_topics/ecogenetics +27 -0
- data/lib/studium/exam_topics/ecological_agriculture +12 -0
- data/lib/studium/exam_topics/ecology +313 -0
- data/lib/studium/exam_topics/economy +210 -0
- data/lib/studium/exam_topics/elektronenmikroskopie +353 -0
- data/lib/studium/exam_topics/elektrophorese +88 -0
- data/lib/studium/exam_topics/elektrotechnik +8 -0
- data/lib/studium/exam_topics/elisa +54 -0
- data/lib/studium/exam_topics/embryologie_und_entwicklung +541 -0
- data/lib/studium/exam_topics/endospores_and_spores +92 -0
- data/lib/studium/exam_topics/enzymes_and_cofactors +327 -0
- data/lib/studium/exam_topics/epigenetik +177 -0
- data/lib/studium/exam_topics/ethik +125 -0
- data/lib/studium/exam_topics/evolution_and_evolutionary_genetics +323 -0
- data/lib/studium/exam_topics/excel +7 -0
- data/lib/studium/exam_topics/fish +19 -0
- data/lib/studium/exam_topics/fluorescence_microscopy +7 -0
- data/lib/studium/exam_topics/food_microbiology_and_food_biotechnology +17 -0
- data/lib/studium/exam_topics/forensik +11 -0
- data/lib/studium/exam_topics/forstwirtschaft +52 -0
- data/lib/studium/exam_topics/fortgeschrittene_genetik +429 -0
- data/lib/studium/exam_topics/fortgeschrittene_gentechnik +189 -0
- data/lib/studium/exam_topics/fortgeschrittene_physik +6 -0
- data/lib/studium/exam_topics/fungi +78 -0
- data/lib/studium/exam_topics/genetische_krankheiten +150 -0
- data/lib/studium/exam_topics/genexpression +1008 -0
- data/lib/studium/exam_topics/genomics_and_metagenomics +205 -0
- data/lib/studium/exam_topics/gentechnik_und_praktische_biochemie +863 -0
- data/lib/studium/exam_topics/geochemistry +66 -0
- data/lib/studium/exam_topics/geography +5 -0
- data/lib/studium/exam_topics/geologie_und_mineralogie +610 -0
- data/lib/studium/exam_topics/geschichte +94 -0
- data/lib/studium/exam_topics/gluconeogenesis +34 -0
- data/lib/studium/exam_topics/glycolysis +95 -0
- data/lib/studium/exam_topics/glykomik +42 -0
- data/lib/studium/exam_topics/glyoxylatzyklus +23 -0
- data/lib/studium/exam_topics/grassland_cultivation +32 -0
- data/lib/studium/exam_topics/hormone +122 -0
- data/lib/studium/exam_topics/html +7 -0
- data/lib/studium/exam_topics/human_ecology +8 -0
- data/lib/studium/exam_topics/hygiene +191 -0
- data/lib/studium/exam_topics/imaging_and_microscopy +224 -0
- data/lib/studium/exam_topics/immunanalytik +88 -0
- data/lib/studium/exam_topics/immunologie +888 -0
- data/lib/studium/exam_topics/informatik +95 -0
- data/lib/studium/exam_topics/innate_immunity +20 -0
- data/lib/studium/exam_topics/insekten +30 -0
- data/lib/studium/exam_topics/insulin_and_diabetes +55 -0
- data/lib/studium/exam_topics/java +440 -0
- data/lib/studium/exam_topics/javascript +10 -0
- data/lib/studium/exam_topics/klima +6 -0
- data/lib/studium/exam_topics/landtechnik +27 -0
- data/lib/studium/exam_topics/lebensmittel +206 -0
- data/lib/studium/exam_topics/lebensmitteltechnologie +16 -0
- data/lib/studium/exam_topics/linux +5 -0
- data/lib/studium/exam_topics/lipids +95 -0
- data/lib/studium/exam_topics/macroeconomics +39 -0
- data/lib/studium/exam_topics/mathematics +175 -0
- data/lib/studium/exam_topics/medizin_und_biomedizinische_technik +250 -0
- data/lib/studium/exam_topics/medizinische_chemie_und_pharmazie +397 -0
- data/lib/studium/exam_topics/messtechnik_und_regeltechnik +104 -0
- data/lib/studium/exam_topics/metabolismus +433 -0
- data/lib/studium/exam_topics/microbial_ecology +35 -0
- data/lib/studium/exam_topics/mikrobielle_lebensgemeinschaften +34 -0
- data/lib/studium/exam_topics/mikrobielle_physiologie +153 -0
- data/lib/studium/exam_topics/mixed +289 -0
- data/lib/studium/exam_topics/molecular_biology_of_plants +235 -0
- data/lib/studium/exam_topics/molekulare_medizin +129 -0
- data/lib/studium/exam_topics/nanotechnologie +303 -0
- data/lib/studium/exam_topics/nature_conservation_and_biodiversity +165 -0
- data/lib/studium/exam_topics/naturstoffe +9 -0
- data/lib/studium/exam_topics/netzwerke +32 -0
- data/lib/studium/exam_topics/neurobiology +266 -0
- data/lib/studium/exam_topics/nucleotide_sequencing +30 -0
- data/lib/studium/exam_topics/object_oriented_modeling +14 -0
- data/lib/studium/exam_topics/obstbau +234 -0
- data/lib/studium/exam_topics/organische_chemie +1007 -0
- data/lib/studium/exam_topics/organische_chemie_2 +72 -0
- data/lib/studium/exam_topics/paleobiology +33 -0
- data/lib/studium/exam_topics/parasitic_diseases_and_molecular_infection_biology +335 -0
- data/lib/studium/exam_topics/patent_law +55 -0
- data/lib/studium/exam_topics/pathologie +713 -0
- data/lib/studium/exam_topics/pcr +133 -0
- data/lib/studium/exam_topics/peroxisomes_glycosomes_and_lysosomes +54 -0
- data/lib/studium/exam_topics/pflanzenanatomie +240 -0
- data/lib/studium/exam_topics/pflanzenbau +24 -0
- data/lib/studium/exam_topics/pflanzenschutz +35 -0
- data/lib/studium/exam_topics/pflanzenwissenschaften +1009 -0
- data/lib/studium/exam_topics/pharmaceutical_biotechnology +250 -0
- data/lib/studium/exam_topics/physik +338 -0
- data/lib/studium/exam_topics/physikalische_chemie +85 -0
- data/lib/studium/exam_topics/physiology_and_histology +485 -0
- data/lib/studium/exam_topics/phytochemie +33 -0
- data/lib/studium/exam_topics/plant_biotechnology +127 -0
- data/lib/studium/exam_topics/plant_breeding +64 -0
- data/lib/studium/exam_topics/plant_development +50 -0
- data/lib/studium/exam_topics/populationsgenetik +136 -0
- data/lib/studium/exam_topics/posttranslationale_modifikation_von_proteinen +186 -0
- data/lib/studium/exam_topics/projektmanagement +218 -0
- data/lib/studium/exam_topics/prokaryote_genetics +470 -0
- data/lib/studium/exam_topics/proteomik +38 -0
- data/lib/studium/exam_topics/prozesstechnik +95 -0
- data/lib/studium/exam_topics/psychologie +9 -0
- data/lib/studium/exam_topics/python +350 -0
- data/lib/studium/exam_topics/quality_management +241 -0
- data/lib/studium/exam_topics/rechtsgrundlagen +115 -0
- data/lib/studium/exam_topics/research_topics_in_immunobiology +42 -0
- data/lib/studium/exam_topics/rna_and_dna +362 -0
- data/lib/studium/exam_topics/rna_seq +11 -0
- data/lib/studium/exam_topics/ruby +131 -0
- data/lib/studium/exam_topics/ruby_on_rails +62 -0
- data/lib/studium/exam_topics/scientific_writing_and_publishing +38 -0
- data/lib/studium/exam_topics/semisynthese_von_proteinen_und_nukleotiden +120 -0
- data/lib/studium/exam_topics/sexualbiologie +59 -0
- data/lib/studium/exam_topics/signal_transduction_and_laser_systems +136 -0
- data/lib/studium/exam_topics/splicing_exons_and_introns +57 -0
- data/lib/studium/exam_topics/statistik +202 -0
- data/lib/studium/exam_topics/stemcells +87 -0
- data/lib/studium/exam_topics/structural_bioinformatics +54 -0
- data/lib/studium/exam_topics/strukturbiologie +319 -0
- data/lib/studium/exam_topics/system_biology_and_synthetic_biology +87 -0
- data/lib/studium/exam_topics/systematische_zoologie +430 -0
- data/lib/studium/exam_topics/technical_ecology +144 -0
- data/lib/studium/exam_topics/technische_chemie +194 -0
- data/lib/studium/exam_topics/technische_grundlagen_der_informatik +22 -0
- data/lib/studium/exam_topics/technische_mikrobiologie +403 -0
- data/lib/studium/exam_topics/technisches_zeichnen +5 -0
- data/lib/studium/exam_topics/the_bacterial_cell_wall +86 -0
- data/lib/studium/exam_topics/the_c_plus_plus_programming_language +488 -0
- data/lib/studium/exam_topics/the_c_programming_language +128 -0
- data/lib/studium/exam_topics/the_cellcycle +65 -0
- data/lib/studium/exam_topics/the_european_union +119 -0
- data/lib/studium/exam_topics/the_interferon_system +32 -0
- data/lib/studium/exam_topics/the_microbiome +163 -0
- data/lib/studium/exam_topics/the_universe +6 -0
- data/lib/studium/exam_topics/theoretische_chemie +5 -0
- data/lib/studium/exam_topics/theoretische_informatik +157 -0
- data/lib/studium/exam_topics/tierzucht +94 -0
- data/lib/studium/exam_topics/toxikologie +403 -0
- data/lib/studium/exam_topics/transcription +26 -0
- data/lib/studium/exam_topics/translation_ribosomes_and_translational_control +138 -0
- data/lib/studium/exam_topics/umweltbiotechnologie +58 -0
- data/lib/studium/exam_topics/umweltchemie +233 -0
- data/lib/studium/exam_topics/urbanism_and_traffic +19 -0
- data/lib/studium/exam_topics/vaccines_and_vaccination +234 -0
- data/lib/studium/exam_topics/vectors_and_gene_therapy +237 -0
- data/lib/studium/exam_topics/verfahrenstechnik +32 -0
- data/lib/studium/exam_topics/veterinary_medicine +10 -0
- data/lib/studium/exam_topics/vitamine +19 -0
- data/lib/studium/exam_topics/wasserkunde +141 -0
- data/lib/studium/exam_topics/weinbau +59 -0
- data/lib/studium/exam_topics/wissenschaft +17 -0
- data/lib/studium/exam_topics/yeast +97 -0
- data/lib/studium/exam_topics/zoologie +329 -0
- data/lib/studium/exams/afterburn.rb +264 -0
- data/lib/studium/exams/ask_exam_from_the_upcoming_exams_pool.rb +158 -0
- data/lib/studium/exams/ask_exam_question/answer.rb +106 -0
- data/lib/studium/exams/ask_exam_question/ask_exam_question.rb +135 -0
- data/lib/studium/exams/ask_exam_question/constants.rb +74 -0
- data/lib/studium/exams/ask_exam_question/delay.rb +101 -0
- data/lib/studium/exams/ask_exam_question/help.rb +72 -0
- data/lib/studium/exams/ask_exam_question/initialize.rb +70 -0
- data/lib/studium/exams/ask_exam_question/menu.rb +382 -0
- data/lib/studium/exams/ask_exam_question/misc.rb +938 -0
- data/lib/studium/exams/ask_exam_question/question.rb +77 -0
- data/lib/studium/exams/ask_exam_question/reset.rb +103 -0
- data/lib/studium/exams/ask_exam_question/run.rb +49 -0
- data/lib/studium/exams/ask_exam_topic_question.rb +120 -0
- data/lib/studium/exams/ask_question_from_alias.rb +151 -0
- data/lib/studium/exams/ask_question_from_any_of_the_still_missing_lectures.rb +133 -0
- data/lib/studium/exams/ask_question_from_grouped_themes.rb +141 -0
- data/lib/studium/exams/ask_question_from_last_topic.rb +93 -0
- data/lib/studium/exams/ask_random_question.rb +190 -0
- data/lib/studium/exams/autoinclude.rb +7 -0
- data/lib/studium/exams/class.rb +127 -0
- data/lib/studium/exams/csv/create_csv_passed_exams_file.rb +225 -0
- data/lib/studium/exams/cycle.rb +283 -0
- data/lib/studium/exams/dataset.rb +90 -0
- data/lib/studium/exams/exam_registration_at/constants.rb +49 -0
- data/lib/studium/exams/exam_registration_at/exam_registration_at.rb +254 -0
- data/lib/studium/exams/exam_registration_at/help.rb +46 -0
- data/lib/studium/exams/exam_registration_at/menu.rb +81 -0
- data/lib/studium/exams/exam_registration_at/report.rb +108 -0
- data/lib/studium/exams/exam_registration_at/reset.rb +49 -0
- data/lib/studium/exams/exam_statistics_from_this_file/exam_statistics_from_this_file.rb +127 -0
- data/lib/studium/exams/exam_topics.rb +202 -0
- data/lib/studium/exams/exams.rb +18 -0
- data/lib/studium/exams/exams_per_month/colours.rb +81 -0
- data/lib/studium/exams/exams_per_month/constants.rb +69 -0
- data/lib/studium/exams/exams_per_month/dataset.rb +64 -0
- data/lib/studium/exams/exams_per_month/exams_per_month.rb +291 -0
- data/lib/studium/exams/exams_per_month/help.rb +72 -0
- data/lib/studium/exams/exams_per_month/initialize.rb +39 -0
- data/lib/studium/exams/exams_per_month/menu.rb +258 -0
- data/lib/studium/exams/exams_per_month/open.rb +139 -0
- data/lib/studium/exams/exams_per_month/requires.rb +8 -0
- data/lib/studium/exams/exams_per_month/reset.rb +115 -0
- data/lib/studium/exams/exams_per_month/run.rb +18 -0
- data/lib/studium/exams/exams_per_month/sanitize.rb +129 -0
- data/lib/studium/exams/exams_per_month/show_and_report.rb +1281 -0
- data/lib/studium/exams/exams_this_week.rb +179 -0
- data/lib/studium/exams/fix_exam_dates.rb +129 -0
- data/lib/studium/exams/last_exams/last_exams.rb +381 -0
- data/lib/studium/exams/lectures_without_exam_entry.rb +145 -0
- data/lib/studium/exams/mandatory_continuous_assessment/compare.rb +144 -0
- data/lib/studium/exams/mandatory_continuous_assessment/constants.rb +18 -0
- data/lib/studium/exams/mandatory_continuous_assessment/help.rb +92 -0
- data/lib/studium/exams/mandatory_continuous_assessment/initialize.rb +46 -0
- data/lib/studium/exams/mandatory_continuous_assessment/mandatory_continuous_assessment.rb +1115 -0
- data/lib/studium/exams/mandatory_continuous_assessment/menu.rb +114 -0
- data/lib/studium/exams/mandatory_continuous_assessment/misc.rb +61 -0
- data/lib/studium/exams/mandatory_continuous_assessment/reset.rb +85 -0
- data/lib/studium/exams/mandatory_continuous_assessment/run.rb +33 -0
- data/lib/studium/exams/mandatory_continuous_assessment/set_title_of_the_curriculum.rb +181 -0
- data/lib/studium/exams/mandatory_continuous_assessment/show_and_report.rb +147 -0
- 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 +119 -0
- data/lib/studium/exams/n_exams_in_these_topics.rb +408 -0
- data/lib/studium/exams/new_questions_per_year.rb +153 -0
- data/lib/studium/exams/next_exam.rb +111 -0
- data/lib/studium/exams/next_exams.rb +385 -0
- data/lib/studium/exams/open_exam_associated_url.rb +158 -0
- data/lib/studium/exams/open_last_exam_question_asked_file/constants.rb +20 -0
- data/lib/studium/exams/open_last_exam_question_asked_file/initialize.rb +29 -0
- data/lib/studium/exams/open_last_exam_question_asked_file/open_last_exam_question_asked_file.rb +112 -0
- data/lib/studium/exams/passed_exams/passed_exams.rb +46 -0
- data/lib/studium/exams/pruefung.rb +288 -0
- data/lib/studium/exams/push_solved_questions_on_top.rb +188 -0
- data/lib/studium/exams/question_answer/question_answer.rb +842 -0
- data/lib/studium/exams/questions_solved_from_day_to_day.rb +353 -0
- data/lib/studium/exams/repeat_last_question.rb +78 -0
- data/lib/studium/exams/show_all_passed_exams_of_this_university.rb +260 -0
- data/lib/studium/exams/show_backlog_of_exams.rb +125 -0
- data/lib/studium/exams/show_next_exams_for.rb +141 -0
- data/lib/studium/exams/show_themes/constants.rb +33 -0
- data/lib/studium/exams/show_themes/menu.rb +61 -0
- data/lib/studium/exams/show_themes/misc.rb +536 -0
- data/lib/studium/exams/show_themes/reset.rb +64 -0
- data/lib/studium/exams/show_themes/show_themes.rb +27 -0
- data/lib/studium/exams/show_upcoming_exams/consider_autogenerating_exam_aliases.rb +170 -0
- data/lib/studium/exams/show_upcoming_exams/constants.rb +82 -0
- data/lib/studium/exams/show_upcoming_exams/help.rb +33 -0
- data/lib/studium/exams/show_upcoming_exams/initialize.rb +71 -0
- data/lib/studium/exams/show_upcoming_exams/menu.rb +53 -0
- data/lib/studium/exams/show_upcoming_exams/report.rb +195 -0
- data/lib/studium/exams/show_upcoming_exams/reset.rb +38 -0
- data/lib/studium/exams/show_upcoming_exams/run.rb +20 -0
- data/lib/studium/exams/show_upcoming_exams/show_upcoming_exams.rb +494 -0
- data/lib/studium/exams/solve_all_questions_from_this_topic.rb +122 -0
- data/lib/studium/exams/solved/constants.rb +37 -0
- data/lib/studium/exams/solved/help.rb +23 -0
- data/lib/studium/exams/solved/menu.rb +35 -0
- data/lib/studium/exams/solved/reset.rb +30 -0
- data/lib/studium/exams/solved/solved.rb +306 -0
- data/lib/studium/exams/steop.rb +99 -0
- data/lib/studium/exams/unsolve_all_questions_from_this_topic.rb +170 -0
- data/lib/studium/exams/upcoming_exams/constants.rb +20 -0
- data/lib/studium/exams/upcoming_exams/help.rb +38 -0
- data/lib/studium/exams/upcoming_exams/initialize.rb +27 -0
- data/lib/studium/exams/upcoming_exams/menu.rb +79 -0
- data/lib/studium/exams/upcoming_exams/misc.rb +360 -0
- data/lib/studium/exams/upcoming_exams/reset.rb +37 -0
- data/lib/studium/exams/upcoming_exams/run.rb +25 -0
- data/lib/studium/exams/upcoming_exams/upcoming_exams.rb +32 -0
- data/lib/studium/exams/upcoming_exams_at_the_boku/constants.rb +23 -0
- data/lib/studium/exams/upcoming_exams_at_the_boku/html.rb +64 -0
- data/lib/studium/exams/upcoming_exams_at_the_boku/upcoming_exams_at_the_boku.rb +194 -0
- data/lib/studium/exams/upcoming_exams_dataset.rb +251 -0
- data/lib/studium/exams/upload_exam_topics.rb +357 -0
- data/lib/studium/flashcards/flashcards.rb +95 -0
- data/lib/studium/graphviz/README.md +4 -0
- data/lib/studium/graphviz/bachelor_vector_based_strategies.dot +160 -0
- data/lib/studium/graphviz/master_vector_based_strategies.dot +46 -0
- data/lib/studium/gui/gtk2/constants.rb +52 -0
- data/lib/studium/gui/gtk2/exam_card.rb +199 -0
- data/lib/studium/gui/gtk2/flip_card.rb +8 -0
- data/lib/studium/gui/gtk2/frame.rb +319 -0
- data/lib/studium/gui/gtk2/main_box.rb +188 -0
- data/lib/studium/gui/gtk2/misc.rb +99 -0
- data/lib/studium/gui/gtk2/module_methods.rb +58 -0
- data/lib/studium/gui/gtk2/require_gtk_files.rb +25 -0
- data/lib/studium/gui/gtk2/run.rb +47 -0
- data/lib/studium/gui/gtk2/show_curriculum_entries.rb +186 -0
- data/lib/studium/gui/gtk2/simple_widget_question_answer.rb +185 -0
- data/lib/studium/gui/gtk2/vbox.rb +748 -0
- data/lib/studium/gui/gtk3/README.md +1 -0
- data/lib/studium/gui/gtk3/studium_panel.rb +54 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/constants.rb +22 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/determine.rb +630 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/help.rb +44 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/html.rb +599 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/initialize.rb +53 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/konsole.rb +32 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/menu.rb +466 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/misc.rb +598 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/reset.rb +120 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/run.rb +44 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/show.rb +106 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb +491 -0
- data/lib/studium/lectures/show_lectures_on_the_commandline/sorted_individual_curricula.rb +117 -0
- data/lib/studium/logging/README.md +2 -0
- data/lib/studium/logging/ensure_that_the_log_directory_exists.rb +47 -0
- data/lib/studium/logging/html_log_directory.rb +35 -0
- data/lib/studium/logging/log_directory.rb +100 -0
- data/lib/studium/logging/store_last_question_asked_into_file.rb +138 -0
- data/lib/studium/misc/return_remote_homepage_of_this_lecture.rb +8661 -0
- data/lib/studium/misc/return_remote_moodle_link_of_this_lecture.rb +1343 -0
- data/lib/studium/parsers/README.md +2 -0
- data/lib/studium/parsers/custom_exam_results_parser.rb +208 -0
- data/lib/studium/parsers/parse_lva_dates.rb +190 -0
- data/lib/studium/pdf/README.md +2 -0
- data/lib/studium/pdf/create_pdf_file_for_this_exam_topic.rb +277 -0
- data/lib/studium/project/project.rb +80 -0
- data/lib/studium/requires/common_popular_requires.rb +37 -0
- data/lib/studium/requires/commonly_used_requires.rb +13 -0
- data/lib/studium/requires/require_class_exams_solved.rb +7 -0
- data/lib/studium/requires/require_ects_scripts.rb +25 -0
- data/lib/studium/requires/require_encoding.rb +7 -0
- data/lib/studium/requires/require_the_exam_scripts.rb +37 -0
- data/lib/studium/requires/require_the_studium_constants.rb +14 -0
- data/lib/studium/requires/require_the_studium_project.rb +47 -0
- data/lib/studium/requires/require_the_utility_scripts.rb +26 -0
- data/lib/studium/requires/require_toplevel_methods.rb +26 -0
- data/lib/studium/requires/require_upcoming_exams.rb +7 -0
- data/lib/studium/requires/require_yaml.rb +7 -0
- data/lib/studium/requires/with_GUI.rb +12 -0
- data/lib/studium/requires/www_mode.rb +17 -0
- data/lib/studium/sinatra/app.rb +225 -0
- data/lib/studium/sinatra/misc.rb +111 -0
- data/lib/studium/statistics/README.md +4 -0
- data/lib/studium/statistics/best_exam_months.rb +81 -0
- data/lib/studium/statistics/curriculum_comparer.rb +344 -0
- data/lib/studium/statistics/determine_exam_statistics_from_this_file.rb +140 -0
- data/lib/studium/statistics/max_stats.rb +171 -0
- data/lib/studium/statistics/report_how_many_ects_points_per_curriculum_were_completed.rb +172 -0
- data/lib/studium/statistics/report_how_many_exam_questions_were_answered.rb +478 -0
- data/lib/studium/statistics/show_exam_statistics.rb +60 -0
- data/lib/studium/statistics/top_stats.rb +122 -0
- data/lib/studium/steop/README.md +4 -0
- data/lib/studium/steop/show_all_steop_lectures.rb +101 -0
- data/lib/studium/steop/steop_lectures_in_this_curriculum.rb +291 -0
- data/lib/studium/steop/steop_lva_dates.rb +102 -0
- data/lib/studium/toplevel_methods/all_passed_exams.rb +35 -0
- data/lib/studium/toplevel_methods/already_solved_this_lecture.rb +98 -0
- data/lib/studium/toplevel_methods/available_curricula.rb +71 -0
- data/lib/studium/toplevel_methods/available_topics.rb +145 -0
- data/lib/studium/toplevel_methods/average_grade.rb +141 -0
- data/lib/studium/toplevel_methods/calculate_pr/303/274fungsimmanente_lectures_from_this_file.rb +55 -0
- data/lib/studium/toplevel_methods/cd.rb +25 -0
- data/lib/studium/toplevel_methods/cd_stud.rb +134 -0
- data/lib/studium/toplevel_methods/copy_the_last_backup_of_file_lecture_information.rb +27 -0
- data/lib/studium/toplevel_methods/determine_local_directory_of_this_lecture.rb +72 -0
- data/lib/studium/toplevel_methods/does_this_course_require_mandatory_presence.rb +44 -0
- data/lib/studium/toplevel_methods/download.rb +157 -0
- data/lib/studium/toplevel_methods/e.rb +16 -0
- data/lib/studium/toplevel_methods/ects_from_lectures.rb +251 -0
- data/lib/studium/toplevel_methods/editor.rb +64 -0
- data/lib/studium/toplevel_methods/esystem.rb +22 -0
- data/lib/studium/toplevel_methods/exams_dataset.rb +45 -0
- data/lib/studium/toplevel_methods/filter_away_invalid_questions.rb +77 -0
- data/lib/studium/toplevel_methods/find_exam_topic_and_exam_title.rb +2771 -0
- data/lib/studium/toplevel_methods/from_curriculum_id_to_university.rb +47 -0
- data/lib/studium/toplevel_methods/frozen.rb +32 -0
- data/lib/studium/toplevel_methods/handle_archive_of_the_exam_questions.rb +136 -0
- data/lib/studium/toplevel_methods/has_a_bachelor_or_master_curriculum.rb +84 -0
- data/lib/studium/toplevel_methods/has_this_lecture_been_already_passed_but_the_id_was_changed_lateron.rb +41 -0
- data/lib/studium/toplevel_methods/has_this_module_been_completed.rb +206 -0
- data/lib/studium/toplevel_methods/install_the_project_on_the_given_hostsystem.rb +32 -0
- data/lib/studium/toplevel_methods/is_on_roebe.rb +26 -0
- data/lib/studium/toplevel_methods/is_this_exam_topic_included.rb +46 -0
- data/lib/studium/toplevel_methods/is_this_homepage_registered.rb +31 -0
- data/lib/studium/toplevel_methods/is_this_lecture_a_practical_course.rb +100 -0
- data/lib/studium/toplevel_methods/is_this_lecture_part_of_the_vector_curriculum.rb +110 -0
- data/lib/studium/toplevel_methods/is_this_lecture_registered_in_upcoming_exams.rb +43 -0
- data/lib/studium/toplevel_methods/lecture_information.rb +101 -0
- data/lib/studium/toplevel_methods/lectures_without_attribution_to_any_curriculum.rb +42 -0
- data/lib/studium/toplevel_methods/lva_numbers.rb +339 -0
- data/lib/studium/toplevel_methods/main_dataset.rb +73 -0
- data/lib/studium/toplevel_methods/map_curriculum_number_to_curriculum_name.rb +97 -0
- data/lib/studium/toplevel_methods/methods_related_to_curricula.rb +47 -0
- data/lib/studium/toplevel_methods/methods_related_to_files.rb +197 -0
- data/lib/studium/toplevel_methods/mkdir.rb +25 -0
- data/lib/studium/toplevel_methods/n_questions_available.rb +128 -0
- data/lib/studium/toplevel_methods/n_topics_available.rb +63 -0
- data/lib/studium/toplevel_methods/name_of_this_curriculum.rb +38 -0
- data/lib/studium/toplevel_methods/names_of_all_solved_exams.rb +71 -0
- data/lib/studium/toplevel_methods/note_down_the_start_time_and_how_many_exams_have_been_already_solved.rb +70 -0
- data/lib/studium/toplevel_methods/opnn.rb +25 -0
- data/lib/studium/toplevel_methods/passed_this_exam_on.rb +105 -0
- data/lib/studium/toplevel_methods/pristine.rb +69 -0
- data/lib/studium/toplevel_methods/read_dataset_from_a_curriculum_file.rb +133 -0
- data/lib/studium/toplevel_methods/read_delay_between_questions_from_file.rb +34 -0
- data/lib/studium/toplevel_methods/regexes.rb +90 -0
- data/lib/studium/toplevel_methods/registered_for_this_exam.rb +62 -0
- data/lib/studium/toplevel_methods/remote_url.rb +57 -0
- data/lib/studium/toplevel_methods/remove_comments.rb +26 -0
- data/lib/studium/toplevel_methods/remove_exam_topics_that_were_already_answered.rb +27 -0
- data/lib/studium/toplevel_methods/remove_tags.rb +26 -0
- data/lib/studium/toplevel_methods/report.rb +143 -0
- data/lib/studium/toplevel_methods/report_all_lectures_matching_this_lecture_type.rb +45 -0
- data/lib/studium/toplevel_methods/report_attributed_lectures_to_universities.rb +30 -0
- data/lib/studium/toplevel_methods/report_n_ects_per_university.rb +63 -0
- data/lib/studium/toplevel_methods/report_n_entries_in_the_file_lecture_information.rb +36 -0
- data/lib/studium/toplevel_methods/report_nquestions_of.rb +96 -0
- data/lib/studium/toplevel_methods/report_solved_topics.rb +56 -0
- data/lib/studium/toplevel_methods/return_all_exams_on_this_day.rb +66 -0
- data/lib/studium/toplevel_methods/return_curriculum_of_this_lva_number.rb +82 -0
- data/lib/studium/toplevel_methods/return_dataset_for_this_exam_topic.rb +41 -0
- data/lib/studium/toplevel_methods/return_dataset_from_this_curriculum_file.rb +150 -0
- data/lib/studium/toplevel_methods/return_directory_for.rb +66 -0
- data/lib/studium/toplevel_methods/return_div_timetable_of_upcoming_exams.rb +489 -0
- data/lib/studium/toplevel_methods/return_ects_from_this_lecture_stored_in_the_file_lecture_information.rb +197 -0
- data/lib/studium/toplevel_methods/return_hash_of_already_solved_lectures.rb +41 -0
- data/lib/studium/toplevel_methods/return_local_path_of_this_pwdstud.rb +59 -0
- data/lib/studium/toplevel_methods/return_lva_number_of_this_lecture.rb +72 -0
- data/lib/studium/toplevel_methods/return_n_percent_solved_from_this_topic.rb +75 -0
- data/lib/studium/toplevel_methods/return_n_questions_were_answered_for_this_topic.rb +37 -0
- data/lib/studium/toplevel_methods/return_proper_university_image.rb +80 -0
- data/lib/studium/toplevel_methods/return_question_answer_string_from_this_topic.rb +56 -0
- data/lib/studium/toplevel_methods/return_sanitized_dataset_from_the_file_lecture_information.rb +126 -0
- data/lib/studium/toplevel_methods/return_theme_of_the_next_upcoming_exam.rb +38 -0
- data/lib/studium/toplevel_methods/return_this_curriculum_as_a_string.rb +26 -0
- data/lib/studium/toplevel_methods/return_title_from_this_curriculum_file.rb +91 -0
- data/lib/studium/toplevel_methods/rinstall2.rb +34 -0
- data/lib/studium/toplevel_methods/rti_conflict.rb +29 -0
- data/lib/studium/toplevel_methods/runmode.rb +86 -0
- data/lib/studium/toplevel_methods/sanitize_this_theme_topic.rb +128 -0
- data/lib/studium/toplevel_methods/sanitized_dataset_from_file_passed_exams_per_month.rb +52 -0
- data/lib/studium/toplevel_methods/save_all_registered_upcoming_exams.rb +62 -0
- data/lib/studium/toplevel_methods/save_file.rb +81 -0
- data/lib/studium/toplevel_methods/save_this_delay_between_questions_and_answers.rb +43 -0
- data/lib/studium/toplevel_methods/set_last_file_for_exam_questions.rb +64 -0
- data/lib/studium/toplevel_methods/set_this_cd_alias_to.rb +86 -0
- data/lib/studium/toplevel_methods/show_passed_ects_in_the_individual_bachelor_and_master_curricula.rb +81 -0
- data/lib/studium/toplevel_methods/show_passed_exams_having_this_grade.rb +27 -0
- data/lib/studium/toplevel_methods/spacer.rb +18 -0
- data/lib/studium/toplevel_methods/time.rb +220 -0
- data/lib/studium/toplevel_methods/total_ects_points_passed.rb +72 -0
- data/lib/studium/toplevel_methods/try_to_guess_the_most_likely_lva_id.rb +57 -0
- data/lib/studium/toplevel_methods/try_to_return_the_expanded_name_of_this_lecture.rb +63 -0
- data/lib/studium/toplevel_methods/unfinished.rb +51 -0
- data/lib/studium/toplevel_methods/url.rb +74 -0
- data/lib/studium/toplevel_methods/verbose_truth.rb +21 -0
- data/lib/studium/toplevel_methods/when_was_this_lecture_passed.rb +53 -0
- data/lib/studium/toplevel_methods/yes_or_no_ja_oder_nein.rb +33 -0
- data/lib/studium/tu_vienna/README.md +6 -0
- data/lib/studium/tu_vienna/tu_ferien.rb +38 -0
- data/lib/studium/tu_vienna/tu_/303/266ffnungszeiten.rb +29 -0
- data/lib/studium/utility_scripts/attribute_lecture_to_curriculum/attribute_boku_lecture_to_curriculum.rb +389 -0
- data/lib/studium/utility_scripts/attribute_lecture_to_curriculum/attribute_lecture_to_curriculum.rb +236 -0
- data/lib/studium/utility_scripts/attribute_lectures_to_university/attribute_lectures_to_university.rb +385 -0
- data/lib/studium/utility_scripts/audio_stats.rb +176 -0
- data/lib/studium/utility_scripts/auto_stud/auto_stud.rb +253 -0
- data/lib/studium/utility_scripts/auto_stud/constants.rb +23 -0
- data/lib/studium/utility_scripts/auto_stud/initialize.rb +23 -0
- data/lib/studium/utility_scripts/auto_stud/misc.rb +18 -0
- data/lib/studium/utility_scripts/autopurge_this_lecture_date.rb +101 -0
- data/lib/studium/utility_scripts/calendar/README.md +2 -0
- data/lib/studium/utility_scripts/calendar/calendar.rb +244 -0
- data/lib/studium/utility_scripts/calendar/misc.rb +35 -0
- data/lib/studium/utility_scripts/check_description_of_these_lectures.rb +224 -0
- data/lib/studium/utility_scripts/clean_up_lecture_date.rb +151 -0
- data/lib/studium/utility_scripts/current_lectures_belonging_to_both_bachelor_and_master_curriculum.rb +113 -0
- data/lib/studium/utility_scripts/currently_participating_in_these_lectures.rb +104 -0
- data/lib/studium/utility_scripts/display_lecture_url.rb +117 -0
- data/lib/studium/utility_scripts/expand_time_range.rb +422 -0
- data/lib/studium/utility_scripts/find_duplicate_lectures.rb +121 -0
- data/lib/studium/utility_scripts/finished_exams_at_this_university.rb +94 -0
- data/lib/studium/utility_scripts/foreign_language_percentage/constants.rb +28 -0
- data/lib/studium/utility_scripts/foreign_language_percentage/foreign_language_percentage.rb +142 -0
- data/lib/studium/utility_scripts/foreign_language_percentage/help.rb +29 -0
- data/lib/studium/utility_scripts/foreign_language_percentage/initialize.rb +25 -0
- data/lib/studium/utility_scripts/foreign_language_percentage/menu.rb +141 -0
- data/lib/studium/utility_scripts/foreign_language_percentage/report.rb +62 -0
- data/lib/studium/utility_scripts/foreign_language_percentage/reset.rb +57 -0
- data/lib/studium/utility_scripts/foreign_language_percentage/run.rb +19 -0
- data/lib/studium/utility_scripts/generate_spreadsheet.rb +349 -0
- data/lib/studium/utility_scripts/holidays.rb +143 -0
- data/lib/studium/utility_scripts/lecture_downloader.rb +115 -0
- data/lib/studium/utility_scripts/lectures_attributed_to_universities.rb +344 -0
- data/lib/studium/utility_scripts/lva_nummer.rb +440 -0
- data/lib/studium/utility_scripts/mandatory_lectures_in_this_month.rb +321 -0
- data/lib/studium/utility_scripts/name_of_this_lva_id.rb +110 -0
- data/lib/studium/utility_scripts/new_stud.rb +332 -0
- data/lib/studium/utility_scripts/next_week.rb +111 -0
- data/lib/studium/utility_scripts/passed_ects_per_year.rb +172 -0
- data/lib/studium/utility_scripts/passed_pr/303/274fungsimmanente_courses/passed_pr/303/274fungsimmanente_courses.rb +181 -0
- data/lib/studium/utility_scripts/prepare_individual_curriculum.rb +182 -0
- data/lib/studium/utility_scripts/priority.rb +126 -0
- data/lib/studium/utility_scripts/priority_points.rb +263 -0
- data/lib/studium/utility_scripts/publish_my_exams.rb +174 -0
- data/lib/studium/utility_scripts/regexes/README.md +2 -0
- data/lib/studium/utility_scripts/regexes/generate_regex.rb +278 -0
- data/lib/studium/utility_scripts/regexes/generate_regexes_for_the_available_moodle_links.rb +54 -0
- data/lib/studium/utility_scripts/regexes/generate_regexes_for_the_registered_lectures.rb +48 -0
- data/lib/studium/utility_scripts/report_outdated_timetable_entries.rb +148 -0
- data/lib/studium/utility_scripts/report_total_amount_of_questions_and_answers_for.rb +120 -0
- data/lib/studium/utility_scripts/report_whether_this_lecture_is_registered_in_the_file_lecture_information.rb +125 -0
- data/lib/studium/utility_scripts/resolve_practical_courses_date_conflicts/individual_resolve_practical_courses_date_conflicts.rb +257 -0
- data/lib/studium/utility_scripts/resolve_practical_courses_date_conflicts/resolve_practical_courses_date_conflicts.rb +273 -0
- data/lib/studium/utility_scripts/scrape_remote_university_url.rb +146 -0
- data/lib/studium/utility_scripts/semester_schedule_creator/semester_container.rb +142 -0
- data/lib/studium/utility_scripts/semester_schedule_creator/semester_schedule_creator.rb +381 -0
- data/lib/studium/utility_scripts/semesterplaner.rb +289 -0
- data/lib/studium/utility_scripts/show_all_lectures.rb +403 -0
- data/lib/studium/utility_scripts/show_all_passed_master_lectures.rb +127 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/constants.rb +56 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/do_report_the_upcoming_exams.rb +60 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/help.rb +49 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/initialize.rb +28 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/menu.rb +54 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/misc.rb +214 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/report.rb +118 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/reset.rb +80 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/run.rb +22 -0
- data/lib/studium/utility_scripts/show_conflicting_lva_lectures/show_conflicting_lva_lectures.rb +651 -0
- data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/constants.rb +28 -0
- data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/menu.rb +62 -0
- data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/reset.rb +36 -0
- data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/run.rb +35 -0
- data/lib/studium/utility_scripts/show_descriptions_of_lectures_belonging_to_this_module/show_descriptions_of_lectures_belonging_to_this_module.rb +145 -0
- data/lib/studium/utility_scripts/show_lecturers/show_lecturers.rb +145 -0
- data/lib/studium/utility_scripts/show_lectures/constants.rb +16 -0
- data/lib/studium/utility_scripts/show_lectures/help.rb +34 -0
- data/lib/studium/utility_scripts/show_lectures/initialize.rb +23 -0
- data/lib/studium/utility_scripts/show_lectures/menu.rb +106 -0
- data/lib/studium/utility_scripts/show_lectures/misc.rb +582 -0
- data/lib/studium/utility_scripts/show_lectures/reset.rb +92 -0
- data/lib/studium/utility_scripts/show_lectures/run.rb +27 -0
- data/lib/studium/utility_scripts/show_lectures/show_lectures.rb +48 -0
- data/lib/studium/utility_scripts/show_lectures_fitting_to_this_language.rb +129 -0
- data/lib/studium/utility_scripts/show_lectures_fitting_to_this_theme.rb +100 -0
- data/lib/studium/utility_scripts/show_lectures_on_this_day.rb +154 -0
- data/lib/studium/utility_scripts/show_lva_dates_of_this_lecture.rb +177 -0
- data/lib/studium/utility_scripts/show_outdated_lva_dates.rb +218 -0
- data/lib/studium/utility_scripts/show_solved_english_lectures.rb +139 -0
- data/lib/studium/utility_scripts/show_the_associated_lectures_for_the_individual_curriculum.rb +285 -0
- data/lib/studium/utility_scripts/studienkennzahl.rb +109 -0
- data/lib/studium/utility_scripts/studium_skeleton.rb +220 -0
- data/lib/studium/utility_scripts/stundenplan.rb +603 -0
- data/lib/studium/utility_scripts/sync_studium_relevant_entries_one_level_downwards.rb +221 -0
- data/lib/studium/utility_scripts/ufind.rb +101 -0
- data/lib/studium/utility_scripts/upcoming_mandatory_presence_courses/constants.rb +31 -0
- data/lib/studium/utility_scripts/upcoming_mandatory_presence_courses/run.rb +20 -0
- data/lib/studium/utility_scripts/upcoming_mandatory_presence_courses/upcoming_mandatory_presence_courses.rb +179 -0
- data/lib/studium/utility_scripts/vorbesprechungen.rb +293 -0
- data/lib/studium/utility_scripts/week_parser/constants.rb +28 -0
- data/lib/studium/utility_scripts/week_parser/help.rb +32 -0
- data/lib/studium/utility_scripts/week_parser/menu.rb +56 -0
- data/lib/studium/utility_scripts/week_parser/misc.rb +51 -0
- data/lib/studium/utility_scripts/week_parser/reset.rb +55 -0
- data/lib/studium/utility_scripts/week_parser/run.rb +18 -0
- data/lib/studium/utility_scripts/week_parser/show.rb +242 -0
- data/lib/studium/utility_scripts/week_parser/week_parser.rb +362 -0
- data/lib/studium/utility_scripts/weekday_parser.rb +159 -0
- data/lib/studium/utility_scripts/weekly_schedule.rb +209 -0
- data/lib/studium/utility_scripts/wochenplanung.rb +278 -0
- data/lib/studium/version/version.rb +46 -0
- data/lib/studium/www/curricula_displayer.cgi +170 -0
- data/lib/studium/www/curriculum_displayer.rb +162 -0
- data/lib/studium/www/exams.cgi +50 -0
- data/lib/studium/www/statistics.cgi +55 -0
- data/lib/studium/yaml/allowed_themes_for_exams.yml +307 -0
- data/lib/studium/yaml/array_allowed_entries_for_the_file_lecture_information.yml +68 -0
- data/lib/studium/yaml/backlog_of_exams.yml +35 -0
- data/lib/studium/yaml/current_exams.yml +19 -0
- data/lib/studium/yaml/curricula.yml +530 -0
- data/lib/studium/yaml/curricula/README.md +3 -0
- data/lib/studium/yaml/curricula/bachelor_agrarwissenschaften_033255.yml +130 -0
- data/lib/studium/yaml/curricula/bachelor_biologie_basisblock_033630.yml +65 -0
- data/lib/studium/yaml/curricula/bachelor_biologie_botanik_033630.yml +84 -0
- data/lib/studium/yaml/curricula/bachelor_biologie_ecology_033630.yml +74 -0
- data/lib/studium/yaml/curricula/bachelor_biologie_mikrobiologie_und_genetik_033630.yml +120 -0
- data/lib/studium/yaml/curricula/bachelor_biologie_molekulare_biologie_033630.yml +104 -0
- data/lib/studium/yaml/curricula/bachelor_biologie_zoologie_033630.yml +87 -0
- data/lib/studium/yaml/curricula/bachelor_chemie_033662.yml +164 -0
- data/lib/studium/yaml/curricula/bachelor_dummy_curriculum.yml +135 -0
- data/lib/studium/yaml/curricula/bachelor_elektrotechnik_und_informationstechnik_033235.yml +13 -0
- data/lib/studium/yaml/curricula/bachelor_forstwirtschaft_033225.yml +105 -0
- data/lib/studium/yaml/curricula/bachelor_informatik_033521.yml +130 -0
- data/lib/studium/yaml/curricula/bachelor_informatik_und_molekulare_biologie.yml +1144 -0
- data/lib/studium/yaml/curricula/bachelor_ktww_033231.yml +84 -0
- data/lib/studium/yaml/curricula/bachelor_lmbt_033217.yml +108 -0
- data/lib/studium/yaml/curricula/bachelor_medizinische_informatik_033533.yml +200 -0
- data/lib/studium/yaml/curricula/bachelor_molekularbiologie_033665.yml +93 -0
- data/lib/studium/yaml/curricula/bachelor_nutrition_science_033638.yml +117 -0
- data/lib/studium/yaml/curricula/bachelor_pharmazie_033305.yml +170 -0
- data/lib/studium/yaml/curricula/bachelor_technische_chemie_033290.yml +129 -0
- data/lib/studium/yaml/curricula/bachelor_technische_informatik_033535.yml +23 -0
- data/lib/studium/yaml/curricula/bachelor_ubrm_033227.yml +140 -0
- data/lib/studium/yaml/curricula/bachelor_vector_based_strategies_in_life_sciences_molecular_medicine_and_biotechnology.yml +1157 -0
- data/lib/studium/yaml/curricula/bachelor_verfahrenstechnik_033273.yml +167 -0
- data/lib/studium/yaml/curricula/bachelor_wirtschaftsinformatik_033526.yml +29 -0
- data/lib/studium/yaml/curricula/master_bioinformatics_and_molecular_biotechnology_including_aspects_from_molecular_medicine.yml +438 -0
- data/lib/studium/yaml/curricula/master_bioinformatik_066875.yml +76 -0
- data/lib/studium/yaml/curricula/master_biologie_molekulare_mikrobiologie_mikrobielle_oekologie_und_immunbiologie_066830.yml +78 -0
- data/lib/studium/yaml/curricula/master_biologische_chemie_066863.yml +61 -0
- data/lib/studium/yaml/curricula/master_dummy_curriculum.yml +137 -0
- data/lib/studium/yaml/curricula/master_food_science_and_plant_biotechnology.yml +30 -0
- data/lib/studium/yaml/curricula/master_genetik_und_entwicklungsbiologie_066877.yml +90 -0
- data/lib/studium/yaml/curricula/master_lmbt_066418.yml +65 -0
- data/lib/studium/yaml/curricula/master_molekulare_biologie_066834.yml +142 -0
- data/lib/studium/yaml/curricula/master_pharmazie_066605.yml +170 -0
- data/lib/studium/yaml/curricula/master_technische_chemie_066490.yml +123 -0
- data/lib/studium/yaml/curricula/master_vector_based_strategies_in_life_sciences_molecular_medicine_and_biotechnology.yml +741 -0
- data/lib/studium/yaml/custom_colours.yml +21 -0
- data/lib/studium/yaml/daily_questions_solved.yml +789 -0
- data/lib/studium/yaml/default_delay.yml +4 -0
- data/lib/studium/yaml/default_encoding.yml +1 -0
- data/lib/studium/yaml/directory_to_the_exam_topics.yml +0 -0
- data/lib/studium/yaml/editor.yml +1 -0
- data/lib/studium/yaml/file_for_exam_questions.yml +1 -0
- data/lib/studium/yaml/german/README.md +2 -0
- data/lib/studium/yaml/german/german_to_english_month_names.yml +16 -0
- data/lib/studium/yaml/grouped_themes.yml +187 -0
- data/lib/studium/yaml/holidays.yml +176 -0
- data/lib/studium/yaml/important_exams.yml +194 -0
- data/lib/studium/yaml/inscription_dates_of_universities.yml +58 -0
- data/lib/studium/yaml/lecture_aliases.yml +108 -0
- data/lib/studium/yaml/lecture_information.yml +47783 -0
- data/lib/studium/yaml/log_dir.yml +1 -0
- data/lib/studium/yaml/main_topic.yml +11 -0
- data/lib/studium/yaml/max_stats.yml +227 -0
- data/lib/studium/yaml/mitteilungsbl/303/244tter.yml +315 -0
- data/lib/studium/yaml/n_total_questions.yml +1 -0
- data/lib/studium/yaml/participating_in_these_courses.yml +50 -0
- data/lib/studium/yaml/rename_konsole_tab.yml +1 -0
- data/lib/studium/yaml/show_topic.yml +1 -0
- data/lib/studium/yaml/statistics.yml +57 -0
- data/lib/studium/yaml/use_colours.yml +1 -0
- data/studium.gemspec +79 -0
- data/test/testing_studium.rb +244 -0
- data/test/testing_time_component.rb +29 -0
- metadata +1079 -0
@@ -0,0 +1,188 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# === Studium::Exams::PushSolvedQuestionsOnTop
|
6
|
+
#
|
7
|
+
# This class will simply relocate all solved questions to the top of the
|
8
|
+
# exam file at hand.
|
9
|
+
#
|
10
|
+
# Usage example:
|
11
|
+
#
|
12
|
+
# Studium::Exams::PushSolvedQuestionsOnTop.new(ARGV)
|
13
|
+
#
|
14
|
+
# =========================================================================== #
|
15
|
+
# require 'studium/exams/push_solved_questions_on_top.rb'
|
16
|
+
# =========================================================================== #
|
17
|
+
require 'studium/base/base.rb'
|
18
|
+
|
19
|
+
module Studium
|
20
|
+
|
21
|
+
module Exams
|
22
|
+
|
23
|
+
class PushSolvedQuestionsOnTop < ::Studium::Base # === Studium::Exams::PushSolvedQuestionsOnTop
|
24
|
+
|
25
|
+
# ========================================================================= #
|
26
|
+
# === NAMESPACE
|
27
|
+
# ========================================================================= #
|
28
|
+
NAMESPACE = inspect
|
29
|
+
|
30
|
+
# ========================================================================= #
|
31
|
+
# === initialize
|
32
|
+
# ========================================================================= #
|
33
|
+
def initialize(
|
34
|
+
commandline_arguments = nil,
|
35
|
+
run_already = true
|
36
|
+
)
|
37
|
+
reset
|
38
|
+
set_commandline_arguments(
|
39
|
+
commandline_arguments
|
40
|
+
)
|
41
|
+
run if run_already
|
42
|
+
end
|
43
|
+
|
44
|
+
# ========================================================================= #
|
45
|
+
# === reset (reset tag)
|
46
|
+
# ========================================================================= #
|
47
|
+
def reset
|
48
|
+
super()
|
49
|
+
# ======================================================================= #
|
50
|
+
# === @namespace
|
51
|
+
# ======================================================================= #
|
52
|
+
@namespace = NAMESPACE
|
53
|
+
# ======================================================================= #
|
54
|
+
# === @work_on_this_file
|
55
|
+
#
|
56
|
+
# Specifies on which file we will be working.
|
57
|
+
# ======================================================================= #
|
58
|
+
@work_on_this_file = nil
|
59
|
+
end
|
60
|
+
|
61
|
+
# ========================================================================= #
|
62
|
+
# === overwrite_the_existing_file_with_this_content
|
63
|
+
#
|
64
|
+
# This method will overwrite the old file.
|
65
|
+
# ========================================================================= #
|
66
|
+
def overwrite_the_existing_file_with_this_content(content)
|
67
|
+
original_into = @work_on_this_file
|
68
|
+
opnn; e 'Storing the modified dataset into '+sfile(original_into)+'.'
|
69
|
+
write_what_into(content, original_into)
|
70
|
+
if is_on_roebe?
|
71
|
+
into = roebe_exam_directory?
|
72
|
+
if File.directory?(into)
|
73
|
+
into = into+File.basename(@work_on_this_file)
|
74
|
+
if into != original_into
|
75
|
+
opnn; e 'Storing the modified dataset into '+sfile(into)+' as well.'
|
76
|
+
write_what_into(content, into)
|
77
|
+
end
|
78
|
+
else
|
79
|
+
opnn; e 'No directory at '+sdir(into)+' exists.'
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# ========================================================================= #
|
85
|
+
# === determine_on_which_file_to_work_on
|
86
|
+
#
|
87
|
+
# This method will determine on which file this class will be working on.
|
88
|
+
# ========================================================================= #
|
89
|
+
def determine_on_which_file_to_work_on
|
90
|
+
first_argument = first_argument?
|
91
|
+
if first_argument.nil?
|
92
|
+
opnn; e 'Please provide a valid exam topic, as input to this class.'
|
93
|
+
exit
|
94
|
+
else
|
95
|
+
location = return_file_associated_with_this_exam_topic(first_argument)
|
96
|
+
# ===================================================================== #
|
97
|
+
# Obtain the full path.
|
98
|
+
# ===================================================================== #
|
99
|
+
@work_on_this_file = "#{directory_to_the_exam_topics?}#{location}"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# ========================================================================= #
|
104
|
+
# === run (run tag)
|
105
|
+
# ========================================================================= #
|
106
|
+
def run
|
107
|
+
# ======================================================================= #
|
108
|
+
# First, determine on which file we want to work on.
|
109
|
+
# ======================================================================= #
|
110
|
+
determine_on_which_file_to_work_on
|
111
|
+
if @work_on_this_file and File.exist?(@work_on_this_file)
|
112
|
+
@dataset = proper_readlines(@work_on_this_file)
|
113
|
+
# ===================================================================== #
|
114
|
+
# Next check whether there is any line ending with ' []'. If so then
|
115
|
+
# we will do modifications; if not then not.
|
116
|
+
# ===================================================================== #
|
117
|
+
if @dataset.any? {|line| line.end_with? " []\n" }
|
118
|
+
do_modify_this_dataset(@dataset)
|
119
|
+
else
|
120
|
+
opnn; e 'This file does not contain any lines ending '\
|
121
|
+
'with '+steelblue(' []')
|
122
|
+
end
|
123
|
+
else
|
124
|
+
unless @work_on_this_file.nil?
|
125
|
+
opnn; e 'No file could be found at '+sfile(@work_on_this_file)+'.'
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# ========================================================================= #
|
131
|
+
# === do_modify_this_dataset
|
132
|
+
#
|
133
|
+
# This method is the one that will actually modify the dataset at hand.
|
134
|
+
#
|
135
|
+
# We will simply build a new file, by moving all lines ending with
|
136
|
+
# " []\n" to another array.
|
137
|
+
# ========================================================================= #
|
138
|
+
def do_modify_this_dataset(i = @dataset)
|
139
|
+
_ = ''.dup
|
140
|
+
hash = {}
|
141
|
+
i.each {|this_line|
|
142
|
+
stripped_line = this_line.rstrip
|
143
|
+
if stripped_line.start_with?('#') or
|
144
|
+
stripped_line.empty? or
|
145
|
+
this_line.strip.empty?
|
146
|
+
this_line.empty?
|
147
|
+
# This is a comment or a newline, then.
|
148
|
+
unless hash.has_key? :comments
|
149
|
+
hash[:comments] = []
|
150
|
+
end
|
151
|
+
hash[:comments] << stripped_line
|
152
|
+
elsif stripped_line.end_with? ' []'
|
153
|
+
# This is a solved question, then.
|
154
|
+
unless hash.has_key? :solved_questions
|
155
|
+
hash[:solved_questions] = []
|
156
|
+
end
|
157
|
+
hash[:solved_questions] << stripped_line
|
158
|
+
else # Else we assume this must be an unsolved question.
|
159
|
+
unless hash.has_key? :unsolved_questions
|
160
|
+
hash[:unsolved_questions] = []
|
161
|
+
end
|
162
|
+
hash[:unsolved_questions] << stripped_line
|
163
|
+
end
|
164
|
+
}
|
165
|
+
hash[:comments].each {|line|
|
166
|
+
_ << "#{line}\n"
|
167
|
+
}
|
168
|
+
hash[:solved_questions].each {|line|
|
169
|
+
_ << "#{line}\n"
|
170
|
+
}
|
171
|
+
hash[:unsolved_questions].each {|line|
|
172
|
+
_ << "#{line}\n"
|
173
|
+
}
|
174
|
+
overwrite_the_existing_file_with_this_content(_)
|
175
|
+
end
|
176
|
+
|
177
|
+
# ========================================================================= #
|
178
|
+
# === Studium::Exams::PushSolvedQuestionsOnTop[]
|
179
|
+
# ========================================================================= #
|
180
|
+
def self.[](i = '')
|
181
|
+
new(i)
|
182
|
+
end
|
183
|
+
|
184
|
+
end; end; end
|
185
|
+
|
186
|
+
if __FILE__ == $PROGRAM_NAME
|
187
|
+
Studium::Exams::PushSolvedQuestionsOnTop.new(ARGV)
|
188
|
+
end # pushsolvedquestionsontop ab2
|
@@ -0,0 +1,842 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# === Studium::Exams::QuestionAnswer
|
6
|
+
#
|
7
|
+
# This class accepts a question-answer line as its input. It will
|
8
|
+
# then interprete this topic (aka the question-answer components)
|
9
|
+
# and randomly determine a question and an answer.
|
10
|
+
#
|
11
|
+
# Usage examples in ruby code:
|
12
|
+
#
|
13
|
+
# x = Studium::Exams::QuestionAnswer.new('- Wir können Melanome nach der "ABCDE" Regel beurteilen. Wofür stehen diese Abkürzungen? (1) A: Asymmetry (2) B: Border (3) C: Color (4) D: Diameter (5) E: Evolving')
|
14
|
+
# x = Studium::Exams::QuestionAnswer.new('- Nenne die beiden wichtigsten Mechanismen zur Verhinderung der Selbstbefruchtung. A: (1) physische Trennung von männlichen und weiblichen Gametophyten (2) genetisch, über die Selbst-Inkompatibilität')
|
15
|
+
# x = Studium::Exams::QuestionAnswer.new('- Nenne die Zucker des Calvin-Zyklus, beginnend von RUBISCO, im "Uhrzeigersinn"! A: (1) 3-Phosphoglycerat (2) 1,3-Bisphosphoglycerat (3) G3P (4) 5-G3P und Ribulose-1-5-Bisphosphat.')
|
16
|
+
# x = Studium::Exams::QuestionAnswer.new('- abc? def? ya')
|
17
|
+
#
|
18
|
+
# =========================================================================== #
|
19
|
+
# require 'studium/exams/question_answer/question_answer.rb'
|
20
|
+
# Studium::Exams::QuestionAnswer
|
21
|
+
# =========================================================================== #
|
22
|
+
require 'studium/base/base.rb'
|
23
|
+
|
24
|
+
module Studium
|
25
|
+
|
26
|
+
module Exams
|
27
|
+
|
28
|
+
class QuestionAnswer < ::Studium::Base # === Studium::Exams::QuestionAnswer
|
29
|
+
|
30
|
+
# ========================================================================= #
|
31
|
+
# === NAMESPACE
|
32
|
+
# ========================================================================= #
|
33
|
+
NAMESPACE = inspect
|
34
|
+
|
35
|
+
# ========================================================================= #
|
36
|
+
# === ALL_COLOUR_METHODS
|
37
|
+
# ========================================================================= #
|
38
|
+
ALL_COLOUR_METHODS = ::Colours::AllColourMethods
|
39
|
+
|
40
|
+
# ========================================================================= #
|
41
|
+
# === COLOUR_OLIVEDRAB
|
42
|
+
#
|
43
|
+
# We need the string-representation of the RGB values.
|
44
|
+
# ========================================================================= #
|
45
|
+
COLOUR_OLIVEDRAB = ::Colours.rgb_value_as_string('olivedrab')
|
46
|
+
|
47
|
+
# ========================================================================= #
|
48
|
+
# === EMPHASIZE_WORDS_IN_QUOTES_IN_A_GIVEN_ANSWER
|
49
|
+
# ========================================================================= #
|
50
|
+
EMPHASIZE_WORDS_IN_QUOTES_IN_A_GIVEN_ANSWER = false
|
51
|
+
|
52
|
+
# ========================================================================= #
|
53
|
+
# === EMPHASIZE_WORDS_IN_QUOTES_IN_A_GIVEN_QUESTION
|
54
|
+
#
|
55
|
+
# This constant is like the constant called
|
56
|
+
# EMPHASIZE_WORDS_IN_QUOTES_IN_A_GIVEN_ANSWER, except that here
|
57
|
+
# we work on double-quotes, aka '"' characters, in a question.
|
58
|
+
#
|
59
|
+
# As of November 2019, this defaults to false, since we already
|
60
|
+
# use many other colours at this point.
|
61
|
+
# ========================================================================= #
|
62
|
+
EMPHASIZE_WORDS_IN_QUOTES_IN_A_GIVEN_QUESTION = false
|
63
|
+
|
64
|
+
# ========================================================================= #
|
65
|
+
# === COLOURS
|
66
|
+
# ========================================================================= #
|
67
|
+
COLOURS = ::Colours::AllColourMethods
|
68
|
+
|
69
|
+
# ========================================================================= #
|
70
|
+
# === initialize
|
71
|
+
#
|
72
|
+
# The first argument should contain the line that has both the
|
73
|
+
# particular question and the answer to said question.
|
74
|
+
# ========================================================================= #
|
75
|
+
def initialize(
|
76
|
+
use_this_line = nil,
|
77
|
+
run_already = true
|
78
|
+
)
|
79
|
+
reset
|
80
|
+
set_line(use_this_line)
|
81
|
+
if block_given?
|
82
|
+
yielded = yield
|
83
|
+
case yielded
|
84
|
+
# ===================================================================== #
|
85
|
+
# === :disable_colours
|
86
|
+
# ===================================================================== #
|
87
|
+
when :disable_colours
|
88
|
+
disable_colours
|
89
|
+
set_mode :www # ← Experimental as of 13.04.2019.
|
90
|
+
end
|
91
|
+
end
|
92
|
+
run if run_already
|
93
|
+
end
|
94
|
+
|
95
|
+
# ========================================================================= #
|
96
|
+
# === reset (reset tag)
|
97
|
+
# ========================================================================= #
|
98
|
+
def reset
|
99
|
+
super()
|
100
|
+
# ======================================================================= #
|
101
|
+
# === @namespace
|
102
|
+
# ======================================================================= #
|
103
|
+
@namespace = NAMESPACE
|
104
|
+
# ======================================================================= #
|
105
|
+
# === @use_colours
|
106
|
+
# ======================================================================= #
|
107
|
+
@use_colours = true
|
108
|
+
# ======================================================================= #
|
109
|
+
# === @question
|
110
|
+
# ======================================================================= #
|
111
|
+
@question = ''.dup
|
112
|
+
# ======================================================================= #
|
113
|
+
# === @line
|
114
|
+
# ======================================================================= #
|
115
|
+
@line = nil
|
116
|
+
# ======================================================================= #
|
117
|
+
# === @answer
|
118
|
+
# ======================================================================= #
|
119
|
+
@answer = ''.dup
|
120
|
+
# ======================================================================= #
|
121
|
+
# === @word_wrap_at
|
122
|
+
# ======================================================================= #
|
123
|
+
@word_wrap_at = 82
|
124
|
+
# ======================================================================= #
|
125
|
+
# The default colours will not be made available when we run in the www-mode.
|
126
|
+
# ======================================================================= #
|
127
|
+
if are_we_in_www_mode?
|
128
|
+
disable_colours
|
129
|
+
end
|
130
|
+
# ======================================================================= #
|
131
|
+
# === @custom_colours
|
132
|
+
# ======================================================================= #
|
133
|
+
@custom_colours = nil
|
134
|
+
# ======================================================================= #
|
135
|
+
# Next, honour custom colours that the user has defined, should these
|
136
|
+
# exist.
|
137
|
+
# ======================================================================= #
|
138
|
+
if File.exist?(FILE_CUSTOM_COLOURS)
|
139
|
+
@custom_colours = YAML.load_file(FILE_CUSTOM_COLOURS)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# ========================================================================= #
|
144
|
+
# === line_contains_italic_token?
|
145
|
+
# ========================================================================= #
|
146
|
+
def line_contains_italic_token?(i = @line)
|
147
|
+
(i.include?('<it>') and i.include?('</it>')) or
|
148
|
+
(i.include?('<i>') and i.include?('</i>'))
|
149
|
+
end
|
150
|
+
|
151
|
+
# ========================================================================= #
|
152
|
+
# === colour_for_answers?
|
153
|
+
# ========================================================================= #
|
154
|
+
def colour_for_answers?
|
155
|
+
@custom_colours['colour_for_answers']
|
156
|
+
end
|
157
|
+
|
158
|
+
# ========================================================================= #
|
159
|
+
# === colour_for_questions?
|
160
|
+
# ========================================================================= #
|
161
|
+
def colour_for_questions?
|
162
|
+
@custom_colours['colour_for_questions']
|
163
|
+
end
|
164
|
+
|
165
|
+
# ========================================================================= #
|
166
|
+
# === line_contains_bold_token?
|
167
|
+
# ========================================================================= #
|
168
|
+
def line_contains_bold_token?(i = @line)
|
169
|
+
(i.include?('<b>') and i.include?('</b>'))
|
170
|
+
end
|
171
|
+
|
172
|
+
# ========================================================================= #
|
173
|
+
# === line_contains_underline_token?
|
174
|
+
# ========================================================================= #
|
175
|
+
def line_contains_underline_token?(i = @line)
|
176
|
+
(i.include?('<ud>') and i.include?('</ud>')) or
|
177
|
+
(i.include?('<u>') and i.include?('</u>'))
|
178
|
+
end
|
179
|
+
|
180
|
+
# ========================================================================= #
|
181
|
+
# === assign_url
|
182
|
+
#
|
183
|
+
# Only call this method after making a line.include? 'URL:' check. The
|
184
|
+
# reason for this is that we will only apply this method on a line
|
185
|
+
# that has this substring representing a remote URL.
|
186
|
+
# ========================================================================= #
|
187
|
+
def assign_url(i)
|
188
|
+
if use_unicode_symbols?
|
189
|
+
nice_token = '➡' # We will use a slightly prettier symbol for Unicode in this case.
|
190
|
+
else
|
191
|
+
nice_token = '=>'
|
192
|
+
end
|
193
|
+
i =~ /URL:\s*(.*)( |)/
|
194
|
+
url = sanitize_url($1.to_s.dup) # URL is something like: "http://de.wikipedia.org/wiki/Ester"
|
195
|
+
url = url.first if url.is_a? Array
|
196
|
+
i = i.dup if i.frozen?
|
197
|
+
begin
|
198
|
+
# ===================================================================== #
|
199
|
+
# The next regex shall also check for input such as:
|
200
|
+
# URL: https://en.wikipedia.org/wiki/2,4-Dinitrophenol
|
201
|
+
# URL: https://en.wikipedia.org/wiki/File:Histidin_-_Histidine.svg
|
202
|
+
# Since as of 11.11.2018, we also include any other entry that
|
203
|
+
# starts with 'https:'.
|
204
|
+
# ===================================================================== #
|
205
|
+
if $1 # See: http://rubular.com/r/rNeLS2MH6f
|
206
|
+
i.gsub!(/URL:\s*(.*)( |)/, nice_token+' \1') # <- Also add a '=>' token.
|
207
|
+
end
|
208
|
+
rescue Exception => error
|
209
|
+
e 'Debugging for `'+sfancy(i.to_s)+'`:'
|
210
|
+
pp error
|
211
|
+
p url.class
|
212
|
+
e sfancy(url)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
# ========================================================================= #
|
217
|
+
# === colourize_https_substring
|
218
|
+
#
|
219
|
+
# Input that passes into the following method, can look like this:
|
220
|
+
#
|
221
|
+
# 'Das "CDT-Toxin". => https://www.ncbi.nlm.nih.gov/pubmed/24253566'
|
222
|
+
#
|
223
|
+
# ========================================================================= #
|
224
|
+
def colourize_https_substring(i)
|
225
|
+
if i.include? 'https://'
|
226
|
+
use_this_regex = /(https:\/\/.+)/ # See: http://rubular.com/r/4quDI8hKxS
|
227
|
+
i =~ use_this_regex
|
228
|
+
i = i.gsub(use_this_regex, slateblue('\1')) if $1
|
229
|
+
end
|
230
|
+
i
|
231
|
+
end
|
232
|
+
|
233
|
+
# ========================================================================= #
|
234
|
+
# === assign_url_or_colourize_https_substring
|
235
|
+
# ========================================================================= #
|
236
|
+
def assign_url_or_colourize_https_substring(i)
|
237
|
+
if i.include?(' URL:')
|
238
|
+
assign_url(i)
|
239
|
+
elsif i.include?(' https://')
|
240
|
+
colourize_https_substring(i)
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
# ========================================================================= #
|
245
|
+
# === determine_the_split_position
|
246
|
+
#
|
247
|
+
# This method must determine the split-position, also called the
|
248
|
+
# "index" position.
|
249
|
+
#
|
250
|
+
# Example string:
|
251
|
+
#
|
252
|
+
# - Name abc def. A: <one>DNA-Methylation</one>.
|
253
|
+
#
|
254
|
+
#
|
255
|
+
# ========================================================================= #
|
256
|
+
def determine_the_split_position(i = @line)
|
257
|
+
# ======================================================================= #
|
258
|
+
# Next, we must find the most important '?' token, then we can
|
259
|
+
# split on it. This is, by definition, the very last '?' that
|
260
|
+
# we can find, hence why we use .rindex() rather than .index().
|
261
|
+
# ======================================================================= #
|
262
|
+
if i.include?('?')
|
263
|
+
rindex = i.rindex('?')
|
264
|
+
# ===================================================================== #
|
265
|
+
# Some entries may have a '?' but also a 'A:' token. In this case,
|
266
|
+
# we have to change the index position. However had, we must be
|
267
|
+
# careful here, as a few answers will contain something like this
|
268
|
+
# here:
|
269
|
+
#
|
270
|
+
# '(1) A: Asymmetry (2) B: Border (3) C: Color (4) D: Diameter (5) E: Evolving'
|
271
|
+
#
|
272
|
+
# ===================================================================== #
|
273
|
+
if i.include?('?') and i.include?(' A: ') and
|
274
|
+
!(i =~ /\d{1}\) A: /) # The last one here is explained above.
|
275
|
+
rindex = i.index(' A: ')
|
276
|
+
end
|
277
|
+
set_split_position rindex
|
278
|
+
elsif i.include?(' A: ')
|
279
|
+
set_split_position i.index(' A: ')
|
280
|
+
else
|
281
|
+
e 'No ? and no A: was found. Please check the line.'
|
282
|
+
e tomato(i)
|
283
|
+
e
|
284
|
+
report_this_error
|
285
|
+
e
|
286
|
+
exit
|
287
|
+
end
|
288
|
+
end; alias determine_index_position determine_the_split_position # === determine_index_position
|
289
|
+
|
290
|
+
# ========================================================================= #
|
291
|
+
# === report_this_error
|
292
|
+
# ========================================================================= #
|
293
|
+
def report_this_error(error = nil)
|
294
|
+
opnn; e 'We encountered an '+swarn('error')+'. The @index_position '\
|
295
|
+
'was probably out of range.'
|
296
|
+
opnn; e 'Feedbacking @line next:'
|
297
|
+
pp @line
|
298
|
+
opnn; e "Feedbacking #{royalblue('@split_position')} next:"
|
299
|
+
pp @split_position
|
300
|
+
if error
|
301
|
+
pp error
|
302
|
+
pp error.class
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
# ========================================================================= #
|
307
|
+
# === set_split_position
|
308
|
+
# ========================================================================= #
|
309
|
+
def set_split_position(i)
|
310
|
+
@split_position = i
|
311
|
+
end; alias set_index_position set_split_position # === set_index_position
|
312
|
+
|
313
|
+
# ========================================================================= #
|
314
|
+
# === determine_the_question_from_the_line
|
315
|
+
# ========================================================================= #
|
316
|
+
def determine_the_question_from_the_line
|
317
|
+
set_question(@line[0 .. @split_position])
|
318
|
+
end
|
319
|
+
|
320
|
+
# ========================================================================= #
|
321
|
+
# === set_question
|
322
|
+
# ========================================================================= #
|
323
|
+
def set_question(i)
|
324
|
+
i = i.dup if i.frozen?
|
325
|
+
i.strip! # ← Always chop off trailing newlines.
|
326
|
+
i[-2,2] = '' if i.end_with? '?A'
|
327
|
+
i[0,2] = '' if i.start_with? '- ' # Chop off leading '-' components.
|
328
|
+
# ======================================================================= #
|
329
|
+
# A question typically will have a trailing '?', thus we ensure this
|
330
|
+
# by appending a question mark '?' - unless the string already ends
|
331
|
+
# with '?', '.' or a '!'.
|
332
|
+
# ======================================================================= #
|
333
|
+
unless i.rstrip.end_with?('?','.','!')
|
334
|
+
i << '?'
|
335
|
+
end
|
336
|
+
i[-3,3] = '' if i.end_with? ' A?'
|
337
|
+
if i.end_with? '! ?' # Preserve the ! here.
|
338
|
+
i[-2,2] = ''
|
339
|
+
end
|
340
|
+
# ======================================================================= #
|
341
|
+
# i[-2,2] = '' if i.end_with? 'A?'
|
342
|
+
# ^^^ The above check is not good because the question may end like:
|
343
|
+
# "T-DNA?". Perhaps we have to think of another way.
|
344
|
+
# ======================================================================= #
|
345
|
+
if i.end_with? '. ?' # This can not be correct - it must be a typo.
|
346
|
+
i[-2,2] = '' # Thus get rid of the last two entries.
|
347
|
+
end
|
348
|
+
if i.end_with? '.?','!?' # These two values can not be correct - it must thus be a typo.
|
349
|
+
i.chop! # Thus get rid of the last two entries.
|
350
|
+
end
|
351
|
+
# ======================================================================= #
|
352
|
+
# Next we will determine how many characters are in the given line.
|
353
|
+
# We need to exclude ANSII escape sequences, though, as they
|
354
|
+
# will not be shown on the commandline - they will be interpreted
|
355
|
+
# differently, such as displaying a red underline colour for the
|
356
|
+
# given text.
|
357
|
+
# ======================================================================= #
|
358
|
+
trimmed_sequence = remove_escape_sequences(
|
359
|
+
remove_tags_from_this_input(
|
360
|
+
i
|
361
|
+
)
|
362
|
+
)
|
363
|
+
n_characters_to_consider_in_the_line = trimmed_sequence.size
|
364
|
+
if n_characters_to_consider_in_the_line > @word_wrap_at
|
365
|
+
i = word_wrap(i, @word_wrap_at)
|
366
|
+
end
|
367
|
+
if @custom_colours and
|
368
|
+
@custom_colours.has_key?('colour_for_questions')
|
369
|
+
i = COLOURS.send(@custom_colours['colour_for_questions'], i)
|
370
|
+
else
|
371
|
+
# ===================================================================== #
|
372
|
+
# Use colours in this case. The hardcoded colour is olivedrab
|
373
|
+
# but since as of June 2018, we also allow custom colours.
|
374
|
+
# ===================================================================== #
|
375
|
+
i = olivedrab(i) # This used to be teal().
|
376
|
+
end
|
377
|
+
# ======================================================================= #
|
378
|
+
# === Handle entries that are between <u>foo</u> tags
|
379
|
+
# ======================================================================= #
|
380
|
+
if line_contains_underline_token?(i)
|
381
|
+
use_this_colour = grey('')
|
382
|
+
if @custom_colours and
|
383
|
+
@custom_colours.has_key?('colour_for_questions')
|
384
|
+
use_this_colour = COLOURS.send(@custom_colours['colour_for_questions']) { :omit_end }
|
385
|
+
end
|
386
|
+
# ===================================================================== #
|
387
|
+
# Colourize <ud> or <u> for underline next:
|
388
|
+
# ===================================================================== #
|
389
|
+
i = replace_underline_token_with_default_colour(i)+
|
390
|
+
use_this_colour
|
391
|
+
end
|
392
|
+
# ======================================================================= #
|
393
|
+
# === Handle entries that are between <i>foo</i> tags
|
394
|
+
# ======================================================================= #
|
395
|
+
if line_contains_italic_token?(i)
|
396
|
+
use_this_colour = grey('')
|
397
|
+
if @custom_colours and
|
398
|
+
@custom_colours.has_key?('colour_for_questions')
|
399
|
+
use_this_colour = COLOURS.send(@custom_colours['colour_for_questions']) { :omit_end }
|
400
|
+
end
|
401
|
+
# ===================================================================== #
|
402
|
+
# Colourize <i> for italic font-style next:
|
403
|
+
# ===================================================================== #
|
404
|
+
i = replace_italic_token_with_default_colour(i)+
|
405
|
+
use_this_colour
|
406
|
+
end
|
407
|
+
# ======================================================================= #
|
408
|
+
# === Handle entries that are between <b>foo</b> tags
|
409
|
+
# ======================================================================= #
|
410
|
+
if line_contains_bold_token?(i)
|
411
|
+
use_this_colour = grey('')
|
412
|
+
if @custom_colours and
|
413
|
+
@custom_colours.has_key?('colour_for_answers')
|
414
|
+
use_this_colour = COLOURS.send(@custom_colours['colour_for_questions']) { :omit_end }
|
415
|
+
end
|
416
|
+
# ===================================================================== #
|
417
|
+
# Colourize <b> for italic font-style next:
|
418
|
+
# ===================================================================== #
|
419
|
+
i = replace_bold_token_with_default_colour(i)+
|
420
|
+
use_this_colour
|
421
|
+
end
|
422
|
+
# ======================================================================= #
|
423
|
+
# Next, consider colourizing all questions that have at the least 2
|
424
|
+
# '"' characters. These will be colourized if a certain constant is
|
425
|
+
# set to true.
|
426
|
+
# ======================================================================= #
|
427
|
+
if EMPHASIZE_WORDS_IN_QUOTES_IN_A_GIVEN_QUESTION
|
428
|
+
if @use_colours and commandline? and (i.count('"') > 1)
|
429
|
+
use_this_regex = /"(.+?\s*.*?)"/ # See: https://rubular.com/r/6WK5NjMJld
|
430
|
+
# =================================================================== #
|
431
|
+
# Note that we have two possibilities to consider next:
|
432
|
+
#
|
433
|
+
# (a) the user has not specified any special colour that he/she
|
434
|
+
# prefers. In this case, we default to olivedrab as the colour.
|
435
|
+
# (b) the user has specified a colour to be used for exam-questions.
|
436
|
+
# In this case we will use that colour.
|
437
|
+
#
|
438
|
+
# =================================================================== #
|
439
|
+
if @custom_colours and @custom_colours.has_key?('colour_for_questions')
|
440
|
+
use_this_colour = ALL_COLOUR_METHODS.send(
|
441
|
+
@custom_colours['colour_for_questions']
|
442
|
+
) { :omit_end }
|
443
|
+
i.gsub!(use_this_regex,
|
444
|
+
'"'+forestgreen('\1'.delete(N))+ # forestgreen is the hardcoded colour to be used for now.
|
445
|
+
use_this_colour+'"'
|
446
|
+
)
|
447
|
+
else # else use the hardcoded olivedrab-colour.
|
448
|
+
i.gsub!(use_this_regex,
|
449
|
+
'"'+forestgreen('\1'.delete(N))+ # forestgreen is the hardcoded colour to be used for now.
|
450
|
+
COLOUR_OLIVEDRAB+'"'
|
451
|
+
)
|
452
|
+
end
|
453
|
+
end
|
454
|
+
end
|
455
|
+
@question = i
|
456
|
+
end
|
457
|
+
|
458
|
+
# ========================================================================= #
|
459
|
+
# === determine_the_question_and_the_answer
|
460
|
+
# ========================================================================= #
|
461
|
+
def determine_the_question_and_the_answer
|
462
|
+
determine_the_question_from_the_line
|
463
|
+
determine_the_answer_from_the_line
|
464
|
+
end
|
465
|
+
|
466
|
+
# ========================================================================= #
|
467
|
+
# === split_position?
|
468
|
+
# ========================================================================= #
|
469
|
+
def split_position?
|
470
|
+
@split_position
|
471
|
+
end
|
472
|
+
|
473
|
+
# ========================================================================= #
|
474
|
+
# === set_custom_colours
|
475
|
+
# ========================================================================= #
|
476
|
+
def set_custom_colours(i)
|
477
|
+
@custom_colours = i
|
478
|
+
end
|
479
|
+
|
480
|
+
# ========================================================================= #
|
481
|
+
# === determine_the_answer_from_the_line
|
482
|
+
# ========================================================================= #
|
483
|
+
def determine_the_answer_from_the_line
|
484
|
+
if @split_position.nil?
|
485
|
+
e crimson('Some error for this line:')
|
486
|
+
e steelblue(line?)
|
487
|
+
pp self
|
488
|
+
end
|
489
|
+
set_answer @line[(@split_position+1) .. -1]
|
490
|
+
end
|
491
|
+
|
492
|
+
# ========================================================================= #
|
493
|
+
# === line?
|
494
|
+
# ========================================================================= #
|
495
|
+
def line?
|
496
|
+
@line
|
497
|
+
end
|
498
|
+
|
499
|
+
# ========================================================================= #
|
500
|
+
# === run
|
501
|
+
# ========================================================================= #
|
502
|
+
def run
|
503
|
+
end
|
504
|
+
|
505
|
+
# ========================================================================= #
|
506
|
+
# === answer?
|
507
|
+
# ========================================================================= #
|
508
|
+
def answer?
|
509
|
+
@answer
|
510
|
+
end; alias answer answer? # === answer
|
511
|
+
alias last answer? # === last
|
512
|
+
|
513
|
+
# ========================================================================= #
|
514
|
+
# === question?
|
515
|
+
# ========================================================================= #
|
516
|
+
def question?
|
517
|
+
@question
|
518
|
+
end; alias question question? # === question
|
519
|
+
alias first question? # === first
|
520
|
+
|
521
|
+
# ========================================================================= #
|
522
|
+
# === set_answer
|
523
|
+
#
|
524
|
+
# This method will assign to @answer, but first it will do a LOT of
|
525
|
+
# parsing. Perhaps this should be factored out into a separate method,
|
526
|
+
# but for now it will remain as it is.
|
527
|
+
# ========================================================================= #
|
528
|
+
def set_answer(i)
|
529
|
+
# ======================================================================= #
|
530
|
+
# === include_numbers_in_parens
|
531
|
+
#
|
532
|
+
# The next variable keeps track as to whether we have numbers such
|
533
|
+
# as (2).
|
534
|
+
# ======================================================================= #
|
535
|
+
include_numbers_in_parens = false
|
536
|
+
# ======================================================================= #
|
537
|
+
# === Handle Array as input
|
538
|
+
#
|
539
|
+
# This can happen due to assign_url() returning an Array.
|
540
|
+
# ======================================================================= #
|
541
|
+
i = i.first if i.is_a? Array
|
542
|
+
i = i.to_s.dup # Work on non-frozen Strings past this point here.
|
543
|
+
i[0,2] = '' if i.start_with? '- '
|
544
|
+
if i.start_with? 'A: '
|
545
|
+
i[0, 3] = ''
|
546
|
+
end
|
547
|
+
i.strip! # This also implies .chomp.
|
548
|
+
# ======================================================================= #
|
549
|
+
# Try to cut down at about 76 characters per line, or whatever the
|
550
|
+
# limit-per-line is. We have to ignore special tags, though, such
|
551
|
+
# as <u> or <orange>. We also have to call this BEFORE replacing
|
552
|
+
# these tags with the corresponding escape values.
|
553
|
+
# ======================================================================= #
|
554
|
+
unless include_numbers_in_parens
|
555
|
+
string_without_tags = remove_tags_from_this_input(i.dup)
|
556
|
+
n_characters_to_consider_in_the_line = string_without_tags.size
|
557
|
+
if n_characters_to_consider_in_the_line > @word_wrap_at
|
558
|
+
i = word_wrap(i, @word_wrap_at) # word-wrap is a value such as 85.
|
559
|
+
i.gsub!(/\n/, N+LEFT_PADDING) if i.include? N # Also pad these newlines.
|
560
|
+
end
|
561
|
+
end
|
562
|
+
# ======================================================================= #
|
563
|
+
# Next, remove html-numbers such as <one> or HTML colours such as
|
564
|
+
# <royalblue>. Thus, we query whether the line contains a valid
|
565
|
+
# HTML colour too.
|
566
|
+
# ======================================================================= #
|
567
|
+
if use_colours? and
|
568
|
+
(::Colours.does_this_string_include_a_html_number?(i) or
|
569
|
+
::Colours.does_this_line_include_a_html_colour?(i))
|
570
|
+
use_this_as_replacement_hash = {
|
571
|
+
'one' => :steelblue,
|
572
|
+
'two' => :mediumseagreen,
|
573
|
+
'three' => :mediumpurple, # ← Used to be 'peru' up until 23.11.2019.
|
574
|
+
'four' => :olivedrab,
|
575
|
+
'five' => :lightgreen
|
576
|
+
}
|
577
|
+
i = ::Colours.away_with_html_colours_and_special_numbers(
|
578
|
+
i,
|
579
|
+
@custom_colours['colour_for_answers'],
|
580
|
+
use_this_as_replacement_hash
|
581
|
+
)
|
582
|
+
end
|
583
|
+
# ======================================================================= #
|
584
|
+
# === Get rid of ' A:' if they are in that string.
|
585
|
+
#
|
586
|
+
# At this point, we do no longer want to have 'A:' in our
|
587
|
+
# answer-string, so we get rid of it.
|
588
|
+
# ======================================================================= #
|
589
|
+
if i.include? ' A:'
|
590
|
+
i.sub!(/ A:/,'') unless i.include? ') A:' # The unless check exists to avoid rare cases.
|
591
|
+
end
|
592
|
+
if i.start_with? '?'
|
593
|
+
i.sub!(/^\?/,'') # Only chop it away at the beginning.
|
594
|
+
end
|
595
|
+
i[0,2] = '' if i.start_with? ': ','? ','?:'
|
596
|
+
i.strip! # Call .strip! again here, just in case.
|
597
|
+
# ======================================================================= #
|
598
|
+
# Assume () modifications. But this conflicts with entries that have
|
599
|
+
# a pure () as part of their answer, which may happen on computer
|
600
|
+
# related questions such as foobar(). Hence, on Dec 2014, I have
|
601
|
+
# disabled the next line.
|
602
|
+
# ======================================================================= #
|
603
|
+
# i.gsub!(/\(\)/, N+'- ') if i.include? '()'
|
604
|
+
# ======================================================================= #
|
605
|
+
if debug?
|
606
|
+
e "We will now set the answer to: #{sfancy(i)}" if commandline?
|
607
|
+
end
|
608
|
+
# ======================================================================= #
|
609
|
+
# Get rid of trailing [], just in case.
|
610
|
+
# ======================================================================= #
|
611
|
+
i[-2,2] = '' if i.end_with? '[]'
|
612
|
+
i[0,2] = '' if i.start_with? 'A:' # This here may be rare.
|
613
|
+
if i.include? '(a)' # Also assume (b) (c) etc..
|
614
|
+
i.gsub!(/\(a\)/, N+' (a)')
|
615
|
+
i.gsub!(/\(b\)/, N+' (b)') if i.include? '(b)'
|
616
|
+
i.gsub!(/\(c\)/, N+' (c)') if i.include? '(c)'
|
617
|
+
i.gsub!(/\(d\)/, N+' (d)') if i.include? '(d)'
|
618
|
+
i.gsub!(/\(e\)/, N+' (e)') if i.include? '(e)'
|
619
|
+
i.gsub!(/\(f\)/, N+' (f)') if i.include? '(f)'
|
620
|
+
end
|
621
|
+
# ======================================================================= #
|
622
|
+
# === Replace <br> tags, should they be part of the answer
|
623
|
+
# ======================================================================= #
|
624
|
+
i.gsub!(/<br>/, N) if i.include? '<br>'
|
625
|
+
# ======================================================================= #
|
626
|
+
# === Get rid of (2) and similar numbers
|
627
|
+
#
|
628
|
+
# We assume this to also include (1) and (3) and so forth here.
|
629
|
+
# ======================================================================= #
|
630
|
+
if i.include? '(2)'
|
631
|
+
include_numbers_in_parens = true
|
632
|
+
# ===================================================================== #
|
633
|
+
# Do a word wrap if the size range from the part up to the first
|
634
|
+
# '(' is larger than the allowed characters per line.
|
635
|
+
# Since as of August 2019 we will honour HTML colour-tags though
|
636
|
+
# and add that to the subrange size.
|
637
|
+
# ===================================================================== #
|
638
|
+
subrange = i[0 .. (i.index('(') - 1)].dup
|
639
|
+
subrange_size = subrange.size
|
640
|
+
if does_this_line_include_a_html_colour?(subrange)
|
641
|
+
subrange_size += return_this_line_has_n_characters_as_html_colour_tags(subrange)
|
642
|
+
end
|
643
|
+
if subrange_size > @word_wrap_at
|
644
|
+
i[0 .. (i.index('(')-1)] = ''.dup
|
645
|
+
subrange = word_wrap(subrange, @word_wrap_at).dup+N
|
646
|
+
i[0,0] = subrange
|
647
|
+
end
|
648
|
+
12.times { |iteration_number_n|
|
649
|
+
if @use_colours
|
650
|
+
# ================================================================= #
|
651
|
+
# Colourize the parens - and also add a leading newline.
|
652
|
+
# ================================================================= #
|
653
|
+
replace_with_this = N+
|
654
|
+
' '+
|
655
|
+
rev+
|
656
|
+
slategray('(')+
|
657
|
+
skyblue(iteration_number_n.to_s.chomp)+
|
658
|
+
slategray(')')
|
659
|
+
if use_colours? and
|
660
|
+
@custom_colours and
|
661
|
+
@custom_colours.has_key?('colour_for_answers')
|
662
|
+
use_this_colour = ::Colours.send(@custom_colours['colour_for_answers']) { :omit_end }
|
663
|
+
replace_with_this << use_this_colour
|
664
|
+
end
|
665
|
+
i.gsub!(/\(#{iteration_number_n}\)/,replace_with_this)
|
666
|
+
else
|
667
|
+
i.gsub!(/\(#{iteration_number_n}\)/,
|
668
|
+
N+'('+iteration_number_n.to_s+')') # Will add a leading newline.
|
669
|
+
end
|
670
|
+
} # The above is equivalent to the below, by the way:
|
671
|
+
# i.gsub!(/\(6\)/, N+'(6)')
|
672
|
+
end
|
673
|
+
# ======================================================================= #
|
674
|
+
# Colourize the answer as grey.
|
675
|
+
# ======================================================================= #
|
676
|
+
if @custom_colours and
|
677
|
+
@custom_colours.has_key?('colour_for_answers')
|
678
|
+
i = COLOURS.send(@custom_colours['colour_for_answers'], i)
|
679
|
+
else # else we will use grey as the colour.
|
680
|
+
i = grey(i)
|
681
|
+
end
|
682
|
+
# ======================================================================= #
|
683
|
+
# === Handle entries that are between <ud>foo</ud> tags
|
684
|
+
# ======================================================================= #
|
685
|
+
if line_contains_underline_token?(i)
|
686
|
+
use_this_colour = grey('')
|
687
|
+
if @custom_colours and
|
688
|
+
@custom_colours.has_key?('colour_for_answers')
|
689
|
+
use_this_colour = COLOURS.send(@custom_colours['colour_for_answers']) { :omit_end }
|
690
|
+
end
|
691
|
+
# ===================================================================== #
|
692
|
+
# Colourize <ud> for underline next:
|
693
|
+
# ===================================================================== #
|
694
|
+
i = replace_underline_token_with_default_colour(i)+
|
695
|
+
use_this_colour
|
696
|
+
end
|
697
|
+
# ======================================================================= #
|
698
|
+
# === Handle entries that are between <b>foo</b> tags
|
699
|
+
# ======================================================================= #
|
700
|
+
if line_contains_bold_token?(i)
|
701
|
+
use_this_colour = grey('')
|
702
|
+
if @custom_colours and
|
703
|
+
@custom_colours.has_key?('colour_for_answers')
|
704
|
+
use_this_colour = COLOURS.send(colour_for_answers?, '')
|
705
|
+
end
|
706
|
+
# ===================================================================== #
|
707
|
+
# Colourize <b> for italic font-style next:
|
708
|
+
# ===================================================================== #
|
709
|
+
i = replace_bold_token_with_default_colour(i)+
|
710
|
+
use_this_colour
|
711
|
+
end
|
712
|
+
# ======================================================================= #
|
713
|
+
# === Handle entries that are between <it>foo</it> tags
|
714
|
+
# ======================================================================= #
|
715
|
+
if line_contains_italic_token?(i)
|
716
|
+
use_this_colour = grey('')
|
717
|
+
if @custom_colours and
|
718
|
+
@custom_colours.has_key?('colour_for_answers')
|
719
|
+
use_this_colour = COLOURS.send(@custom_colours['colour_for_answers']) { :omit_end }
|
720
|
+
end
|
721
|
+
# ===================================================================== #
|
722
|
+
# Colourize <it> for italic font-style next:
|
723
|
+
# ===================================================================== #
|
724
|
+
i = replace_italic_token_with_default_colour(i)+
|
725
|
+
use_this_colour
|
726
|
+
end
|
727
|
+
# ======================================================================= #
|
728
|
+
# === Handle URLs next
|
729
|
+
# ======================================================================= #
|
730
|
+
if i.include? ' URL:' # This is the valid form.
|
731
|
+
i = assign_url(i)
|
732
|
+
# ======================================================================= #
|
733
|
+
# === Handle entries that include the substring ' https://'
|
734
|
+
# ======================================================================= #
|
735
|
+
elsif i.include? ' https://'
|
736
|
+
i = colourize_https_substring(i)
|
737
|
+
end
|
738
|
+
if i.include?(' URL:') or i.include?(' https://')
|
739
|
+
assign_url_or_colourize_https_substring(i)
|
740
|
+
end
|
741
|
+
# ======================================================================= #
|
742
|
+
# === Colourize words in quotes
|
743
|
+
#
|
744
|
+
# Next, consider colourizing all answers that have at the least 2
|
745
|
+
# '"' characters. These will be colourized.
|
746
|
+
# ======================================================================= #
|
747
|
+
if EMPHASIZE_WORDS_IN_QUOTES_IN_A_GIVEN_ANSWER
|
748
|
+
if @use_colours and commandline? and (i.count('"') > 1)
|
749
|
+
use_this_regex = /"(.+?\s*.*?)"/ # See: http://rubular.com/r/6WK5NjMJld
|
750
|
+
use_this_colour = GRAY
|
751
|
+
if @custom_colours and
|
752
|
+
@custom_colours.has_key?('colour_for_answers')
|
753
|
+
use_this_colour = ALL_COLOUR_METHODS.send(@custom_colours['colour_for_answers']) { :omit_end }
|
754
|
+
end
|
755
|
+
i.gsub!(
|
756
|
+
use_this_regex,
|
757
|
+
'"'+steelblue('\1'.delete(N))+
|
758
|
+
use_this_colour+'"'
|
759
|
+
)
|
760
|
+
end
|
761
|
+
end
|
762
|
+
@answer = i
|
763
|
+
end
|
764
|
+
|
765
|
+
# ========================================================================= #
|
766
|
+
# === set_line
|
767
|
+
#
|
768
|
+
# This method will assign to @line. A full @line is an exam-question
|
769
|
+
# containing a question, and the answer to this question.
|
770
|
+
# ========================================================================= #
|
771
|
+
def set_line(i)
|
772
|
+
if i
|
773
|
+
i = i.dup if i.frozen?
|
774
|
+
if i.start_with? '- '
|
775
|
+
i[0,2] = '' # Chop off leading '- ' tokens.
|
776
|
+
end
|
777
|
+
end
|
778
|
+
@line = i
|
779
|
+
if block_given?
|
780
|
+
case yield
|
781
|
+
# ===================================================================== #
|
782
|
+
# === :then_determine_the_split_position
|
783
|
+
# ===================================================================== #
|
784
|
+
when :then_determine_the_split_position
|
785
|
+
determine_the_split_position
|
786
|
+
end
|
787
|
+
end
|
788
|
+
end
|
789
|
+
|
790
|
+
# ========================================================================= #
|
791
|
+
# === Studium::Exams::QuestionAnswer[]
|
792
|
+
# ========================================================================= #
|
793
|
+
def self.[](i = '')
|
794
|
+
new(i)
|
795
|
+
end
|
796
|
+
|
797
|
+
end
|
798
|
+
|
799
|
+
# =========================================================================== #
|
800
|
+
# === Studium::Exams.question_answer
|
801
|
+
# =========================================================================== #
|
802
|
+
def self.question_answer(topic = 'random_topic')
|
803
|
+
QuestionAnswer.new(topic)
|
804
|
+
end
|
805
|
+
|
806
|
+
end
|
807
|
+
|
808
|
+
# =========================================================================== #
|
809
|
+
# === Studium.question_answer
|
810
|
+
# =========================================================================== #
|
811
|
+
def self.question_answer(i = ARGV)
|
812
|
+
Studium::Exams::QuestionAnswer.new(i)
|
813
|
+
end; self.instance_eval { alias parse_question_answer question_answer } # === Studium.parse_question_answer
|
814
|
+
|
815
|
+
# =========================================================================== #
|
816
|
+
# === Studium.return_question_answer_as_array
|
817
|
+
#
|
818
|
+
# This method will return the question-answer variant, as an Array.
|
819
|
+
#
|
820
|
+
# It will not make use of any colours; the reason for this is because
|
821
|
+
# the method was added at 13.04.2019 to be used primarily on the www.
|
822
|
+
#
|
823
|
+
# Invocation example:
|
824
|
+
#
|
825
|
+
# x = Studium.return_question_answer_as_array('amg1')
|
826
|
+
#
|
827
|
+
# =========================================================================== #
|
828
|
+
def self.return_question_answer_as_array(topic = 'random_topic')
|
829
|
+
_ = ::Studium::Exams::QuestionAnswer.new(topic) { :disable_colours }
|
830
|
+
[_.question?, _.answer?]
|
831
|
+
end
|
832
|
+
|
833
|
+
end
|
834
|
+
|
835
|
+
if __FILE__ == $PROGRAM_NAME
|
836
|
+
require 'colours/colours_e_autoinclude.rb'
|
837
|
+
require 'cliner'
|
838
|
+
dataset = Studium::Exams.question_answer(ARGV)
|
839
|
+
e dataset.question?
|
840
|
+
cliner
|
841
|
+
e dataset.answer?
|
842
|
+
end # rb question_answer.rb amg
|