├── log └── .gitkeep ├── .yarn ├── cache │ └── .keep ├── sdks │ └── .keep ├── plugins │ └── .keep ├── releases │ └── .keep └── versions │ └── .keep ├── APP_VERSION_SUFFIX ├── lib ├── tasks │ └── .gitkeep └── language │ └── digital │ └── Digital.jar ├── public ├── favicon.ico ├── images │ └── rails.png └── robots.txt ├── .ruby-gemset ├── APP_VERSION ├── app ├── assets │ ├── builds │ │ └── .keep │ ├── images │ │ ├── .keep │ │ ├── rails.png │ │ └── topbg.jpg │ ├── javascripts │ │ ├── login.js.coffee │ │ ├── main.js.coffee │ │ ├── site.js.coffee │ │ ├── sites.js.coffee │ │ ├── tasks.js.coffee │ │ ├── test.js.coffee │ │ ├── users.js.coffee │ │ ├── contests.js.coffee │ │ ├── graders.js.coffee │ │ ├── groups.js.coffee │ │ ├── heartbeat.js.coffee │ │ ├── messages.js.coffee │ │ ├── problems.js.coffee │ │ ├── report.js.coffee │ │ ├── testcases.js.coffee │ │ ├── user_admin.js.coffee │ │ ├── configurations.js.coffee │ │ ├── contest_management.js.coffee │ │ ├── tags.coffee │ │ └── announcements.js.coffee │ ├── fonts │ │ ├── sarabun │ │ │ ├── Sarabun-Bold.ttf │ │ │ ├── Sarabun-Light.ttf │ │ │ ├── Sarabun-Thin.ttf │ │ │ ├── Sarabun-Italic.ttf │ │ │ ├── Sarabun-Medium.ttf │ │ │ ├── Sarabun-Regular.ttf │ │ │ ├── Sarabun-SemiBold.ttf │ │ │ ├── Sarabun-BoldItalic.ttf │ │ │ ├── Sarabun-ExtraBold.ttf │ │ │ ├── Sarabun-ExtraLight.ttf │ │ │ ├── Sarabun-ThinItalic.ttf │ │ │ ├── Sarabun-LightItalic.ttf │ │ │ ├── Sarabun-MediumItalic.ttf │ │ │ ├── Sarabun-ExtraBoldItalic.ttf │ │ │ ├── Sarabun-SemiBoldItalic.ttf │ │ │ └── Sarabun-ExtraLightItalic.ttf │ │ ├── ubuntu_mono │ │ │ ├── UbuntuMono-Bold.ttf │ │ │ ├── UbuntuMono-Italic.ttf │ │ │ ├── UbuntuMono-Regular.ttf │ │ │ └── UbuntuMono-BoldItalic.ttf │ │ ├── cascadia_code │ │ │ ├── CascadiaCode-Bold.ttf │ │ │ ├── CascadiaCode-Italic.ttf │ │ │ ├── CascadiaCode-Light.ttf │ │ │ ├── CascadiaCode-Medium.ttf │ │ │ ├── CascadiaCode-Regular.ttf │ │ │ ├── CascadiaCode-SemiBold.ttf │ │ │ ├── CascadiaCode-BoldItalic.ttf │ │ │ ├── CascadiaCode-ExtraLight.ttf │ │ │ ├── CascadiaCode-LightItalic.ttf │ │ │ ├── CascadiaCode-MediumItalic.ttf │ │ │ ├── CascadiaCode-SemiBoldItalic.ttf │ │ │ └── CascadiaCode-ExtraLightItalic.ttf │ │ ├── courier_prime │ │ │ ├── CourierPrime-Bold.ttf │ │ │ ├── CourierPrime-Italic.ttf │ │ │ ├── CourierPrime-Regular.ttf │ │ │ └── CourierPrime-BoldItalic.ttf │ │ ├── material_symbols │ │ │ ├── MaterialSymbolsSharp.woff2 │ │ │ ├── MaterialSymbolsRounded.woff2 │ │ │ └── MaterialSymbolsOutlined.woff2 │ │ ├── cascadia_mono │ │ │ ├── CascadiaMono-VariableFont_wght.ttf │ │ │ └── CascadiaMono-Italic-VariableFont_wght.ttf │ │ └── inconsolata │ │ │ └── Inconsolata-VariableFont_wdth,wght.ttf │ ├── stylesheets │ │ ├── application.bootstrap.scss │ │ ├── application.sass.scss │ │ ├── problems.scss │ │ └── graders.scss │ └── config │ │ └── manifest.js ├── mailers │ └── .gitkeep ├── models │ ├── .gitkeep │ ├── concerns │ │ └── .keep │ ├── description.rb │ ├── login.rb │ ├── test_pair.rb │ ├── country.rb │ ├── right.rb │ ├── application_record.rb │ ├── comment_reveal.rb │ ├── role.rb │ ├── submission_view_log.rb │ ├── heart_beat.rb │ ├── user_contest_stat.rb │ ├── tag.rb │ ├── group_problem.rb │ ├── problem_tag.rb │ ├── contest_user.rb │ ├── group_user.rb │ ├── worker_dataset.rb │ └── contest_problem.rb ├── controllers │ └── concerns │ │ └── .keep ├── helpers │ ├── login_helper.rb │ ├── site_helper.rb │ ├── sites_helper.rb │ ├── tags_helper.rb │ ├── tasks_helper.rb │ ├── test_helper.rb │ ├── users_helper.rb │ ├── groups_helper.rb │ ├── report_helper.rb │ ├── sources_helper.rb │ ├── datasets_helper.rb │ ├── languages_helper.rb │ ├── messages_helper.rb │ ├── testcases_helper.rb │ ├── user_admin_helper.rb │ ├── submissions_helper.rb │ ├── announcements_helper.rb │ ├── configurations_helper.rb │ ├── contest_management_helper.rb │ ├── graders_helper.rb │ ├── turbo_stream_actions_helper.rb │ └── main_helper.rb ├── javascript │ ├── setup_datatables.js │ ├── setup_jquery.js │ ├── setup_bootstrap.js │ ├── cafe_turbo.js │ ├── controllers │ │ ├── user_admin │ │ │ └── index_controller.js │ │ ├── hello_controller.js │ │ ├── application.js │ │ └── children_select_controller.js │ └── cafe_bundle.js ├── views │ ├── main │ │ ├── list.json.jbuilder │ │ ├── error.html.haml │ │ └── _problem.json.jbuilder │ ├── user_admin │ │ ├── active.html.haml │ │ ├── import.html.haml │ │ ├── new.html.haml │ │ └── show.html.haml │ ├── application │ │ ├── error.html.haml │ │ ├── _tooltip.html.haml │ │ ├── _error_for_model.html.haml │ │ ├── _toggle_button.js.haml │ │ ├── _msg_modal_show.turbo_stream.haml │ │ └── _msg_modal_show.js.haml │ ├── languages │ │ ├── index.json.jbuilder │ │ ├── _language.json.jbuilder │ │ └── new.html.haml │ ├── report │ │ ├── show_max_score.turbo_stream.haml │ │ ├── _all_time_hof.html.haml │ │ ├── _report_menu.html.haml │ │ ├── ai_query.json.jbuilder │ │ └── problem_hof.html.haml │ ├── submissions │ │ ├── new.html.haml │ │ ├── rejudge.js.haml │ │ ├── get_latest_submission_status.js.haml │ │ └── _form.html.haml │ ├── configurations │ │ ├── update.turbo_stream.haml │ │ ├── clear_user_ip.turbo_stream.haml │ │ ├── toggle.turbo_stream.haml │ │ └── edit.html.haml │ ├── tags │ │ ├── new.html.haml │ │ ├── index_query.json.jbuilder │ │ └── edit.html.haml │ ├── groups │ │ ├── edit.html.haml │ │ ├── new.html.haml │ │ ├── toggle.turbo_stream.haml │ │ ├── toggle.js.haml │ │ └── _group_users.html.haml │ ├── contests │ │ ├── edit.html.haml │ │ ├── new.html.haml │ │ └── view.html.haml │ ├── datasets │ │ ├── file_delete.turbo_stream.haml │ │ └── update.turbo_stream.haml │ ├── problems │ │ ├── _problem_head.html.haml │ │ ├── toggle.turbo_stream.haml │ │ ├── update.turbo_stream.haml │ │ ├── import_testcases.turbo_stream.haml │ │ ├── toggle.js.haml │ │ └── _acquire_hint_confirm.html.haml │ ├── comments │ │ ├── show.turbo_stream.haml │ │ ├── submission_and_toast.turbo_stream.haml │ │ └── manage_problem.turbo_stream.haml │ ├── users │ │ ├── email_error.html.haml │ │ ├── new_splash.html.haml │ │ └── profile.html.haml │ ├── sites │ │ ├── edit.html.haml │ │ └── show.html.haml │ ├── messages │ │ ├── list_all.html.haml │ │ ├── console.html.haml │ │ └── _message.html.haml │ ├── announcements │ │ ├── toggle.turbo_stream.haml │ │ └── edit.html.haml │ ├── layouts │ │ └── _js_route.html.haml │ └── graders │ │ ├── queues.html.haml │ │ └── queues_query.json.jbuilder ├── jobs │ ├── create_problem_pdf_job.rb │ └── application_job.rb ├── NOTES ├── engine │ ├── compiler │ │ ├── go.rb │ │ ├── rust.rb │ │ ├── blank.rb │ │ ├── pascal.rb │ │ └── haskell.rb │ └── judge_logger.rb └── validators │ └── name_format_validator.rb ├── test ├── fixtures │ ├── .gitkeep │ ├── countries.yml │ ├── messages.yml │ ├── descriptions.yml │ ├── grader_processes.yml │ ├── roles.yml │ ├── test_requests.yml │ ├── problem_tags.yml │ ├── user_contest_stats.yml │ ├── test_pairs.yml │ ├── announcements.yml │ ├── tags.yml │ ├── sites.yml │ ├── rights.yml │ ├── contests.yml │ └── comments.yml ├── integration │ ├── .gitkeep │ └── admin_task_test.rb ├── load │ ├── .gitignore │ ├── NOTES │ └── common_visitors.rb ├── problem_examples │ ├── fibo │ │ ├── testcases │ │ │ ├── 1.sol │ │ │ ├── 2.sol │ │ │ ├── 3.in │ │ │ ├── 4.sol │ │ │ ├── 5.in │ │ │ ├── 7.in │ │ │ ├── 1.in │ │ │ ├── 2.in │ │ │ ├── 3.sol │ │ │ ├── 4.in │ │ │ ├── 5.sol │ │ │ ├── 6.in │ │ │ ├── 6.sol │ │ │ ├── 8.in │ │ │ ├── 7.sol │ │ │ └── 8.sol │ │ ├── statement.pdf │ │ └── model_solutions │ │ │ ├── 26800 │ │ │ └── cpp_fibo.cpp │ │ │ └── 61460 │ │ │ └── cpp_fibo.cpp │ ├── fibo_minimal │ │ ├── 1.sol │ │ ├── 2.sol │ │ ├── 3.in │ │ ├── 3.sol │ │ ├── 4.sol │ │ ├── 5.in │ │ ├── 7.in │ │ ├── 1.in │ │ ├── 2.in │ │ ├── 4.in │ │ ├── 5.sol │ │ ├── 6.in │ │ ├── 6.sol │ │ ├── 8.in │ │ ├── 7.sol │ │ ├── 8.sol │ │ └── statement.pdf │ ├── fibo.zip │ └── fibo_minimal.zip ├── models │ ├── job_test.rb │ ├── tag_test.rb │ ├── comment_test.rb │ └── problem_tag_test.rb ├── judge │ └── basic_judge.rb ├── jobs │ └── create_problem_pdf_job_test.rb ├── controllers │ └── testcases_controller_test.rb ├── application_system_test_case.rb └── concurrent │ ├── task_test_teardown.rb │ ├── task_test_get.rb │ └── task_test_setup.rb ├── vendor ├── javascript │ ├── .keep │ └── ace-noconflict │ │ ├── mode-text.js │ │ ├── snippets │ │ ├── d.js │ │ ├── abap.js │ │ ├── ada.js │ │ ├── alda.js │ │ ├── apex.js │ │ ├── aql.js │ │ ├── asl.js │ │ ├── astro.js │ │ ├── basic.js │ │ ├── cirru.js │ │ ├── cobol.js │ │ ├── csp.js │ │ ├── csv.js │ │ ├── curly.js │ │ ├── dot.js │ │ ├── ejs.js │ │ ├── elm.js │ │ ├── flix.js │ │ ├── forth.js │ │ ├── ftl.js │ │ ├── gcode.js │ │ ├── glsl.js │ │ ├── haxe.js │ │ ├── hjson.js │ │ ├── ini.js │ │ ├── ion.js │ │ ├── jack.js │ │ ├── jade.js │ │ ├── jexl.js │ │ ├── json.js │ │ ├── json5.js │ │ ├── jssm.js │ │ ├── jsx.js │ │ ├── julia.js │ │ ├── latex.js │ │ ├── latte.js │ │ ├── less.js │ │ ├── lisp.js │ │ ├── mask.js │ │ ├── mel.js │ │ ├── mips.js │ │ ├── mixal.js │ │ ├── mysql.js │ │ ├── nasal.js │ │ ├── nginx.js │ │ ├── nim.js │ │ ├── nix.js │ │ ├── nsis.js │ │ ├── ocaml.js │ │ ├── odin.js │ │ ├── pgsql.js │ │ ├── pig.js │ │ ├── plsql.js │ │ ├── praat.js │ │ ├── prql.js │ │ ├── qml.js │ │ ├── raku.js │ │ ├── rdoc.js │ │ ├── red.js │ │ ├── rhtml.js │ │ ├── rust.js │ │ ├── sac.js │ │ ├── sass.js │ │ ├── scad.js │ │ ├── scala.js │ │ ├── scss.js │ │ ├── sjs.js │ │ ├── slim.js │ │ ├── space.js │ │ ├── svg.js │ │ ├── swift.js │ │ ├── text.js │ │ ├── toml.js │ │ ├── tsv.js │ │ ├── tsx.js │ │ ├── twig.js │ │ ├── vhdl.js │ │ ├── vue.js │ │ ├── xml.js │ │ ├── yaml.js │ │ ├── zeek.js │ │ ├── zig.js │ │ ├── bibtex.js │ │ ├── crystal.js │ │ ├── csharp.js │ │ ├── eiffel.js │ │ ├── elixir.js │ │ ├── fortran.js │ │ ├── fsharp.js │ │ ├── gherkin.js │ │ ├── golang.js │ │ ├── groovy.js │ │ ├── kotlin.js │ │ ├── logiql.js │ │ ├── logtalk.js │ │ ├── luapage.js │ │ ├── lucene.js │ │ ├── matlab.js │ │ ├── partiql.js │ │ ├── pascal.js │ │ ├── prisma.js │ │ ├── prolog.js │ │ ├── puppet.js │ │ ├── scheme.js │ │ ├── scrypt.js │ │ ├── smarty.js │ │ ├── smithy.js │ │ ├── sparql.js │ │ ├── stylus.js │ │ ├── turtle.js │ │ ├── verilog.js │ │ ├── asciidoc.js │ │ ├── autohotkey.js │ │ ├── batchfile.js │ │ ├── c9search.js │ │ ├── coldfusion.js │ │ ├── cuttlefish.js │ │ ├── dockerfile.js │ │ ├── gitignore.js │ │ ├── handlebars.js │ │ ├── html_ruby.js │ │ ├── livescript.js │ │ ├── mediawiki.js │ │ ├── mushcode.js │ │ ├── nunjucks.js │ │ ├── objectivec.js │ │ ├── plain_text.js │ │ ├── powershell.js │ │ ├── properties.js │ │ ├── protobuf.js │ │ ├── redshift.js │ │ ├── terraform.js │ │ ├── typescript.js │ │ ├── vbscript.js │ │ ├── apache_conf.js │ │ ├── applescript.js │ │ ├── assembly_x86.js │ │ ├── csound_score.js │ │ ├── html_elixir.js │ │ ├── soy_template.js │ │ ├── visualforce.js │ │ ├── assembly_arm32.js │ │ ├── haskell_cabal.js │ │ └── php_laravel_blade.js │ │ └── ext-error_marker.js ├── plugins │ └── .gitkeep ├── assets │ ├── javascripts │ │ └── .gitkeep │ └── stylesheets │ │ ├── .gitkeep │ │ ├── highlight │ │ ├── pojoaque.jpg │ │ └── brown-papersq.png │ │ └── datatables │ │ └── readme.md └── bootstrap │ └── scss │ ├── helpers │ ├── _clearfix.scss │ ├── _text-truncation.scss │ ├── _visually-hidden.scss │ ├── _vr.scss │ ├── _stretched-link.scss │ ├── _stacks.scss │ ├── _focus-ring.scss │ └── _color-bg.scss │ ├── mixins │ ├── _clearfix.scss │ ├── _lists.scss │ ├── _color-scheme.scss │ ├── _text-truncate.scss │ ├── _resize.scss │ ├── _banner.scss │ ├── _backdrop.scss │ └── _pagination.scss │ ├── bootstrap-reboot.scss │ ├── forms │ └── _form-text.scss │ ├── _forms.scss │ ├── bootstrap-utilities.scss │ └── _helpers.scss ├── .ruby-version ├── data ├── tasks │ └── .gitignore ├── printing │ └── .gitignore └── test_request │ ├── input │ └── .gitignore │ └── output │ └── .gitignore ├── .yarnrc.yml ├── config ├── initializers │ ├── .gitignore │ ├── session_store.rb │ ├── abstract_mysql2_adapter.rb.SAMPLE │ ├── mime_types.rb │ ├── cookies_serializer.rb │ └── assets.rb ├── .gitignore ├── spring.rb ├── environment.rb ├── boot.rb ├── cable.yml ├── recurring.yml └── queue.yml ├── .ignore ├── script └── daily_task.rb ├── Procfile.dev ├── bin ├── rake ├── importmap ├── bundle ├── jobs ├── rails └── dev ├── db └── migrate │ ├── 20170310110146_add_index_to_task.rb │ ├── 20200405112919_add_index_to_login.rb │ ├── 20140913060729_add_section_to_users.rb │ ├── 20150827133841_add_last_ip_to_user.rb │ ├── 20210809105935_add_index_to_task_status.rb │ ├── 20230728055327_more_new_evaluation.rb │ ├── 20200404135714_add_index_to_submission.rb │ ├── 20200404142959_add_id_to_group_user.rb │ ├── 20231019151423_add_job_priority.rb │ ├── 20140917150629_add_ip_to_submissions.rb │ ├── 20150914155101_add_status_to_heart_beat.rb │ ├── 20230220171501_add_more_index_to_submissions.rb │ ├── 20200813083020_add_enabled_to_group.rb │ ├── 20250825154201_add_status_to_comment.rb │ ├── 20170124024527_add_view_testcase_to_problem.rb │ ├── 20210130121812_add_default_language_to_user.rb │ ├── 20250308164629_add_group_to_announcement.rb │ ├── 20241213073348_add_role_to_contest_user.rb │ ├── 20250204091008_change_default_language.rb │ ├── 20230910132835_add_status_to_grader_process.rb │ ├── 20180612102327_change_submission_source_size.rb │ ├── 20210124101028_add_on_nav_bar_to_announcement.rb │ ├── 20240609073050_add_time_to_contest.rb │ ├── 20150203153534_add_more_to_users.rb │ ├── 20250711030331_add_llm_enable_to_contest_problem.rb │ ├── 20231218145225_add_last_heartbeat_to_user.rb │ ├── 012_add_email_to_users.rb │ ├── 013_add_url_to_problem.rb │ ├── 20081210021333_add_timestamps_to_users.rb │ ├── 20121001033508_rename_configurations_to_grader_configurations.rb │ ├── 20220927074644_add_description_to_problems.rb │ ├── 026_add_body_to_problems.rb │ ├── 20220204080936_add_type_to_submission.rb │ ├── 20230301170551_optimize_submission_indices.rb │ ├── 20100303095700_add_name_to_contests.rb │ ├── 20150503164846_change_userid_on_login.rb │ ├── 20170123162543_change_testcase_size.rb │ ├── 20250629104116_add_llm_support_to_comment.rb │ ├── 016_add_task_to_grader_process.rb │ ├── 20090815171610_add_title_to_announcements.rb │ ├── 20100506163112_add_notes_to_announcements.rb │ ├── 20100124040107_add_description_to_config.rb │ ├── 20161008050135_modify_grader_process.rb │ ├── 005_add_index_to_submissions.rb │ ├── 017_rename_grader_process_column_ip_to_host.rb │ ├── 033_add_task_type_to_grader_processes.rb │ ├── 20081215012843_change_user_login_string_limit.rb │ ├── 20241121143036_tags_display.rb │ ├── 20090426131044_add_terminated_to_grader_processes.rb │ ├── 20081107145815_add_frontpage_flag_to_announcement.rb │ ├── 20100219014840_add_description_filename_to_problems.rb │ ├── 20140823031747_add_more_detail_to_submission.rb │ ├── 021_change_compiler_message_type_test_request.rb │ ├── 20090206145016_add_contest_flag_to_announcements.rb │ ├── 20100328123325_add_forced_logout_to_user_contest_stat.rb │ ├── 20140826095949_create_logins.rb │ ├── 20231228144804_more_status_on_worker_dataset.rb │ ├── 20150914090545_create_heart_beats.rb │ ├── 034_create_countries.rb │ ├── 20150914223258_add_more_config.rb │ ├── 20170914150545_create_tags.rb │ ├── 20150827131927_create_submission_view_logs.rb │ ├── 008_create_tasks.rb │ ├── 20150916054105_update_heart_beat.rb │ ├── 20250717145356_alter_utf8_for_comments.rb │ ├── 20250609154731_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb │ ├── 031_add_supports_for_output_only_problems.rb │ ├── 20170427070345_add_heart_beat_full.rb │ ├── 20100216105730_create_contests.rb │ ├── 011_add_language_ext.rb │ ├── 024_create_sites.rb │ ├── 027_create_descriptions.rb │ ├── 029_add_test_allowed_to_problems.rb │ ├── 20100216162324_create_contests_users_join_table.rb │ ├── 20231007041620_job_type_enable.rb │ ├── 030_create_announcements.rb │ ├── 20100113094740_create_test_pairs.rb │ ├── 20170914150742_create_problem_tags.rb │ ├── 20100124054458_create_user_contest_stats.rb │ ├── 20100216162940_create_contests_problems_join_table.rb │ ├── 20230611072646_create_jobs.rb │ └── 20241117084758_contest_finalize.rb ├── config.ru ├── doc └── README_FOR_APP ├── Rakefile ├── README.rdoc └── package.json /log/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.yarn/cache/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.yarn/sdks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /APP_VERSION_SUFFIX: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-gemset: -------------------------------------------------------------------------------- 1 | grader 2 | -------------------------------------------------------------------------------- /.yarn/plugins/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.yarn/releases/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.yarn/versions/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /APP_VERSION: -------------------------------------------------------------------------------- 1 | 4.1.3 2 | -------------------------------------------------------------------------------- /app/assets/builds/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/mailers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/javascript/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-3.4.4 2 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/load/.gitignore: -------------------------------------------------------------------------------- 1 | tmp 2 | 3 | -------------------------------------------------------------------------------- /app/assets/javascripts/login.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/main.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/site.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/sites.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/tasks.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/test.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/users.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/tasks/.gitignore: -------------------------------------------------------------------------------- 1 | [a-zA-Z]* 2 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/contests.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/graders.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/groups.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/heartbeat.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/messages.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/problems.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/report.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/testcases.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/user_admin.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/javascripts/configurations.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/printing/.gitignore: -------------------------------------------------------------------------------- 1 | [a-zA-Z0-9]* 2 | 3 | -------------------------------------------------------------------------------- /data/test_request/input/.gitignore: -------------------------------------------------------------------------------- 1 | [a-z]* 2 | -------------------------------------------------------------------------------- /data/test_request/output/.gitignore: -------------------------------------------------------------------------------- 1 | [a-z]* 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/1.sol: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/2.sol: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/3.in: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/4.sol: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/5.in: -------------------------------------------------------------------------------- 1 | 17 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/7.in: -------------------------------------------------------------------------------- 1 | 40 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/1.sol: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/2.sol: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/3.in: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/3.sol: -------------------------------------------------------------------------------- 1 | 55 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/4.sol: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/5.in: -------------------------------------------------------------------------------- 1 | 17 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/7.in: -------------------------------------------------------------------------------- 1 | 40 2 | -------------------------------------------------------------------------------- /app/assets/javascripts/contest_management.js.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/2.in: -------------------------------------------------------------------------------- 1 | 6 2 | 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/3.sol: -------------------------------------------------------------------------------- 1 | 55 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/4.in: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/5.sol: -------------------------------------------------------------------------------- 1 | 1597 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/6.in: -------------------------------------------------------------------------------- 1 | 20 2 | 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/6.sol: -------------------------------------------------------------------------------- 1 | 6765 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/8.in: -------------------------------------------------------------------------------- 1 | 45 2 | 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/2.in: -------------------------------------------------------------------------------- 1 | 6 2 | 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/4.in: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/5.sol: -------------------------------------------------------------------------------- 1 | 1597 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/6.in: -------------------------------------------------------------------------------- 1 | 20 2 | 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/6.sol: -------------------------------------------------------------------------------- 1 | 6765 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/8.in: -------------------------------------------------------------------------------- 1 | 45 2 | 3 | -------------------------------------------------------------------------------- /app/helpers/login_helper.rb: -------------------------------------------------------------------------------- 1 | module LoginHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/site_helper.rb: -------------------------------------------------------------------------------- 1 | module SiteHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/sites_helper.rb: -------------------------------------------------------------------------------- 1 | module SitesHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/tags_helper.rb: -------------------------------------------------------------------------------- 1 | module TagsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/tasks_helper.rb: -------------------------------------------------------------------------------- 1 | module TasksHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/test_helper.rb: -------------------------------------------------------------------------------- 1 | module TestHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/7.sol: -------------------------------------------------------------------------------- 1 | 102334155 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/testcases/8.sol: -------------------------------------------------------------------------------- 1 | 1134903170 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/7.sol: -------------------------------------------------------------------------------- 1 | 102334155 2 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/8.sol: -------------------------------------------------------------------------------- 1 | 1134903170 2 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | # nodeLinker: node-modules 2 | nodeLinker: pnp 3 | -------------------------------------------------------------------------------- /app/helpers/groups_helper.rb: -------------------------------------------------------------------------------- 1 | module GroupsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/report_helper.rb: -------------------------------------------------------------------------------- 1 | module ReportHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/sources_helper.rb: -------------------------------------------------------------------------------- 1 | module SourcesHelper 2 | end 3 | -------------------------------------------------------------------------------- /config/initializers/.gitignore: -------------------------------------------------------------------------------- 1 | cafe_grader_config.rb 2 | 3 | -------------------------------------------------------------------------------- /app/helpers/datasets_helper.rb: -------------------------------------------------------------------------------- 1 | module DatasetsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/languages_helper.rb: -------------------------------------------------------------------------------- 1 | module LanguagesHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/messages_helper.rb: -------------------------------------------------------------------------------- 1 | module MessagesHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/testcases_helper.rb: -------------------------------------------------------------------------------- 1 | module TestcasesHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/user_admin_helper.rb: -------------------------------------------------------------------------------- 1 | module UserAdminHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/submissions_helper.rb: -------------------------------------------------------------------------------- 1 | module SubmissionsHelper 2 | end 3 | -------------------------------------------------------------------------------- /config/.gitignore: -------------------------------------------------------------------------------- 1 | application.rb 2 | database.yml 3 | tasks.yml 4 | 5 | -------------------------------------------------------------------------------- /app/helpers/announcements_helper.rb: -------------------------------------------------------------------------------- 1 | module AnnouncementsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/configurations_helper.rb: -------------------------------------------------------------------------------- 1 | module ConfigurationsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/models/description.rb: -------------------------------------------------------------------------------- 1 | class Description < ApplicationRecord 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/contest_management_helper.rb: -------------------------------------------------------------------------------- 1 | module ContestManagementHelper 2 | end 3 | -------------------------------------------------------------------------------- /.ignore: -------------------------------------------------------------------------------- 1 | #ignore file for fd (nvim-treesitter) 2 | /tmp 3 | /.hg 4 | /storage 5 | /log 6 | -------------------------------------------------------------------------------- /app/javascript/setup_datatables.js: -------------------------------------------------------------------------------- 1 | import "setup_jquery" 2 | 3 | import "select2" 4 | 5 | -------------------------------------------------------------------------------- /app/models/login.rb: -------------------------------------------------------------------------------- 1 | class Login < ApplicationRecord 2 | belongs_to :user 3 | 4 | end 5 | -------------------------------------------------------------------------------- /app/views/main/list.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.array! @problems, partial: "problem", as: :problem 2 | -------------------------------------------------------------------------------- /app/views/user_admin/active.html.haml: -------------------------------------------------------------------------------- 1 | %h1 Active users 2 | 3 | 4 | Under construction 5 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/helpers/_clearfix.scss: -------------------------------------------------------------------------------- 1 | .clearfix { 2 | @include clearfix(); 3 | } 4 | -------------------------------------------------------------------------------- /app/models/test_pair.rb: -------------------------------------------------------------------------------- 1 | class TestPair < ApplicationRecord 2 | belongs_to :problem 3 | end 4 | -------------------------------------------------------------------------------- /app/views/application/error.html.haml: -------------------------------------------------------------------------------- 1 | %h2 Error 2 | .alert.alert-danger 3 | = @error_message 4 | -------------------------------------------------------------------------------- /app/models/country.rb: -------------------------------------------------------------------------------- 1 | class Country < ApplicationRecord 2 | 3 | has_many :sites 4 | 5 | end 6 | -------------------------------------------------------------------------------- /app/models/right.rb: -------------------------------------------------------------------------------- 1 | class Right < ApplicationRecord 2 | has_and_belongs_to_many :roles 3 | end 4 | -------------------------------------------------------------------------------- /public/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/public/images/rails.png -------------------------------------------------------------------------------- /script/daily_task.rb: -------------------------------------------------------------------------------- 1 | 2 | # purge old job 3 | Job.clean_old_job 4 | 5 | # erase old isolate_submission 6 | -------------------------------------------------------------------------------- /app/assets/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/images/rails.png -------------------------------------------------------------------------------- /app/assets/images/topbg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/images/topbg.jpg -------------------------------------------------------------------------------- /app/views/languages/index.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.array! @languages, partial: "languages/language", as: :language 2 | -------------------------------------------------------------------------------- /Procfile.dev: -------------------------------------------------------------------------------- 1 | web: bin/rails server 2 | css: yarn build:css --watch 3 | solid_queue: bin/rails solid_queue:start 4 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | primary_abstract_class 3 | end 4 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /test/problem_examples/fibo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/test/problem_examples/fibo.zip -------------------------------------------------------------------------------- /app/views/report/show_max_score.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.replace 'max_score_result', partial: 'score_table' 2 | -------------------------------------------------------------------------------- /bin/importmap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require_relative "../config/application" 4 | require "importmap/commands" 5 | -------------------------------------------------------------------------------- /lib/language/digital/Digital.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/lib/language/digital/Digital.jar -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /app/views/submissions/new.html.haml: -------------------------------------------------------------------------------- 1 | %h1 New submission 2 | 3 | = render 'form' 4 | 5 | = link_to 'Back', submissions_path 6 | -------------------------------------------------------------------------------- /app/models/comment_reveal.rb: -------------------------------------------------------------------------------- 1 | class CommentReveal < ApplicationRecord 2 | belongs_to :comment 3 | belongs_to :user 4 | end 5 | -------------------------------------------------------------------------------- /app/models/role.rb: -------------------------------------------------------------------------------- 1 | class Role < ApplicationRecord 2 | has_and_belongs_to_many :users 3 | has_and_belongs_to_many :rights 4 | end 5 | -------------------------------------------------------------------------------- /app/models/submission_view_log.rb: -------------------------------------------------------------------------------- 1 | class SubmissionViewLog < ApplicationRecord 2 | #attr_accessible :submission_id, :user_id 3 | end 4 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | Spring.watch( 2 | ".ruby-version", 3 | ".rbenv-vars", 4 | "tmp/restart.txt", 5 | "tmp/caching-dev.txt" 6 | ) 7 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/statement.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/test/problem_examples/fibo/statement.pdf -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/test/problem_examples/fibo_minimal.zip -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-Bold.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-Light.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-Thin.ttf -------------------------------------------------------------------------------- /app/views/application/_tooltip.html.haml: -------------------------------------------------------------------------------- 1 | %sup.mi.mi-bs.md-18{ data: {bs: {toggle: :tooltip, placement: :top, title: title}}} help_center 2 | -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-Italic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-Medium.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-Regular.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-SemiBold.ttf -------------------------------------------------------------------------------- /app/assets/stylesheets/application.bootstrap.scss: -------------------------------------------------------------------------------- 1 | //@import 'bootstrap/scss/bootstrap'; 2 | //@import 'bootstrap-icons/font/bootstrap-icons'; 3 | -------------------------------------------------------------------------------- /app/views/configurations/update.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.update dom_id(@config,"config"), partial: 'config', locals: {conf: @config} 2 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-BoldItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-ExtraBold.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-ExtraLight.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-ThinItalic.ttf -------------------------------------------------------------------------------- /app/views/languages/_language.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! language, :id, :created_at, :updated_at 2 | json.url language_url(language, format: :json) 3 | -------------------------------------------------------------------------------- /app/views/tags/new.html.haml: -------------------------------------------------------------------------------- 1 | %h1 New tag 2 | .row.my-3.gx-3 3 | .col-md-6 4 | .card.shadow-sm 5 | .card-body 6 | = render 'form' 7 | -------------------------------------------------------------------------------- /bin/jobs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require_relative "../config/environment" 4 | require "solid_queue/cli" 5 | 6 | SolidQueue::Cli.start(ARGV) 7 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/helpers/_text-truncation.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Text truncation 3 | // 4 | 5 | .text-truncate { 6 | @include text-truncate(); 7 | } 8 | -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-LightItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-MediumItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/ubuntu_mono/UbuntuMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/ubuntu_mono/UbuntuMono-Bold.ttf -------------------------------------------------------------------------------- /app/assets/fonts/ubuntu_mono/UbuntuMono-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/ubuntu_mono/UbuntuMono-Italic.ttf -------------------------------------------------------------------------------- /app/views/groups/edit.html.haml: -------------------------------------------------------------------------------- 1 | %h1 Edit group 2 | .row.my-3.gx-3 3 | .col-md-6 4 | .card.shadow-sm 5 | .card-body 6 | = render 'form' 7 | -------------------------------------------------------------------------------- /app/views/groups/new.html.haml: -------------------------------------------------------------------------------- 1 | %h1 New group 2 | .row.my-3.gx-3 3 | .col-md-6 4 | .card.shadow-sm 5 | .card-body 6 | = render 'form' 7 | -------------------------------------------------------------------------------- /test/problem_examples/fibo_minimal/statement.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/test/problem_examples/fibo_minimal/statement.pdf -------------------------------------------------------------------------------- /vendor/assets/stylesheets/highlight/pojoaque.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/vendor/assets/stylesheets/highlight/pojoaque.jpg -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-Bold.ttf -------------------------------------------------------------------------------- /app/assets/fonts/courier_prime/CourierPrime-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/courier_prime/CourierPrime-Bold.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/ubuntu_mono/UbuntuMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/ubuntu_mono/UbuntuMono-Regular.ttf -------------------------------------------------------------------------------- /app/views/contests/edit.html.haml: -------------------------------------------------------------------------------- 1 | %h1 Edit contest 2 | .row.my-3.gx-3 3 | .col-md-6 4 | .card.shadow-sm 5 | .card-body 6 | = render 'form' 7 | -------------------------------------------------------------------------------- /app/views/user_admin/import.html.haml: -------------------------------------------------------------------------------- 1 | return to 2 | = link_to '[user list]', :action => 'list' 3 | 4 | %h3 Import log 5 | 6 | = simple_format(@import_log) 7 | -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-Italic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-Light.ttf -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-Medium.ttf -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-Regular.ttf -------------------------------------------------------------------------------- /app/assets/fonts/courier_prime/CourierPrime-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/courier_prime/CourierPrime-Italic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/courier_prime/CourierPrime-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/courier_prime/CourierPrime-Regular.ttf -------------------------------------------------------------------------------- /app/assets/fonts/sarabun/Sarabun-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/sarabun/Sarabun-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/ubuntu_mono/UbuntuMono-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/ubuntu_mono/UbuntuMono-BoldItalic.ttf -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /test/models/job_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class JobTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/tag_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TagTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/highlight/brown-papersq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/vendor/assets/stylesheets/highlight/brown-papersq.png -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-SemiBold.ttf -------------------------------------------------------------------------------- /app/javascript/setup_jquery.js: -------------------------------------------------------------------------------- 1 | import jquery from "jquery" 2 | window.jQuery = jquery 3 | window.$ = jquery 4 | 5 | //console.log('jQuery is loaded as jQuery and $') 6 | -------------------------------------------------------------------------------- /app/models/heart_beat.rb: -------------------------------------------------------------------------------- 1 | class HeartBeat < ApplicationRecord 2 | # attr_accessible :title, :body 3 | belongs_to :user 4 | 5 | #attr_accessible :ip_address 6 | end 7 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-BoldItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-ExtraLight.ttf -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-LightItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-MediumItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/courier_prime/CourierPrime-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/courier_prime/CourierPrime-BoldItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/material_symbols/MaterialSymbolsSharp.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/material_symbols/MaterialSymbolsSharp.woff2 -------------------------------------------------------------------------------- /db/migrate/20170310110146_add_index_to_task.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToTask < ActiveRecord::Migration[4.2] 2 | def change 3 | add_index :tasks, :submission_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200405112919_add_index_to_login.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToLogin < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :logins, :user_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/models/comment_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class CommentTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/material_symbols/MaterialSymbolsRounded.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/material_symbols/MaterialSymbolsRounded.woff2 -------------------------------------------------------------------------------- /app/views/contests/new.html.haml: -------------------------------------------------------------------------------- 1 | %h1 New Contest 2 | .row.my-3.gx-3 3 | .col-md-6 4 | .card.shadow-sm 5 | .card-body 6 | = render 'form', contest: @contest 7 | -------------------------------------------------------------------------------- /app/views/languages/new.html.haml: -------------------------------------------------------------------------------- 1 | %h1 New language 2 | 3 | .row.my-3.gx-3 4 | .col-md-6 5 | .card.shadow-sm 6 | .card-body 7 | = render 'form' 8 | .col-md-6 9 | -------------------------------------------------------------------------------- /test/fixtures/countries.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | # one: 4 | # column: value 5 | # 6 | # two: 7 | # column: value 8 | -------------------------------------------------------------------------------- /test/fixtures/messages.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | # one: 4 | # column: value 5 | # 6 | # two: 7 | # column: value 8 | -------------------------------------------------------------------------------- /test/judge/basic_judge.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BasicJudgeTest < ActionDispatch::IntegrationTest 4 | test "the truth" do 5 | assert true 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/problem_tag_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ProblemTagTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_code/CascadiaCode-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_code/CascadiaCode-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_mono/CascadiaMono-VariableFont_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_mono/CascadiaMono-VariableFont_wght.ttf -------------------------------------------------------------------------------- /app/assets/fonts/material_symbols/MaterialSymbolsOutlined.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/material_symbols/MaterialSymbolsOutlined.woff2 -------------------------------------------------------------------------------- /app/javascript/setup_bootstrap.js: -------------------------------------------------------------------------------- 1 | import "setup_jquery" 2 | 3 | import * as bootstrap from "bootstrap" 4 | window.bootstrap = bootstrap 5 | 6 | //console.log('Bootstrap is loaded') 7 | -------------------------------------------------------------------------------- /db/migrate/20140913060729_add_section_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddSectionToUsers < ActiveRecord::Migration[4.2] 2 | def change 3 | add_column :users, :section, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20150827133841_add_last_ip_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddLastIpToUser < ActiveRecord::Migration[4.2] 2 | def change 3 | add_column :users, :last_ip, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210809105935_add_index_to_task_status.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToTaskStatus < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :tasks, :status 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/fixtures/descriptions.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | # one: 4 | # column: value 5 | # 6 | # two: 7 | # column: value 8 | -------------------------------------------------------------------------------- /test/fixtures/grader_processes.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | # one: 4 | # column: value 5 | # 6 | # two: 7 | # column: value 8 | -------------------------------------------------------------------------------- /test/fixtures/roles.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | admin: 3 | name: admin 4 | rights: graders_right, user_admin_right, problems_right -------------------------------------------------------------------------------- /test/fixtures/test_requests.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | # one: 4 | # column: value 5 | # 6 | # two: 7 | # column: value 8 | -------------------------------------------------------------------------------- /app/assets/fonts/inconsolata/Inconsolata-VariableFont_wdth,wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/inconsolata/Inconsolata-VariableFont_wdth,wght.ttf -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_cafe_grader_session' 4 | -------------------------------------------------------------------------------- /db/migrate/20230728055327_more_new_evaluation.rb: -------------------------------------------------------------------------------- 1 | class MoreNewEvaluation < ActiveRecord::Migration[7.0] 2 | def change 3 | rename_column :testcases, :score, :weight 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/load/NOTES: -------------------------------------------------------------------------------- 1 | How to call 2 | =========== 3 | 4 | Load test for front page: 5 | 6 | ruby runner.rb common_visitors.rb FirstPageViewer 20 -t 10 --site_url=http://localhost/cafe 7 | 8 | -------------------------------------------------------------------------------- /db/migrate/20200404135714_add_index_to_submission.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToSubmission < ActiveRecord::Migration[5.2] 2 | def change 3 | add_index :submissions, :submitted_at 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200404142959_add_id_to_group_user.rb: -------------------------------------------------------------------------------- 1 | class AddIdToGroupUser < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :groups_users, :id, :primary_key 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20231019151423_add_job_priority.rb: -------------------------------------------------------------------------------- 1 | class AddJobPriority < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :jobs, :priority, :integer, default: 0 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/integration/admin_task_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AdminTaskTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/jobs/create_problem_pdf_job_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class CreateProblemPdfJobTest < ActiveJob::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /app/assets/fonts/cascadia_mono/CascadiaMono-Italic-VariableFont_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nattee/cafe-grader-web/HEAD/app/assets/fonts/cascadia_mono/CascadiaMono-Italic-VariableFont_wght.ttf -------------------------------------------------------------------------------- /app/jobs/create_problem_pdf_job.rb: -------------------------------------------------------------------------------- 1 | class CreateProblemPdfJob < ApplicationJob 2 | queue_as :default 3 | 4 | def perform(problem) 5 | ProblemPdfGenerator.new(problem).call 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/views/application/_error_for_model.html.haml: -------------------------------------------------------------------------------- 1 | - if model.errors.count > 0 2 | .alert.alert-danger 3 | %ul 4 | - model.errors.full_messages.each do |message| 5 | %li= message 6 | -------------------------------------------------------------------------------- /config/initializers/abstract_mysql2_adapter.rb.SAMPLE: -------------------------------------------------------------------------------- 1 | class ActiveRecord::ConnectionAdapters::Mysql2Adapter 2 | NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY" 3 | end 4 | -------------------------------------------------------------------------------- /db/migrate/20140917150629_add_ip_to_submissions.rb: -------------------------------------------------------------------------------- 1 | class AddIpToSubmissions < ActiveRecord::Migration[4.2] 2 | def change 3 | add_column :submissions, :ip_address, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20150914155101_add_status_to_heart_beat.rb: -------------------------------------------------------------------------------- 1 | class AddStatusToHeartBeat < ActiveRecord::Migration[4.2] 2 | def change 3 | add_column :heart_beats, :status, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20230220171501_add_more_index_to_submissions.rb: -------------------------------------------------------------------------------- 1 | class AddMoreIndexToSubmissions < ActiveRecord::Migration[7.0] 2 | def change 3 | add_index :submissions, :graded_at 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/javascript/cafe_turbo.js: -------------------------------------------------------------------------------- 1 | 2 | Turbo.StreamActions.bootbox = function() { 3 | const message = this.getAttribute("message") 4 | 5 | bootbox.alert({message: message, title: 'Error'}) 6 | 7 | } 8 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /db/migrate/20200813083020_add_enabled_to_group.rb: -------------------------------------------------------------------------------- 1 | class AddEnabledToGroup < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :groups, :enabled, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20250825154201_add_status_to_comment.rb: -------------------------------------------------------------------------------- 1 | class AddStatusToComment < ActiveRecord::Migration[8.0] 2 | def change 3 | add_column :comments, :status, :integer, default: 0 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/controllers/testcases_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class TestcasesControllerTest < ActionController::TestCase 4 | setup do 5 | @testcase = testcases(:one) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/load/common_visitors.rb: -------------------------------------------------------------------------------- 1 | if !defined? VISITOR_OPTION_LIST 2 | VISITOR_OPTION_LIST = {} 3 | end 4 | 5 | visitor "FirstPageViewer", VISITOR_OPTION_LIST do 6 | stores_cookies 7 | get "/" 8 | end 9 | -------------------------------------------------------------------------------- /app/helpers/graders_helper.rb: -------------------------------------------------------------------------------- 1 | module GradersHelper 2 | def job_type_text(job_type) 3 | return 'all' if job_type.blank? || job_type == 'compile evaluate score' 4 | return job_type 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/views/main/error.html.haml: -------------------------------------------------------------------------------- 1 | = user_title_bar(@user) 2 | 3 | .announcementbox 4 | %span{:class => 'title'} 5 | Error 6 | .announcement 7 | You are uploading a file which is too large (> 2MB). 8 | -------------------------------------------------------------------------------- /app/views/submissions/rejudge.js.haml: -------------------------------------------------------------------------------- 1 | :plain 2 | $("#main-content").prepend("
Submission #{@submission.id}'s is added to judge queue. It will be re-judged soon.
") 3 | -------------------------------------------------------------------------------- /db/migrate/20170124024527_add_view_testcase_to_problem.rb: -------------------------------------------------------------------------------- 1 | class AddViewTestcaseToProblem < ActiveRecord::Migration[4.2] 2 | def change 3 | add_column :problems, :view_testcase, :bool 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210130121812_add_default_language_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultLanguageToUser < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :users, :default_language, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20250308164629_add_group_to_announcement.rb: -------------------------------------------------------------------------------- 1 | class AddGroupToAnnouncement < ActiveRecord::Migration[7.0] 2 | def change 3 | add_reference :announcements, :group, null: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /app/models/user_contest_stat.rb: -------------------------------------------------------------------------------- 1 | class UserContestStat < ApplicationRecord 2 | 3 | belongs_to :user 4 | 5 | def reset_timer_and_save 6 | self.started_at = nil 7 | save 8 | end 9 | 10 | end 11 | -------------------------------------------------------------------------------- /app/views/configurations/clear_user_ip.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | -# %turbo-stream{action: "append", target: "stream_js"} 2 | = turbo_stream.append :stream_js do 3 | :javascript 4 | alert('All users ip are cleared') 5 | -------------------------------------------------------------------------------- /app/views/datasets/file_delete.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.update :dataset_files, partial: 'managers', locals: {ds: @dataset} 2 | = turbo_stream.append 'toast-area', partial: 'toast', locals: {toast: @toast} 3 | -------------------------------------------------------------------------------- /db/migrate/20241213073348_add_role_to_contest_user.rb: -------------------------------------------------------------------------------- 1 | class AddRoleToContestUser < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :contests_users, :role, :integer, default: 0 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/tag.rb: -------------------------------------------------------------------------------- 1 | class Tag < ApplicationRecord 2 | enum :kind, {normal: 0, topic: 1, llm_prompt: 2} 3 | has_many :problems_tags, class_name: 'ProblemTag' 4 | has_many :problems, through: :problems_tags 5 | end 6 | -------------------------------------------------------------------------------- /app/views/configurations/toggle.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | %turbo-stream{action: "append", target: "stream_js"} 2 | %template 3 | :javascript 4 | $("##{dom_id(@config,"config")}").prop("checked",#{@config.value}) 5 | -------------------------------------------------------------------------------- /db/migrate/20250204091008_change_default_language.rb: -------------------------------------------------------------------------------- 1 | class ChangeDefaultLanguage < ActiveRecord::Migration[7.0] 2 | def change 3 | rename_column :users, :default_language, :default_language_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/helpers/_visually-hidden.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Visually hidden 3 | // 4 | 5 | .visually-hidden, 6 | .visually-hidden-focusable:not(:focus):not(:focus-within) { 7 | @include visually-hidden(); 8 | } 9 | -------------------------------------------------------------------------------- /db/migrate/20230910132835_add_status_to_grader_process.rb: -------------------------------------------------------------------------------- 1 | class AddStatusToGraderProcess < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :grader_processes, :status, :integer, default: 0 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/fixtures/problem_tags.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | problem_id: 5 | tag_id: 6 | 7 | two: 8 | problem_id: 9 | tag_id: 10 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/helpers/_vr.scss: -------------------------------------------------------------------------------- 1 | .vr { 2 | display: inline-block; 3 | align-self: stretch; 4 | width: $vr-border-width; 5 | min-height: 1em; 6 | background-color: currentcolor; 7 | opacity: $hr-opacity; 8 | } 9 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /db/migrate/20180612102327_change_submission_source_size.rb: -------------------------------------------------------------------------------- 1 | class ChangeSubmissionSourceSize < ActiveRecord::Migration[4.2] 2 | def change 3 | change_column :submissions, :source, :text, :limit => 1.megabyte 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210124101028_add_on_nav_bar_to_announcement.rb: -------------------------------------------------------------------------------- 1 | class AddOnNavBarToAnnouncement < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :announcements, :on_nav_bar, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20240609073050_add_time_to_contest.rb: -------------------------------------------------------------------------------- 1 | class AddTimeToContest < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :contests, :start, :datetime 4 | add_column :contests, :stop, :datetime 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /doc/README_FOR_APP: -------------------------------------------------------------------------------- 1 | Use this README file to introduce your application and point to useful places in the API for learning more. 2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. 3 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/mixins/_clearfix.scss: -------------------------------------------------------------------------------- 1 | // scss-docs-start clearfix 2 | @mixin clearfix() { 3 | &::after { 4 | display: block; 5 | clear: both; 6 | content: ""; 7 | } 8 | } 9 | // scss-docs-end clearfix 10 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/mixins/_lists.scss: -------------------------------------------------------------------------------- 1 | // Lists 2 | 3 | // Unstyled keeps list items block level, just removes default browser padding and list-style 4 | @mixin list-unstyled { 5 | padding-left: 0; 6 | list-style: none; 7 | } 8 | -------------------------------------------------------------------------------- /db/migrate/20150203153534_add_more_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddMoreToUsers < ActiveRecord::Migration[4.2] 2 | def change 3 | add_column :users, :enabled, :boolean, default: 1 4 | add_column :users, :remark, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20250711030331_add_llm_enable_to_contest_problem.rb: -------------------------------------------------------------------------------- 1 | class AddLlmEnableToContestProblem < ActiveRecord::Migration[8.0] 2 | def change 3 | add_column :contests_problems, :allow_llm, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/mixins/_color-scheme.scss: -------------------------------------------------------------------------------- 1 | // scss-docs-start mixin-color-scheme 2 | @mixin color-scheme($name) { 3 | @media (prefers-color-scheme: #{$name}) { 4 | @content; 5 | } 6 | } 7 | // scss-docs-end mixin-color-scheme 8 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/mixins/_text-truncate.scss: -------------------------------------------------------------------------------- 1 | // Text truncate 2 | // Requires inline-block or block for proper styling 3 | 4 | @mixin text-truncate() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /app/views/submissions/get_latest_submission_status.js.haml: -------------------------------------------------------------------------------- 1 | :plain 2 | $("#latest_status").html("#{j render({partial: 'submission_short', locals: {submission: @submission, show_id: true, sub_count: @submission.number, show_button: false } })}") 3 | -------------------------------------------------------------------------------- /db/migrate/20231218145225_add_last_heartbeat_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddLastHeartbeatToUser < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :last_heartbeat, :datetime 4 | add_column :tags, :color, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/assets/javascripts/tags.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/views/problems/_problem_head.html.haml: -------------------------------------------------------------------------------- 1 | %h3 2 | - if local_assigns[:prefix] 3 | %span= prefix 4 | %span.font-monospace.text-secondary [#{problem.name}] 5 | %span #{problem.full_name} 6 | - if local_assigns[:suffix] 7 | %span= suffix 8 | -------------------------------------------------------------------------------- /db/migrate/012_add_email_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddEmailToUsers < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :users, :email, :string 4 | end 5 | 6 | def self.down 7 | remove_column :users, :email 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/013_add_url_to_problem.rb: -------------------------------------------------------------------------------- 1 | class AddUrlToProblem < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :problems, :url, :string 4 | end 5 | 6 | def self.down 7 | remove_column :problems, :url 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20081210021333_add_timestamps_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddTimestampsToUsers < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_timestamps :users 4 | end 5 | 6 | def self.down 7 | remove_timestamps :users 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20121001033508_rename_configurations_to_grader_configurations.rb: -------------------------------------------------------------------------------- 1 | class RenameConfigurationsToGraderConfigurations < ActiveRecord::Migration[4.2] 2 | def change 3 | rename_table 'configurations', 'grader_configurations' 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220927074644_add_description_to_problems.rb: -------------------------------------------------------------------------------- 1 | class AddDescriptionToProblems < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :problems, :description, :text 4 | add_column :problems, :markdown, :boolean 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/views/comments/show.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = render partial: 'msg_modal_show', locals: {do_popup: true, 2 | header_msg: @header_msg, 3 | body_msg: markdown(@body_msg)} 4 | -------------------------------------------------------------------------------- /app/views/groups/toggle.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.append 'js-response' do 2 | :javascript 3 | set_group_switch(#{@group.id},#{@group.enabled?}) 4 | - if @toast 5 | = turbo_stream.append 'toast-area', partial: 'toast', locals: {toast: @toast} 6 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: cafe_grader_production 11 | -------------------------------------------------------------------------------- /db/migrate/026_add_body_to_problems.rb: -------------------------------------------------------------------------------- 1 | class AddBodyToProblems < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :problems, :body, :text 4 | end 5 | 6 | def self.down 7 | remove_column :problems, :body 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20220204080936_add_type_to_submission.rb: -------------------------------------------------------------------------------- 1 | class AddTypeToSubmission < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :submissions, :tag, :integer, default: 0 4 | add_column :problems, :difficulty, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /test/fixtures/user_contest_stats.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | one: 4 | user_id: 1 5 | started_at: 2010-01-24 12:44:58 6 | 7 | two: 8 | user_id: 1 9 | started_at: 2010-01-24 12:44:58 10 | -------------------------------------------------------------------------------- /app/NOTES: -------------------------------------------------------------------------------- 1 | (2/8) 2 | layout problem, fixed in a bad way. 3 | when login redirect_to main.list, the layout used is "login", but 4 | should be "application". 5 | so I added it manually, but it should be "convention". 6 | HAVE TO CHECK 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_tree ../../javascript .js 3 | //= link_tree ../../../vendor/javascript .js 4 | //= link datatables/datatables-new.min.css 5 | //entry point 6 | //= link my_app.js 7 | 8 | //= link_tree ../builds 9 | -------------------------------------------------------------------------------- /app/assets/javascripts/announcements.js.coffee: -------------------------------------------------------------------------------- 1 | #js for announcement 2 | $ -> 3 | $(document).ajaxError (event, jqxhr, settings, exception) -> 4 | if jqxhr.status 5 | alert 'We\'re sorry, but something went wrong (' + jqxhr.status + ')' 6 | return 7 | -------------------------------------------------------------------------------- /db/migrate/20230301170551_optimize_submission_indices.rb: -------------------------------------------------------------------------------- 1 | class OptimizeSubmissionIndices < ActiveRecord::Migration[7.0] 2 | def change 3 | remove_index :submissions, column: [:user_id,:problem_id] 4 | add_index :submissions, :problem_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/mixins/_resize.scss: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | @mixin resizable($direction) { 4 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 5 | resize: $direction; // Options: horizontal, vertical, both 6 | } 7 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | == cafe-grader forks at Chula 2 | * This is a development fork of https://github.com/cafe-grader-team/cafe-grader-web that is primarily used at Chulalongkorn University. 3 | * See https://github.com/cafe-grader-team/cafe-grader-web/wiki for installation. 4 | -------------------------------------------------------------------------------- /test/fixtures/test_pairs.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | one: 4 | problem_id: 1 5 | input: MyText 6 | solution: MyText 7 | 8 | two: 9 | problem_id: 1 10 | input: MyText 11 | solution: MyText 12 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.sass.scss: -------------------------------------------------------------------------------- 1 | // Entry point for your Sass build 2 | @import "my_bootstrap_var"; 3 | @import "bootstrap/scss/bootstrap"; 4 | //@use "select2/dist/css/select2.min.css"; 5 | 6 | 7 | @import 'my_font'; 8 | @import 'my_custom'; 9 | 10 | -------------------------------------------------------------------------------- /db/migrate/20100303095700_add_name_to_contests.rb: -------------------------------------------------------------------------------- 1 | class AddNameToContests < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :contests, :name, :string 4 | end 5 | 6 | def self.down 7 | remove_column :contests, :name 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/fixtures/announcements.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | one: 4 | author: MyString 5 | body: MyText 6 | published: false 7 | 8 | two: 9 | author: MyString 10 | body: MyText 11 | published: false 12 | -------------------------------------------------------------------------------- /app/javascript/controllers/user_admin/index_controller.js: -------------------------------------------------------------------------------- 1 | //import BaseController from './base_controller' 2 | import BaseController from "controllers/user_admin/base_controller" 3 | 4 | export default class extends BaseController { 5 | 6 | connect(event) { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /app/views/tags/index_query.json.jbuilder: -------------------------------------------------------------------------------- 1 | # for data table 2 | json.data do 3 | json.array! @tags do |tag| 4 | json.extract! tag, :id, :name, :description, :public, :kind 5 | json.kind_text I18n.t(tag.kind, scope: "activerecord.attributes.tag.kinds") 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/views/user_admin/new.html.haml: -------------------------------------------------------------------------------- 1 | %h1 New user 2 | .row 3 | .col-md-6 4 | .card.shadow-sm 5 | .card-body 6 | = simple_form_for @user, url: user_admin_index_path(@user), wrapper: :horizontal_form do |f| 7 | = render partial: 'form', locals: {f: f} 8 | -------------------------------------------------------------------------------- /app/views/users/email_error.html.haml: -------------------------------------------------------------------------------- 1 | %h1 2 | =t 'registration.errors.email.title' 3 | 4 | .errorExplanation 5 | =t 'registration.errors.email.expl', :email => @admin_email 6 | 7 | =t 'go_back_to' 8 | =link_to((t 'login_page'), {:controller => 'main', :action => 'login'}) 9 | -------------------------------------------------------------------------------- /db/migrate/20150503164846_change_userid_on_login.rb: -------------------------------------------------------------------------------- 1 | class ChangeUseridOnLogin < ActiveRecord::Migration[4.2] 2 | def up 3 | change_column :logins, :user_id, :integer 4 | end 5 | 6 | def down 7 | change_column :logins, :user_id, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170123162543_change_testcase_size.rb: -------------------------------------------------------------------------------- 1 | class ChangeTestcaseSize < ActiveRecord::Migration[4.2] 2 | def change 3 | change_column :testcases, :input, :text, :limit => 4294967295 4 | change_column :testcases, :sol, :text, :limit => 4294967295 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20250629104116_add_llm_support_to_comment.rb: -------------------------------------------------------------------------------- 1 | class AddLlmSupportToComment < ActiveRecord::Migration[8.0] 2 | def change 3 | add_column :comments, :llm_response, :text, limit: 16.megabytes - 1 4 | add_column :comments, :llm_model, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /test/fixtures/tags.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | name: MyString 5 | description: MyString 6 | public: 7 | 8 | two: 9 | name: MyString 10 | description: MyString 11 | public: 12 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/bootstrap-reboot.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/banner"; 2 | @include bsBanner(Reboot); 3 | 4 | @import "functions"; 5 | @import "variables"; 6 | @import "variables-dark"; 7 | @import "maps"; 8 | @import "mixins"; 9 | @import "root"; 10 | @import "reboot"; 11 | -------------------------------------------------------------------------------- /app/views/sites/edit.html.haml: -------------------------------------------------------------------------------- 1 | %h1 Editing site 2 | .row 3 | .col-md-4 4 | - content_for(:form_buttons) do 5 | = link_to t(:back), sites_path, class: 'btn btn-outline-secondary mx-2' 6 | = render partial: 'form', locals: {site: @site} 7 | .col-md-8 8 | 9 | 10 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/mixins/_banner.scss: -------------------------------------------------------------------------------- 1 | @mixin bsBanner($file) { 2 | /*! 3 | * Bootstrap #{$file} v5.3.6 (https://getbootstrap.com/) 4 | * Copyright 2011-2025 The Bootstrap Authors 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | */ 7 | } 8 | -------------------------------------------------------------------------------- /app/javascript/controllers/hello_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | 3 | export default class extends Controller { 4 | connect() { 5 | } 6 | 7 | test(event) { 8 | console.log('xxxx',this.element) 9 | console.log(event) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/views/problems/toggle.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.append 'js-response' do 2 | :javascript 3 | set_problem_switch(#{@problem.id},#{@problem.available},#{@problem.view_testcase}) 4 | - if @toast 5 | = turbo_stream.append 'toast-area', partial: 'toast', locals: {toast: @toast} 6 | -------------------------------------------------------------------------------- /db/migrate/016_add_task_to_grader_process.rb: -------------------------------------------------------------------------------- 1 | class AddTaskToGraderProcess < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :grader_processes, :task_id, :integer 4 | end 5 | 6 | def self.down 7 | remove_column :grader_processes, :task_id 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20090815171610_add_title_to_announcements.rb: -------------------------------------------------------------------------------- 1 | class AddTitleToAnnouncements < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :announcements, :title, :string 4 | end 5 | 6 | def self.down 7 | remove_column :announcements, :title 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20100506163112_add_notes_to_announcements.rb: -------------------------------------------------------------------------------- 1 | class AddNotesToAnnouncements < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :announcements, :notes, :string 4 | end 5 | 6 | def self.down 7 | remove_column :announcements, :notes 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/assets/stylesheets/problems.scss: -------------------------------------------------------------------------------- 1 | tr { 2 | &.available { 3 | background: #c0ffc0; 4 | } 5 | 6 | &.not-available { 7 | background: #ffc0c0; 8 | } 9 | } 10 | 11 | .import-log { 12 | background: lightgray; 13 | border: solid black 1px; 14 | padding: 10px; 15 | } 16 | -------------------------------------------------------------------------------- /app/views/messages/list_all.html.haml: -------------------------------------------------------------------------------- 1 | %h1 Console: all messages 2 | 3 | = link_to '[active messages]', :action => 'list_all' 4 | 5 | %table 6 | %tr 7 | %th From 8 | %th When 9 | %th Message 10 | %th 11 | = render :partial => "short_message", :collection => @messages 12 | -------------------------------------------------------------------------------- /app/engine/compiler/go.rb: -------------------------------------------------------------------------------- 1 | class Compiler::Go < Compiler 2 | def build_compile_command(source,bin) 3 | cmd = [ 4 | "#{Rails.configuration.worker[:compiler][:go]}", 5 | "build", 6 | "-o #{bin}", 7 | source 8 | ] 9 | return cmd.join ' ' 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/javascript/controllers/application.js: -------------------------------------------------------------------------------- 1 | import { Application } from "@hotwired/stimulus" 2 | 3 | const application = Application.start() 4 | 5 | // Configure Stimulus development experience 6 | application.debug = false 7 | window.Stimulus = application 8 | 9 | export { application } 10 | -------------------------------------------------------------------------------- /app/views/messages/console.html.haml: -------------------------------------------------------------------------------- 1 | 2 | %h1 Console: active messages 3 | 4 | = link_to '[all messages]', :action => 'list_all' 5 | 6 | %table 7 | %tr 8 | %th From 9 | %th When 10 | %th Message 11 | %th 12 | = render :partial => "short_message", :collection => @messages 13 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /db/migrate/20100124040107_add_description_to_config.rb: -------------------------------------------------------------------------------- 1 | class AddDescriptionToConfig < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :configurations, :description, :text 4 | end 5 | 6 | def self.down 7 | remove_column :configurations, :description 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20161008050135_modify_grader_process.rb: -------------------------------------------------------------------------------- 1 | class ModifyGraderProcess < ActiveRecord::Migration[4.2] 2 | def up 3 | change_column :grader_processes, :host, :string 4 | end 5 | 6 | def down 7 | change_column :grader_processes, :host, :string, limit: 20 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/engine/compiler/rust.rb: -------------------------------------------------------------------------------- 1 | class Compiler::Rust < Compiler 2 | def build_compile_command(source, bin) 3 | cmd = [ 4 | "#{Rails.configuration.worker[:compiler][:rust]}", 5 | "-o #{bin}", 6 | "-O", 7 | source 8 | ] 9 | return cmd.join ' ' 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/005_add_index_to_submissions.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToSubmissions < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_index :submissions, [:user_id, :problem_id] 4 | end 5 | 6 | def self.down 7 | remove_index :submissions, :column => [:user_id, :problem_id] 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/engine/compiler/blank.rb: -------------------------------------------------------------------------------- 1 | class Compiler::Blank < Compiler 2 | def build_compile_command(source, bin) 3 | # this basically is no-op 4 | cmd = [ 5 | "/usr/bin/echo " 6 | ] 7 | return cmd.join ' ' 8 | end 9 | 10 | def post_compile 11 | # do nothing 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/announcements/toggle.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.append 'js-response' do 2 | :javascript 3 | set_announcement_switch(#{@announcement.id},#{@announcement.published},#{@announcement.frontpage}) 4 | - if @toast 5 | = turbo_stream.append 'toast-area', partial: 'toast', locals: {toast: @toast} 6 | -------------------------------------------------------------------------------- /app/views/problems/update.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.replace :problem, partial: 'form', locals: {problem: @problem} 2 | - if @toast 3 | = turbo_stream.append 'toast-area', partial: 'toast', locals: {toast: @toast} 4 | = turbo_stream.append 'js-response' do 5 | :javascript 6 | problem_form_init() 7 | -------------------------------------------------------------------------------- /app/views/report/_all_time_hof.html.haml: -------------------------------------------------------------------------------- 1 | %h2 Paid in Full 2 | User with highest number of problem solved 3 | 4 | %h2 Polymaths 5 | User with highest number of problems each solved by more than 1 languages. 6 | 7 | %h2 Icebreakers 8 | If you solve the problem before 95% of your friends, you are an icebreaker. 9 | -------------------------------------------------------------------------------- /db/migrate/017_rename_grader_process_column_ip_to_host.rb: -------------------------------------------------------------------------------- 1 | class RenameGraderProcessColumnIpToHost < ActiveRecord::Migration[4.2] 2 | def self.up 3 | rename_column :grader_processes, :ip, :host 4 | end 5 | 6 | def self.down 7 | rename_column :grader_processes, :host, :ip 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/033_add_task_type_to_grader_processes.rb: -------------------------------------------------------------------------------- 1 | class AddTaskTypeToGraderProcesses < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column 'grader_processes', 'task_type', :string 4 | end 5 | 6 | def self.down 7 | remove_column 'grader_processes', 'task_type' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20081215012843_change_user_login_string_limit.rb: -------------------------------------------------------------------------------- 1 | class ChangeUserLoginStringLimit < ActiveRecord::Migration[4.2] 2 | def self.up 3 | execute "ALTER TABLE `users` CHANGE `login` `login` VARCHAR( 50 )" 4 | end 5 | 6 | def self.down 7 | # don't have to revert 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20241121143036_tags_display.rb: -------------------------------------------------------------------------------- 1 | class TagsDisplay < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :tags, :primary, :bool, default: false 4 | add_column :groups, :hidden, :bool, default: false 5 | change_column_default :tags, :color, from: nil, to: '#6C757D' 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/forms/_form-text.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Form text 3 | // 4 | 5 | .form-text { 6 | margin-top: $form-text-margin-top; 7 | @include font-size($form-text-font-size); 8 | font-style: $form-text-font-style; 9 | font-weight: $form-text-font-weight; 10 | color: $form-text-color; 11 | } 12 | -------------------------------------------------------------------------------- /app/views/application/_toggle_button.js.haml: -------------------------------------------------------------------------------- 1 | :plain 2 | var t = $("#{button_id}"); 3 | t.removeClass('btn-outline-secondary'); 4 | t.removeClass('btn-success'); 5 | t.removeClass('btn-warning'); 6 | t.addClass("btn-#{button_on ? 'success' : 'outline-secondary'}"); 7 | t.text("#{button_on ? 'Yes' : 'No'}"); 8 | -------------------------------------------------------------------------------- /app/views/problems/import_testcases.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.replace :import_dataset_into_problem, partial: 'problems/ds_import', locals: {problem: @problem, updated: @updated} 2 | - if @dataset 3 | = turbo_stream.replace :dataset_update, partial: 'datasets/form', locals: {ds: @dataset, updated: @updated} 4 | -------------------------------------------------------------------------------- /app/views/tags/edit.html.haml: -------------------------------------------------------------------------------- 1 | %h3 Edit tag 2 | .mb-3 3 | [ 4 | = link_to "#{mdi(:arrow_back)} Back".html_safe, tags_path, class: 'mx-1' 5 | ] 6 | .row.my-3.gx-3 7 | .col-md-6 8 | .card.shadow-sm 9 | .card-body 10 | = render 'form' 11 | .col-md-6 12 | = render 'tag_help' 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures/sites.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | first_site: 4 | name: First site 5 | started: false 6 | start_time: 2008-04-09 14:08:28 7 | 8 | second_site: 9 | name: Second site 10 | started: false 11 | start_time: 2008-04-09 14:08:28 12 | -------------------------------------------------------------------------------- /app/engine/compiler/pascal.rb: -------------------------------------------------------------------------------- 1 | class Compiler::Pascal < Compiler 2 | def build_compile_command(source,bin) 3 | cmd = [ 4 | "#{Rails.configuration.worker[:compiler][:pascal]}", 5 | "-O1 -XS -dCONTEST", 6 | "-o#{bin}", 7 | source 8 | ] 9 | return cmd.join ' ' 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /app/views/sites/show.html.haml: -------------------------------------------------------------------------------- 1 | %p 2 | %b Name: 3 | = h @site.name 4 | %p 5 | %b Password: 6 | = h @site.password 7 | %p 8 | %b Started: 9 | = h @site.started 10 | %p 11 | %b Start time: 12 | = h @site.start_time 13 | = link_to 'Edit', edit_site_path(@site) 14 | | 15 | = link_to 'Back', sites_path 16 | -------------------------------------------------------------------------------- /app/views/users/new_splash.html.haml: -------------------------------------------------------------------------------- 1 | %h1 2 | =t 'registration.successful_title' 3 | 4 | =t 'registration.email_sent' 5 | %br/ 6 | =t 'registration.email_verify_at', :email => @user.email 7 | %br/ 8 | %br/ 9 | 10 | =t 'go_back_to' 11 | =link_to((t 'login_page'), {:controller => 'main', :action => 'login'}) 12 | -------------------------------------------------------------------------------- /test/fixtures/rights.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | graders_right: 4 | controller: graders 5 | action: all 6 | 7 | user_admin_right: 8 | controller: user_admin 9 | action: all 10 | 11 | problems_right: 12 | controller: problems 13 | action: all 14 | -------------------------------------------------------------------------------- /app/models/group_problem.rb: -------------------------------------------------------------------------------- 1 | class GroupProblem < ApplicationRecord 2 | self.table_name = 'groups_problems' 3 | belongs_to :problem 4 | belongs_to :group 5 | validates_uniqueness_of :problem_id, scope: :group_id, message: ->(object, data) { "'#{Problem.find(data[:value]).full_name}' is already in the group" } 6 | end 7 | -------------------------------------------------------------------------------- /app/models/problem_tag.rb: -------------------------------------------------------------------------------- 1 | class ProblemTag < ApplicationRecord 2 | self.table_name = 'problems_tags' 3 | 4 | belongs_to :problem 5 | belongs_to :tag 6 | 7 | validates_uniqueness_of :problem_id, scope: :tag_id, message: ->(object, data) { "'#{Problem.find(data[:value]).full_name}' is already has this tag" } 8 | end 9 | -------------------------------------------------------------------------------- /app/validators/name_format_validator.rb: -------------------------------------------------------------------------------- 1 | class NameFormatValidator < ActiveModel::EachValidator 2 | # validates if name is a machine readable 3 | def validate_each(record, attribute, value) 4 | unless value =~ /\A[a-zA-Z\d\-\_\[\]()]+\z/ 5 | record.errors.add(attribute, :name_format) 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20090426131044_add_terminated_to_grader_processes.rb: -------------------------------------------------------------------------------- 1 | class AddTerminatedToGraderProcesses < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :grader_processes, :terminated, :boolean 4 | end 5 | 6 | def self.down 7 | remove_column :grader_processes, :terminated 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/problems/toggle.js.haml: -------------------------------------------------------------------------------- 1 | = render partial: 'toggle_button', 2 | locals: {button_id: "#problem-avail-#{@problem.id}",button_on: @problem.available } 3 | :plain 4 | r = $("#prob-#{@problem.id}"); 5 | r.removeClass('table-success'); 6 | r.addClass("#{@problem.available? ? 'table-success' : ''}"); 7 | 8 | -------------------------------------------------------------------------------- /db/migrate/20081107145815_add_frontpage_flag_to_announcement.rb: -------------------------------------------------------------------------------- 1 | class AddFrontpageFlagToAnnouncement < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :announcements, "frontpage", :boolean, :default => 0 4 | end 5 | 6 | def self.down 7 | remove_column :announcements, "frontpage" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20100219014840_add_description_filename_to_problems.rb: -------------------------------------------------------------------------------- 1 | class AddDescriptionFilenameToProblems < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :problems, :description_filename, :string 4 | end 5 | 6 | def self.down 7 | remove_column :problems, :description_filename 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20140823031747_add_more_detail_to_submission.rb: -------------------------------------------------------------------------------- 1 | class AddMoreDetailToSubmission < ActiveRecord::Migration[4.2] 2 | def change 3 | add_column :submissions, :max_runtime, :float 4 | add_column :submissions, :peak_memory, :integer 5 | add_column :submissions, :effective_code_length, :integer 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/_forms.scss: -------------------------------------------------------------------------------- 1 | @import "forms/labels"; 2 | @import "forms/form-text"; 3 | @import "forms/form-control"; 4 | @import "forms/form-select"; 5 | @import "forms/form-check"; 6 | @import "forms/form-range"; 7 | @import "forms/floating-labels"; 8 | @import "forms/input-group"; 9 | @import "forms/validation"; 10 | -------------------------------------------------------------------------------- /app/engine/judge_logger.rb: -------------------------------------------------------------------------------- 1 | class JudgeLogger 2 | @@logger_filename = Rails.root.join 'log', 'judge.log' 3 | def self.logger 4 | @@logger ||= Logger.new(@@logger_filename) 5 | if @@logger_filename.exist? == false 6 | @@logger = Logger.new(@@logger_filename) 7 | end 8 | return @@logger 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/views/application/_msg_modal_show.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | -# replace the modal (and show it if necessary) 2 | = turbo_stream.update :msg_modal_main, partial: 'msg_modal', locals: local_assigns 3 | 4 | - id = local_assigns.fetch(:id, 'msg_modal') 5 | = turbo_stream.append 'js-response' do 6 | :javascript 7 | $("##{id}").modal('show') 8 | -------------------------------------------------------------------------------- /app/views/configurations/edit.html.haml: -------------------------------------------------------------------------------- 1 | = turbo_frame_tag dom_id(@config,"config") do 2 | = simple_form_for @config do |f| 3 | = f.input :value, label: false, autofocus: true 4 | = f.submit "Update", class: 'btn btn-sm btn-primary' 5 | = link_to "Cancel", grader_configuration_index_path, class: 'btn btn-sm btn-outline-secondary' 6 | -------------------------------------------------------------------------------- /app/views/groups/toggle.js.haml: -------------------------------------------------------------------------------- 1 | = render partial: 'toggle_button', 2 | locals: {button_id: "#group-enabled-#{@group.id}",button_on: @group.enabled } 3 | :plain 4 | r = $("#group-#{@group.id}"); 5 | r.removeClass('success'); 6 | r.removeClass('danger'); 7 | r.addClass("#{@group.enabled? ? 'success' : 'danger'}"); 8 | 9 | -------------------------------------------------------------------------------- /db/migrate/021_change_compiler_message_type_test_request.rb: -------------------------------------------------------------------------------- 1 | class ChangeCompilerMessageTypeTestRequest < ActiveRecord::Migration[4.2] 2 | def self.up 3 | change_column :test_requests, :compiler_message, :text 4 | end 5 | 6 | def self.down 7 | change_column :test_requests, :compiler_message, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20090206145016_add_contest_flag_to_announcements.rb: -------------------------------------------------------------------------------- 1 | class AddContestFlagToAnnouncements < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :announcements, :contest_only, :boolean, :default => false 4 | end 5 | 6 | def self.down 7 | remove_column :announcements, :contest_only 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/comments/submission_and_toast.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.update 'submission_comments', partial: 'submissions/comments', locals: {submission: @submission, has_processing: @submission.has_processing_comments?, show_edit: @show_edit} 2 | - if @toast 3 | = turbo_stream.append 'toast-area', partial: 'toast', locals: {toast: @toast} 4 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = "1.0" 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/helpers/_stretched-link.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Stretched link 3 | // 4 | 5 | .stretched-link { 6 | &::#{$stretched-link-pseudo-element} { 7 | position: absolute; 8 | top: 0; 9 | right: 0; 10 | bottom: 0; 11 | left: 0; 12 | z-index: $stretched-link-z-index; 13 | content: ""; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/views/datasets/update.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.update :dataset_select, partial: 'datasets/dataset_select', locals: {ds: @dataset, problem: @dataset.problem} 2 | = turbo_stream.update :dataset, partial: 'datasets/form', locals: {ds: @dataset} 3 | - if @toast 4 | = turbo_stream.append 'toast-area', partial: 'toast', locals: {toast: @toast} 5 | -------------------------------------------------------------------------------- /app/views/groups/_group_users.html.haml: -------------------------------------------------------------------------------- 1 | = turbo_frame_tag :user_table_frame do 2 | %table#user_table.table.datatable.table-hover 3 | %thead 4 | %tr 5 | %th Login 6 | %th Full name 7 | %th Role 8 | %th Remark 9 | %th Enabled 10 | %th Remove 11 | %th Set role 12 | %tbody 13 | -------------------------------------------------------------------------------- /db/migrate/20100328123325_add_forced_logout_to_user_contest_stat.rb: -------------------------------------------------------------------------------- 1 | class AddForcedLogoutToUserContestStat < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :user_contest_stats, :forced_logout, :boolean 4 | end 5 | 6 | def self.down 7 | remove_column :user_contest_stats, :forced_logout, :boolean 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20140826095949_create_logins.rb: -------------------------------------------------------------------------------- 1 | class CreateLogins < ActiveRecord::Migration[4.2] 2 | def change 3 | create_table :logins, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.string :user_id 5 | t.string :ip_address 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /test/concurrent/task_test_teardown.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] = "test" 2 | require File.expand_path(File.dirname(__FILE__) + "/../../config/environment") 3 | 4 | def clear_all_tasks 5 | Task.all.each do |task| 6 | task.destroy 7 | end 8 | end 9 | 10 | puts Task.where(status: Task::STATUS_COMPLETE).length 11 | 12 | clear_all_tasks 13 | 14 | -------------------------------------------------------------------------------- /app/engine/compiler/haskell.rb: -------------------------------------------------------------------------------- 1 | class Compiler::Haskell < Compiler 2 | def build_compile_command(source,bin) 3 | cmd = [ 4 | "#{Rails.configuration.worker[:compiler][:haskell]}", 5 | "-odir /mybin", 6 | "-outputdir /mybin", 7 | "-o #{bin}", 8 | source 9 | ] 10 | return cmd.join ' ' 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/helpers/turbo_stream_actions_helper.rb: -------------------------------------------------------------------------------- 1 | module TurboStreamActionsHelper 2 | # this allows turbo_stream.bootbox('xxx') to be used 3 | # in controllers and views 4 | def bootbox(message) 5 | turbo_stream_action_tag :bootbox, message: message 6 | end 7 | 8 | end 9 | 10 | Turbo::Streams::TagBuilder.prepend(TurboStreamActionsHelper) 11 | -------------------------------------------------------------------------------- /app/views/layouts/_js_route.html.haml: -------------------------------------------------------------------------------- 1 | :javascript 2 | // generate path to be used in js 3 | // for any parameterized id, the id is replaced with -123 to be gsubbed, later 4 | window.AppRoute = { 5 | contest: "#{contest_path(-123)}", 6 | view_contest: "#{view_contest_path(-123)}", 7 | clone_contest: "#{clone_contest_path(-123)}", 8 | } 9 | -------------------------------------------------------------------------------- /config/recurring.yml: -------------------------------------------------------------------------------- 1 | # production: 2 | # periodic_cleanup: 3 | # class: CleanSoftDeletedRecordsJob 4 | # queue: background 5 | # args: [ 1000, { batch_size: 500 } ] 6 | # schedule: every hour 7 | # periodic_command: 8 | # command: "SoftDeletedRecord.due.delete_all" 9 | # priority: 2 10 | # schedule: at 5am every day 11 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/helpers/_stacks.scss: -------------------------------------------------------------------------------- 1 | // scss-docs-start stacks 2 | .hstack { 3 | display: flex; 4 | flex-direction: row; 5 | align-items: center; 6 | align-self: stretch; 7 | } 8 | 9 | .vstack { 10 | display: flex; 11 | flex: 1 1 auto; 12 | flex-direction: column; 13 | align-self: stretch; 14 | } 15 | // scss-docs-end stacks 16 | -------------------------------------------------------------------------------- /app/views/comments/manage_problem.turbo_stream.haml: -------------------------------------------------------------------------------- 1 | = turbo_stream.update :hint_select, partial: 'problems/hint_select' 2 | = turbo_stream.update :hint_detail, partial: 'hint_edit', locals: {hint: @hint} 3 | -# = turbo_stream.update :hint_detail, partial: 'datasets/form' 4 | - if @toast 5 | = turbo_stream.append 'toast-area', partial: 'toast', locals: {toast: @toast} 6 | -------------------------------------------------------------------------------- /db/migrate/20231228144804_more_status_on_worker_dataset.rb: -------------------------------------------------------------------------------- 1 | class MoreStatusOnWorkerDataset < ActiveRecord::Migration[7.0] 2 | def change 3 | rename_column :worker_datasets, :status, :testcases_status 4 | add_column :worker_datasets, :managers_status, :integer, limit: 1, default: 0 5 | add_column :datasets, :initializer_filename, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/fixtures/contests.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 2 | 3 | contest_a: 4 | name: contest_a 5 | title: Contest A 6 | enabled: true 7 | 8 | contest_b: 9 | name: contest_b 10 | title: Contest B 11 | enabled: true 12 | 13 | contest_c: 14 | name: contest_c 15 | title: Contest C 16 | enabled: false 17 | -------------------------------------------------------------------------------- /app/models/contest_user.rb: -------------------------------------------------------------------------------- 1 | class ContestUser < ApplicationRecord 2 | self.table_name = 'contests_users' 3 | belongs_to :contest 4 | belongs_to :user 5 | 6 | enum :role, {user: 0, editor: 2} 7 | 8 | #validates_uniqueness_of :user_id, scope: :contest_id, message: ->(object, data) { "'#{User.find(data[:value]).full_name}' is already in the contest" } 9 | end 10 | -------------------------------------------------------------------------------- /app/models/group_user.rb: -------------------------------------------------------------------------------- 1 | class GroupUser < ApplicationRecord 2 | self.table_name = 'groups_users' 3 | 4 | enum :role, {user: 0, reporter: 1, editor: 2} 5 | 6 | belongs_to :user 7 | belongs_to :group 8 | validates_uniqueness_of :user_id, scope: :group_id, message: ->(object, data) { "'#{User.find(data[:value]).full_name}' is already in the group" } 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20150914090545_create_heart_beats.rb: -------------------------------------------------------------------------------- 1 | class CreateHeartBeats < ActiveRecord::Migration[4.2] 2 | def change 3 | create_table :heart_beats, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.column 'user_id',:integer 5 | t.column 'ip_address',:string 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/models/worker_dataset.rb: -------------------------------------------------------------------------------- 1 | class WorkerDataset < ApplicationRecord 2 | belongs_to :dataset 3 | #should belong to worker but we don't have the hosts table yet 4 | #belongs_to :worker 5 | 6 | enum :testcases_status, {created: 0, downloading: 1, ready: 3}, prefix: :ts 7 | enum :managers_status, {created: 0, downloading: 1, ready: 3}, prefix: :ms 8 | 9 | 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/034_create_countries.rb: -------------------------------------------------------------------------------- 1 | class CreateCountries < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :countries, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.column :name, :string 5 | t.timestamps 6 | end 7 | end 8 | 9 | def self.down 10 | drop_table :countries 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/views/report/_report_menu.html.haml: -------------------------------------------------------------------------------- 1 | 2 | .task-menu 3 | Reports 4 | %br/ 5 | = link_to '[Hall of Fame]', :action => 'problem_hof' 6 | = link_to '[Struggle]', :action => 'stuck' 7 | = link_to '[Cheat Detection]', :action => 'cheat_report' 8 | = link_to '[Cheat Detail]', :action => 'cheat_scruntinize' 9 | = link_to '[Multiple Login]', :action => 'multiple_login' 10 | -------------------------------------------------------------------------------- /app/views/submissions/_form.html.haml: -------------------------------------------------------------------------------- 1 | = form_for @submission do |f| 2 | - if @submission.errors.any? 3 | #error_explanation 4 | %h2= "#{pluralize(@submission.errors.count, "error")} prohibited this submission from being saved:" 5 | %ul 6 | - @submission.errors.full_messages.each do |msg| 7 | %li= msg 8 | 9 | .actions 10 | = f.submit 'Save' 11 | -------------------------------------------------------------------------------- /config/queue.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | dispatchers: 3 | - polling_interval: 1 4 | batch_size: 500 5 | workers: 6 | - queues: "*" 7 | threads: 3 8 | processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> 9 | polling_interval: 0.1 10 | 11 | development: 12 | <<: *default 13 | 14 | test: 15 | <<: *default 16 | 17 | production: 18 | <<: *default 19 | -------------------------------------------------------------------------------- /db/migrate/20150914223258_add_more_config.rb: -------------------------------------------------------------------------------- 1 | class AddMoreConfig < ActiveRecord::Migration[4.2] 2 | def up 3 | GraderConfiguration.create key: 'right.bypass_agreement', value_type: 'boolean', value:'true', description:'When false, a check box to accept license agreement appear at login and the user must click accept' 4 | end 5 | 6 | def down 7 | 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170914150545_create_tags.rb: -------------------------------------------------------------------------------- 1 | class CreateTags < ActiveRecord::Migration[4.2] 2 | def change 3 | create_table :tags, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.string :name, null: false 5 | t.text :description 6 | t.boolean :public 7 | 8 | t.timestamps null: false 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/assets/stylesheets/graders.scss: -------------------------------------------------------------------------------- 1 | table.graders tr { 2 | &.active { 3 | border: 1px solid black; 4 | background: lightgreen; 5 | text-align: center; 6 | } 7 | 8 | &.inactive { 9 | border: 1px solid black; 10 | background: #ffcccc; 11 | text-align: center; 12 | } 13 | } 14 | 15 | .submitbox .item { 16 | padding-right: 5px; 17 | float: left; 18 | } 19 | -------------------------------------------------------------------------------- /app/views/messages/_message.html.haml: -------------------------------------------------------------------------------- 1 | .message 2 | .stat 3 | = "#{message.sender.full_name} at #{message.created_at}" 4 | %div{:class => (!defined?(reply) or (reply==false)) ? "body" : "reply-body"} 5 | = simple_format(message.body) 6 | - if message.replied_messages.length!=0 7 | = render :partial => 'message', :collection => message.replied_messages, :locals => {:reply => true} 8 | -------------------------------------------------------------------------------- /db/migrate/20150827131927_create_submission_view_logs.rb: -------------------------------------------------------------------------------- 1 | class CreateSubmissionViewLogs < ActiveRecord::Migration[4.2] 2 | def change 3 | create_table :submission_view_logs, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.integer :user_id 5 | t.integer :submission_id 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "dependencies": { 4 | "bootstrap": "^5.3.6", 5 | "sass": "^1.89.2", 6 | "select2": "^4.1.0-rc.0", 7 | "select2-bootstrap-5-theme": "^1.3.0" 8 | }, 9 | "scripts": { 10 | "build:css": "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css --no-source-map --load-path=vendor" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/model_solutions/61460/cpp_fibo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | 6 | int main(){ 7 | int in; 8 | scanf("%d",&in); 9 | vector v; 10 | v.push_back(0); 11 | v.push_back(1); 12 | for(int i=2;i<=in;i++){ 13 | v.push_back(v[i-1]+v[i-2]); 14 | } 15 | printf("%d",v[in]); 16 | return 0; 17 | } -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/mode-text.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/mode/text"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /app/models/contest_problem.rb: -------------------------------------------------------------------------------- 1 | class ContestProblem < ApplicationRecord 2 | self.table_name = 'contests_problems' 3 | belongs_to :contest 4 | belongs_to :problem 5 | 6 | # scope with available problems in contest mode for that user 7 | scope :from_available_contests_problems_for_user, ->(user_id) { 8 | where(problem: Problem.contests_problems_for_user(user_id)) 9 | } 10 | end 11 | -------------------------------------------------------------------------------- /app/views/graders/queues.html.haml: -------------------------------------------------------------------------------- 1 | %h1 Solid Queue (Latest jobs) 2 | 3 | %div{ data: { turbo: true, 4 | controller: 'datatables--init init-ui-component', 5 | 'datatables--init-config-name-value': 'solidQueueJob', 6 | 'datatables--init-ajax-url-value': queues_query_grader_processes_path 7 | } 8 | } 9 | %table#table.table.table-hover 10 | %thead 11 | %tr 12 | -------------------------------------------------------------------------------- /app/views/graders/queues_query.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.draw params['draw']&.to_i 2 | json.recordsTotal @recordsTotal 3 | json.recordsFiltered @recordsFiltered 4 | json.data do 5 | json.array! @jobs do |job| 6 | json.extract! job, :id, :queue_name, :class_name, :status, :created_at, :submission_id, :detail, :detail_html 7 | json.extract! job, :user_name, :problem_name 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/008_create_tasks.rb: -------------------------------------------------------------------------------- 1 | class CreateTasks < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :tasks, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.column 'submission_id', :integer 5 | t.column 'created_at', :datetime 6 | end 7 | end 8 | 9 | def self.down 10 | drop_table :tasks 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20150916054105_update_heart_beat.rb: -------------------------------------------------------------------------------- 1 | class UpdateHeartBeat < ActiveRecord::Migration[4.2] 2 | def up 3 | GraderConfiguration.create key: 'right.heartbeat_response', value_type: 'string', value:'OK', description:'Heart beat response text' 4 | add_index :heart_beats, :updated_at 5 | end 6 | 7 | def down 8 | remove_index :heart_beats, :updated_at 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/d.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/d"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /app/javascript/cafe_bundle.js: -------------------------------------------------------------------------------- 1 | // this combines several custom export into one big files 2 | // it also runs all event listener setup (in cafe_event.js) 3 | // this should be imported by 4 | // import * as cafe from 'cafe_bundle' 5 | 6 | export * from 'cafe' 7 | export * from 'cafe_datatable' 8 | export * from 'cafe_turbo' 9 | 10 | 11 | // setup the event listener 12 | import 'cafe_event' 13 | -------------------------------------------------------------------------------- /app/views/application/_msg_modal_show.js.haml: -------------------------------------------------------------------------------- 1 | - modal_id = local_assigns.fetch(:modal_id, 'msg_modal') 2 | - header_msg = local_assigns.fetch(:header_msg, 'Message') 3 | - body_msg = local_assigns.fetch(:body_msg, 'Body Placeholder') 4 | :plain 5 | $('##{modal_id} .modal-header h4').html("#{j header_msg}") 6 | $('##{modal_id} .modal-body pre').html("#{j body_msg}") 7 | $('##{modal_id}').modal('show') 8 | -------------------------------------------------------------------------------- /app/views/report/ai_query.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.draw params['draw']&.to_i 2 | json.recordsTotal @recordsTotal 3 | json.recordsFiltered @recordsFiltered 4 | json.data do 5 | json.array! @jobs do |job| 6 | json.extract! job, :id, :queue_name, :class_name, :status, :created_at, :submission_id, :detail, :detail_html 7 | json.extract! job, :user_name, :problem_name, :points 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20250717145356_alter_utf8_for_comments.rb: -------------------------------------------------------------------------------- 1 | class AlterUtf8ForComments < ActiveRecord::Migration[8.0] 2 | def up 3 | execute "ALTER TABLE comment_reveals CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci" 4 | execute "ALTER TABLE comments CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci" 5 | end 6 | 7 | def down 8 | # do nothing 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/abap.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/abap"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/ada.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/ada"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/alda.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/alda"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/apex.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/apex"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/aql.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/aql"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/asl.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/asl"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/astro.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/astro"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/basic.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/basic"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/cirru.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/cirru"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/cobol.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/cobol"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/csp.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/csp"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/csv.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/csv"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/curly.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/curly"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/dot.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/dot"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/ejs.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/ejs"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/elm.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/elm"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/flix.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/flix"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/forth.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/forth"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/ftl.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/ftl"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/gcode.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/gcode"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/glsl.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/glsl"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/haxe.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/haxe"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/hjson.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/hjson"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/ini.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/ini"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/ion.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/ion"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/jack.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/jack"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/jade.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/jade"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/jexl.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/jexl"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/json.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/json"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/json5.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/json5"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/jssm.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/jssm"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/jsx.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/jsx"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/julia.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/julia"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/latex.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/latex"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/latte.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/latte"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/less.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/less"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/lisp.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/lisp"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/mask.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/mask"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/mel.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/mel"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/mips.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/mips"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/mixal.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/mixal"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/mysql.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/mysql"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/nasal.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/nasal"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/nginx.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/nginx"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/nim.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/nim"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/nix.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/nix"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/nsis.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/nsis"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/ocaml.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/ocaml"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/odin.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/odin"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/pgsql.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/pgsql"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/pig.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/pig"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/plsql.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/plsql"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/praat.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/praat"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/prql.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/prql"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/qml.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/qml"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/raku.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/raku"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/rdoc.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/rdoc"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/red.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/red"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/rhtml.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/rhtml"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/rust.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/rust"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/sac.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/sac"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/sass.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/sass"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/scad.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/scad"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/scala.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/scala"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/scss.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/scss"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/sjs.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/sjs"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/slim.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/slim"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/space.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/space"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/svg.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/svg"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/swift.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/swift"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/text.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/text"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/toml.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/toml"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/tsv.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/tsv"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/tsx.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/tsx"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/twig.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/twig"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/vhdl.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/vhdl"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/vue.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/vue"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/xml.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/xml"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/yaml.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/yaml"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/zeek.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/zeek"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/zig.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/zig"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /app/javascript/controllers/children_select_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | 3 | export default class extends Controller { 4 | static targets = [ 'selectForm' ] 5 | 6 | // trigger when the drop down item is selected 7 | // submit the form 8 | childSelect(event) { 9 | const form = this.selectFormTarget 10 | form.requestSubmit() 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /db/migrate/20250609154731_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from active_storage (originally 20211119233751) 2 | class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0] 3 | def change 4 | return unless table_exists?(:active_storage_blobs) 5 | 6 | change_column_null(:active_storage_blobs, :checksum, true) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/ext-error_marker.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/ext/error_marker"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/bibtex.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/bibtex"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/crystal.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/crystal"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/csharp.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/csharp"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/eiffel.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/eiffel"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/elixir.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/elixir"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/fortran.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/fortran"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/fsharp.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/fsharp"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/gherkin.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/gherkin"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/golang.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/golang"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/groovy.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/groovy"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/kotlin.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/kotlin"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/logiql.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/logiql"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/logtalk.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/logtalk"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/luapage.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/luapage"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/lucene.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/lucene"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/matlab.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/matlab"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/partiql.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/partiql"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/pascal.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/pascal"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/prisma.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/prisma"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/prolog.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/prolog"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/puppet.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/puppet"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/scheme.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/scheme"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/scrypt.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/scrypt"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/smarty.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/smarty"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/smithy.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/smithy"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/sparql.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/sparql"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/stylus.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/stylus"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/turtle.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/turtle"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/verilog.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/verilog"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /app/views/problems/_acquire_hint_confirm.html.haml: -------------------------------------------------------------------------------- 1 | :markdown 2 | This hint **costs #{hint.cost || 0} points** to reveal 3 | and you haven't revealed it yet. By proceeding, the __full score__ 4 | for this problem will be __reduced by #{hint.cost || 0} points__ 5 | and the hint will then be permanently unlocked for you 6 | to view whenever you wish. 7 | 8 | **Do you want to confirm and reveal the hint?** 9 | -------------------------------------------------------------------------------- /db/migrate/031_add_supports_for_output_only_problems.rb: -------------------------------------------------------------------------------- 1 | class AddSupportsForOutputOnlyProblems < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :submissions, :source_filename, :string 4 | add_column :problems, :output_only, :boolean 5 | end 6 | 7 | def self.down 8 | remove_column :submissions, :source_filename 9 | remove_column :problems, :output_only 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20170427070345_add_heart_beat_full.rb: -------------------------------------------------------------------------------- 1 | class AddHeartBeatFull < ActiveRecord::Migration[4.2] 2 | def up 3 | GraderConfiguration.create key: 'right.heartbeat_response_full', value_type: 'string', value:'RESTART', description:'Heart beat response text when user got full score (set this value to the empty string to disable this feature)' 4 | end 5 | 6 | def down 7 | 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/concurrent/task_test_get.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] = "test" 2 | require File.expand_path(File.dirname(__FILE__) + "/../../config/environment") 3 | 4 | def take_wait_return 5 | task = Task.get_inqueue_and_change_status(Task::STATUS_GRADING) 6 | sleep (rand)/10.0 7 | task.status_complete 8 | task.save! 9 | end 10 | 11 | n = 300 12 | 13 | n.times do |i| 14 | take_wait_return 15 | puts i 16 | end 17 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/asciidoc.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/asciidoc"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/autohotkey.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/autohotkey"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/batchfile.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/batchfile"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/c9search.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/c9search"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/coldfusion.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/coldfusion"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/cuttlefish.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/cuttlefish"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/dockerfile.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/dockerfile"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/gitignore.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/gitignore"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/handlebars.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/handlebars"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/html_ruby.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/html_ruby"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/livescript.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/livescript"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/mediawiki.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/mediawiki"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/mushcode.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/mushcode"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/nunjucks.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/nunjucks"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/objectivec.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/objectivec"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/plain_text.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/plain_text"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/powershell.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/powershell"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/properties.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/properties"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/protobuf.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/protobuf"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/redshift.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/redshift"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/terraform.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/terraform"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/typescript.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/typescript"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/vbscript.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/vbscript"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /db/migrate/20100216105730_create_contests.rb: -------------------------------------------------------------------------------- 1 | class CreateContests < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :contests, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.string :title 5 | t.boolean :enabled 6 | 7 | t.timestamps 8 | end 9 | end 10 | 11 | def self.down 12 | drop_table :contests 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /test/fixtures/comments.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | commentable: one 5 | user: one 6 | kind: 1 7 | enabled: false 8 | cost: 1.5 9 | body: MyText 10 | remark: MyText 11 | 12 | two: 13 | commentable: two 14 | user: two 15 | kind: 1 16 | enabled: false 17 | cost: 1.5 18 | body: MyText 19 | remark: MyText 20 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/apache_conf.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/apache_conf"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/applescript.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/applescript"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/assembly_x86.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/assembly_x86"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/csound_score.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/csound_score"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/html_elixir.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/html_elixir"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/soy_template.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/soy_template"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/visualforce.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/visualforce"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /db/migrate/011_add_language_ext.rb: -------------------------------------------------------------------------------- 1 | class AddLanguageExt < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :languages, :ext, :string, :limit => 10 4 | 5 | Language.reset_column_information 6 | langs = Language.all 7 | langs.each do |l| 8 | l.ext = l.name 9 | l.save 10 | end 11 | end 12 | 13 | def self.down 14 | remove_column :languages, :ext 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/datatables/readme.md: -------------------------------------------------------------------------------- 1 | These files is a part of the zip file downloaded from the datatable website 2 | 3 | https://datatables.net/download/#bs5/jszip-3.10.1/dt-2.1.7/af-2.7.0/b-3.1.2/b-colvis-3.1.2/b-html5-3.1.2/b-print-3.1.2/cr-2.0.4/date-1.5.4/fc-5.0.1/fh-4.0.1/kt-2.12.1/r-3.0.3/rg-1.5.0/rr-1.5.0/sc-2.4.3/sb-1.8.0/sp-2.3.2/sl-2.1.0/sr-1.4.1 4 | 5 | I unzip it and move the css files to this location 6 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/assembly_arm32.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/assembly_arm32"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/haskell_cabal.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/haskell_cabal"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /app/views/users/profile.html.haml: -------------------------------------------------------------------------------- 1 | %h1 Account Setting 2 | .row 3 | .col-md-6 4 | = simple_form_for @current_user, url: update_self_users_path do |f| 5 | = f.association :default_language, collection: Language.all, include_blank: '-- No default language --'.html_safe 6 | = f.input :password 7 | = f.input :password_confirmation 8 | = f.button :submit, class: 'btn btn-primary' 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /db/migrate/024_create_sites.rb: -------------------------------------------------------------------------------- 1 | class CreateSites < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :sites, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.string :name 5 | t.boolean :started 6 | t.datetime :start_time 7 | 8 | t.timestamps 9 | end 10 | end 11 | 12 | def self.down 13 | drop_table :sites 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /vendor/javascript/ace-noconflict/snippets/php_laravel_blade.js: -------------------------------------------------------------------------------- 1 | 2 | ; (function() { 3 | ace.require(["ace/snippets/php_laravel_blade"], function(m) { 4 | if (typeof module == "object" && typeof exports == "object" && module) { 5 | module.exports = m; 6 | } 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /app/views/contests/view.html.haml: -------------------------------------------------------------------------------- 1 | %h2 2 | Contest Status 3 | %span.text-body-secondary.font-monospace (#{@contest.name}) 4 | .row 5 | .col 6 | [ 7 | = link_to "#{mdi(:arrow_back)} Back".html_safe, contests_path, class: 'mx-1' 8 | ] 9 | 10 | .mt-3 11 | = render partial: 'report/score_table', locals: {problems: @problems, link_for_data: view_query_contest_path(@contest), contest_id: @contest.id } 12 | 13 | -------------------------------------------------------------------------------- /app/views/main/_problem.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! problem, :id, :name, :full_name, :difficulty, :permitted_lang 2 | json.tags problem.tags.pluck(:name) 3 | json.statement_url download_by_type_problem_path(problem, 'statement') if problem.statement.attached? 4 | json.attachment_url download_by_type_problem_path(problem, 'attachment') if problem.attachment.attached? 5 | json.best_score score = @prob_submissions[problem.id][:max_score] 6 | -------------------------------------------------------------------------------- /app/views/report/problem_hof.html.haml: -------------------------------------------------------------------------------- 1 | .row.my-2 2 | .col-md-6 3 | = render 'problem_chooser', {problems: @problems, selected_problem: @problem, target_url_method: :problem_hof_view_report_path} 4 | 5 | - unless params[:id] 6 | Please select a problem from the list above. 7 | - else 8 | .my-3 9 | = render partial: 'problems/problem_head', locals: {problem: @problem} 10 | = render partial: 'task_hof' 11 | 12 | -------------------------------------------------------------------------------- /db/migrate/027_create_descriptions.rb: -------------------------------------------------------------------------------- 1 | class CreateDescriptions < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :descriptions, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.column :body, :text 5 | t.column :markdowned, :boolean 6 | t.timestamps 7 | end 8 | end 9 | 10 | def self.down 11 | drop_table :descriptions 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/mixins/_backdrop.scss: -------------------------------------------------------------------------------- 1 | // Shared between modals and offcanvases 2 | @mixin overlay-backdrop($zindex, $backdrop-bg, $backdrop-opacity) { 3 | position: fixed; 4 | top: 0; 5 | left: 0; 6 | z-index: $zindex; 7 | width: 100vw; 8 | height: 100vh; 9 | background-color: $backdrop-bg; 10 | 11 | // Fade for backdrop 12 | &.fade { opacity: 0; } 13 | &.show { opacity: $backdrop-opacity; } 14 | } 15 | -------------------------------------------------------------------------------- /app/helpers/main_helper.rb: -------------------------------------------------------------------------------- 1 | module MainHelper 2 | def link_to_description_if_any(name, problem, **options) 3 | if !problem.url.blank? 4 | return link_to name, problem.url, **options 5 | elsif problem.statement.attached? 6 | return link_to name, download_by_type_problem_path(problem, 'statement'), target: '_blank', data: {turbo: false}, **options 7 | else 8 | return '' 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/views/user_admin/show.html.haml: -------------------------------------------------------------------------------- 1 | %h1 User information 2 | - for column in User.content_columns 3 | %p 4 | %b 5 | = column.human_name 6 | \: 7 | = h @user.send(column.name) 8 | %p 9 | %strong Group 10 | \: 11 | = @user.groups.map{ |x| link_to(x.name,group_path(x)).html_safe}.join(', ').html_safe 12 | = link_to 'Edit', :action => 'edit', :id => @user 13 | | 14 | = link_to 'Back', :action => 'index' 15 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/bootstrap-utilities.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/banner"; 2 | @include bsBanner(Utilities); 3 | 4 | // Configuration 5 | @import "functions"; 6 | @import "variables"; 7 | @import "variables-dark"; 8 | @import "maps"; 9 | @import "mixins"; 10 | @import "utilities"; 11 | 12 | // Layout & components 13 | @import "root"; 14 | 15 | // Helpers 16 | @import "helpers"; 17 | 18 | // Utilities 19 | @import "utilities/api"; 20 | -------------------------------------------------------------------------------- /test/problem_examples/fibo/model_solutions/26800/cpp_fibo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | int n, sum = 0, f0 = 0, f1 = 1; 5 | scanf("%d", &n); 6 | if(n < 2){ 7 | printf("%d", n); 8 | return 0; 9 | } 10 | for(int i = 2; i <= n; i++){ 11 | sum = f0 + f1; 12 | f0 = f1; 13 | f1 = sum; 14 | } 15 | printf("%d", sum); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/_helpers.scss: -------------------------------------------------------------------------------- 1 | @import "helpers/clearfix"; 2 | @import "helpers/color-bg"; 3 | @import "helpers/colored-links"; 4 | @import "helpers/focus-ring"; 5 | @import "helpers/icon-link"; 6 | @import "helpers/ratio"; 7 | @import "helpers/position"; 8 | @import "helpers/stacks"; 9 | @import "helpers/visually-hidden"; 10 | @import "helpers/stretched-link"; 11 | @import "helpers/text-truncation"; 12 | @import "helpers/vr"; 13 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/helpers/_focus-ring.scss: -------------------------------------------------------------------------------- 1 | .focus-ring:focus { 2 | outline: 0; 3 | // By default, there is no `--bs-focus-ring-x`, `--bs-focus-ring-y`, or `--bs-focus-ring-blur`, but we provide CSS variables with fallbacks to initial `0` values 4 | box-shadow: var(--#{$prefix}focus-ring-x, 0) var(--#{$prefix}focus-ring-y, 0) var(--#{$prefix}focus-ring-blur, 0) var(--#{$prefix}focus-ring-width) var(--#{$prefix}focus-ring-color); 5 | } 6 | -------------------------------------------------------------------------------- /db/migrate/029_add_test_allowed_to_problems.rb: -------------------------------------------------------------------------------- 1 | class AddTestAllowedToProblems < ActiveRecord::Migration[4.2] 2 | def self.up 3 | add_column :problems, :test_allowed, :boolean 4 | Problem.reset_column_information 5 | 6 | Problem.all.each do |problem| 7 | problem.test_allowed = true 8 | problem.save 9 | end 10 | end 11 | 12 | def self.down 13 | remove_column :problems, :test_allowed 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20100216162324_create_contests_users_join_table.rb: -------------------------------------------------------------------------------- 1 | class CreateContestsUsersJoinTable < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :contests_users, :id => false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.integer :contest_id 5 | t.integer :user_id 6 | end 7 | end 8 | 9 | def self.down 10 | drop_table :contests_users 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20231007041620_job_type_enable.rb: -------------------------------------------------------------------------------- 1 | class JobTypeEnable < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :problems, :permitted_lang, :string 4 | add_column :groups_users, :role, :integer, default: 0 5 | add_column :submissions, :cookie, :string 6 | add_column :logins, :cookie, :string 7 | rename_column :grader_processes, :task_type, :job_type 8 | add_index :submissions, :tag 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /test/concurrent/task_test_setup.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] = "test" 2 | require File.expand_path(File.dirname(__FILE__) + "/../../config/environment") 3 | 4 | def clear_all_tasks 5 | Task.all.each do |task| 6 | task.destroy 7 | end 8 | end 9 | 10 | 11 | clear_all_tasks 12 | 13 | (1..1000).each do |i| 14 | Task.create(:id => i, 15 | :submission_id => i, 16 | :status => Task::STATUS_INQUEUE) 17 | end 18 | 19 | -------------------------------------------------------------------------------- /db/migrate/030_create_announcements.rb: -------------------------------------------------------------------------------- 1 | class CreateAnnouncements < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :announcements, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.string :author 5 | t.text :body 6 | t.boolean :published 7 | 8 | t.timestamps 9 | end 10 | end 11 | 12 | def self.down 13 | drop_table :announcements 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20100113094740_create_test_pairs.rb: -------------------------------------------------------------------------------- 1 | class CreateTestPairs < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :test_pairs, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.integer :problem_id 5 | t.text :input 6 | t.text :solution 7 | 8 | t.timestamps 9 | end 10 | end 11 | 12 | def self.down 13 | drop_table :test_pairs 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /bin/dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if ! gem list foreman -i --silent; then 4 | echo "Installing foreman..." 5 | gem install foreman 6 | fi 7 | 8 | # Default to port 3000 if not specified 9 | export PORT="${PORT:-3000}" 10 | 11 | # Let the debug gem allow remote connections, 12 | # but avoid loading until `debugger` is called 13 | export RUBY_DEBUG_OPEN="true" 14 | export RUBY_DEBUG_LAZY="true" 15 | 16 | exec foreman start -f Procfile.dev "$@" 17 | -------------------------------------------------------------------------------- /db/migrate/20170914150742_create_problem_tags.rb: -------------------------------------------------------------------------------- 1 | class CreateProblemTags < ActiveRecord::Migration[4.2] 2 | def change 3 | create_table :problems_tags, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.references :problem, index: true, foreign_key: true 5 | t.references :tag, index: true, foreign_key: true 6 | 7 | t.index [:problem_id,:tag_id], unique: true 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20100124054458_create_user_contest_stats.rb: -------------------------------------------------------------------------------- 1 | class CreateUserContestStats < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :user_contest_stats, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.integer :user_id 5 | t.timestamp :started_at 6 | 7 | t.timestamps 8 | end 9 | end 10 | 11 | def self.down 12 | drop_table :user_contest_stats 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20100216162940_create_contests_problems_join_table.rb: -------------------------------------------------------------------------------- 1 | class CreateContestsProblemsJoinTable < ActiveRecord::Migration[4.2] 2 | def self.up 3 | create_table :contests_problems, :id => false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t| 4 | t.integer :contest_id 5 | t.integer :problem_id 6 | end 7 | end 8 | 9 | def self.down 10 | drop_table :contests_problems 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/helpers/_color-bg.scss: -------------------------------------------------------------------------------- 1 | // All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251 2 | @each $color, $value in $theme-colors { 3 | .text-bg-#{$color} { 4 | color: color-contrast($value) if($enable-important-utilities, !important, null); 5 | background-color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}bg-opacity, 1)) if($enable-important-utilities, !important, null); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /app/views/announcements/edit.html.haml: -------------------------------------------------------------------------------- 1 | %h3 Edit announcement 2 | .mb-3 3 | [ 4 | = link_to "#{mdi(:arrow_back)} Back".html_safe, announcements_path, class: 'mx-1' 5 | ] 6 | .row 7 | .col-md-6 8 | .card.shadow-sm 9 | .card-body 10 | - content_for(:form_buttons) do 11 | = link_to 'arrow_back Back'.html_safe, announcements_path, class: 'btn btn-outline-secondary mx-2' 12 | = render 'form' 13 | -------------------------------------------------------------------------------- /db/migrate/20230611072646_create_jobs.rb: -------------------------------------------------------------------------------- 1 | class CreateJobs < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :jobs do |t| 4 | t.integer :status, limit: 1, default: 0 5 | t.integer :grader_process_id 6 | t.integer :job_type 7 | t.integer :arg 8 | t.string :param 9 | t.string :result 10 | t.references :parent_job 11 | t.datetime :finished 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20241117084758_contest_finalize.rb: -------------------------------------------------------------------------------- 1 | class ContestFinalize < ActiveRecord::Migration[7.0] 2 | def change 3 | rename_column :contests, :freeze, :finalized 4 | add_column :contests_users, :last_heartbeat, :datetime 5 | add_column :problems, :log, :text, limit: 4_000_000 #so that we get MEDIUMTEXT in mysql (3-byte lengths) 6 | add_column :evaluations, :output, :text, limit: 15000 #so that we get TEXT in mysql (2-byte lengths) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /vendor/bootstrap/scss/mixins/_pagination.scss: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | // scss-docs-start pagination-mixin 4 | @mixin pagination-size($padding-y, $padding-x, $font-size, $border-radius) { 5 | --#{$prefix}pagination-padding-x: #{$padding-x}; 6 | --#{$prefix}pagination-padding-y: #{$padding-y}; 7 | @include rfs($font-size, --#{$prefix}pagination-font-size); 8 | --#{$prefix}pagination-border-radius: #{$border-radius}; 9 | } 10 | // scss-docs-end pagination-mixin 11 | --------------------------------------------------------------------------------