Class: Studium::Commandline
- Inherits:
-
Base
- Object
- Base
- Studium::Commandline
show all
- Defined in:
- lib/studium/commandline/run.rb,
lib/studium/commandline/help.rb,
lib/studium/commandline/menu.rb,
lib/studium/commandline/misc.rb,
lib/studium/commandline/reset.rb,
lib/studium/commandline/constants.rb,
lib/studium/commandline/initialize.rb
Overview
Constant Summary
collapse
- NAMESPACE =
inspect
Constants inherited
from Base
Base::ARRAY_HTML_COLOURS_IN_USE, Base::CHECK_FOR_INCORRECT_ENTRIES_IN_THE_QUESTION_ANSWER_FILE_THAT_SHOULD_BE_COMMENTS, Base::COLOURS, Base::COMMON_YEAR_DAYS_IN_MONTH, Base::GRAY, Base::LEFT_PADDING, Base::N_CHARACTERS_PER_LINE, Base::UNICODE_RIGHT_ARROW
Constants included
from Colours
Studium::Colours::COLOURS
Class Method Summary
collapse
-
.[](i = '') ⇒ Object
# === Studium::Commandline[] ========================================================================= #.
Instance Method Summary
collapse
Methods inherited from Base
#add_proper_year_entry_to_this_line, #already_solved_this_lva_number?, #append_what_into, #available_topics_as_short_name, #average_grade, #bachelor_master_or_diploma, #base_dir?, #be_silent, #be_verbose?, #beautiful_url, #change_directory, #cheering_person, #cliner, #colour_for_ects_points, #colourize_percentage, #commandline_arguments?, #commandline_arguments_joined, #commandline_arguments_with_hyphens?, #convert_this_array_of_lectures_into_the_full_dataset, #copy, #cpruby, #create_directory, #create_file, #csv_file?, #current_month?, #datum?, #day_month_year, #debug?, #delete_file, #directory_of_the_exam_topics?, #directory_to_my_exam_topics, #directory_to_the_exam_topics?, #disable_colours, #disable_colours_globally, #do_not_be_verbose, #do_not_use_opn, #do_these_curricula_include_both_a_bachelor_and_a_master_curriculum?, #does_this_line_include_a_german_weekday?, #does_this_line_include_a_html_colour?, #e, #ecomment, #editor?, #ee, #enable_colours, #enable_colours_globally, #enable_debug, #encoding?, #english_to_german_weekday, #ensure_main_encoding, #ensure_that_the_log_directory_exists, #eparse, #erev, #esystem, #etomato, #exit_program, #expand_topic, #extract_dd_mm_yyyy, #file_lecture_information?, #file_read_with_proper_encoding, #filter_away_invalid_questions, #find_corresponding_exam_topic, #first_argument?, #first_non_hyphen_argument?, #from_curriculum_id_to_university, #german_date_notation, #german_weekday?, #german_weekdays?, #has_a_bachelor_curriculum?, #has_a_master_curriculum?, #has_this_exam_topic_been_solved?, #has_year_entry?, #hh_mm_ss_dd_mm_yyyy, #horizontal_bar?, #html_log_directory?, #is_a_master_lecture?, #is_a_weekday?, #is_connected_to_the_www?, #is_on_roebe?, #is_prüfungsimmanent?, #is_this_a_valid_html_colour?, #is_this_day_today?, #konsole_support?, #last_file?, #lectures_from_indi1, #lectures_from_indi2, #lectures_from_indi3, #lectures_from_indi4, #lectures_from_the_bachelor_genetik_curriculum, #lectures_from_the_individual_vektor_curricula, #load_yaml_dataset, #move_file, #n_days_difference_from_today_to_this_day, #no_ext_name, #no_file_at, #number_to_month, #obtain, #obtain_lectures_from_this_curriculum, #open_in_editor, #opnn, #path_to_exam_topic?, #read_dataset_from_a_curriculum_file, #read_in_exam_dataset_from_this_file, #read_this_file_with_default_encoding, #readlines_from_this_input_file, #register_sigint, #remove_empty_strings, #remove_escape_sequences, #remove_internal_comments, #remove_leading_comments, #remove_leading_weekday_names_from, #remove_newlines, #remove_tags_from_this_input, #rename_kde_konsole_tab, #rename_konsole_tab?, #replace_all_html_colours_in_this, #replace_bold_token_with_default_colour, #replace_italic_token_with_default_colour, #replace_italic_token_with_this_colour, #replace_regular_numbers_with_unicode_numbers, #replace_underline_token_with_default_colour, #replace_underline_token_with_this_colour, #return_all_bachelor_lectures, #return_all_exams_on_this_day, #return_all_numbers_from, #return_all_registered_curricula, #return_all_steop_lectures, #return_current_year, #return_dataset_for_this_topic, #return_dataset_from_this_curriculum_file, #return_dd_mm_yy_and_time_from, #return_directory_for, #return_ects_points_from_these_lectures, #return_either_grey_or_the_custom_colour_for_answers, #return_either_grey_or_the_custom_colour_for_questions, #return_file_for_this_curriculum, #return_german_name_for_this_english_month, #return_german_weekday_of?, #return_hh_mm_ss_from, #return_hour_from_this, #return_lectures_from_bachelor_vektor_curriculum, #return_lectures_with_at_the_least_one_upcoming_exam, #return_local_path_of_this_pwdstud, #return_lva_number_of_this_lecture, #return_month_fitting_to_this_input, #return_n_days_until_monday, #return_n_days_until_sunday, #return_n_exam_questions_in, #return_n_questions_were_answered_for_this_topic, #return_name_of_the_weekday, #return_name_of_this_curriculum, #return_name_of_this_curriculum_based_on_its_id_number, #return_opnn, #return_passed_courses, #return_pwd, #return_random_curriculum, #return_sanitized_dataset_from_the_file_lecture_information, #return_solved_lectures, #return_steop_lectures, #return_the_remote_homepage_url, #return_this_line_has_n_characters_as_html_colour_tags, #return_title_from_this_curriculum_file, #rev, #right_arrow?, #rinstall2, #roebe_exam_directory?, #ruby_src_dir_at_home?, #runmode?, #sanitize_this_topic, #sanitize_url, #select_lectures_with_this_key, #set_be_quiet, #set_be_verbose, #set_commandline_arguments, #set_commandline_mode, #set_runmode, #set_this_cd_alias_to, #set_www_mode, #sfancy, #shall_we_make_use_of_unicode_symbols?, #show_todays_date, #simp, #sort_these_lecture_names_by_time, #spacer, #swarn, #this_month_has_n_days?, #total_ects_points_passed, #translate_dd_mm_yyyy_to_weekday, #try_to_require_the_rcfiles, #turn_this_array_into_the_full_dataset, #unicode_blocks_line, #use_colours?, #use_opn?, #vertical_bar?, #web_liner, #weekday?, #weekdays?, #word_wrap, #write_what_into, #www_connection_is_unavailable, #www_mode?, #yaml_dir?
Methods included from Colours
#bold_blue, #bold_red, #bold_yellow, #cadetblue, #chartreuse, crimson, #darkgray, darkgreen, darkseagreen, deepskyblue, #deepskyblue, default_colour, #dimgray, disable_colours, #dodgerblue, e, #efancy, enable_colours, #ewarn, #forestgreen, gold, #grey, lightblue, lightgreen, #lightslategray, #lightsteelblue, #mediumorchid, #mediumseagreen, #oldlace, #olivedrab, orange, orangered, #orchid, palevioletred, #papayawhip, rev, royalblue, sdir, #sdir, sfancy, #sfancy, sfile, #sfile, simp, #simp, slateblue, steelblue, #steelblue, #swarn, swarn, #teal, turquoise, use_colours?, use_this_colour_for_exam_answers, use_this_colour_for_exam_questions, #yellow
Constructor Details
#initialize(i = ARGV, run_already = true) ⇒ Commandline
18
19
20
21
22
23
24
25
26
|
# File 'lib/studium/commandline/initialize.rb', line 18
def initialize(
i = ARGV,
run_already = true
)
reset
set_commandline_arguments(i)
parse_commandline_arguments_as_a_full_string
run if run_already
end
|
Class Method Details
.[](i = '') ⇒ Object
#
Studium::Commandline[]
#
720
721
722
|
# File 'lib/studium/commandline/misc.rb', line 720
def self.[](i = '')
new(i)
end
|
Instance Method Details
#add_new_exam_question ⇒ Object
#
add_new_exam_question
#
244
245
246
247
|
# File 'lib/studium/commandline/misc.rb', line 244
def add_new_exam_question
require 'studium/exams/add_exam_question.rb'
Studium::Exams::AddExamQuestion.new
end
|
#create_an_archive_of_the_exam_questions ⇒ Object
#
create_an_archive_of_the_exam_questions
#
#create_an_executable_on_windows(on_this_file = '/home/x/programming/ruby/src/studium/lib/studium/gui/libui/ask_exam_question.rb', name_of_the_output_exe = 'ask_exam_question.exe') ⇒ Object
#
create_an_executable_on_windows
To invoke this method do:
studium --create-executable
#
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/studium/commandline/misc.rb', line 42
def create_an_executable_on_windows(
on_this_file =
'/home/x/programming/ruby/src/studium/lib/studium/gui/libui/ask_exam_question.rb',
name_of_the_output_exe = 'ask_exam_question.exe'
)
_ = 'ocra '+on_this_file+' '\
'--dll ruby_builtin_dlls/libssp-0.dll '\
'--dll ruby_builtin_dlls/libgmp-10.dll '\
'--dll ruby_builtin_dlls/libffi-7.dll '\
'--gem-all=fiddle '\
'--output '+name_of_the_output_exe
esystem _
end
|
#curriculum_comparer ⇒ Object
#do_show_the_average_grade_of_all_passed_exams ⇒ Object
#
do_show_the_average_grade_of_all_passed_exams
#
580
581
582
583
584
585
586
|
# File 'lib/studium/commandline/misc.rb', line 580
def do_show_the_average_grade_of_all_passed_exams
require 'studium/toplevel_methods/average_grade.rb'
e 'The average grade of all passed exams is '+
sfancy(
Studium.average_grade(:default, round_to: 2 )
)+'.'
end
|
#do_show_the_inscription_dates_at_the_different_universities ⇒ Object
#
do_show_the_inscription_dates_at_the_different_universities
#
591
592
593
594
595
596
597
598
599
600
601
602
603
604
|
# File 'lib/studium/commandline/misc.rb', line 591
def do_show_the_inscription_dates_at_the_different_universities
_ = YAML.load_file(Studium.project_yaml_dir?+'inscription_dates_of_universities.yml')
e
_.each_pair {|key, value|
if value.is_a? Array
value = value.first
end
university = key.ljust(40)
e " "\
"#{royalblue(university)} "\
"#{steelblue(value)}"
}
e
end
|
#lectures_without_exam_entry ⇒ Object
#
lectures_without_exam_entry
#
137
138
139
140
|
# File 'lib/studium/commandline/misc.rb', line 137
def lectures_without_exam_entry
require 'studium/exams/lectures_without_exam_entry.rb'
::Studium::Exams::LecturesWithoutExamEntry.new
end
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
|
# File 'lib/studium/commandline/menu.rb', line 19
def (
i = commandline_arguments?
)
if i.is_a? Array
i.each {|entry| (entry) }
else
case i when /^-?-?ects(-|_| )?per(-|_| )?university$/i,
/^-?-?per(-|_| )?university$/i,
/^-?-?per(-|_| )?uni$/i
require 'studium/ects/ects_per_university.rb'
Studium::EctsPerUniversity.new
when /^-?-?passed(-|_| )?exams\??$/i,
/^-?-?all(-|_| )?passed(-|_| )?exams\??$/i,
/^-?-?return(-|_| )?passed(-|_| )?exams\??$/i,
/^-?-?total(-|_| )?ECTS\??$/i
show_passed_exams
when /^-?-?current(-|_| )?studyset\??$/i
show_the_current_studyset
when /^-?-?last(_|-)?questions$/i
require 'studium/logging/store_last_question_asked_into_file.rb'
_ = Studium::Log::StoreLastQuestionAskedIntoFile.new {
:do_not_run_yet
}.return_path_to_the_file_all_exam_questions_asked
e File.read(_)
when /^-?-?create(_|-)?database$/i,
/^-?-?database$/i,
/^-?-?sql$/i
Dir.chdir(Studium.log_directory?) if File.directory?(Studium.log_directory?)
require 'studium/utility_scripts/create_database/create_database.rb'
Studium::CreateDatabase.new
if File.exist? 'INSERT_INTO_STATEMENTS.sql'
File.delete('exam_questions.db') if File.exist? 'exam_questions.db'
esystem 'sqlite3 exam_questions.db < INSERT_INTO_STATEMENTS.sql'
else
e 'No file exists called '+sfile(INSERT_INTO_STATEMENTS.sql)+'.'
end
when /(_|-)?(_|-)?log(_|-)?dir\??/i
e
e " #{sfile(Studium.log_directory?)}"
e
when /^-?-?max(_|-)?per(_|-)?topic\??$/i,
/^-?-?max(_|-)?exams(_|-)?answered(_|-)?per(_|-)?topic\??$/i,
/^-?-?max(_|-)?each$/i
show_max_exam_questions_answered_per_topic
when /-?-?start(_|-)?a(_|-)?new(_|-)?exam(_|-)?day$/i,
/-?-?clear(_|-)?last(_|-)?questions$/i,
/^-?-?clear(_|-)?old(_|-)?file$/i,
/^-?-?clear(_|-)?file$/i
start_a_new_exam_day
exit
when /-?-?libui$/i
require 'studium/gui/libui/ask_exam_question/ask_exam_question.rb'
Studium::GUI::Libui::AskExamQuestion.new
exit
when /-?-?gtk3?$/i,
/-?-?gui$/i
require 'studium/gui/gtk3/exam_question_widget/exam_question_widget.rb'
Studium::GUI::Gtk::ExamQuestionWidget.run(ARGV)
exit
when /-?-?create(_|-)?executable$/i,
/-?-?executable$/i
create_an_executable_on_windows
exit
when /-?-?exam(_|-)?stats$/,
/-?-?exam(_|-)?statistics/,
/^-?-?statistics\??$/i,
/^-?-?statistik\??$/i,
/^-?-?stats$/i
require 'studium/statistics/show_exam_statistics.rb'
Studium.show_exam_statistics
if Studium.is_on_roebe?
require 'studium/toplevel_methods/report.rb'
Studium::Exams.report_how_many_exam_questions_were_already_solved
end
exit
when /^-?-?max(-|_| )?ever\??$/,
/^-?-?max(-|_| )?answers\??$/,
/^-?-?max(-|_| )?stats\??$/,
/^-?-?max(-|_| )?statistics\??$/,
/^-?-?max(-|_| )?questions(-|_| )?answered\??$/, /^-?-?daily$/i,
/^-?-?daily(-|_| )?changes\??$/
show_maximum_amount_of_questions_ever_answered
exit
when /^-?-?generate(-|_| )?pdf(-|_| )?for=(.+)$/i, /^-?-?make(-|_| )?pdf(-|_| )?for=(.+)$/i, /^-?-?pdf(-|_| )?for-?=(.+)$/i, /^-?-?pdf=(.+)$/i require 'studium/pdf/create_pdf_file_for_this_exam_topic.rb'
this_topic = $1.to_s.dup if $1
this_topic = $2.to_s.dup if $2
this_topic = $3.to_s.dup if $3
::Studium.create_pdf_file_for_this_exam_topic(this_topic) when /^-?-?open(-|_| )?the(-|_| )?statistics$/,
/^-?-?open(-|_| )?the(-|_| )?statistics(-|_| )?file$/,
/^-?-?open(-|_| )?statistics$/,
/^-?-?open(-|_| )?stats$/
open_the_statistics_file
exit
when /^-?-?n(_|-)?entries(_|-)?in(_|-)?the(_|-)?file(_|-)?lecture(_|-)?information\??$/i,
/^-?-?n(_|-)?entries\??$/i,
/^-?-?n(_|-)?lectures\??$/i,
/^-?-?n(_|-)?lectures(_|-)?registered$/i,
/^-?-?n(_|-)?registered(_|-)?lectures$/i,
/^-?-?n(_|-)?registered$/i,
/^-?-?n(_|-)?courses$/i
require 'studium/toplevel_methods/report_n_entries_in_the_file_lecture_information.rb'
Studium.report_n_entries_in_the_file_lecture_information
when /^-?-?update(-|_| )?max(-|_| )?ever$/i,
/^-?-?update$/i,
/^-?-?update(-|_| )?statistics$/i,
/^-?-?record$/i,
/^-?-?save$/i,
/^-?-?update(-|_| )?examstats$/i verbose_update_max_ever
exit
when /^-?-?update(-|_| )?max(-|_| )?questions$/
require 'studium/statistics/report_how_many_exam_questions_were_answered.rb'
Studium::Statistics::ReportHowManyExamQuestionsWereAnswered.new
exit
when /^-?-?solved(_|-)?topics\??$/
require 'studium/toplevel_methods/return_n_percent_solved_from_this_topic.rb'
e 'The solved exam-topics are as follows:'
e
::Studium.available_topics_as_short_names.each {|this_topic|
case ::Studium.return_n_percent_solved_from_this_topic(this_topic)
when 100.0
puts 'The topic '+this_topic+' has been solved.'
end
}
e
exit
when /^-?-?solved$/
require 'studium/exams/exams.rb'
_ = Studium::Exams::Solved.new(ARGV, :dont_run_yet)
_.set_commandline
_.run
when /^-?-?nsolved$/
report_how_many_exam_questions_were_already_solved
when /-?-?solved\?? (\d+)/,
/-?-?already(_|-)?solved(_|-)?this(_|-)?id (\d+)/
the_lva_number = $1.to_s.dup
the_lva_number = $4.to_s.dup if $4
yes_or_no = Studium.yes_or_no(
Studium.already_solved_this_lva_number?(the_lva_number).to_s
)
e 'Did we solve this lecture (ID: '+simp(the_lva_number)+') yet? '+
sfancy(yes_or_no)
when /^-?-?mandatory$/i
show_upcoming_mandatory_presence_courses
exit
when /^-?-?create(-|_| )?a(-|_| )?clean(-|_| )?lecture(-|_| )?information(-|_| )?file$/i
Studium.create_a_clean_lecture_information_file
exit
when /-?-?upload(_|-)?exam(_|-)?questions/,
/-?-?upload(_|-)?exams/,
/-?-?uexams/
Studium.upload_exam_questions { :be_verbose }
when /^-?-?compare$/
curriculum_comparer
when /^-?-?download(_|-)?exam(_|-)?dataset$/i,
/^-?-?download(_|-)?dataset$/i
::Studium.download_exam_dataset
when /^-?-?use(-|_| )?this(-|_| )?colour(-|_| )?for(-|_| )?exam(-|_| )?answers=(.+)/i,
/^-?-?use(-|_| )?this(-|_| )?colour(-|_| )?for(-|_| )?answers=(.+)/i,
/^-?-?colour(-|_| )?for(-|_| )?answers=(.+)/i
_ = $3
_ = $5 if $5
_ = $6 if $6
::Studium::Colours.use_this_colour_for_exam_answers(_.to_s.dup)
when /^-?-?lectures(_|-)?on(_|-)?this(_|-)?day(_|-)?=(.+)$/,
/^(\d{2}.\d{2}.\d{4})$/
require 'studium/curricula/determine_curricula/determine_curricula.rb'
first_match_to_the_regex = $1.to_s.dup
i = $5.to_s.dup
if first_match_to_the_regex =~ /^\d+/
i = first_match_to_the_regex
end
Studium.show_lectures_on_this_day(i)
when /^-?-?master(=|-)(.+)$/
require 'studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb'
this_curriculum = "master-#{$2.to_s.dup}"
Studium::ShowLecturesOnTheCommandline.new(this_curriculum)
when /set(_|-)?directory(_|-)?to(_|-)?the(_|-)?exam(_|-)?topics=(.+)/
match = $6.to_s.dup
verbose_set_this_dir_to_exam_topics(match)
when /set(_|-)?dir=(.+)/
match = $2.to_s.dup
verbose_set_this_dir_to_exam_topics(match)
when /^-?-?pristine$/,
/^-?-?new(_|-)?lecture(_|-)?information$/
pristine
when /-?-?collage\??$/
show_collage_of_current_exams
exit
when /^-?-?passed(_|-)?exams=(.+)/i,
/^-?-?report(_|-)?passed(_|-)?exams(_|-)?fitting(_|-)?to(_|-)?this(_|-)?theme=(.+)/i
this_theme = $2.to_s.dup
this_theme = $7.to_s.dup if $7
report_passed_exams_fitting_to_this_theme(this_theme)
when /^-?-?outdated$/
show_outdated_lva_dates
when /^-?-?upload(-|_| )?archive(-|_| )?of(-|_| )?the(-|_| )?exam(-|_| )?questions$/,
/^-?-?upload(-|_| )?exam(-|_| )?archive$/,
/^-?-?upload(-|_| )?exam(-|_| )?topics$/
upload_archive_of_the_exam_questions
when /^-?-?encoding=(.+)$/i
Studium.use_this_new_encoding($1.to_s.dup)
exit
when /^-?-?lectures(_|-)?without(_|-)?exam(_|-)?entry$/i
lectures_without_exam_entry
when /^-?-?use(-|_| )?this(-|_| )?colour(-|_| )?for(-|_| )?exam(-|_| )?questions=(.+)/i,
/^-?-?use(-|_| )?this(-|_| )?colour(-|_| )?for(-|_| )?questions=(.+)/i,
/^-?-?colour(-|_| )?for(-|_| )?questions=(.+)/i
_ = $3
_ = $5 if $5
_ = $6 if $6
::Studium::Colours.use_this_colour_for_exam_questions(_.to_s.dup)
when /^-?-?merge$/i
copy_lecture_information_file_to_default_location
when /^-?-?open(-|_| )?upcoming(-|_| )?exams$/i,
/^-?-?open(-|_| )?important$/i
open_relevant_files
when /^-?-?open(-|_| )?important(-|_| )?exams$/i,
/^-?-?important(-|_| )?exams$/i,
/^-?-?important$/i,
/^-?-?priorities$/i,
/^-?-?priority$/i,
/^-?-?open(-|_| )?important(-|_| )?lectures$/i verbose_open_important_exams
when /^-?-?create(-|_| )?an(-|_| )?archive(-|_| )?of(-|_| )?the(-|_| )?exam(-|_| )?questions$/i,
/^-?-?create(-|_| )?exam(-|_| )?topics(-|_| )?archive$/i
create_an_archive_of_the_exam_questions
when /-?-?upcoming(-|_| )?important(-|_| )?exams/,
/-?-?upcoming(-|_| )?exams/
upcoming_important_exams
when /^-?-?end$/i,
/^-?-?end(-|_| )?difference$/i
report_the_difference_to_the_start_time
when /^-?-?upload(-|_| )?pdf$/i
upload_pdf
when /^-?-?vim$/i
permanently_set_this_editor(:vim)
when /help$/i,
/-h$/i
show_help
when /^-?-?show(_|-)?lva(_|-)?dates(_|-)?of(_|-)?this(_|-)?lecture=(.+)/i
this_theme = $6.to_s.dup.delete('"')
show_lva_dates_of_this_lecture(this_theme)
when /-?-?colours\??/
e ::Colours.rev+
'Does the Studium project use colours, right now? '+
sfancy(Studium.yes_or_no(Studium.use_colours?.to_s))
when /^-?-?add(-|_| )?a(-|_| )?new(-|_| )?question$/i
add_new_exam_question
when /set(_|-)?delay=(.+)/ ::Studium.save_this_delay_between_questions_and_answers($2.to_s.dup)
when /-?-?set(_|-)?log(_|-)?dir=(.+)/
match = $3.to_s.dup
verbose_set_this_new_log_dir(match)
when /^-?-?last(_|-)?question\??$/i
require 'studium/constants/last_question_asked.rb'
_ = Studium.file_last_question_asked?
if File.exist? _
e File.read(_)
else
no_file_exists_at(_)
end
when /^-?-?expand(-|_| )?time(-|_| )?range=(.+)$/,
/^-?-?expander=(.+)$/
_ = $1.to_s.dup
_ = $3.to_s.dup if $3
unless Studium.respond_to? :expand_time_range
require 'studium/utility_scripts/expand_time_range.rb'
end
Studium.expand_time_range(_)
when /^-?-?generate(_|-)?spreadsheet(_|-)?for=(.+)$/i, /^-?-?xls(_|-)?for=(.+)$/i require 'studium/utility_scripts/generate_spreadsheet.rb'
_ = $2.to_s.dup
_ = $3.to_s.dup if $3
Studium::GenerateSpreadsheet.new(_)
when /^-?-?use(_|-)?this(_|-)?curriculum=(.+)$/i
require 'studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb'
_ = $3.to_s.dup
if File.exist? _
object = Studium::ShowLecturesOnTheCommandline.new { :do_not_run_yet }
dataset = File.readlines(_).reject {|line|
line.start_with?('#') or line.strip.empty?
}.map {|entry|
if entry.include?('#')
entry = entry[0 .. (entry.index('#')-1)]
end
entry.strip.squeeze(' ')
}
object.clear_old_dataset
object.add_to_the_dataset_without_any_further_checks(dataset)
object.sanitize_the_dataset
object.uniq_the_dataset
object.is_not_an_individual_curriculum
object.do_all_actions_after_the_main_dataset_was_read_in
else
e 'No file exists at '+sfile(_)+'.'
end
when /important(_|-)?exams\.?yml$/
target = ruby_src_dir_at_home?+'studium/lib/studium/yaml/important_exams.yml'
e sfile(target)
open_in_editor(target)
when /^-?-?version\??$/i
require 'studium/version/version.rb'
e sfancy(
Studium.return_version_and_last_update
)
when /^-?-?open(-|_| )?top$/i,
/^-?-?open(-|_| )?last$/i
require 'studium/exams/show_backlog_of_exams.rb'
Studium::ShowBacklogOfExams.open_the_main_file
when /^-?-?show(_|-)?(english)(_|-)?lectures$/,
/^-?-?show(_|-)?(german)(_|-)?lectures$/
require 'studium/utility_scripts/show_lectures_fitting_to_this_language.rb'
seek_lectures_for_this_language = $2.to_s.dup
ShowLecturesFittingToThisLanguage.new(seek_lectures_for_this_language)
when /^-?-?files\??$/i,
/^-?-?show(_|-)?important(_|-)?files\??$/i
require 'studium/toplevel_methods/show_important_files.rb'
::Studium.show_important_files
when /-?-?exam(_|-)?topics\??/
show_where_the_exam_topics_can_be_found
when /^-?-?statistics\??$/i,
/^-?-?stats\??$/i
require 'studium/curricula/determine_curricula/determine_curricula.rb'
Studium.determine_curricula
when /^-?-?n(_|-)?topics(_|-)?available\??/,
/^-?-?n-?topics\??/
show_how_many_exam_topics_are_available
when /^-?-?topics\??$/i
show_available_topics
when /^-?-?path(-|_| )?to(-|_| )?file(-|_| )?lecture(-|_| )?information$/i
show_path_to_the_file_lecture_information
when /-?-?open(-|_| )?timetable$/i
open_timetable
exit
when /upcoming_?exams_?at_?the_?boku/
show_upcoming_exams_at_the_boku
when /^-?-?show(_|-)?collage(_|-)?of(_|-)?current(_|-)?exams$/i
show_collage_of_current_exams
when /^-?-?open$/i
open_useful_files_via_the_default_editor
exit
when /^-?-?base(_|-)?dir\??/,
/^-?-?dir\??$/
show_the_base_dir
when /^-?-?ects(_|-)?bachelor(_|-)?master$/,
/^-?-?bachelor(_|-)?master$/,
/^-?-?bm$/ show_passed_ects_in_the_individual_bachelor_and_master_curricula
when /-?-?check(-|_| )?the(-|_| )?lecture(-|_| )?information(-|_| )?file$/,
/-?-?check(-|_| )?file(-|_| )?information$/
check_the_lecture_information_file
when /(-|_| )?(-|_| )?exams(-|_| )?at(-|_| )?the(-|_| )?(.+)$/
this_university = $6.to_s.dup.downcase
show_all_exams_at_this_university(this_university)
when /^-?-?best-month$/,
/^-?-?best(_|-)?month(_|-)?stats$/,
/^-?-?show(_|-)?best(_|-)?months?$/,
/^-?-?best(_|-)?months?$/
show_best_month
exit
when /-?-?max\??$/,
/-?-?show(_|-)?how(_|-)?many(_|-)?exams(_|-)?were(_|-)?passed$/,
/^-?-?top$/i show_how_many_exams_were_passed
exit
when /^-?-?n(-|_| )?ects(-|_| )?from(-|_| )?this(-|_| )?file=(.+)$/i, /^-?-?ects(-|_| )?from=(.+)$/i _ = $2.to_s.dup if $2
_ = $5.to_s.dup if $5
show_n_ects_from_this_file(_)
when /^-?-?audio/
require 'studium/utility_scripts/audio_stats.rb'
Studium.audio_stats?
when /^-?-?sinatra$/
start_the_sinatra_interface
exit
when /^-?-?backlog(-|_| )?of(-|_| )?exams$/i
show_backlog_of_exams
when /^-?-?bachelor(-|_| )?curricula$/i,
/^-?-?bachelor$/i
show_passed_lectures_in_a_bachelor_curriculum
exit
when /^-?-?disable(_|-)?colours$/i,
/^-?-?permanently(_|-)?disable(_|-)?colours$/i
permanently_disable_colours
when /^-?-?average(-|_| )?grade$/i
do_show_the_average_grade_of_all_passed_exams
when /^-?-?passed(-|_| )?ects(-|_| )?per(-|_| )?year$/i
show_passed_ects_per_year
when /^-?-?inskriptionsfrist$/i
do_show_the_inscription_dates_at_the_different_universities
when /^-?-?master(-|_| )?curricula$/i,
/^-?-?master$/i
show_passed_lectures_in_a_master_curriculum
exit
when /^-?-?timetable$/
show_timetable
exit
when /^-?-?set(-|_| )?editor=(.+)$/i
permanently_set_this_editor($2.to_s.dup)
when /^-?-?start$/i
note_down_the_start_time_and_how_many_exams_have_been_already_solved
when /^-?-?curricula$/i,
/^-?-?show(-|_| )?curricula$/i
show_curricula
when /^-?-?bachelor(=|-)(.+)$/
require 'studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb'
this_curriculum = "bachelor-#{$2.to_s.dup}"
Studium::ShowLecturesOnTheCommandline.new(this_curriculum)
when /^-?-?questions(_|-)?per(_|-)?year$/
show_questions_per_year
when /^-?-?passed(_|-)?ects\??$/i,
/^-?-?overview$/i,
/^-?-?performance$/i show_passed_credits_per_curriculum
when /^-?-?universities$/i,
/^-?-?show(_|-)?ects(_|-)?passed(_|-)?per(_|-)?university$/i
show_ects_passed_per_university
exit
when /^-?-?yearly(_|-)?average(_|-)?grades$/,
/^-?-?grades$/i
show_yearly_average_grades
exit
when /^-?-?editor\??$/i
e sfancy(Studium.editor?)
when /^-?-?delay\?/ require 'studium/toplevel_methods/read_delay_between_questions_from_file.rb'
e rev+
'The delay is '+lightgreen(
Studium::Exams.read_delay_from_file.to_s
)+
' seconds between individual question-answer sessions.'
else if i.start_with?('/') and i.end_with?('/')
e "A pseudo-regex was discovered (#{sfancy(i)}). We "\
"will next query for any"
e 'exam matching to that regex.'
e
use_this_regexp = Regexp.new(i.delete('/'), Regexp::IGNORECASE) Studium.try_to_report_exams_that_match_to_this_regexp(use_this_regexp) { :also_show_the_grade }
elsif ARRAY_LECTURE_TYPES_THAT_ARE_MANDATORY_CONTINUOUS_ASSESSMENT.include?(i.delete('-')) or
(i.delete('-') == 'VO')
Studium.report_all_lectures_matching_this_lecture_type(i.delete('-'))
elsif i.include?('--')
e 'Unrecognized commandline instruction: '+
steelblue(i)
end
end
end
end
|
#note_down_the_start_time_and_how_many_exams_have_been_already_solved ⇒ Object
#
note_down_the_start_time_and_how_many_exams_have_been_already_solved
#
#open_relevant_files ⇒ Object
161
162
163
|
# File 'lib/studium/commandline/misc.rb', line 161
def open_relevant_files
Studium::Exams::UpcomingImportantExams.open_relevant_files
end
|
#open_the_statistics_file ⇒ Object
#
open_the_statistics_file
#
299
300
301
302
303
304
305
306
307
308
|
# File 'lib/studium/commandline/misc.rb', line 299
def open_the_statistics_file
e
cmd = "bluefish #{Studium.file_statistics} &"
if Studium.is_on_roebe?
cmd = "bluefish $RUBY_SRC/studium/lib/studium/yaml/statistics.yml &"
end
e cmd
e
system cmd
end
|
#
To invoke this method, do:
studium --open-timetable
#
370
371
372
373
|
# File 'lib/studium/commandline/misc.rb', line 370
def open_timetable
_ = FILE_EXAMS_AT_NON_BOKU_UNIVERSITIES
Open.in_editor(_) if File.exist? _
end
|
#open_useful_files_via_the_default_editor ⇒ Object
#
open_useful_files_via_the_default_editor
Invoke this method like so:
studium --open
#
#parse_commandline_arguments_as_a_full_string ⇒ Object
#
parse_commandline_arguments_as_a_full_string
This method will act on the whole ARGV, as a String rather than an Array.
#
227
228
229
230
231
232
233
234
235
236
237
238
239
|
# File 'lib/studium/commandline/misc.rb', line 227
def parse_commandline_arguments_as_a_full_string
_ = return_commandline_arguments_as_string
case _
when /-?-?last-?exams (\d+)/
_ = $1.to_s.dup.to_i
require 'studium/exams/last_exams/last_exams.rb'
Studium.show_n_last_exams(_) exit
end
end
|
#permanently_disable_colours ⇒ Object
#
permanently_disable_colours
To invoke this method, try:
studium --permanently-disable-colours
#
535
536
537
538
539
540
541
542
543
|
# File 'lib/studium/commandline/misc.rb', line 535
def permanently_disable_colours
opnn; e 'The colours in the Studium namespace will be '\
'permanently disabled.'
into = Studium.yaml_directory?+'use_colours.yml'
if File.exist? into
opnn; e "Storing into the file #{sfile(into)} next."
write_what_into(YAML.dump(false), into)
end
end
|
#permanently_set_this_editor(i = :vim) ⇒ Object
#
permanently_set_this_editor
#
#report_how_many_exam_questions_were_already_solved ⇒ Object
#
report_how_many_exam_questions_were_already_solved
#
#report_passed_exams_fitting_to_this_theme(this_theme) ⇒ Object
#
report_passed_exams_fitting_to_this_theme
#
#report_the_difference_to_the_start_time ⇒ Object
#
report_the_difference_to_the_start_time
#
#reset ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/studium/commandline/reset.rb', line 16
def reset
super()
@namespace = NAMESPACE
end
|
#run ⇒ Object
16
17
18
|
# File 'lib/studium/commandline/run.rb', line 16
def run
end
|
#show_all_exams_at_this_university(this_university) ⇒ Object
#
show_all_exams_at_this_university
To invoke this method, try:
studium --exams-at-the-meduni
#
454
455
456
457
|
# File 'lib/studium/commandline/misc.rb', line 454
def show_all_exams_at_this_university(this_university)
require 'studium/utility_scripts/finished_exams_at_this_university.rb'
Studium::FinishedExamsAtThisUniversity.new(this_university)
end
|
#show_available_topics ⇒ Object
#
show_available_topics
Invocation example:
studium --topics?
#
342
343
344
345
346
347
348
349
350
351
|
# File 'lib/studium/commandline/misc.rb', line 342
def show_available_topics
require 'studium/toplevel_methods/available_topics.rb'
e
Studium.available_topics?.sort.each_with_index {|entry, index| index += 1
padded_index = (' '+index.to_s+')').ljust(7)
e royalblue(padded_index)+
steelblue(entry)
}
e
end
|
#show_backlog_of_exams ⇒ Object
#
show_backlog_of_exams
#
492
493
494
495
|
# File 'lib/studium/commandline/misc.rb', line 492
def show_backlog_of_exams
require 'studium/exams/show_backlog_of_exams.rb'
Studium::ShowBacklogOfExams.new
end
|
#show_best_month(i = 10) ⇒ Object
#
show_best_month
To invoke this, try:
studium --show-best-month
#
467
468
469
470
471
472
|
# File 'lib/studium/commandline/misc.rb', line 467
def show_best_month(i = 10)
require 'studium/exams/exams_per_month/exams_per_month.rb'
_ = Studium::ExamsPerMonth.new(:do_not_run_yet)
_.sanitize_dataset
_.show_best_months(i)
end
|
#show_collage_of_current_exams ⇒ Object
#
show_collage_of_current_exams
Invoke this method via:
studium --collage?
#
392
393
394
395
396
397
398
399
400
401
402
|
# File 'lib/studium/commandline/misc.rb', line 392
def show_collage_of_current_exams
file = Studium::Exams::Cycle.main_file?
array = YAML.load_file(file)
opnn; e 'These entries are currently being tested by class'
opnn; e "#{slateblue('Studium::Exams::Cycle')}:"
e
array.each {|this_exam_topic|
e " #{sfancy(this_exam_topic)}"
}
e
end
|
#show_curricula(use_this_file = FILE_CURRICULA) ⇒ Object
638
639
640
641
642
643
644
645
646
647
648
649
650
651
|
# File 'lib/studium/commandline/misc.rb', line 638
def show_curricula(
use_this_file = FILE_CURRICULA
)
e
e 'The available curricula are:'
e
YAML.load_file(use_this_file).each_pair {|id_of_the_curriculum, inner_array|
name_of_the_curriculum = inner_array.first
e ' '+
orange(id_of_the_curriculum.ljust(8))+' → '+
slateblue(name_of_the_curriculum)
}
e
end
|
#show_ects_passed_per_university ⇒ Object
#
show_ects_passed_per_university
#
556
557
558
559
|
# File 'lib/studium/commandline/misc.rb', line 556
def show_ects_passed_per_university
require 'studium/ects/ects_per_university.rb'
Studium::EctsPerUniversity.new
end
|
#show_exam_statistics ⇒ Object
#
show_exam_statistics
This method will show some exam-statistics, if the file specified at FILE_STATISTICS can be found. If it is found, the content will be displayed, but we will also colourize a bit, to make the display easier to read.
To invoke this method, do:
studium --examstats
#
#show_help ⇒ Object
#
show_help (help tag)
We will first build up an Array, then sort it, then display it. That way we can just add to that Array without having to worry about whether it is sorted or not.
Invocation example:
studium --show-help
#
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
# File 'lib/studium/commandline/help.rb', line 23
def show_help
array = []
array << ' --exam-topics? # feedback '\
'the location to the exam-topics in use'
array << ' --log-dir? # feedback '\
'the log directory in use'
array << ' --n-topics? # feedback '\
'how many topics are available'
array << ' --show_how_many_exams_were_passed # feedback '\
'how many exams were already passed'
array << ' --set-directory-to-the-exam-topics=/Depot/j/EXAM_TOPICS/ # set a '\
'specific directory target'
array << ' --best-months # show '\
'the best month, that is, most ECTS points solved in any given month'
array << ' --set-dir=/dir # shorter '\
'variant of the above; an alias'
array << ' --set-editor=vim # set '\
'to use the editor called vim (or any other one of your choice)'
array << ' --show-curricula # show '\
'all registered curricula'
array << ' --master-curricula # show '\
'all lectures passed in a given master curriculum'
array << ' --upload-exam-questions # uploads '\
'the exam questions'
array << ' --expand="15.10-22.10.2018" # expand '\
'the time range for this range'
array << ' --encoding=utf # use '\
'this encoding for the Studium namespace'
array << ' --outdated # show '\
'outdated lva- and exam-dates of registered lectures'
array << ' --collage? # show '\
'which exams we are currently training'
array << ' --n-ects-from-this-file=ECTS.md # display '\
'how many ECTS points are in that file'
array << ' --ects-bachelor-master? # show '\
'how many bachelor/master ECTS points were passed so far'
array << ' --passed-exams? # show '\
'which exams were already completed successfully'
array << ' --start # note '\
'down the start time + how many exams were solved at this point'
array << ' --pristine # this '\
'will create a new file called '+
'lecture_information.yml'+
', without any already solved exams'
array << ' --colours? # show '\
'whether we will use colours or whether we will not'
array << ' --passed-ects # show '\
'how many ECTS were passed in the registered curricula'
array << ' --passed-exams=chemistry # show '\
'passed exams belonging to the given theme (in this '\
'case, lectures related to chemistry)'
array << ' --statistics # show '\
'some general statistics of this project'
array << ' --check-the-lecture-information-file # check '\
'whether all entries are correct, in the file called '+
sfile('lecture_information.yml')
array << ' --lectures-on-this-day=05.05.2018 # show '\
'which lectures are on the given day'
array << ' --disable-colours # this '\
'entry point allows you to permanently disable colours'
array << ' --solved? # show '\
'whether whether that particular lecture ID was already solved or '\
'whether it was not'
array << ' --set-log-dir=/foo/bar/ # specify '\
'another log directory'
array << ' --exams-at-the-meduni # show '\
'all exams at the meduni'
array << ' --n-entries-in-the-file-lecture-information? # report '\
'how many courses are registered in the file '+
sfile('lecture_information.yml')
array << ' --max? # show '\
'how many exams were already passed'
array << ' --download-exam-dataset # download '\
'the exam dataset from a remote website'
array << ' --gui # start '\
'the GUI component of the Studium project'
array << ' --timetable # show '\
'upcoming possible exams, via a timetable'
array << ' --max-ever # show '\
'the maximum amount of exam-questions ever answered'
array << ' --audio-stats # show '\
'all locally available audio files in the study-directory'
array << ' --yearly-average-grades # show '\
'the yearly average grades'
array << ' --percentage-achieved # show '\
'how much percent of a given curriculum we have already passed'
array << ' --questions-per-year # show '\
'how many questions were added per year'
array << ' --exams-at-the-uniwien # show '\
'all exams at the uniwien (university of vienna)'
array << ' --open # open '\
'relevant study-specific files in the (default) editor'
array << ' /name_of_exams/ # regex '\
'search for an exam with that name'
array << ' --upcoming_exams_at_the_boku # show '\
'all upcoming exams at the BOKU. (This will also generate a .html page.)'
array << ' --upcoming-important-exams # show '\
'all upcoming exams in general. (This will also generate a .html page.)'
array << ' --examstats # show '\
'the exam statistics, that is, how many exams you passed'
array << ' --use-this-colour-for-exam-questions=slateblue # set '\
'to use this colour for exam-questions'
array << ' --use-this-colour-for-exam-answers=slateblue # set '\
'to use this colour for exam-answers'
array << ' --set-delay=5 # set '\
'the delay between answering a question to n seconds, in this case 5'
array << ' --delay? # query '\
'the current delay in use'
array << ' --files? # show '\
'where some of the important files may be kept'
array << ' last-exams 15 # show '\
'the last 15 passed exams'
array << ' --update-max-questions # update '\
'how many questions were asked'
array << ' --mandatory # show '\
'upcoming mandatory courses in the next some days (40 days usually)'
e
e "#{rev}The following #{steelblue(array.size.to_s)} options "\
"are available and documented for #{royalblue('bin/studium')}:"
e
e
array.sort.each {|entry| eparse entry }
e
end
|
#show_how_many_exam_topics_are_available ⇒ Object
#
show_how_many_exam_topics_are_available
#
313
314
315
316
317
|
# File 'lib/studium/commandline/misc.rb', line 313
def show_how_many_exam_topics_are_available
require 'studium/toplevel_methods/n_topics_available.rb'
e rev+'There are '+simp(Studium::Exams.n_topics_available?.to_s)+' '\
'topics available.'
end
|
#show_how_many_exams_were_passed ⇒ Object
#
show_how_many_exams_were_passed
This method will tell us how many exams were passed.
Commandline invocation example:
studium --show_how_many_exams_were_passed
#
#show_lva_dates_of_this_lecture(this_theme) ⇒ Object
#
show_lva_dates_of_this_lecture
#
#show_max_exam_questions_answered_per_topic ⇒ Object
#
show_max_exam_questions_answered_per_topic
#
322
323
324
325
326
327
328
329
330
331
332
|
# File 'lib/studium/commandline/misc.rb', line 322
def show_max_exam_questions_answered_per_topic
_ = FILE_MAX_STATS
dataset = YAML.load_file(_)
e
dataset.each_pair {|key, value|
value = value.to_s.rjust(5)
e " #{lightgreen(key+':').ljust(80)} "\
"#{steelblue(value)}"
}
e
end
|
#show_maximum_amount_of_questions_ever_answered ⇒ Object
#
show_maximum_amount_of_questions_ever_answered
#
#show_n_ects_from_this_file(i) ⇒ Object
#
show_n_ects_from_this_file
#
#show_outdated_lva_dates ⇒ Object
#
show_outdated_lva_dates
#
#show_passed_credits_per_curriculum ⇒ Object
#
show_passed_credits_per_curriculum
Invocation example:
studium --passed-ects
#
#show_passed_ects_in_the_individual_bachelor_and_master_curricula ⇒ Object
#
show_passed_ects_in_the_individual_bachelor_and_master_curricula
#
#show_passed_ects_per_year ⇒ Object
#
show_passed_ects_per_year
#
572
573
574
575
|
# File 'lib/studium/commandline/misc.rb', line 572
def show_passed_ects_per_year
require 'studium/utility_scripts/passed_ects_per_year.rb'
Studium.passed_ects_per_year
end
|
#show_passed_exams ⇒ Object
#show_passed_lectures_in_a_bachelor_curriculum ⇒ Object
#
show_passed_lectures_in_a_bachelor_curriculum
#
#show_passed_lectures_in_a_master_curriculum ⇒ Object
#
show_passed_lectures_in_a_master_curriculum
Use this method if you want to see which lectures have been passed in a master curriculum.
To invoke this method from the commandline, try:
studium --master_curricula
#
#show_questions_per_year ⇒ Object
#
show_questions_per_year
#
#show_the_base_dir ⇒ Object
420
421
422
423
424
425
426
427
428
|
# File 'lib/studium/commandline/misc.rb', line 420
def show_the_base_dir
e
e ' '+sfile(
File.expand_path(
File.read(Studium.file_log_directory).chomp
)
)
e
end
|
#show_the_current_studyset ⇒ Object
#
show_the_current_studyset
#
697
698
699
700
701
702
703
704
705
706
707
|
# File 'lib/studium/commandline/misc.rb', line 697
def show_the_current_studyset
_ = FILE_FOR_EXAM_QUESTIONS
if File.exist? _
this_exam_topic = YAML.load_file(_).strip
e 'The current exam-topic, taken from the file '
e sfile(_)
e 'is `'+sfile(File.basename(this_exam_topic))+'`.'
else
e 'No file exists at `'+sfile(_)+'`.'
end
end
|
#
Invocation example:
studium --timetable
#
630
631
632
633
|
# File 'lib/studium/commandline/misc.rb', line 630
def show_timetable
require 'studium/requires/require_upcoming_exams.rb'
Studium::Exams::UpcomingExams.new
end
|
#show_upcoming_exams_at_the_boku ⇒ Object
#
show_upcoming_exams_at_the_boku
#
#show_upcoming_mandatory_presence_courses ⇒ Object
#
show_upcoming_mandatory_presence_courses
#
73
74
75
76
|
# File 'lib/studium/commandline/misc.rb', line 73
def show_upcoming_mandatory_presence_courses
require 'studium/utility_scripts/upcoming_mandatory_presence_courses/upcoming_mandatory_presence_courses.rb'
Studium::UpcomingMandatoryPresenceCourses.new(ARGV)
end
|
#show_where_the_exam_topics_can_be_found ⇒ Object
#
show_where_the_exam_topics_can_be_found
#
270
271
272
273
274
275
276
|
# File 'lib/studium/commandline/misc.rb', line 270
def show_where_the_exam_topics_can_be_found
e
e 'The exam topics can be found here:'
e
e " #{sdir(Studium.exam_topics?)}"
e
end
|
#show_yearly_average_grades ⇒ Object
#
show_yearly_average_grades
Invocation example:
studium --yearly-average-grades
#
661
662
663
664
665
666
667
|
# File 'lib/studium/commandline/misc.rb', line 661
def show_yearly_average_grades
require 'studium/exams/exams_per_month/exams_per_month.rb'
Studium::ExamsPerMonth.new(:dont_run_yet) { '--yearly-average-grades' }
end
|
#start_a_new_exam_day ⇒ Object
#start_gui_component ⇒ Object
#
start_gui_component
Use this method to start the gui/gtk component of the Studium project.
Invocation example:
studium --gui
#
119
120
121
122
123
124
|
# File 'lib/studium/commandline/misc.rb', line 119
def start_gui_component
unless ::Studium.const_defined? :GUI
require 'studium/gui/gtk2/simple_widget_question_answer.rb'
end
Studium::GUI::Gtk::SimpleWidgetQuestionAnswer.run_as_standalone_gtk_window
end
|
#start_the_sinatra_interface ⇒ Object
#
start_the_sinatra_interface
#
514
515
516
517
|
# File 'lib/studium/commandline/misc.rb', line 514
def start_the_sinatra_interface
require 'studium/sinatra/app.rb'
Studium.start_sinatra_interface
end
|
#upcoming_important_exams ⇒ Object
#
upcoming_important_exams
This class seems to no longer exist as of October 2020.
#
196
197
198
|
# File 'lib/studium/commandline/misc.rb', line 196
def upcoming_important_exams
Studium::Exams::UpcomingImportantExams.new
end
|
#upload_archive_of_the_exam_questions ⇒ Object
#
upload_archive_of_the_exam_questions
#
#verbose_open_important_exams ⇒ Object
#
verbose_open_important_exams
#
168
169
170
171
172
173
|
# File 'lib/studium/commandline/misc.rb', line 168
def verbose_open_important_exams
require 'studium/exams/upcoming_exams/misc.rb'
opnn; e "Now opening the #{slateblue('important-exams')} "\
"file in the editor."
::Studium.open_important_exams
end
|
#verbose_set_this_dir_to_exam_topics(match) ⇒ Object
#
verbose_set_this_dir_to_exam_topics
#
#verbose_set_this_new_log_dir(match) ⇒ Object
#
verbose_set_this_new_log_dir
#
#verbose_update_max_ever ⇒ Object
#
verbose_update_max_ever
#