├── log └── .gitkeep ├── lib ├── tasks │ ├── .gitkeep │ ├── populate_forums.rake │ ├── populate_course_preference.rake │ ├── populate_vote_count.rake │ ├── add_zero_level.rake │ ├── user_achievement.rake │ ├── populate_comment_subscriptions.rake │ ├── generate_uncategorized_taggroups.rake │ ├── populate_empty_materials_root.rake │ ├── fix_last_comment_at.rake │ └── add_survey_section.rake ├── assets │ └── .gitkeep ├── mission_constraint.rb ├── training_constraint.rb ├── extensions.rb ├── extensions │ └── renderer.rb └── templates │ └── erb │ └── scaffold │ └── _form.html.erb ├── public ├── favicon.ico ├── img │ ├── next.png │ ├── prev.png │ ├── close.png │ └── loading.gif ├── images │ ├── lock.png │ ├── tick.png │ ├── favicon.png │ ├── login_fb.png │ ├── ajax_loader.gif │ ├── feature-ui.png │ ├── feature-gamify.png │ ├── coursemology_white.png │ ├── feature-analytics.png │ ├── teaching-wordle_316.png │ ├── coursemology_logo_square.png │ ├── coursemology_logo_landscape_100.png │ └── filters.svg ├── fonts │ └── lato │ │ └── v7 │ │ ├── kcf5uOXucLcbFOydGU24WALUuEpTyoUstqEm5AMlJo4.woff │ │ ├── qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff │ │ └── qdgUG4U09HnJwhYI-uK18wLUuEpTyoUstqEm5AMlJo4.woff └── robots.txt ├── app ├── mailers │ └── .gitkeep ├── models │ ├── .gitkeep │ ├── data_map.rb │ ├── delayed_job.rb │ ├── action.rb │ ├── theme_attribute.rb │ ├── masquerade_log.rb │ ├── navbar_link_type.rb │ ├── taggable_tag.rb │ ├── requirable_requirement.rb │ ├── guild_user.rb │ ├── forum │ │ ├── forum_forum_subscription.rb │ │ ├── forum_topic_subscription.rb │ │ └── forum_topic_view.rb │ ├── programming_language.rb │ ├── lesson_plan_resource.rb │ ├── course_theme_attribute.rb │ ├── guild.rb │ ├── pending_comments.rb │ ├── navbar_preferable_item.rb │ ├── queued_job.rb │ ├── survey_question_type.rb │ ├── assessment │ │ ├── grading_log.rb │ │ ├── answer_grading_log.rb │ │ ├── answer_option.rb │ │ ├── general_answer.rb │ │ ├── auto_grading_exact_option.rb │ │ ├── scribing_answer.rb │ │ ├── coding_answer.rb │ │ ├── auto_grading_keyword_option.rb │ │ └── scribing_question.rb │ ├── survey_essay_answer.rb │ ├── modules │ │ ├── mail_monitor_plugin.rb │ │ ├── activity_object.rb │ │ ├── date_validator.rb │ │ ├── as_requirement.rb │ │ └── has_requirement.rb │ ├── scribble.rb │ ├── assignment_display_mode.rb │ ├── system_wide_announcement.rb │ ├── duplicate_log.rb │ ├── pending_action.rb │ ├── survey_section.rb │ └── course_navbar_preference.rb ├── views │ ├── materials │ │ ├── _folder_tree.html.erb │ │ ├── _disabled_controls.html.erb │ │ ├── new.html.erb │ │ ├── edit_folder.html.erb │ │ └── _subfolder_title.html.erb │ ├── forums │ │ ├── forums │ │ │ ├── edit.html.erb │ │ │ └── new.html.erb │ │ └── posts │ │ │ └── edit.html.erb │ ├── users │ │ ├── request_lecturer.html.erb │ │ ├── mailer │ │ │ ├── confirmation_instructions.html.erb │ │ │ └── unlock_instructions.html.erb │ │ ├── unlocks │ │ │ └── new.html.erb │ │ ├── passwords │ │ │ └── new.html.erb │ │ └── confirmations │ │ │ └── new.html.erb │ ├── assessment │ │ ├── coding_questions │ │ │ ├── _one.html.erb │ │ │ ├── new.html.erb │ │ │ └── edit.html.erb │ │ ├── mission_submissions │ │ │ └── edit.html.erb │ │ ├── trainings │ │ │ ├── access_denied.html.erb │ │ │ └── new.html.erb │ │ ├── gradings │ │ │ ├── edit.html.erb │ │ │ └── new.html.erb │ │ ├── general_questions │ │ │ ├── new.html.erb │ │ │ └── edit.html.erb │ │ ├── scribing_questions │ │ │ ├── edit.html.erb │ │ │ ├── new.html.erb │ │ │ └── _canvas.html.erb │ │ ├── mcq_questions │ │ │ ├── edit.html.erb │ │ │ ├── new.html.erb │ │ │ └── _one.html.erb │ │ └── missions │ │ │ └── new.html.erb │ ├── tags │ │ ├── new.html.erb │ │ └── edit.html.erb │ ├── kaminari │ │ ├── _gap.html.erb │ │ ├── _first_page.html.erb │ │ ├── _last_page.html.erb │ │ ├── _next_page.html.erb │ │ ├── _prev_page.html.erb │ │ └── _page.html.erb │ ├── tabs │ │ └── tabs │ │ │ ├── new.html.erb │ │ │ ├── edit.html.erb │ │ │ └── show.html.erb │ ├── facebook │ │ └── obtain_badge.html.erb │ ├── lesson_plan │ │ ├── new.html.erb │ │ ├── edit.html.erb │ │ ├── milestone_edit.html.erb │ │ ├── milestone_new.html.erb │ │ └── milestone_show.html.erb │ ├── static_pages │ │ └── access_denied.html.erb │ ├── admins │ │ ├── search.html.erb │ │ └── _search_form.html.erb │ ├── tag_groups │ │ ├── edit.html.erb │ │ ├── new.html.erb │ │ └── _form.html.erb │ ├── pending_actions │ │ ├── new.html.erb │ │ ├── edit.html.erb │ │ └── show.html.erb │ ├── user_mailer │ │ ├── system_wide_announcement.html.erb │ │ ├── update_user_role.html.erb │ │ ├── new_assessment.html.erb │ │ ├── new_student.html.erb │ │ ├── mission_due.html.erb │ │ ├── new_grading.html.erb │ │ ├── user_deleted.html.erb │ │ ├── new_submission.html.erb │ │ ├── course_deleted.html.erb │ │ ├── new_lecturer.html.erb │ │ ├── forum_topic_reply.html.erb │ │ ├── new_enroll_request.html.erb │ │ ├── email_changed.html.erb │ │ ├── new_announcement.html.erb │ │ ├── mission_reminder_summary.html.erb │ │ ├── new_comment.html.erb │ │ ├── enrollment_invitation.html.erb │ │ └── new_annotation.html.erb │ ├── user_courses │ │ └── _short_name_display.html.erb │ ├── layouts │ │ ├── _user_name_link.html.erb │ │ ├── _setting_layout.html.erb │ │ ├── _material_file_picker.html.erb │ │ ├── _material_title.html.erb │ │ ├── _mission_title.html.erb │ │ ├── _user_thumb_profile.html.erb │ │ └── _facebook_like.html.erb │ ├── guilds │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── announcements │ │ ├── _announcement.html.erb │ │ ├── show.html.erb │ │ ├── new.html.erb │ │ └── edit.html.erb │ ├── achievements │ │ ├── new.html.erb │ │ └── edit.html.erb │ ├── course_preferences │ │ └── _course_navbar_preference_fields.html.erb │ ├── survey_questions │ │ ├── edit.html.erb │ │ ├── new.html.erb │ │ └── _one.html.erb │ ├── role_requests │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── comics │ │ └── new.html.erb │ ├── surveys │ │ ├── new.html.erb │ │ └── edit.html.erb │ ├── notifications │ │ ├── _popup_level.html.erb │ │ └── _popup.html.erb │ ├── enroll_requests │ │ ├── new.html.erb │ │ └── _enroll_tab.html.erb │ ├── courses │ │ └── _manage_user_tab.html.erb │ ├── asm_tags │ │ └── _form_row.html.erb │ └── requirements │ │ └── _lvl_req_row.erb ├── assets │ ├── javascripts │ │ ├── users.js.coffee │ │ ├── form_clear.js │ │ ├── popup.js │ │ ├── stats.js │ │ └── level.js │ ├── stylesheets │ │ ├── forum_participation.css.scss │ │ ├── mission_submission_gradings.css.scss │ │ ├── _html_editor.css.scss │ │ ├── mcq_questions.css.scss │ │ ├── stats.css.scss │ │ ├── mission_coding_questions.css.scss │ │ ├── materials_file_picker.css.scss │ │ ├── mission.css.scss │ │ ├── guilds.css.scss │ │ ├── comments.css.scss │ │ └── courses.css.scss │ └── images │ │ └── rails.png ├── helpers │ ├── comics_helper.rb │ └── assessment_helper.rb ├── controllers │ └── sessions_controller.rb └── jobs │ └── enumerable.rb ├── vendor ├── plugins │ └── .gitkeep └── assets │ ├── javascripts │ └── .gitkeep │ └── stylesheets │ └── .gitkeep ├── python └── sandbox │ ├── cos_san_test.py │ ├── testing │ ├── test.py │ ├── inf.py │ ├── modify_file.py │ └── valid_excep.py │ └── override_methods.py ├── .rspec ├── provisioning └── files │ ├── my.cnf │ └── gemrc ├── config ├── initializers │ ├── extensions.rb │ ├── koala.rb │ ├── paperclip.rb │ ├── wicked_pdf.rb │ ├── load_decorators.rb │ ├── mime_types.rb │ ├── rpm_instrumentation.rb │ ├── fix_dev_cache.rb │ ├── delayed_job_config.rb │ ├── backtrace_silencers.rb │ └── session_store.rb ├── database.yml.travis ├── environment.rb ├── boot.rb └── database.yml.sample ├── db └── migrate │ ├── 20130729084346_add_index_to_roles.rb │ ├── 20140103084403_add_order_to_tab.rb │ ├── 20130411142638_add_index_to_asm_req.rb │ ├── 20130411145450_add_index_to_user.rb │ ├── 20130411145648_add_index_to_course.rb │ ├── 20130412051556_add_index_to_user2.rb │ ├── 20130724154512_drop_quizzes.rb │ ├── 20140106060421_add_exp_to_survey.rb │ ├── 20130411141354_add_index_to_missions.rb │ ├── 20130411142407_add_index_to_trainings.rb │ ├── 20130411142941_add_index_to_activity.rb │ ├── 20130411145934_add_index_to_mission2.rb │ ├── 20130411150227_add_index_to_question.rb │ ├── 20130411150433_add_index_to_tag_group.rb │ ├── 20130821073628_add_text_index_to_actions.rb │ ├── 20140905053809_drop_old_tags.rb │ ├── 20121216162236_add_file_to_file_upload.rb │ ├── 20130124121139_add_deleted_at_to_user.rb │ ├── 20130411150129_add_index_to_training2.rb │ ├── 20131226130516_add_tab_id_to_mission.rb │ ├── 20151014153816_add_time_zone_to_users.rb │ ├── 20130123170709_add_tag_group_id_to_tag.rb │ ├── 20130124121058_add_deleted_at_to_course.rb │ ├── 20130821074325_add_asm_type_index_to_asm_qns.rb │ ├── 20131226130425_add_tab_id_to_training.rb │ ├── 20140130091537_add_obj_url_to_activity.rb │ ├── 20140301064128_add_title_to_questions.rb │ ├── 20140918115607_add_deleted_at_to_tabs.rb │ ├── 20121101032911_add_title_to_assignments.rb │ ├── 20130815093227_add_deleted_at_to_comments.rb │ ├── 20130821074952_add_asm_type_index_to_asm_reqs.rb │ ├── 20140801034059_remove_user_rewards.rb │ ├── 20160319072038_remove_deleted_at_from_users.rb │ ├── 20121212174619_add_max_grade_to_training.rb │ ├── 20121218183832_add_level_to_user_course.rb │ ├── 20130124105156_add_deleted_at_to_training.rb │ ├── 20131226151544_add_owner_type_to_tab.rb │ ├── 20140801051806_add_job_type_to_queued_jobs.rb │ ├── 20121026154331_add_user_system_role_column.rb │ ├── 20130124121007_add_deleted_at_to_achievement.rb │ ├── 20130124121415_add_deleted_at_to_submission.rb │ ├── 20130124121554_add_deleted_at_to_user_course.rb │ ├── 20130208045011_change_description_to_text.rb │ ├── 20130411142532_add_index_to_asm_qn.rb │ ├── 20130411150540_add_index_to_tag.rb │ ├── 20130718085534_rename_course_id_to_owner_id_in_file_uploads.rb │ ├── 20130724154720_drop_quiz_submissions.rb │ ├── 20130805034612_add_last_commented_at_to_mcq.rb │ ├── 20130815160342_add_deleted_at_to_annotations.rb │ ├── 20130817204132_add_dependent_id_to_missions.rb │ ├── 20130828175742_add_publish_to_missions.rb │ ├── 20130829071527_add_t_type_to_trainings.rb │ ├── 20130923064001_add_publish_to_courses.rb │ ├── 20130923064228_add_is_open_to_courses.rb │ ├── 20131217160844_add_copy_url_to_file_uploads.rb │ ├── 20140729114456_rename_tags_to_old_tags.rb │ ├── 20140901043213_add_position_to_achievement.rb │ ├── 20130124121621_add_deleted_at_to_announcement.rb │ ├── 20130411142751_add_index_to_asm_tag.rb │ ├── 20130411143112_add_index_to_course_theme_att.rb │ ├── 20130411150009_add_index_to_quiz.rb │ ├── 20130411150257_add_index_to_mcq.rb │ ├── 20130411150618_add_index_to_title.rb │ ├── 20130828175807_add_publish_to_trainings.rb │ ├── 20130923064303_add_is_active_to_courses.rb │ ├── 20131229225554_add_result_to_std_coding_answer.rb │ ├── 20121029160057_change_assignment_column_course.rb │ ├── 20130411143418_add_index_to_exp_level.rb │ ├── 20130411144615_add_index_to_std_tag.rb │ ├── 20130411150750_add_index_to_reward.rb │ ├── 20130703110916_add_comments_to_coding_questions.rb │ ├── 20130723141846_change_masquerade_log_action_type.rb │ ├── 20130814062446_add_expiry_date_to_announcements.rb │ ├── 20130814080545_add_deleted_at_to_enroll_requests.rb │ ├── 20140106165916_add_can_skip_to_trainings.rb │ ├── 20140224171045_add_locked_to_forum_forum.rb │ ├── 20140301064203_add_title_to_coding_questions.rb │ ├── 20140801034012_remove_used_forum_post_votes.rb │ ├── 20140804045207_add_cmd_to_programming_languages.rb │ ├── 20121209024203_rename_written_question_to_question.rb │ ├── 20121211095140_add_final_grading_to_submission.rb │ ├── 20130124121323_add_deleted_at_to_exp_transaction.rb │ ├── 20130124121423_add_deleted_at_to_quiz_submission.rb │ ├── 20130718085622_rename_course_id_in_file_uploads.rb │ ├── 20130810154632_add_phantom_to_user_courses.rb │ ├── 20130821074157_add_annotable_type_index_to_annotations.rb │ ├── 20130911180832_add_original_name_to_file_uploads.rb │ ├── 20131220033623_change_publish_to_course.rb │ ├── 20140307163937_add_display_mode_to_missions.rb │ ├── 20130411143809_add_index_to_requirement.rb │ ├── 20130411144048_add_index_to_sbm_answer.rb │ ├── 20130411150846_add_index_to_mcq_answer.rb │ ├── 20130411151523_add_index_to_comment.rb │ ├── 20130411171002_add_columns_to_users.rb │ ├── 20130718105330_add_last_commented_at_to_std_answer.rb │ ├── 20130911001144_add_pos_to_survey_question_options.rb │ ├── 20131014100625_add_include_sol_to_coding_questions.rb │ ├── 20131229142437_add_test_left_to_std_coding_answer.rb │ ├── 20140109072900_add_status_to_training_submissions.rb │ ├── 20140224151448_add_is_public_to_file_uploads.rb │ ├── 20140309163444_add_comment_per_qn_to_missions.rb │ ├── 20140805142804_add_facebook_obj_id_to_achievements.rb │ ├── 20150117163547_change_scribble_content_type.rb │ ├── 20130124121218_add_deleted_at_to_training_submission.rb │ ├── 20130411143937_add_index_to_role_request.rb │ ├── 20130411145354_add_index_to_user_title.rb │ ├── 20130411151023_add_index_to_std_answer.rb │ ├── 20130705164200_add_is_correct_to_std_coding_answers.rb │ ├── 20130719144739_add_multiplier_to_training_submission.rb │ ├── 20130811121721_add_single_question_to_missions.rb │ ├── 20130822041144_add_commentable_index_for_comment.rb │ ├── 20130911125744_add_current_qn_to_survey_submissions.rb │ ├── 20130912162749_add_count_to_survey_question_options.rb │ ├── 20140104052733_add_start_at_to_lesson_plan_milestone.rb │ ├── 20140112180643_add_last_active_time_to_user_courses.rb │ ├── 20140217143134_add_pending_deletion_to_users.rb │ ├── 20140617053542_add_published_to_achievements.rb │ ├── 20140911054305_add_obtained_at_to_user_achievement.rb │ ├── 20140919103853_add_default_value_to_is_contest.rb │ ├── 20121214173428_add_final_grading_to_quiz_submission.rb │ ├── 20130411144246_add_index_to_seen_by_user.rb │ ├── 20130411145231_add_index_to_user_reward.rb │ ├── 20130411145513_add_index_to_course_theme.rb │ ├── 20130411150701_add_index_to_achievement.rb │ ├── 20130724195920_add_index_to_annotation.rb │ ├── 20131026104847_rename_lesson_plan_reserved_column_name.rb │ ├── 20131102174954_make_milestone_end_at_unique.rb │ ├── 20131219234053_add_dates_to_course.rb │ ├── 20140217143202_add_pending_deletion_to_courses.rb │ ├── 20140627064143_add_use_uploaded_picture_to_user.rb │ ├── 20140801033909_remove_used_tag_tables.rb │ ├── 20140908071250_add_saved_at_to_assessment_submissions.rb │ ├── 20121030152358_add_logo_url_to_course.rb │ ├── 20130411143204_add_index_to_enroll_request.rb │ ├── 20130411145608_add_index_to_announcement.rb │ ├── 20130805034745_add_last_commented_at_to_coding_question.rb │ ├── 20130817204036_add_is_file_submission_to_missions.rb │ ├── 20140105222138_add_is_requried_to_survey_question.rb │ ├── 20141106064954_add_deleted_at_to_scribing_question.rb │ ├── 20151009084141_add_unique_index_to_assessment_gradings.rb │ ├── 20121213111700_add_student_answer_type_to_answer_grading.rb │ ├── 20130724093301_add_last_commented_at_to_std_coding_answers.rb │ ├── 20140215164332_add_file_submission_only_to_mission.rb │ ├── 20141106063824_create_scribing_questions.rb │ ├── 20130411143312_add_index_to_exp_transaction.rb │ ├── 20130411143641_add_index_to_notification.rb │ ├── 20130811235526_add_confirm_token_to_mass_enrollment_emails.rb │ ├── 20131226151447_remove_type_from_tab.rb │ ├── 20131229130926_add_is_auto_grading_to_coding_question.rb │ ├── 20140104154740_remove_lesson_plan_index.rb │ ├── 20151011115753_add_unique_index_to_submissions.rb │ ├── 20170531072006_change_system_announcement_type.rb │ ├── 20121222094359_add_exp_transaction_id_to_submission_grading.rb │ ├── 20130813191719_add_last_grade_updated_to_submission_gradings.rb │ ├── 20140114091219_add_is_publish_to_lesson_plan_milestone.rb │ ├── 20121214175026_change_assignment_to_mission.rb │ ├── 20130124104853_add_deleted_at_to_tag_and_tag_group.rb │ ├── 20130411144948_add_index_to_user_achievement.rb │ ├── 20130823094613_change_is_submission_file_in_missions.rb │ ├── 20140729131241_remove_index_on_name_tag.rb │ ├── 20130718085939_add_owner_type_to_file_uploads.rb │ ├── 20150827111659_add_sample_answer_to_assessment_general_questions.rb │ ├── 20121117052103_add_title_and_desc_to_announcement.rb │ ├── 20121213043007_remove_assignment_id_from_question_and_mcq.rb │ ├── 20121230193636_create_actions.rb │ ├── 20130411144854_add_index_to_training_submission.rb │ ├── 20140526043332_create_navbar_link_types.rb │ ├── 20131109130905_add_reply_to_to_forem_posts.forem.rb │ ├── 20140531152553_add_create_at_index_activity.rb │ ├── 20140608144533_add_autograding_refresh_to_submission_grading.rb │ ├── 20160319042230_add_uniq_index_to_user_courses.rb │ ├── 20130808084910_add_columns_to_mcq_to_support_all_answers_kind.rb │ ├── 20131212055120_create_comic_pages.rb │ ├── 20140307153226_create_assignment_display_mode.rb │ ├── 20121213172612_move_order_from_question_to_asm_qn.rb │ ├── 20130411144706_add_index_to_submission.rb │ ├── 20121216162151_create_file_uploads.rb │ ├── 20121228045425_create_role_requests.rb │ ├── 20130411144507_add_index_to_std_mcq_answer.rb │ ├── 20130824164123_add_achievement_id_and_user_course_id_index_to_user_achievements.rb │ ├── 20131109130910_add_hidden_to_forem_topics.forem.rb │ ├── 20131210162710_addis_logged_in_to_users.rb │ ├── 20121026033635_create_roles.rb │ ├── 20130808173715_change_date_format_in_mcq.rb │ ├── 20130809062153_rename_comments_to_staff_comments_in_coding_questions.rb │ ├── 20130910184054_create_survey_types.rb │ ├── 20131214231300_add_is_tbc_to_comic_pages.rb │ ├── 20150714051531_change_column_null_in_assessments.rb │ ├── 20130829075227_create_assignment_types.rb │ ├── 20121023155209_create_users.rb │ ├── 20121026041328_create_courses.rb │ ├── 20121216073952_create_asm_reqs.rb │ ├── 20130115044758_create_std_tags.rb │ ├── 20130811190133_add_bonus_exp_and_bonus_cutoff_time_for_trainings.rb │ ├── 20131109130906_add_locked_to_forem_topics.forem.rb │ ├── 20140825131756_add_fb_publish_actions_request_count_to_users.rb │ ├── 20141113065557_create_assessment_scribing_answers.rb │ ├── 20121216072645_create_user_achievements.rb │ ├── 20130123170643_create_tag_groups.rb │ ├── 20130411151309_add_index_to_answer_grading.rb │ ├── 20130824160020_add_name_to_user_courses.rb │ ├── 20131019110754_add_materials_timestamps.rb │ ├── 20131109130907_add_pinned_to_forem_topics.forem.rb │ ├── 20140929155854_remove_dependent_id_from_assessment.rb │ ├── 20141107054440_create_guilds.rb │ ├── 20121213103340_create_std_answers.rb │ ├── 20121216072257_create_user_titles.rb │ ├── 20121226084218_change_order_to_pos.rb │ ├── 20130411145119_add_index_to_user_course.rb │ ├── 20130411151104_add_index_to_submission_grading.rb │ ├── 20140207072305_add_detail_to_role_request.rb │ ├── 20121211032636_add_grade_to_assignment_and_question.rb │ ├── 20130910185549_create_survey_question_types.rb │ ├── 20121216072233_create_user_rewards.rb │ ├── 20121230070236_create_seen_by_users.rb │ ├── 20130808173531_change_date_format_in_std_answer.rb │ ├── 20141225134326_create_scribbles.rb │ ├── 20121026160218_create_enroll_requests.rb │ ├── 20121212155230_create_asm_qns.rb │ ├── 20121214172423_rename_submission_to_sbm_id_type_in_submission_grading.rb │ ├── 20130111050247_create_theme_attributes.rb │ ├── 20130128190046_create_course_themes.rb │ ├── 20130702101844_create_std_coding_answers.rb │ ├── 20121216071735_create_titles.rb │ ├── 20130115043542_create_asm_tags.rb │ ├── 20130825075032_add_unique_index_to_user_achievements.rb │ ├── 20121216071618_create_levels.rb │ ├── 20130808144743_add_index_to_comment_subscription.rb │ ├── 20131109130918_create_forem_groups.forem.rb │ ├── 20121026160233_create_user_courses.rb │ ├── 20121216072725_create_requirements.rb │ ├── 20130808173814_change_date_format_in_coding_question.rb │ ├── 20140721103118_create_data_map.rb │ ├── 20130219034623_create_comments.rb │ ├── 20130808173629_change_date_format_in_std_coding_answer.rb │ ├── 20131109130912_create_forem_categories.forem.rb │ ├── 20141107064604_create_guild_users.rb │ ├── 20130115043452_create_tags.rb │ ├── 20130713010831_change_description_text_format_in_coding_questions.rb │ ├── 20131109130908_add_forem_views.forem.rb │ ├── 20140526072050_add_course_preference_index.rb │ ├── 20140723210136_create_system_wide_announcements.rb │ ├── 20150625084352_add_auto_graded_to_assessment_general_questions.rb │ ├── 20150702085119_create_auto_grading_keyword_options.rb │ ├── 20121112101918_create_announcements.rb │ ├── 20121213103531_create_std_mcq_answers.rb │ ├── 20130111050334_create_course_theme_attributes.rb │ ├── 20130723141520_create_masquerade_logs.rb │ ├── 20131109130914_create_forem_subscriptions.forem.rb │ ├── 20130910190241_create_survey_question_options.rb │ ├── 20131102064208_populate_original_file_name.rb │ ├── 20131109130909_add_updated_at_and_count_to_forem_views.forem.rb │ ├── 20140605155859_add_rewardable_to_exp_transaction.rb │ ├── 20121029142406_create_written_questions.rb │ ├── 20121216071821_create_rewards.rb │ ├── 20121029141223_create_mcqs.rb │ ├── 20131226124705_create_tabs.rb │ ├── 20150625085254_create_auto_grading_exact_options.rb │ ├── 20121213095957_create_mcq_answers.rb │ ├── 20121213103737_create_sbm_answers.rb │ ├── 20121218092223_change_user_id_to_user_course_id_in_game_tables.rb │ ├── 20131109130904_create_forem_posts.forem.rb │ ├── 20121216071705_create_achievements.rb │ ├── 20130808144647_create_comment_subscriptions.rb │ ├── 20121209022425_create_submissions.rb │ ├── 20121222083630_create_exp_transactions.rb │ ├── 20130103031840_change_student_id_to_student_course_id_in_sbms.rb │ ├── 20131109130903_create_forem_topics.forem.rb │ ├── 20131114230000_create_category_subscriptions.rb │ ├── 20140105222740_create_survey_essay_answers.rb │ ├── 20121213175707_create_quiz_submissions.rb │ ├── 20130731172921_create_pending_comments.rb │ ├── 20130911102159_create_survey_mrq_answers.rb │ ├── 20131109130902_create_forem_forums.forem.rb │ ├── 20130103163744_change_user_id_to_user_course_id_in_update_and_notification.rb │ ├── 20130702092559_create_coding_questions.rb │ ├── 20130808101129_create_std_mcq_all_answers.rb │ ├── 20131109130919_create_forem_memberships.forem.rb │ ├── 20121211031948_create_answer_gradings.rb │ ├── 20130822102151_add_comment_topic_to_other_tables.rb │ ├── 20121211032525_create_submission_gradings.rb │ ├── 20121213105710_create_training_submissions.rb │ ├── 20131109112240_add_materials_permissions.rb │ ├── 20140909023230_survey_has_section_to_contest.rb │ ├── 20121230194838_create_notifications.rb │ ├── 20131109130920_create_forem_moderator_groups.forem.rb │ ├── 20131115100001_add_notified_to_topics.rb │ ├── 20130711080325_create_tutorial_groups.rb │ ├── 20130724170444_create_annotations.rb │ ├── 20121212154351_create_trainings.rb │ ├── 20121230193603_create_activities.rb │ ├── 20130803065441_create_preferable_items.rb │ ├── 20130809154027_create_mass_enrollment_emails.rb │ ├── 20131212055119_create_comics.rb │ ├── 20140729115342_add_missing_taggable_index.acts_as_taggable_on_engine.rb │ ├── 20130910182934_create_survey_sections.rb │ ├── 20140109030619_add_pending_email_to_mass_enrollment_email.rb │ ├── 20131019100355_create_materials.rb │ ├── 20140526060026_create_navbar_preferable_items.rb │ ├── 20130804092515_create_queued_jobs.rb │ ├── 20130321041710_create_duplicate_logs.rb │ ├── 20131117034500_add_is_digest_to_category_subscription.rb │ ├── 20130803065431_create_course_preferences.rb │ └── 20170426054216_add_constraint_to_question_assessments.rb ├── spec ├── models │ └── scribble_spec.rb ├── controllers │ └── facebook_controller_spec.rb └── support │ ├── controller_helpers.rb │ └── feature_helpers.rb ├── config.ru ├── .hound.yml ├── script ├── delayed_job └── rails ├── .env_sample ├── Rakefile └── remove_duplicate.sql /log/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/mailers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/sandbox/cos_san_test.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /python/sandbox/testing/test.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | import os 4 | -------------------------------------------------------------------------------- /python/sandbox/testing/inf.py: -------------------------------------------------------------------------------- 1 | i = 0 2 | while True: 3 | i = 1 -------------------------------------------------------------------------------- /provisioning/files/my.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | prompt=\\u [\\d] \R:\m.\\s>\\_ 3 | -------------------------------------------------------------------------------- /app/models/data_map.rb: -------------------------------------------------------------------------------- 1 | class DataMap < ActiveRecord::Base 2 | 3 | end 4 | -------------------------------------------------------------------------------- /app/models/delayed_job.rb: -------------------------------------------------------------------------------- 1 | class DelayedJob < ActiveRecord::Base 2 | 3 | end -------------------------------------------------------------------------------- /app/views/materials/_folder_tree.html.erb: -------------------------------------------------------------------------------- 1 |
Tree goes here.
-------------------------------------------------------------------------------- /app/assets/javascripts/users.js.coffee: -------------------------------------------------------------------------------- 1 | jQuery -> 2 | $('.best_in_place').best_in_place() -------------------------------------------------------------------------------- /app/views/forums/forums/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Edit Forum

2 | 3 | <%= render 'form' %> 4 | -------------------------------------------------------------------------------- /app/views/forums/forums/new.html.erb: -------------------------------------------------------------------------------- 1 |

New Forum

2 | 3 | <%= render 'form' %> 4 | -------------------------------------------------------------------------------- /app/views/users/request_lecturer.html.erb: -------------------------------------------------------------------------------- 1 | By becoming a lecturer, you will be able to 2 | -------------------------------------------------------------------------------- /app/views/assessment/coding_questions/_one.html.erb: -------------------------------------------------------------------------------- 1 | <%= style_format(q.description) %> -------------------------------------------------------------------------------- /provisioning/files/gemrc: -------------------------------------------------------------------------------- 1 | --- 2 | :sources: 3 | - https://rubygems.org 4 | gem: --no-ri --no-rdoc 5 | -------------------------------------------------------------------------------- /public/img/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/img/next.png -------------------------------------------------------------------------------- /public/img/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/img/prev.png -------------------------------------------------------------------------------- /app/assets/stylesheets/forum_participation.css.scss: -------------------------------------------------------------------------------- 1 | tr.post-details-container { 2 | display: none; 3 | } -------------------------------------------------------------------------------- /app/models/action.rb: -------------------------------------------------------------------------------- 1 | class Action < ActiveRecord::Base 2 | attr_accessible :description, :text 3 | end 4 | -------------------------------------------------------------------------------- /config/initializers/extensions.rb: -------------------------------------------------------------------------------- 1 | require "#{Rails.root}/lib/extensions.rb" 2 | 3 | Extensions.load_all 4 | -------------------------------------------------------------------------------- /public/img/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/img/close.png -------------------------------------------------------------------------------- /public/images/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/lock.png -------------------------------------------------------------------------------- /public/images/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/tick.png -------------------------------------------------------------------------------- /public/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/img/loading.gif -------------------------------------------------------------------------------- /public/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/favicon.png -------------------------------------------------------------------------------- /public/images/login_fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/login_fb.png -------------------------------------------------------------------------------- /app/assets/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/app/assets/images/rails.png -------------------------------------------------------------------------------- /app/assets/stylesheets/mission_submission_gradings.css.scss: -------------------------------------------------------------------------------- 1 | table.mission-submission-grading { 2 | width: 100% 3 | } 4 | -------------------------------------------------------------------------------- /public/images/ajax_loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/ajax_loader.gif -------------------------------------------------------------------------------- /public/images/feature-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/feature-ui.png -------------------------------------------------------------------------------- /app/views/assessment/mission_submissions/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%= render partial: 'summary' %> 2 | <%= render partial: 'form' %> 3 | -------------------------------------------------------------------------------- /app/views/tags/new.html.erb: -------------------------------------------------------------------------------- 1 | 4 | <%= render :partial => 'form' %> 5 | -------------------------------------------------------------------------------- /python/sandbox/override_methods.py: -------------------------------------------------------------------------------- 1 | old_open_a123afdasdf = open 2 | 3 | def open(f, m): 4 | return old_open_a123afdasdf(f, 'r') -------------------------------------------------------------------------------- /app/views/kaminari/_gap.html.erb: -------------------------------------------------------------------------------- 1 |
  • 2 | <%= link_to raw(t 'views.pagination.truncate'), '#' %> 3 |
  • 4 | -------------------------------------------------------------------------------- /app/views/tabs/tabs/new.html.erb: -------------------------------------------------------------------------------- 1 |

    New tab_tab

    2 | 3 | <%= render 'form' %> 4 | 5 | <%= link_to 'Back', tab_tabs_path %> 6 | -------------------------------------------------------------------------------- /app/views/tags/edit.html.erb: -------------------------------------------------------------------------------- 1 | 4 | <%= render :partial => 'form' %> 5 | -------------------------------------------------------------------------------- /public/images/feature-gamify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/feature-gamify.png -------------------------------------------------------------------------------- /app/models/theme_attribute.rb: -------------------------------------------------------------------------------- 1 | class ThemeAttribute < ActiveRecord::Base 2 | attr_accessible :description, :name, :value_type 3 | end 4 | -------------------------------------------------------------------------------- /app/views/facebook/obtain_badge.html.erb: -------------------------------------------------------------------------------- 1 |

    Facebook#obtain_badge

    2 |

    Find me in app/views/facebook/obtain_badge.html.erb

    3 | -------------------------------------------------------------------------------- /app/views/lesson_plan/new.html.erb: -------------------------------------------------------------------------------- 1 |

    2 | New Event 3 |

    4 | 5 |
    6 | 7 | <%= render :partial => 'lesson_plan/form' %> 8 | -------------------------------------------------------------------------------- /app/views/static_pages/access_denied.html.erb: -------------------------------------------------------------------------------- 1 |
    2 | Sorry dude! 3 | <%= flash[:alert] %> 4 |
    5 | -------------------------------------------------------------------------------- /config/database.yml.travis: -------------------------------------------------------------------------------- 1 | test: 2 | adapter: mysql2 3 | database: coursemology_test 4 | username: travis 5 | encoding: utf8 6 | -------------------------------------------------------------------------------- /public/images/coursemology_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/coursemology_white.png -------------------------------------------------------------------------------- /public/images/feature-analytics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/feature-analytics.png -------------------------------------------------------------------------------- /python/sandbox/testing/modify_file.py: -------------------------------------------------------------------------------- 1 | with open('inf.py', 'r+') as f: 2 | f.write("life is great") 3 | for line in f: 4 | print(line) -------------------------------------------------------------------------------- /app/views/admins/search.html.erb: -------------------------------------------------------------------------------- 1 | <%= render :partial => 'search_form',locals: {origin: nil} %> 2 | <%= render :partial => 'search_result' %> -------------------------------------------------------------------------------- /app/views/tag_groups/edit.html.erb: -------------------------------------------------------------------------------- 1 | 4 | <%= render :partial => 'form' %> 5 | -------------------------------------------------------------------------------- /app/views/tag_groups/new.html.erb: -------------------------------------------------------------------------------- 1 | 4 | <%= render :partial => 'form' %> 5 | -------------------------------------------------------------------------------- /public/images/teaching-wordle_316.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/teaching-wordle_316.png -------------------------------------------------------------------------------- /app/models/masquerade_log.rb: -------------------------------------------------------------------------------- 1 | class MasqueradeLog < ActiveRecord::Base 2 | attr_accessible :action, :as_user_id, :by_user_id, :description 3 | end 4 | -------------------------------------------------------------------------------- /app/views/lesson_plan/edit.html.erb: -------------------------------------------------------------------------------- 1 |

    2 | Edit Lesson Plan Entry 3 |

    4 | 5 |
    6 | 7 | <%= render :partial => 'lesson_plan/form' %> 8 | -------------------------------------------------------------------------------- /app/views/pending_actions/new.html.erb: -------------------------------------------------------------------------------- 1 |

    New pending_action

    2 | 3 | <%= render 'form' %> 4 | 5 | <%= link_to 'Back', pending_actions_path %> 6 | -------------------------------------------------------------------------------- /public/images/coursemology_logo_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/coursemology_logo_square.png -------------------------------------------------------------------------------- /app/models/navbar_link_type.rb: -------------------------------------------------------------------------------- 1 | class NavbarLinkType < ActiveRecord::Base 2 | # attr_accessible :title, :body 3 | attr_accessible :link_type 4 | end 5 | -------------------------------------------------------------------------------- /config/initializers/koala.rb: -------------------------------------------------------------------------------- 1 | Koala.configure do |config| 2 | config.app_id = ENV['FB_APP_ID'] 3 | config.app_secret = ENV['FB_SECRET_KEY'] 4 | end 5 | -------------------------------------------------------------------------------- /app/views/kaminari/_first_page.html.erb: -------------------------------------------------------------------------------- 1 |
  • 2 | <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %> 3 |
  • 4 | -------------------------------------------------------------------------------- /app/views/kaminari/_last_page.html.erb: -------------------------------------------------------------------------------- 1 |
  • 2 | <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %> 3 |
  • 4 | -------------------------------------------------------------------------------- /app/views/lesson_plan/milestone_edit.html.erb: -------------------------------------------------------------------------------- 1 |

    2 | Edit Milestone 3 |

    4 | 5 |
    6 | 7 | <%= render :partial => 'lesson_plan/milestone_form' %> 8 | -------------------------------------------------------------------------------- /app/views/lesson_plan/milestone_new.html.erb: -------------------------------------------------------------------------------- 1 |

    2 | New Milestone 3 |

    4 | 5 |
    6 | 7 | <%= render :partial => 'lesson_plan/milestone_form' %> 8 | -------------------------------------------------------------------------------- /public/images/coursemology_logo_landscape_100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/images/coursemology_logo_landscape_100.png -------------------------------------------------------------------------------- /db/migrate/20130729084346_add_index_to_roles.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToRoles < ActiveRecord::Migration 2 | def change 3 | add_index :roles, :name 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/taggable_tag.rb: -------------------------------------------------------------------------------- 1 | class TaggableTag < ActiveRecord::Base 2 | acts_as_duplicable 3 | 4 | belongs_to :taggable, polymorphic: true 5 | belongs_to :tag 6 | end -------------------------------------------------------------------------------- /db/migrate/20140103084403_add_order_to_tab.rb: -------------------------------------------------------------------------------- 1 | class AddOrderToTab < ActiveRecord::Migration 2 | def change 3 | add_column :tabs, :pos, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/views/kaminari/_next_page.html.erb: -------------------------------------------------------------------------------- 1 |
  • 2 | <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %> 3 |
  • 4 | -------------------------------------------------------------------------------- /app/views/tabs/tabs/edit.html.erb: -------------------------------------------------------------------------------- 1 |

    Editing tab_tab

    2 | 3 | <%= render 'form' %> 4 | 5 | <%= link_to 'Show', @tab_tab %> | 6 | <%= link_to 'Back', tab_tabs_path %> 7 | -------------------------------------------------------------------------------- /app/views/tabs/tabs/show.html.erb: -------------------------------------------------------------------------------- 1 |

    <%= notice %>

    2 | 3 | 4 | <%= link_to 'Edit', edit_tab_tab_path(@tab_tab) %> | 5 | <%= link_to 'Back', tab_tabs_path %> 6 | -------------------------------------------------------------------------------- /db/migrate/20130411142638_add_index_to_asm_req.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToAsmReq < ActiveRecord::Migration 2 | def change 3 | add_index :asm_reqs, :asm_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411145450_add_index_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToUser < ActiveRecord::Migration 2 | def change 3 | add_index :users, :system_role_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411145648_add_index_to_course.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToCourse < ActiveRecord::Migration 2 | def change 3 | add_index :courses, :creator_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130412051556_add_index_to_user2.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToUser2 < ActiveRecord::Migration 2 | def change 3 | add_index :users, [:provider, :uid] 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130724154512_drop_quizzes.rb: -------------------------------------------------------------------------------- 1 | class DropQuizzes < ActiveRecord::Migration 2 | def up 3 | drop_table :quizzes 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20140106060421_add_exp_to_survey.rb: -------------------------------------------------------------------------------- 1 | class AddExpToSurvey < ActiveRecord::Migration 2 | def change 3 | add_column :surveys, :exp, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/models/scribble_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe Scribble, :type => :model do 4 | pending "add some examples to (or delete) #{__FILE__}" 5 | end 6 | -------------------------------------------------------------------------------- /app/assets/javascripts/form_clear.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $(document).on('click', '.form-submit', function(e) { 3 | $('.form-temp').remove(); 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /app/views/kaminari/_prev_page.html.erb: -------------------------------------------------------------------------------- 1 |
  • 2 | <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %> 3 |
  • 4 | -------------------------------------------------------------------------------- /db/migrate/20130411141354_add_index_to_missions.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToMissions < ActiveRecord::Migration 2 | def change 3 | add_index :missions, :course_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411142407_add_index_to_trainings.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToTrainings < ActiveRecord::Migration 2 | def change 3 | add_index :trainings, :course_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411142941_add_index_to_activity.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToActivity < ActiveRecord::Migration 2 | def change 3 | add_index :activities, :course_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411145934_add_index_to_mission2.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToMission2 < ActiveRecord::Migration 2 | def change 3 | add_index :missions, :creator_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411150227_add_index_to_question.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToQuestion < ActiveRecord::Migration 2 | def change 3 | add_index :questions, :creator_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411150433_add_index_to_tag_group.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToTagGroup < ActiveRecord::Migration 2 | def change 3 | add_index :tag_groups, :course_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130821073628_add_text_index_to_actions.rb: -------------------------------------------------------------------------------- 1 | class AddTextIndexToActions < ActiveRecord::Migration 2 | def change 3 | add_index :actions, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140905053809_drop_old_tags.rb: -------------------------------------------------------------------------------- 1 | class DropOldTags < ActiveRecord::Migration 2 | def up 3 | drop_table :old_tags 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/views/lesson_plan/milestone_show.html.erb: -------------------------------------------------------------------------------- 1 | <% milestone = @lesson_plan_milestone %> 2 | 3 | <%= render :partial => 'lesson_plan/milestone', :locals => { :milestone => milestone } %> -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Coursemology::Application 5 | -------------------------------------------------------------------------------- /db/migrate/20121216162236_add_file_to_file_upload.rb: -------------------------------------------------------------------------------- 1 | class AddFileToFileUpload < ActiveRecord::Migration 2 | def change 3 | add_attachment :file_uploads, :file 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130124121139_add_deleted_at_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToUser < ActiveRecord::Migration 2 | def change 3 | add_column :users, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411150129_add_index_to_training2.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToTraining2 < ActiveRecord::Migration 2 | def change 3 | add_index :trainings, :creator_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131226130516_add_tab_id_to_mission.rb: -------------------------------------------------------------------------------- 1 | class AddTabIdToMission < ActiveRecord::Migration 2 | def change 3 | add_column :missions, :tab_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20151014153816_add_time_zone_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddTimeZoneToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :time_zone, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/helpers/comics_helper.rb: -------------------------------------------------------------------------------- 1 | module ComicsHelper 2 | def comic_link_text(comic) 3 | comic.episode.to_s + '. ' + comic.name + (comic.visible ? '' : ' (hidden)') 4 | end 5 | end 6 | 7 | -------------------------------------------------------------------------------- /db/migrate/20130123170709_add_tag_group_id_to_tag.rb: -------------------------------------------------------------------------------- 1 | class AddTagGroupIdToTag < ActiveRecord::Migration 2 | def change 3 | add_column :tags, :tag_group_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130124121058_add_deleted_at_to_course.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToCourse < ActiveRecord::Migration 2 | def change 3 | add_column :courses, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130821074325_add_asm_type_index_to_asm_qns.rb: -------------------------------------------------------------------------------- 1 | class AddAsmTypeIndexToAsmQns < ActiveRecord::Migration 2 | def change 3 | add_index :asm_qns, :asm_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131226130425_add_tab_id_to_training.rb: -------------------------------------------------------------------------------- 1 | class AddTabIdToTraining < ActiveRecord::Migration 2 | def change 3 | add_column :trainings, :tab_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140130091537_add_obj_url_to_activity.rb: -------------------------------------------------------------------------------- 1 | class AddObjUrlToActivity < ActiveRecord::Migration 2 | def change 3 | add_column :activities, :obj_url, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140301064128_add_title_to_questions.rb: -------------------------------------------------------------------------------- 1 | class AddTitleToQuestions < ActiveRecord::Migration 2 | def change 3 | add_column :questions, :title, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140918115607_add_deleted_at_to_tabs.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToTabs < ActiveRecord::Migration 2 | def change 3 | add_column :tabs, :deleted_at, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/requirable_requirement.rb: -------------------------------------------------------------------------------- 1 | class RequirableRequirement < ActiveRecord::Base 2 | EPS = 1e-5 3 | 4 | include AsRequirement 5 | 6 | belongs_to :requireable, polymorphic: true 7 | end -------------------------------------------------------------------------------- /app/views/assessment/trainings/access_denied.html.erb: -------------------------------------------------------------------------------- 1 | 4 | 5 |

    Training hasn't open yet :)

    -------------------------------------------------------------------------------- /app/views/user_mailer/system_wide_announcement.html.erb: -------------------------------------------------------------------------------- 1 |

    Hello, <%= @name %>!

    2 | 3 | <%= @body.html_safe %> 4 | 5 |

    6 | Best Regards,
    7 | The Coursemology Team 8 |

    9 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the rails application 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the rails application 5 | Coursemology::Application.initialize! 6 | -------------------------------------------------------------------------------- /config/initializers/paperclip.rb: -------------------------------------------------------------------------------- 1 | Paperclip::Attachment.default_options[:url] = ':s3_domain_url' 2 | Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename' -------------------------------------------------------------------------------- /db/migrate/20121101032911_add_title_to_assignments.rb: -------------------------------------------------------------------------------- 1 | class AddTitleToAssignments < ActiveRecord::Migration 2 | def change 3 | add_column :assignments, :title, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130815093227_add_deleted_at_to_comments.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToComments < ActiveRecord::Migration 2 | def change 3 | add_column :comments, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130821074952_add_asm_type_index_to_asm_reqs.rb: -------------------------------------------------------------------------------- 1 | class AddAsmTypeIndexToAsmReqs < ActiveRecord::Migration 2 | def change 3 | add_index :asm_reqs, :asm_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140801034059_remove_user_rewards.rb: -------------------------------------------------------------------------------- 1 | class RemoveUserRewards < ActiveRecord::Migration 2 | def up 3 | drop_table :user_rewards 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20160319072038_remove_deleted_at_from_users.rb: -------------------------------------------------------------------------------- 1 | class RemoveDeletedAtFromUsers < ActiveRecord::Migration 2 | def change 3 | remove_column :users, :deleted_at 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /lib/mission_constraint.rb: -------------------------------------------------------------------------------- 1 | class MissionConstraint 2 | def matches?(request) 3 | a = Assessment.find_by_id(request.path_parameters[:assessment_id]) 4 | a && a.is_mission? 5 | end 6 | end -------------------------------------------------------------------------------- /app/models/guild_user.rb: -------------------------------------------------------------------------------- 1 | class GuildUser < ActiveRecord::Base 2 | 3 | attr_accessible :role_id, :user_course_id, :guild_id 4 | 5 | belongs_to :guild 6 | belongs_to :user_course 7 | 8 | end 9 | -------------------------------------------------------------------------------- /app/views/pending_actions/edit.html.erb: -------------------------------------------------------------------------------- 1 |

    Editing pending_action

    2 | 3 | <%= render 'form' %> 4 | 5 | <%= link_to 'Show', @pending_action %> | 6 | <%= link_to 'Back', pending_actions_path %> 7 | -------------------------------------------------------------------------------- /db/migrate/20121212174619_add_max_grade_to_training.rb: -------------------------------------------------------------------------------- 1 | class AddMaxGradeToTraining < ActiveRecord::Migration 2 | def change 3 | add_column :trainings, :max_grade, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20121218183832_add_level_to_user_course.rb: -------------------------------------------------------------------------------- 1 | class AddLevelToUserCourse < ActiveRecord::Migration 2 | def change 3 | add_column :user_courses, :level_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130124105156_add_deleted_at_to_training.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToTraining < ActiveRecord::Migration 2 | def change 3 | add_column :trainings, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131226151544_add_owner_type_to_tab.rb: -------------------------------------------------------------------------------- 1 | class AddOwnerTypeToTab < ActiveRecord::Migration 2 | def change 3 | add_column :tabs, :owner_type, :string, :null => false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140801051806_add_job_type_to_queued_jobs.rb: -------------------------------------------------------------------------------- 1 | class AddJobTypeToQueuedJobs < ActiveRecord::Migration 2 | def change 3 | add_column :queued_jobs, :job_type, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /lib/training_constraint.rb: -------------------------------------------------------------------------------- 1 | class TrainingConstraint 2 | def matches?(request) 3 | a = Assessment.find_by_id(request.path_parameters[:assessment_id]) 4 | a && a.is_training? 5 | end 6 | end -------------------------------------------------------------------------------- /public/fonts/lato/v7/kcf5uOXucLcbFOydGU24WALUuEpTyoUstqEm5AMlJo4.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/fonts/lato/v7/kcf5uOXucLcbFOydGU24WALUuEpTyoUstqEm5AMlJo4.woff -------------------------------------------------------------------------------- /public/fonts/lato/v7/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/fonts/lato/v7/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff -------------------------------------------------------------------------------- /public/fonts/lato/v7/qdgUG4U09HnJwhYI-uK18wLUuEpTyoUstqEm5AMlJo4.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Coursemology/coursemology.org/HEAD/public/fonts/lato/v7/qdgUG4U09HnJwhYI-uK18wLUuEpTyoUstqEm5AMlJo4.woff -------------------------------------------------------------------------------- /app/controllers/sessions_controller.rb: -------------------------------------------------------------------------------- 1 | class SessionsController < Devise::SessionsController 2 | 3 | def destroy 4 | current_user.is_logged_in = false if current_user 5 | super 6 | end 7 | end -------------------------------------------------------------------------------- /app/models/forum/forum_forum_subscription.rb: -------------------------------------------------------------------------------- 1 | class ForumForumSubscription < ActiveRecord::Base 2 | belongs_to :forum, class_name: 'ForumForum' 3 | belongs_to :user, class_name: 'UserCourse' 4 | end 5 | -------------------------------------------------------------------------------- /app/models/forum/forum_topic_subscription.rb: -------------------------------------------------------------------------------- 1 | class ForumTopicSubscription < ActiveRecord::Base 2 | belongs_to :topic, class_name: 'ForumTopic' 3 | belongs_to :user, class_name: 'UserCourse' 4 | end 5 | -------------------------------------------------------------------------------- /app/views/pending_actions/show.html.erb: -------------------------------------------------------------------------------- 1 |

    <%= notice %>

    2 | 3 | 4 | <%= link_to 'Edit', edit_pending_action_path(@pending_action) %> | 5 | <%= link_to 'Back', pending_actions_path %> 6 | -------------------------------------------------------------------------------- /app/views/user_courses/_short_name_display.html.erb: -------------------------------------------------------------------------------- 1 | <%= link_to course_user_course_path(@course, user_course) do %> 2 | <%= user_course.name %> 3 | <% end %> 4 | 5 | -------------------------------------------------------------------------------- /db/migrate/20121026154331_add_user_system_role_column.rb: -------------------------------------------------------------------------------- 1 | class AddUserSystemRoleColumn < ActiveRecord::Migration 2 | def change 3 | add_column :users, :system_role_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130124121007_add_deleted_at_to_achievement.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToAchievement < ActiveRecord::Migration 2 | def change 3 | add_column :achievements, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130124121415_add_deleted_at_to_submission.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToSubmission < ActiveRecord::Migration 2 | def change 3 | add_column :submissions, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130124121554_add_deleted_at_to_user_course.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToUserCourse < ActiveRecord::Migration 2 | def change 3 | add_column :user_courses, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130208045011_change_description_to_text.rb: -------------------------------------------------------------------------------- 1 | class ChangeDescriptionToText < ActiveRecord::Migration 2 | def change 3 | change_column :announcements, :description, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411142532_add_index_to_asm_qn.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToAsmQn < ActiveRecord::Migration 2 | def change 3 | add_index :asm_qns, :asm_id 4 | add_index :asm_qns, :qn_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411150540_add_index_to_tag.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToTag < ActiveRecord::Migration 2 | def change 3 | add_index :tags, :course_id 4 | add_index :tags, :tag_group_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130718085534_rename_course_id_to_owner_id_in_file_uploads.rb: -------------------------------------------------------------------------------- 1 | class RenameCourseIdToOwnerIdInFileUploads < ActiveRecord::Migration 2 | def up 3 | end 4 | 5 | def down 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20130724154720_drop_quiz_submissions.rb: -------------------------------------------------------------------------------- 1 | class DropQuizSubmissions < ActiveRecord::Migration 2 | def up 3 | drop_table :quiz_submissions 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20130805034612_add_last_commented_at_to_mcq.rb: -------------------------------------------------------------------------------- 1 | class AddLastCommentedAtToMcq < ActiveRecord::Migration 2 | def change 3 | add_column :mcqs, :last_commented_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130815160342_add_deleted_at_to_annotations.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToAnnotations < ActiveRecord::Migration 2 | def change 3 | add_column :annotations, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130817204132_add_dependent_id_to_missions.rb: -------------------------------------------------------------------------------- 1 | class AddDependentIdToMissions < ActiveRecord::Migration 2 | def change 3 | add_column :missions, :dependent_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130828175742_add_publish_to_missions.rb: -------------------------------------------------------------------------------- 1 | class AddPublishToMissions < ActiveRecord::Migration 2 | def change 3 | add_column :missions, :publish, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130829071527_add_t_type_to_trainings.rb: -------------------------------------------------------------------------------- 1 | class AddTTypeToTrainings < ActiveRecord::Migration 2 | def change 3 | add_column :trainings, :t_type, :integer, default: 1 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130923064001_add_publish_to_courses.rb: -------------------------------------------------------------------------------- 1 | class AddPublishToCourses < ActiveRecord::Migration 2 | def change 3 | add_column :courses, :is_publish, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130923064228_add_is_open_to_courses.rb: -------------------------------------------------------------------------------- 1 | class AddIsOpenToCourses < ActiveRecord::Migration 2 | def change 3 | add_column :courses, :is_open, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131217160844_add_copy_url_to_file_uploads.rb: -------------------------------------------------------------------------------- 1 | class AddCopyUrlToFileUploads < ActiveRecord::Migration 2 | def change 3 | add_column :file_uploads, :copy_url, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140729114456_rename_tags_to_old_tags.rb: -------------------------------------------------------------------------------- 1 | class RenameTagsToOldTags < ActiveRecord::Migration 2 | def up 3 | rename_table :tags, :old_tags 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20140901043213_add_position_to_achievement.rb: -------------------------------------------------------------------------------- 1 | class AddPositionToAchievement < ActiveRecord::Migration 2 | def change 3 | add_column :achievements, :position, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /.hound.yml: -------------------------------------------------------------------------------- 1 | ShowCopNames: true 2 | 3 | LineLength: 4 | Description: 'Limit lines to 130 characters.' 5 | Max: 130 6 | 7 | java_script: 8 | enabled: true 9 | 10 | scss: 11 | enabled: true 12 | -------------------------------------------------------------------------------- /app/models/programming_language.rb: -------------------------------------------------------------------------------- 1 | class ProgrammingLanguage < ActiveRecord::Base 2 | attr_accessible :name, :version, :codemirror_mode, :cmd 3 | 4 | def title 5 | "#{name} #{version}" 6 | end 7 | end -------------------------------------------------------------------------------- /db/migrate/20130124121621_add_deleted_at_to_announcement.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToAnnouncement < ActiveRecord::Migration 2 | def change 3 | add_column :announcements, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411142751_add_index_to_asm_tag.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToAsmTag < ActiveRecord::Migration 2 | def change 3 | add_index :asm_tags, :asm_id 4 | add_index :asm_tags, :tag_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411143112_add_index_to_course_theme_att.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToCourseThemeAtt < ActiveRecord::Migration 2 | def change 3 | add_index :course_theme_attributes, :course_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411150009_add_index_to_quiz.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToQuiz < ActiveRecord::Migration 2 | def change 3 | add_index :quizzes, :course_id 4 | add_index :quizzes, :creator_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411150257_add_index_to_mcq.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToMcq < ActiveRecord::Migration 2 | def change 3 | add_index :mcqs, :creator_id 4 | add_index :mcqs, :correct_answer_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411150618_add_index_to_title.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToTitle < ActiveRecord::Migration 2 | def change 3 | add_index :titles, :creator_id 4 | add_index :titles, :course_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130828175807_add_publish_to_trainings.rb: -------------------------------------------------------------------------------- 1 | class AddPublishToTrainings < ActiveRecord::Migration 2 | def change 3 | add_column :trainings, :publish, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130923064303_add_is_active_to_courses.rb: -------------------------------------------------------------------------------- 1 | class AddIsActiveToCourses < ActiveRecord::Migration 2 | def change 3 | add_column :courses, :is_active, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131229225554_add_result_to_std_coding_answer.rb: -------------------------------------------------------------------------------- 1 | class AddResultToStdCodingAnswer < ActiveRecord::Migration 2 | def change 3 | add_column :std_coding_answers, :result, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /script/delayed_job: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) 4 | require 'delayed/command' 5 | Delayed::Command.new(ARGV).daemonize 6 | -------------------------------------------------------------------------------- /app/models/lesson_plan_resource.rb: -------------------------------------------------------------------------------- 1 | class LessonPlanResource < ActiveRecord::Base 2 | attr_accessible :obj_id, :obj_type 3 | 4 | belongs_to :lesson_plan_entry 5 | belongs_to :obj, :polymorphic => true 6 | end 7 | -------------------------------------------------------------------------------- /config/initializers/wicked_pdf.rb: -------------------------------------------------------------------------------- 1 | WickedPdf.config = { 2 | :exe_path => WkhtmltopdfBinaryProvider::Dispatcher.path, 3 | :footer => { :center => 'Page [page] of [topage]' }, 4 | :print_media_type => true 5 | } 6 | -------------------------------------------------------------------------------- /db/migrate/20121029160057_change_assignment_column_course.rb: -------------------------------------------------------------------------------- 1 | class ChangeAssignmentColumnCourse < ActiveRecord::Migration 2 | def change 3 | rename_column :assignments, :class_id, :course_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411143418_add_index_to_exp_level.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToExpLevel < ActiveRecord::Migration 2 | def change 3 | add_index :levels, :course_id 4 | add_index :levels, :creator_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411144615_add_index_to_std_tag.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToStdTag < ActiveRecord::Migration 2 | def change 3 | add_index :std_tags, :std_course_id 4 | add_index :std_tags, :tag_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411150750_add_index_to_reward.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToReward < ActiveRecord::Migration 2 | def change 3 | add_index :rewards, :creator_id 4 | add_index :rewards, :course_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130703110916_add_comments_to_coding_questions.rb: -------------------------------------------------------------------------------- 1 | class AddCommentsToCodingQuestions < ActiveRecord::Migration 2 | def change 3 | add_column :coding_questions, :comments, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130723141846_change_masquerade_log_action_type.rb: -------------------------------------------------------------------------------- 1 | class ChangeMasqueradeLogActionType < ActiveRecord::Migration 2 | def change 3 | change_column :masquerade_logs, :action, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130814062446_add_expiry_date_to_announcements.rb: -------------------------------------------------------------------------------- 1 | class AddExpiryDateToAnnouncements < ActiveRecord::Migration 2 | def change 3 | add_column :announcements, :expiry_at, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130814080545_add_deleted_at_to_enroll_requests.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToEnrollRequests < ActiveRecord::Migration 2 | def change 3 | add_column :enroll_requests, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140106165916_add_can_skip_to_trainings.rb: -------------------------------------------------------------------------------- 1 | class AddCanSkipToTrainings < ActiveRecord::Migration 2 | def change 3 | add_column :trainings, :can_skip, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140224171045_add_locked_to_forum_forum.rb: -------------------------------------------------------------------------------- 1 | class AddLockedToForumForum < ActiveRecord::Migration 2 | def change 3 | add_column :forum_forums, :locked, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140301064203_add_title_to_coding_questions.rb: -------------------------------------------------------------------------------- 1 | class AddTitleToCodingQuestions < ActiveRecord::Migration 2 | def change 3 | rename_column :coding_questions, :step_name, :title 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140801034012_remove_used_forum_post_votes.rb: -------------------------------------------------------------------------------- 1 | class RemoveUsedForumPostVotes < ActiveRecord::Migration 2 | def up 3 | drop_table :forum_post_votes 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20140804045207_add_cmd_to_programming_languages.rb: -------------------------------------------------------------------------------- 1 | class AddCmdToProgrammingLanguages < ActiveRecord::Migration 2 | def change 3 | add_column :programming_languages, :cmd, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/course_theme_attribute.rb: -------------------------------------------------------------------------------- 1 | class CourseThemeAttribute < ActiveRecord::Base 2 | attr_accessible :course_id, :theme_attribute_id, :value 3 | 4 | belongs_to :theme_attribute 5 | belongs_to :course 6 | end 7 | -------------------------------------------------------------------------------- /app/views/layouts/_user_name_link.html.erb: -------------------------------------------------------------------------------- 1 | <% if user_course %> 2 | <% cache(user_course) do %> 3 | <%= link_to user_course.name, course_user_course_path(@course, user_course) %> 4 | <% end %> 5 | <% end %> -------------------------------------------------------------------------------- /db/migrate/20121209024203_rename_written_question_to_question.rb: -------------------------------------------------------------------------------- 1 | class RenameWrittenQuestionToQuestion < ActiveRecord::Migration 2 | def change 3 | rename_table :written_questions, :questions 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20121211095140_add_final_grading_to_submission.rb: -------------------------------------------------------------------------------- 1 | class AddFinalGradingToSubmission < ActiveRecord::Migration 2 | def change 3 | add_column :submissions, :final_grading_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130124121323_add_deleted_at_to_exp_transaction.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToExpTransaction < ActiveRecord::Migration 2 | def change 3 | add_column :exp_transactions, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130124121423_add_deleted_at_to_quiz_submission.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToQuizSubmission < ActiveRecord::Migration 2 | def change 3 | add_column :quiz_submissions, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130718085622_rename_course_id_in_file_uploads.rb: -------------------------------------------------------------------------------- 1 | class RenameCourseIdInFileUploads < ActiveRecord::Migration 2 | def change 3 | rename_column :file_uploads, :course_id, :owner_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130810154632_add_phantom_to_user_courses.rb: -------------------------------------------------------------------------------- 1 | class AddPhantomToUserCourses < ActiveRecord::Migration 2 | def change 3 | add_column :user_courses, :is_phantom, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130821074157_add_annotable_type_index_to_annotations.rb: -------------------------------------------------------------------------------- 1 | class AddAnnotableTypeIndexToAnnotations < ActiveRecord::Migration 2 | def change 3 | add_index :annotations, :annotable_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130911180832_add_original_name_to_file_uploads.rb: -------------------------------------------------------------------------------- 1 | class AddOriginalNameToFileUploads < ActiveRecord::Migration 2 | def change 3 | add_column :file_uploads, :original_name, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131220033623_change_publish_to_course.rb: -------------------------------------------------------------------------------- 1 | class ChangePublishToCourse < ActiveRecord::Migration 2 | def change 3 | change_column :courses, :is_publish, :boolean, default: false 4 | end 5 | 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20140307163937_add_display_mode_to_missions.rb: -------------------------------------------------------------------------------- 1 | class AddDisplayModeToMissions < ActiveRecord::Migration 2 | def change 3 | add_column :missions, :display_mode, :integer, default: 1 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/assets/javascripts/popup.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('#popups .modal').modal('show'); 3 | $('#popups .popup-btn-close').click(function() { 4 | $(this).parents('.modal').modal('hide'); 5 | }) 6 | }); 7 | -------------------------------------------------------------------------------- /app/models/guild.rb: -------------------------------------------------------------------------------- 1 | class Guild < ActiveRecord::Base 2 | attr_accessible :description, :name, :course_id 3 | 4 | belongs_to :course 5 | has_many :guild_users, class_name: 'GuildUser', dependent: :destroy 6 | 7 | end 8 | -------------------------------------------------------------------------------- /app/models/pending_comments.rb: -------------------------------------------------------------------------------- 1 | class PendingComments < ActiveRecord::Base 2 | attr_accessible :answer_id, :answer_type, :pending, :course_id 3 | 4 | belongs_to :course 5 | belongs_to :answer, polymorphic: true 6 | end 7 | -------------------------------------------------------------------------------- /app/views/kaminari/_page.html.erb: -------------------------------------------------------------------------------- 1 |
  • 2 | <%= link_to page, page.current? ? '#' : url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %> 3 |
  • 4 | -------------------------------------------------------------------------------- /app/views/user_mailer/update_user_role.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %>! 2 | 3 |

    You have been approved to be a <%= @user.get_role %> on Coursemology!

    4 | 5 | Best Regards, 6 |
    7 | 8 | The Coursemology Team 9 | -------------------------------------------------------------------------------- /db/migrate/20130411143809_add_index_to_requirement.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToRequirement < ActiveRecord::Migration 2 | def change 3 | add_index :requirements, :req_id 4 | add_index :requirements, :obj_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411144048_add_index_to_sbm_answer.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToSbmAnswer < ActiveRecord::Migration 2 | def change 3 | add_index :sbm_answers, :sbm_id 4 | add_index :sbm_answers, :answer_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411150846_add_index_to_mcq_answer.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToMcqAnswer < ActiveRecord::Migration 2 | def change 3 | add_index :mcq_answers, :mcq_id 4 | add_index :mcq_answers, :creator_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411151523_add_index_to_comment.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToComment < ActiveRecord::Migration 2 | def change 3 | add_index :comments, :user_course_id 4 | add_index :comments, :commentable_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411171002_add_columns_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddColumnsToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :provider, :string 4 | add_column :users, :uid, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130718105330_add_last_commented_at_to_std_answer.rb: -------------------------------------------------------------------------------- 1 | class AddLastCommentedAtToStdAnswer < ActiveRecord::Migration 2 | def change 3 | add_column :std_answers, :last_commented_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130911001144_add_pos_to_survey_question_options.rb: -------------------------------------------------------------------------------- 1 | class AddPosToSurveyQuestionOptions < ActiveRecord::Migration 2 | def change 3 | add_column :survey_question_options, :pos, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131014100625_add_include_sol_to_coding_questions.rb: -------------------------------------------------------------------------------- 1 | class AddIncludeSolToCodingQuestions < ActiveRecord::Migration 2 | def change 3 | add_column :coding_questions, :include_sol_qn_id, :integer 4 | end 5 | end -------------------------------------------------------------------------------- /db/migrate/20131229142437_add_test_left_to_std_coding_answer.rb: -------------------------------------------------------------------------------- 1 | class AddTestLeftToStdCodingAnswer < ActiveRecord::Migration 2 | def change 3 | add_column :std_coding_answers, :test_left, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140109072900_add_status_to_training_submissions.rb: -------------------------------------------------------------------------------- 1 | class AddStatusToTrainingSubmissions < ActiveRecord::Migration 2 | def change 3 | add_column :training_submissions, :status, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140224151448_add_is_public_to_file_uploads.rb: -------------------------------------------------------------------------------- 1 | class AddIsPublicToFileUploads < ActiveRecord::Migration 2 | def change 3 | add_column :file_uploads, :is_public, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140309163444_add_comment_per_qn_to_missions.rb: -------------------------------------------------------------------------------- 1 | class AddCommentPerQnToMissions < ActiveRecord::Migration 2 | def change 3 | add_column :missions, :comment_per_qn, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140805142804_add_facebook_obj_id_to_achievements.rb: -------------------------------------------------------------------------------- 1 | class AddFacebookObjIdToAchievements < ActiveRecord::Migration 2 | def change 3 | add_column :achievements, :facebook_obj_id, :int8 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20150117163547_change_scribble_content_type.rb: -------------------------------------------------------------------------------- 1 | class ChangeScribbleContentType < ActiveRecord::Migration 2 | def change 3 | change_column :scribbles, :content, :text, limit: 16.megabytes - 1 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/views/assessment/gradings/edit.html.erb: -------------------------------------------------------------------------------- 1 | 4 | <%= render :partial => 'summary'%> 5 | <%= render :partial => 'form', locals: {mode: "edit"} %> 6 | -------------------------------------------------------------------------------- /app/views/assessment/gradings/new.html.erb: -------------------------------------------------------------------------------- 1 | 4 | <%= render :partial => 'summary'%> 5 | <%= render :partial => 'form', locals: {mode: "edit"} %> 6 | -------------------------------------------------------------------------------- /app/views/guilds/edit.html.erb: -------------------------------------------------------------------------------- 1 | 4 | 5 | <%= render partial: 'manage_guild_tab', locals: { tab: '' } %> 6 | <%= render partial: 'form', locals: { action: 'update' } %> 7 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | # Set up gems listed in the Gemfile. 4 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 5 | 6 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 7 | -------------------------------------------------------------------------------- /config/initializers/load_decorators.rb: -------------------------------------------------------------------------------- 1 | Rails.application.config.to_prepare do 2 | Dir.glob(Rails.root.join("app/**/*_decorator*.rb")) do |c| 3 | Rails.configuration.cache_classes ? require(c) : load(c) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130124121218_add_deleted_at_to_training_submission.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToTrainingSubmission < ActiveRecord::Migration 2 | def change 3 | add_column :training_submissions, :deleted_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411143937_add_index_to_role_request.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToRoleRequest < ActiveRecord::Migration 2 | def change 3 | add_index :role_requests, :user_id 4 | add_index :role_requests, :role_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411145354_add_index_to_user_title.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToUserTitle < ActiveRecord::Migration 2 | def change 3 | add_index :user_titles, :user_course_id 4 | add_index :user_titles, :title_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411151023_add_index_to_std_answer.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToStdAnswer < ActiveRecord::Migration 2 | def change 3 | add_index :std_answers, :student_id 4 | add_index :std_answers, :question_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130705164200_add_is_correct_to_std_coding_answers.rb: -------------------------------------------------------------------------------- 1 | class AddIsCorrectToStdCodingAnswers < ActiveRecord::Migration 2 | def change 3 | add_column :std_coding_answers, :is_correct, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130719144739_add_multiplier_to_training_submission.rb: -------------------------------------------------------------------------------- 1 | class AddMultiplierToTrainingSubmission < ActiveRecord::Migration 2 | def change 3 | add_column :training_submissions, :multiplier, :float 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130811121721_add_single_question_to_missions.rb: -------------------------------------------------------------------------------- 1 | class AddSingleQuestionToMissions < ActiveRecord::Migration 2 | def change 3 | add_column :missions, :single_question, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130822041144_add_commentable_index_for_comment.rb: -------------------------------------------------------------------------------- 1 | class AddCommentableIndexForComment < ActiveRecord::Migration 2 | def change 3 | add_index :comments, [:commentable_id, :commentable_type] 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130911125744_add_current_qn_to_survey_submissions.rb: -------------------------------------------------------------------------------- 1 | class AddCurrentQnToSurveySubmissions < ActiveRecord::Migration 2 | def change 3 | add_column :survey_submissions, :current_qn, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130912162749_add_count_to_survey_question_options.rb: -------------------------------------------------------------------------------- 1 | class AddCountToSurveyQuestionOptions < ActiveRecord::Migration 2 | def change 3 | add_column :survey_question_options, :count, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140104052733_add_start_at_to_lesson_plan_milestone.rb: -------------------------------------------------------------------------------- 1 | class AddStartAtToLessonPlanMilestone < ActiveRecord::Migration 2 | def change 3 | add_column :lesson_plan_milestones, :start_at, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140112180643_add_last_active_time_to_user_courses.rb: -------------------------------------------------------------------------------- 1 | class AddLastActiveTimeToUserCourses < ActiveRecord::Migration 2 | def change 3 | add_column :user_courses, :last_active_time, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140217143134_add_pending_deletion_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddPendingDeletionToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :is_pending_deletion, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140617053542_add_published_to_achievements.rb: -------------------------------------------------------------------------------- 1 | class AddPublishedToAchievements < ActiveRecord::Migration 2 | def change 3 | add_column :achievements, :published, :boolean, :default => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140911054305_add_obtained_at_to_user_achievement.rb: -------------------------------------------------------------------------------- 1 | class AddObtainedAtToUserAchievement < ActiveRecord::Migration 2 | def change 3 | add_column :user_achievements, :obtained_at, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140919103853_add_default_value_to_is_contest.rb: -------------------------------------------------------------------------------- 1 | class AddDefaultValueToIsContest < ActiveRecord::Migration 2 | def change 3 | change_column :surveys, :is_contest, :boolean, :default => false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/forum/forum_topic_view.rb: -------------------------------------------------------------------------------- 1 | class ForumTopicView < ActiveRecord::Base 2 | belongs_to :topic, class_name: 'ForumTopic', foreign_key: 'topic_id' 3 | belongs_to :user, class_name: 'UserCourse', foreign_key: 'user_id' 4 | end 5 | -------------------------------------------------------------------------------- /db/migrate/20121214173428_add_final_grading_to_quiz_submission.rb: -------------------------------------------------------------------------------- 1 | class AddFinalGradingToQuizSubmission < ActiveRecord::Migration 2 | def change 3 | add_column :quiz_submissions, :final_grading_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130411144246_add_index_to_seen_by_user.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToSeenByUser < ActiveRecord::Migration 2 | def change 3 | add_index :seen_by_users, :user_course_id 4 | add_index :seen_by_users, :obj_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411145231_add_index_to_user_reward.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToUserReward < ActiveRecord::Migration 2 | def change 3 | add_index :user_rewards, :user_course_id 4 | add_index :user_rewards, :reward_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411145513_add_index_to_course_theme.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToCourseTheme < ActiveRecord::Migration 2 | def change 3 | add_index :course_themes, :course_id 4 | add_index :course_themes, :theme_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411150701_add_index_to_achievement.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToAchievement < ActiveRecord::Migration 2 | def change 3 | add_index :achievements, :creator_id 4 | add_index :achievements, :course_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130724195920_add_index_to_annotation.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToAnnotation < ActiveRecord::Migration 2 | def change 3 | add_index :annotations, :user_course_id 4 | add_index :annotations, :annotable_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20131026104847_rename_lesson_plan_reserved_column_name.rb: -------------------------------------------------------------------------------- 1 | class RenameLessonPlanReservedColumnName < ActiveRecord::Migration 2 | def change 3 | rename_column :lesson_plan_entries, :type, :entry_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131102174954_make_milestone_end_at_unique.rb: -------------------------------------------------------------------------------- 1 | class MakeMilestoneEndAtUnique < ActiveRecord::Migration 2 | def change 3 | add_index :lesson_plan_milestones, [:course_id, :end_at], { unique: true } 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131219234053_add_dates_to_course.rb: -------------------------------------------------------------------------------- 1 | class AddDatesToCourse < ActiveRecord::Migration 2 | def change 3 | add_column :courses, :start_at, :datetime 4 | add_column :courses, :end_at, :datetime 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20140217143202_add_pending_deletion_to_courses.rb: -------------------------------------------------------------------------------- 1 | class AddPendingDeletionToCourses < ActiveRecord::Migration 2 | def change 3 | add_column :courses, :is_pending_deletion, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140627064143_add_use_uploaded_picture_to_user.rb: -------------------------------------------------------------------------------- 1 | class AddUseUploadedPictureToUser < ActiveRecord::Migration 2 | def change 3 | add_column :users, :use_uploaded_picture, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140801033909_remove_used_tag_tables.rb: -------------------------------------------------------------------------------- 1 | class RemoveUsedTagTables < ActiveRecord::Migration 2 | def up 3 | drop_table :std_tags 4 | drop_table :taggings 5 | end 6 | 7 | def down 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20140908071250_add_saved_at_to_assessment_submissions.rb: -------------------------------------------------------------------------------- 1 | class AddSavedAtToAssessmentSubmissions < ActiveRecord::Migration 2 | def change 3 | add_column :assessment_submissions, :saved_at, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /lib/extensions.rb: -------------------------------------------------------------------------------- 1 | module Extensions 2 | EXTENSIONS_PATH = "#{Rails.root}/lib/extensions" 3 | 4 | def self.load_all 5 | Dir[EXTENSIONS_PATH + '/*.rb'].each do |ext| 6 | require ext 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/models/navbar_preferable_item.rb: -------------------------------------------------------------------------------- 1 | class NavbarPreferableItem < ActiveRecord::Base 2 | attr_accessible :item, :name, :is_enabled, :is_displayed, :description, :pos, :navbar_link_type_id 3 | 4 | belongs_to :navbar_link_type 5 | end 6 | -------------------------------------------------------------------------------- /app/views/announcements/_announcement.html.erb: -------------------------------------------------------------------------------- 1 | <%= announcement.publish_at.to_formatted_s(:long) %> by <%= announcement.creator.name %> 2 |

    <%= announcement.description.html_safe %>

    -------------------------------------------------------------------------------- /app/views/guilds/new.html.erb: -------------------------------------------------------------------------------- 1 | 4 | 5 | <%= render partial: 'manage_guild_tab', locals: { tab: 'create' } %> 6 | <%= render partial: 'form', locals: { action: 'create' } %> -------------------------------------------------------------------------------- /app/views/user_mailer/new_assessment.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %>! 2 | 3 |

    New Assessment Available : <%= @assessment.title %>

    4 | 5 | Best Regards, 6 |
    7 | 8 | The Coursemology Team 9 | -------------------------------------------------------------------------------- /db/migrate/20121030152358_add_logo_url_to_course.rb: -------------------------------------------------------------------------------- 1 | class AddLogoUrlToCourse < ActiveRecord::Migration 2 | def change 3 | add_column :courses, :logo_url, :string 4 | add_column :courses, :banner_url, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411143204_add_index_to_enroll_request.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToEnrollRequest < ActiveRecord::Migration 2 | def change 3 | add_index :enroll_requests, :course_id 4 | add_index :enroll_requests, :role_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411145608_add_index_to_announcement.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToAnnouncement < ActiveRecord::Migration 2 | def change 3 | add_index :announcements, :creator_id 4 | add_index :announcements, :course_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130805034745_add_last_commented_at_to_coding_question.rb: -------------------------------------------------------------------------------- 1 | class AddLastCommentedAtToCodingQuestion < ActiveRecord::Migration 2 | def change 3 | add_column :coding_questions, :last_commented_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130817204036_add_is_file_submission_to_missions.rb: -------------------------------------------------------------------------------- 1 | class AddIsFileSubmissionToMissions < ActiveRecord::Migration 2 | def change 3 | add_column :missions, :is_file_submission, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140105222138_add_is_requried_to_survey_question.rb: -------------------------------------------------------------------------------- 1 | class AddIsRequriedToSurveyQuestion < ActiveRecord::Migration 2 | def change 3 | add_column :survey_questions, :is_required, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20141106064954_add_deleted_at_to_scribing_question.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToScribingQuestion < ActiveRecord::Migration 2 | def change 3 | add_column :assessment_scribing_questions, :deleted_at, :timestamp 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20151009084141_add_unique_index_to_assessment_gradings.rb: -------------------------------------------------------------------------------- 1 | class AddUniqueIndexToAssessmentGradings < ActiveRecord::Migration 2 | def change 3 | add_index :assessment_gradings, :submission_id, unique: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /lib/tasks/populate_forums.rake: -------------------------------------------------------------------------------- 1 | namespace :db do 2 | desc 'Populate forums for all existing courses' 3 | 4 | task populate_forums: :environment do 5 | Course.all.each do |cs| 6 | cs.populate_forum 7 | end 8 | end 9 | end -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-Agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /app/views/achievements/new.html.erb: -------------------------------------------------------------------------------- 1 | <%- display_name = @course.customized_title_by_model(Achievement).singularize -%> 2 | 5 | <%= render partial: 'form' %> 6 | 7 | 8 | -------------------------------------------------------------------------------- /db/migrate/20121213111700_add_student_answer_type_to_answer_grading.rb: -------------------------------------------------------------------------------- 1 | class AddStudentAnswerTypeToAnswerGrading < ActiveRecord::Migration 2 | def change 3 | add_column :answer_gradings, :student_answer_type, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130724093301_add_last_commented_at_to_std_coding_answers.rb: -------------------------------------------------------------------------------- 1 | class AddLastCommentedAtToStdCodingAnswers < ActiveRecord::Migration 2 | def change 3 | add_column :std_coding_answers, :last_commented_at, :time 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140215164332_add_file_submission_only_to_mission.rb: -------------------------------------------------------------------------------- 1 | class AddFileSubmissionOnlyToMission < ActiveRecord::Migration 2 | def change 3 | add_column :missions, :file_submission_only, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20141106063824_create_scribing_questions.rb: -------------------------------------------------------------------------------- 1 | class CreateScribingQuestions < ActiveRecord::Migration 2 | def change 3 | create_table :assessment_scribing_questions do |t| 4 | 5 | t.timestamps 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/models/queued_job.rb: -------------------------------------------------------------------------------- 1 | class QueuedJob < ActiveRecord::Base 2 | attr_accessible :owner_id, :owner_type, :job_type, :delayed_job_id 3 | 4 | belongs_to :owner, polymorphic: true 5 | belongs_to :delayed_job, dependent: :destroy 6 | 7 | end 8 | -------------------------------------------------------------------------------- /app/views/achievements/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%- display_name = @course.customized_title_by_model(Achievement).singularize -%> 2 | 5 | 6 | <%= render partial: 'form' %> 7 | 8 | 9 | -------------------------------------------------------------------------------- /db/migrate/20130411143312_add_index_to_exp_transaction.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToExpTransaction < ActiveRecord::Migration 2 | def change 3 | add_index :exp_transactions, :user_course_id 4 | add_index :exp_transactions, :giver_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411143641_add_index_to_notification.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToNotification < ActiveRecord::Migration 2 | def change 3 | add_index :notifications, :target_course_id 4 | add_index :notifications, :actor_course_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130811235526_add_confirm_token_to_mass_enrollment_emails.rb: -------------------------------------------------------------------------------- 1 | class AddConfirmTokenToMassEnrollmentEmails < ActiveRecord::Migration 2 | def change 3 | add_column :mass_enrollment_emails, :confirm_token, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131226151447_remove_type_from_tab.rb: -------------------------------------------------------------------------------- 1 | class RemoveTypeFromTab < ActiveRecord::Migration 2 | def up 3 | remove_column :tabs, :type 4 | end 5 | 6 | def down 7 | add_column :tabs, :type, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20131229130926_add_is_auto_grading_to_coding_question.rb: -------------------------------------------------------------------------------- 1 | class AddIsAutoGradingToCodingQuestion < ActiveRecord::Migration 2 | def change 3 | add_column :coding_questions, :is_auto_grading, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140104154740_remove_lesson_plan_index.rb: -------------------------------------------------------------------------------- 1 | class RemoveLessonPlanIndex < ActiveRecord::Migration 2 | def up 3 | remove_index :lesson_plan_milestones, :column =>[:course_id, :end_at] 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20151011115753_add_unique_index_to_submissions.rb: -------------------------------------------------------------------------------- 1 | class AddUniqueIndexToSubmissions < ActiveRecord::Migration 2 | def change 3 | add_index :assessment_submissions, [:assessment_id, :std_course_id], unique: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170531072006_change_system_announcement_type.rb: -------------------------------------------------------------------------------- 1 | class ChangeSystemAnnouncementType < ActiveRecord::Migration 2 | def up 3 | change_column :system_wide_announcements, :body, :text 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /public/images/filters.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/views/assessment/general_questions/new.html.erb: -------------------------------------------------------------------------------- 1 | <%- title = 'Question' -%> 2 | 5 | <%= render :partial => 'form' %> 6 | -------------------------------------------------------------------------------- /app/views/user_mailer/new_student.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %>! 2 | 3 |

    You have been enrolled into the course <%= link_to @course.title, course_url(@course) %> on Coursemology!

    4 | 5 | Best Regards, 6 |
    7 | 8 | The Coursemology Team 9 | -------------------------------------------------------------------------------- /db/migrate/20121222094359_add_exp_transaction_id_to_submission_grading.rb: -------------------------------------------------------------------------------- 1 | class AddExpTransactionIdToSubmissionGrading < ActiveRecord::Migration 2 | def change 3 | add_column :submission_gradings, :exp_transaction_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20130813191719_add_last_grade_updated_to_submission_gradings.rb: -------------------------------------------------------------------------------- 1 | class AddLastGradeUpdatedToSubmissionGradings < ActiveRecord::Migration 2 | def change 3 | add_column :submission_gradings, :last_grade_updated, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20140114091219_add_is_publish_to_lesson_plan_milestone.rb: -------------------------------------------------------------------------------- 1 | class AddIsPublishToLessonPlanMilestone < ActiveRecord::Migration 2 | def change 3 | add_column :lesson_plan_milestones, :is_publish, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/survey_question_type.rb: -------------------------------------------------------------------------------- 1 | class SurveyQuestionType < ActiveRecord::Base 2 | attr_accessible :title, :description 3 | 4 | scope :MCQ, where(title: 'MCQ') 5 | scope :MRQ, where(title: 'MRQ') 6 | scope :Essay, where(title: 'Essay') 7 | 8 | end 9 | -------------------------------------------------------------------------------- /app/views/assessment/general_questions/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%- title = 'Question' -%> 2 | 5 | <%= render :partial => 'form' %> 6 | -------------------------------------------------------------------------------- /db/migrate/20121214175026_change_assignment_to_mission.rb: -------------------------------------------------------------------------------- 1 | class ChangeAssignmentToMission < ActiveRecord::Migration 2 | def change 3 | rename_table :assignments, :missions 4 | rename_column :submissions, :assignment_id, :mission_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130124104853_add_deleted_at_to_tag_and_tag_group.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedAtToTagAndTagGroup < ActiveRecord::Migration 2 | def change 3 | add_column :tags, :deleted_at, :time 4 | add_column :tag_groups, :deleted_at, :time 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130411144948_add_index_to_user_achievement.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToUserAchievement < ActiveRecord::Migration 2 | def change 3 | add_index :user_achievements, :user_course_id 4 | add_index :user_achievements, :achievement_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130823094613_change_is_submission_file_in_missions.rb: -------------------------------------------------------------------------------- 1 | class ChangeIsSubmissionFileInMissions < ActiveRecord::Migration 2 | def up 3 | change_column :missions, :is_file_submission, :boolean 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20140729131241_remove_index_on_name_tag.rb: -------------------------------------------------------------------------------- 1 | class RemoveIndexOnNameTag < ActiveRecord::Migration 2 | def up 3 | remove_index :tags, :name 4 | add_index :tags, :name, unique: false 5 | end 6 | 7 | def down 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/assessment/coding_questions/new.html.erb: -------------------------------------------------------------------------------- 1 | <%- title = 'Coding Question' -%> 2 | 5 | 6 | <%= render :partial => 'form' %> 7 | -------------------------------------------------------------------------------- /db/migrate/20130718085939_add_owner_type_to_file_uploads.rb: -------------------------------------------------------------------------------- 1 | class AddOwnerTypeToFileUploads < ActiveRecord::Migration 2 | def change 3 | add_column :file_uploads, :owner_type, :string 4 | 5 | FileUpload.update_all owner_type: 'Course' 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20150827111659_add_sample_answer_to_assessment_general_questions.rb: -------------------------------------------------------------------------------- 1 | class AddSampleAnswerToAssessmentGeneralQuestions < ActiveRecord::Migration 2 | def change 3 | add_column :assessment_general_questions, :sample_answer, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20121117052103_add_title_and_desc_to_announcement.rb: -------------------------------------------------------------------------------- 1 | class AddTitleAndDescToAnnouncement < ActiveRecord::Migration 2 | def change 3 | add_column :announcements, :title, :string 4 | add_column :announcements, :description, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20121213043007_remove_assignment_id_from_question_and_mcq.rb: -------------------------------------------------------------------------------- 1 | class RemoveAssignmentIdFromQuestionAndMcq < ActiveRecord::Migration 2 | def change 3 | remove_column :questions, :assignment_id 4 | remove_column :mcqs, :assignment_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20121230193636_create_actions.rb: -------------------------------------------------------------------------------- 1 | class CreateActions < ActiveRecord::Migration 2 | def change 3 | create_table :actions do |t| 4 | t.string :text 5 | t.string :description 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20130411144854_add_index_to_training_submission.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToTrainingSubmission < ActiveRecord::Migration 2 | def change 3 | add_index :training_submissions, :std_course_id 4 | add_index :training_submissions, :training_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20140526043332_create_navbar_link_types.rb: -------------------------------------------------------------------------------- 1 | class CreateNavbarLinkTypes < ActiveRecord::Migration 2 | def change 3 | create_table :navbar_link_types do |t| 4 | t.string :link_type 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/admins/_search_form.html.erb: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/views/user_mailer/mission_due.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %> 2 | 3 |

    Please be reminded that: <%= @assessment.title %> is due on <%= @assessment.close_at %>

    4 | 5 | Best Regards, 6 |
    7 | 8 | The Coursemology Team 9 | -------------------------------------------------------------------------------- /db/migrate/20131109130905_add_reply_to_to_forem_posts.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20110228084940) 2 | class AddReplyToToForemPosts < ActiveRecord::Migration 3 | def change 4 | add_column :forem_posts, :reply_to_id, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20140531152553_add_create_at_index_activity.rb: -------------------------------------------------------------------------------- 1 | class AddCreateAtIndexActivity < ActiveRecord::Migration 2 | def up 3 | add_index :activities, :created_at 4 | end 5 | 6 | def down 7 | remove_index :activities, :created_at 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20140608144533_add_autograding_refresh_to_submission_grading.rb: -------------------------------------------------------------------------------- 1 | class AddAutogradingRefreshToSubmissionGrading < ActiveRecord::Migration 2 | def change 3 | add_column :submission_gradings, :autograding_refresh, :boolean, default: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20160319042230_add_uniq_index_to_user_courses.rb: -------------------------------------------------------------------------------- 1 | class AddUniqIndexToUserCourses < ActiveRecord::Migration 2 | def change 3 | add_index :user_courses, [:user_id, :course_id], unique: true 4 | remove_column :user_courses, :deleted_at 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/tasks/populate_course_preference.rake: -------------------------------------------------------------------------------- 1 | namespace :db do 2 | desc "populate existing courses with preference" 3 | 4 | task populate_course_pref: :environment do 5 | Course.all.each do |c| 6 | c.populate_preference 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/controllers/facebook_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | describe FacebookController do 4 | 5 | describe "GET 'obtain_badge'", :type => :controller do 6 | # TODO 7 | pending "should contain some proper test" 8 | end 9 | 10 | end 11 | -------------------------------------------------------------------------------- /app/models/assessment/grading_log.rb: -------------------------------------------------------------------------------- 1 | class Assessment::GradingLog < ActiveRecord::Base 2 | acts_as_paranoid 3 | 4 | belongs_to :grader, class_name: User 5 | belongs_to :grader_course, class_name: UserCourse 6 | belongs_to :grading, class_name: Assessment::Grading 7 | end -------------------------------------------------------------------------------- /app/views/user_mailer/new_grading.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %>! 2 | 3 |

    One of your submission has just been graded. 4 | Please click here to view it. 5 |

    6 | 7 | Best Regards, 8 |
    9 | 10 | The Coursemology Team 11 | -------------------------------------------------------------------------------- /db/migrate/20130808084910_add_columns_to_mcq_to_support_all_answers_kind.rb: -------------------------------------------------------------------------------- 1 | class AddColumnsToMcqToSupportAllAnswersKind < ActiveRecord::Migration 2 | def change 3 | add_column :mcqs, :correct_answers, :text 4 | add_column :mcqs, :select_all, :boolean 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20131212055120_create_comic_pages.rb: -------------------------------------------------------------------------------- 1 | class CreateComicPages < ActiveRecord::Migration 2 | def change 3 | create_table :comic_pages do |t| 4 | t.belongs_to :comic 5 | t.integer :page 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20140307153226_create_assignment_display_mode.rb: -------------------------------------------------------------------------------- 1 | class CreateAssignmentDisplayMode < ActiveRecord::Migration 2 | def change 3 | create_table :assignment_display_modes do |t| 4 | t.string :title 5 | t.string :description 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20121213172612_move_order_from_question_to_asm_qn.rb: -------------------------------------------------------------------------------- 1 | class MoveOrderFromQuestionToAsmQn < ActiveRecord::Migration 2 | def change 3 | remove_column :questions, :order 4 | remove_column :mcqs, :order 5 | add_column :asm_qns, :order, :integer 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20130411144706_add_index_to_submission.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToSubmission < ActiveRecord::Migration 2 | def change 3 | add_index :submissions, :std_course_id 4 | add_index :submissions, :mission_id 5 | add_index :submissions, :final_grading_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/views/assessment/scribing_questions/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%- title = 'Question' -%> 2 | 5 | <%= render :partial => 'form', :locals => { :mode => 'edit' } %> 6 | -------------------------------------------------------------------------------- /app/views/assessment/scribing_questions/new.html.erb: -------------------------------------------------------------------------------- 1 | <%- title = 'Question' -%> 2 | 5 | <%= render :partial => 'form', :locals => { :mode => 'new' } %> 6 | -------------------------------------------------------------------------------- /app/views/course_preferences/_course_navbar_preference_fields.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= f.input_field :name %> 3 | <%= f.input_field :pos %> 4 | <%= f.input_field :is_displayed, as: :boolean %> 5 | <%= f.input_field :is_enabled, as: :boolean %> 6 | -------------------------------------------------------------------------------- /app/views/survey_questions/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%- title = 'Survey Question' -%> 2 | 6 | <%= render :partial => 'form' %> 7 | -------------------------------------------------------------------------------- /app/views/survey_questions/new.html.erb: -------------------------------------------------------------------------------- 1 | <%- title = 'Survey Question' -%> 2 | 6 | <%= render :partial => 'form' %> 7 | -------------------------------------------------------------------------------- /app/views/user_mailer/user_deleted.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @name %>: 2 | 3 |

    Your Coursemology account has been removed.

    4 | 5 |

    If you have any question, please contact us at coursemology@gmail.com

    6 | 7 | Best Regards, 8 |
    9 | 10 | The Coursemology Team 11 | -------------------------------------------------------------------------------- /db/migrate/20121216162151_create_file_uploads.rb: -------------------------------------------------------------------------------- 1 | class CreateFileUploads < ActiveRecord::Migration 2 | def change 3 | create_table :file_uploads do |t| 4 | t.integer :course_id 5 | t.integer :creator_id 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20121228045425_create_role_requests.rb: -------------------------------------------------------------------------------- 1 | class CreateRoleRequests < ActiveRecord::Migration 2 | def change 3 | create_table :role_requests do |t| 4 | t.integer :user_id 5 | t.integer :role_id 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20130411144507_add_index_to_std_mcq_answer.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToStdMcqAnswer < ActiveRecord::Migration 2 | def change 3 | add_index :std_mcq_answers, :mcq_answer_id 4 | add_index :std_mcq_answers, :student_id 5 | add_index :std_mcq_answers, :mcq_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20130824164123_add_achievement_id_and_user_course_id_index_to_user_achievements.rb: -------------------------------------------------------------------------------- 1 | class AddAchievementIdAndUserCourseIdIndexToUserAchievements < ActiveRecord::Migration 2 | def change 3 | add_index :user_achievements, [:achievement_id, :user_course_id] 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20131109130910_add_hidden_to_forem_topics.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20110626160056) 2 | class AddHiddenToForemTopics < ActiveRecord::Migration 3 | def change 4 | add_column :forem_topics, :hidden, :boolean, :default => false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20131210162710_addis_logged_in_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddisLoggedInToUsers < ActiveRecord::Migration 2 | def up 3 | add_column :users, :is_logged_in, :boolean, default: true 4 | end 5 | 6 | def down 7 | remove_column :users, :is_logged_in 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /.env_sample: -------------------------------------------------------------------------------- 1 | AWS_BUCKET='coursemology' 2 | AWS_ACCESS_KEY_ID='swag' 3 | AWS_SECRET_ACCESS_KEY='yolo' 4 | 5 | MANDRILL_SMTP_USER='coursemology' 6 | MANDRILL_SMTP_PASSWORD='ootd' 7 | 8 | FB_APP_ID='wassup' 9 | FB_SECRET_KEY='youmadbro' 10 | 11 | ROLLBAR_ACCESS_TOKEN='ifeelyoubro' 12 | -------------------------------------------------------------------------------- /app/views/layouts/_setting_layout.html.erb: -------------------------------------------------------------------------------- 1 |
    2 | 5 |
    6 |
    7 | <%= yield %> 8 |
    9 |
    10 | 11 | -------------------------------------------------------------------------------- /db/migrate/20121026033635_create_roles.rb: -------------------------------------------------------------------------------- 1 | class CreateRoles < ActiveRecord::Migration 2 | def change 3 | create_table :roles do |t| 4 | t.string :name 5 | t.string :title 6 | t.string :description 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20130808173715_change_date_format_in_mcq.rb: -------------------------------------------------------------------------------- 1 | class ChangeDateFormatInMcq < ActiveRecord::Migration 2 | def up 3 | change_column :mcqs, :last_commented_at, :datetime 4 | end 5 | 6 | def down 7 | change_column :mcqs, :last_commented_at, :time 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20130809062153_rename_comments_to_staff_comments_in_coding_questions.rb: -------------------------------------------------------------------------------- 1 | class RenameCommentsToStaffCommentsInCodingQuestions < ActiveRecord::Migration 2 | def up 3 | rename_column :coding_questions, :comments, :staff_comments 4 | end 5 | 6 | def down 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20130910184054_create_survey_types.rb: -------------------------------------------------------------------------------- 1 | class CreateSurveyTypes < ActiveRecord::Migration 2 | def change 3 | create_table :survey_types do |t| 4 | t.string :title 5 | t.string :description 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20131214231300_add_is_tbc_to_comic_pages.rb: -------------------------------------------------------------------------------- 1 | class AddIsTbcToComicPages < ActiveRecord::Migration 2 | def up 3 | add_column :comic_pages, :is_tbc, :boolean, default: false 4 | end 5 | 6 | def down 7 | remove_column :comic_pages, :is_tbc 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20150714051531_change_column_null_in_assessments.rb: -------------------------------------------------------------------------------- 1 | class ChangeColumnNullInAssessments < ActiveRecord::Migration 2 | def change 3 | change_column_null :assessments, :as_assessment_id, false 4 | change_column_null :assessments, :as_assessment_type, false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/views/materials/_disabled_controls.html.erb: -------------------------------------------------------------------------------- 1 |
    2 | 3 | 4 | 5 | 6 | 7 | 8 |
    9 | -------------------------------------------------------------------------------- /db/migrate/20130829075227_create_assignment_types.rb: -------------------------------------------------------------------------------- 1 | class CreateAssignmentTypes < ActiveRecord::Migration 2 | def change 3 | create_table :assignment_types do |t| 4 | t.string :title 5 | t.string :description 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/assets/stylesheets/_html_editor.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the html editor here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | #image-uploader-modal { 6 | top:50%; 7 | margin-top:-250px; 8 | } 9 | -------------------------------------------------------------------------------- /app/assets/stylesheets/mcq_questions.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the mcqs controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | #mcq-options { 5 | textarea { 6 | height: 60px; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /app/models/assessment/answer_grading_log.rb: -------------------------------------------------------------------------------- 1 | class Assessment::AnswerGradingLog < ActiveRecord::Base 2 | acts_as_paranoid 3 | 4 | belongs_to :grader, class_name: User 5 | belongs_to :grader_course, class_name: UserCourse 6 | belongs_to :answer_grading, class_name: Assessment::AnswerGrading 7 | end -------------------------------------------------------------------------------- /app/models/assessment/answer_option.rb: -------------------------------------------------------------------------------- 1 | class Assessment::AnswerOption < ActiveRecord::Base 2 | acts_as_paranoid 3 | 4 | attr_accessible :option_id, :answer_id 5 | 6 | belongs_to :answer, class_name: Assessment::McqAnswer.name 7 | belongs_to :option, class_name: Assessment::McqOption.name 8 | end -------------------------------------------------------------------------------- /app/views/layouts/_material_file_picker.html.erb: -------------------------------------------------------------------------------- 1 |
    2 |

    Select Files

    3 |
    4 |
    5 | 8 | 11 |
    12 |
    -------------------------------------------------------------------------------- /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 | # Mime::Type.register_alias "text/html", :iphone 6 | Mime::Type.register "application/xlsx", :xlsx 7 | -------------------------------------------------------------------------------- /db/migrate/20121023155209_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :name 5 | t.string :profile_photo_url 6 | t.string :display_name 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20121026041328_create_courses.rb: -------------------------------------------------------------------------------- 1 | class CreateCourses < ActiveRecord::Migration 2 | def change 3 | create_table :courses do |t| 4 | t.string :title 5 | t.integer :creator_id 6 | t.string :description 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20121216073952_create_asm_reqs.rb: -------------------------------------------------------------------------------- 1 | class CreateAsmReqs < ActiveRecord::Migration 2 | def change 3 | create_table :asm_reqs do |t| 4 | t.integer :asm_id 5 | t.string :asm_type 6 | t.integer :min_grade 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20130115044758_create_std_tags.rb: -------------------------------------------------------------------------------- 1 | class CreateStdTags < ActiveRecord::Migration 2 | def change 3 | create_table :std_tags do |t| 4 | t.integer :std_course_id 5 | t.integer :tag_id 6 | t.integer :exp 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20130811190133_add_bonus_exp_and_bonus_cutoff_time_for_trainings.rb: -------------------------------------------------------------------------------- 1 | class AddBonusExpAndBonusCutoffTimeForTrainings < ActiveRecord::Migration 2 | def change 3 | add_column :trainings, :bonus_exp, :integer 4 | add_column :trainings, :bonus_cutoff, :datetime 5 | end 6 | 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20131109130906_add_locked_to_forem_topics.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20110519210300) 2 | class AddLockedToForemTopics < ActiveRecord::Migration 3 | def change 4 | add_column :forem_topics, :locked, :boolean, :null => false, :default => false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20140825131756_add_fb_publish_actions_request_count_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddFbPublishActionsRequestCountToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :fb_publish_actions_request_count, 4 | :tinyint, :null => false, :default => 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20141113065557_create_assessment_scribing_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateAssessmentScribingAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :assessment_scribing_answers do |t| 4 | t.timestamp :deleted_at 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | # Add your own tasks in files placed in lib/tasks ending in .rake, 3 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 4 | 5 | require File.expand_path('../config/application', __FILE__) 6 | 7 | Coursemology::Application.load_tasks 8 | -------------------------------------------------------------------------------- /app/views/user_mailer/new_submission.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %>! 2 | 3 |

    There is a new submission by <%= @sbm.std_course.name %>. 4 | Please click here to review and grade it. 5 |

    6 | 7 | Best Regards, 8 |
    9 | 10 | The Coursemology Team 11 | -------------------------------------------------------------------------------- /app/views/users/mailer/confirmation_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

    Welcome <%= @resource.email %>!

    2 | 3 |

    You can confirm your account email through the link below:

    4 | 5 |

    <%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>

    6 | -------------------------------------------------------------------------------- /db/migrate/20121216072645_create_user_achievements.rb: -------------------------------------------------------------------------------- 1 | class CreateUserAchievements < ActiveRecord::Migration 2 | def change 3 | create_table :user_achievements do |t| 4 | t.integer :user_id 5 | t.integer :achievement_id 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20130123170643_create_tag_groups.rb: -------------------------------------------------------------------------------- 1 | class CreateTagGroups < ActiveRecord::Migration 2 | def change 3 | create_table :tag_groups do |t| 4 | t.string :name 5 | t.string :description 6 | t.integer :course_id 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20130411151309_add_index_to_answer_grading.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToAnswerGrading < ActiveRecord::Migration 2 | def change 3 | add_index :answer_gradings, :grader_id 4 | add_index :answer_gradings, :student_answer_id 5 | add_index :answer_gradings, :submission_grading_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20130824160020_add_name_to_user_courses.rb: -------------------------------------------------------------------------------- 1 | class AddNameToUserCourses < ActiveRecord::Migration 2 | def change 3 | add_column :user_courses, :name, :string 4 | 5 | UserCourse.all.each do |uc| 6 | uc.name = uc.user.name 7 | uc.save 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20131019110754_add_materials_timestamps.rb: -------------------------------------------------------------------------------- 1 | class AddMaterialsTimestamps < ActiveRecord::Migration 2 | def change 3 | change_table :material_folders do |t| 4 | t.timestamps 5 | end 6 | change_table :materials do |t| 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20131109130907_add_pinned_to_forem_topics.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20110519222000) 2 | class AddPinnedToForemTopics < ActiveRecord::Migration 3 | def change 4 | add_column :forem_topics, :pinned, :boolean, :default => false, :nullable => false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20140929155854_remove_dependent_id_from_assessment.rb: -------------------------------------------------------------------------------- 1 | class RemoveDependentIdFromAssessment < ActiveRecord::Migration 2 | def up 3 | remove_column :assessments, :dependent_id 4 | end 5 | 6 | def down 7 | add_column :assessments, :dependent_id, :integer 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20141107054440_create_guilds.rb: -------------------------------------------------------------------------------- 1 | class CreateGuilds < ActiveRecord::Migration 2 | def change 3 | create_table :guilds do |t| 4 | t.string :name 5 | t.text :description 6 | t.references :course, index: true 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/views/layouts/_material_title.html.erb: -------------------------------------------------------------------------------- 1 |

    2 | <% if @is_new[material.id] %> 3 | 4 | New 5 | <% end %> 6 | <%= material.filename %> 7 |

    8 | -------------------------------------------------------------------------------- /app/views/user_mailer/course_deleted.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %>: 2 | 3 |

    Your course: <%= @title %> has been deleted.

    4 | 5 |

    If you have any question, please contact us at coursemology@gmail.com

    6 | 7 | Best Regards, 8 |
    9 | 10 | The Coursemology Team 11 | -------------------------------------------------------------------------------- /db/migrate/20121213103340_create_std_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateStdAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :std_answers do |t| 4 | t.string :text 5 | t.integer :student_id 6 | t.integer :question_id 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20121216072257_create_user_titles.rb: -------------------------------------------------------------------------------- 1 | class CreateUserTitles < ActiveRecord::Migration 2 | def change 3 | create_table :user_titles do |t| 4 | t.integer :user_id 5 | t.integer :title_id 6 | t.integer :is_using 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20121226084218_change_order_to_pos.rb: -------------------------------------------------------------------------------- 1 | class ChangeOrderToPos < ActiveRecord::Migration 2 | def up 3 | rename_column :asm_qns, :order, :pos 4 | rename_column :missions, :order, :pos 5 | rename_column :quizzes, :order, :pos 6 | rename_column :trainings, :order, :pos 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20130411145119_add_index_to_user_course.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToUserCourse < ActiveRecord::Migration 2 | def change 3 | add_index :user_courses, :user_id 4 | add_index :user_courses, :course_id 5 | add_index :user_courses, :role_id 6 | add_index :user_courses, :level_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20130411151104_add_index_to_submission_grading.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToSubmissionGrading < ActiveRecord::Migration 2 | def change 3 | add_index :submission_gradings, :grader_id 4 | add_index :submission_gradings, :sbm_id 5 | add_index :submission_gradings, :exp_transaction_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20140207072305_add_detail_to_role_request.rb: -------------------------------------------------------------------------------- 1 | class AddDetailToRoleRequest < ActiveRecord::Migration 2 | def change 3 | add_column :role_requests, :organization, :string 4 | add_column :role_requests, :designation, :string 5 | add_column :role_requests, :reason, :text 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/assets/stylesheets/stats.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the stats controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | .graph { 6 | display: block; 7 | margin: 0 auto; 8 | width: 600px; 9 | } 10 | -------------------------------------------------------------------------------- /db/migrate/20121211032636_add_grade_to_assignment_and_question.rb: -------------------------------------------------------------------------------- 1 | class AddGradeToAssignmentAndQuestion < ActiveRecord::Migration 2 | def change 3 | add_column :assignments, :max_grade, :integer 4 | add_column :mcqs, :max_grade, :integer 5 | add_column :questions, :max_grade, :integer 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20130910185549_create_survey_question_types.rb: -------------------------------------------------------------------------------- 1 | class CreateSurveyQuestionTypes < ActiveRecord::Migration 2 | def change 3 | create_table :survey_question_types do |t| 4 | t.string :title 5 | t.string :description 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/views/user_mailer/new_lecturer.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %>! 2 | 3 |

    You have been approved to be a lecturer on Coursemology!

    4 | 5 |

    Click here to create a new course and get started!

    6 | 7 | Best Regards, 8 |
    9 | 10 | The Coursemology Team 11 | -------------------------------------------------------------------------------- /config/initializers/rpm_instrumentation.rb: -------------------------------------------------------------------------------- 1 | require 'new_relic/agent/method_tracer' 2 | 3 | Assessment::TrainingSubmissionsController.class_eval do 4 | include ::NewRelic::Agent::MethodTracer 5 | 6 | add_method_tracer :submit 7 | add_method_tracer :submit_mcq 8 | add_method_tracer :submit_code 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20121216072233_create_user_rewards.rb: -------------------------------------------------------------------------------- 1 | class CreateUserRewards < ActiveRecord::Migration 2 | def change 3 | create_table :user_rewards do |t| 4 | t.integer :user_id 5 | t.integer :reward_id 6 | t.datetime :claimed_at 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20121230070236_create_seen_by_users.rb: -------------------------------------------------------------------------------- 1 | class CreateSeenByUsers < ActiveRecord::Migration 2 | def change 3 | create_table :seen_by_users do |t| 4 | t.integer :user_course_id 5 | t.integer :obj_id 6 | t.string :obj_type 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20130808173531_change_date_format_in_std_answer.rb: -------------------------------------------------------------------------------- 1 | class ChangeDateFormatInStdAnswer < ActiveRecord::Migration 2 | def up 3 | change_column :std_answers, :last_commented_at, :datetime 4 | end 5 | 6 | def down 7 | change_column :std_answers, :last_commented_at, :time 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20141225134326_create_scribbles.rb: -------------------------------------------------------------------------------- 1 | class CreateScribbles < ActiveRecord::Migration 2 | def change 3 | create_table :scribbles do |t| 4 | t.text :content 5 | t.references :std_course 6 | t.references :scribing_answer 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20121026160218_create_enroll_requests.rb: -------------------------------------------------------------------------------- 1 | class CreateEnrollRequests < ActiveRecord::Migration 2 | def change 3 | create_table :enroll_requests do |t| 4 | t.integer :user_id 5 | t.integer :course_id 6 | t.integer :role_id 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20121212155230_create_asm_qns.rb: -------------------------------------------------------------------------------- 1 | class CreateAsmQns < ActiveRecord::Migration 2 | def change 3 | create_table :asm_qns do |t| 4 | t.integer :asm_id 5 | t.string :asm_type 6 | t.integer :qn_id 7 | t.string :qn_type 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20121214172423_rename_submission_to_sbm_id_type_in_submission_grading.rb: -------------------------------------------------------------------------------- 1 | class RenameSubmissionToSbmIdTypeInSubmissionGrading < ActiveRecord::Migration 2 | def change 3 | rename_column :submission_gradings, :submission_id, :sbm_id 4 | add_column :submission_gradings, :sbm_type, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20130111050247_create_theme_attributes.rb: -------------------------------------------------------------------------------- 1 | class CreateThemeAttributes < ActiveRecord::Migration 2 | def change 3 | create_table :theme_attributes do |t| 4 | t.string :name 5 | t.string :description 6 | t.string :value_type 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20130128190046_create_course_themes.rb: -------------------------------------------------------------------------------- 1 | class CreateCourseThemes < ActiveRecord::Migration 2 | def change 3 | create_table :course_themes do |t| 4 | t.integer :course_id 5 | t.integer :theme_id 6 | t.string :theme_folder_url 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20130702101844_create_std_coding_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateStdCodingAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :std_coding_answers do |t| 4 | t.text :code 5 | t.integer :student_id 6 | t.integer :qn_id 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /script/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 3 | 4 | APP_PATH = File.expand_path('../../config/application', __FILE__) 5 | require File.expand_path('../../config/boot', __FILE__) 6 | require 'rails/commands' 7 | -------------------------------------------------------------------------------- /app/models/assessment/general_answer.rb: -------------------------------------------------------------------------------- 1 | class Assessment::GeneralAnswer < ActiveRecord::Base 2 | acts_as_paranoid 3 | is_a :answer, as: :as_answer, auto_join: false, class_name: "Assessment::Answer" 4 | 5 | attr_accessible :std_course_id, :question_id, :content, :submission_id, :attempt_left 6 | 7 | end 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/models/survey_essay_answer.rb: -------------------------------------------------------------------------------- 1 | class SurveyEssayAnswer < ActiveRecord::Base 2 | acts_as_paranoid 3 | attr_accessible :user_course_id, :question_id, :text, :survey_submission_id 4 | 5 | belongs_to :user_course 6 | belongs_to :question, class_name: "SurveyQuestion" 7 | belongs_to :survey_submission 8 | 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20121216071735_create_titles.rb: -------------------------------------------------------------------------------- 1 | class CreateTitles < ActiveRecord::Migration 2 | def change 3 | create_table :titles do |t| 4 | t.string :title 5 | t.string :description 6 | t.integer :creator_id 7 | t.integer :course_id 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20130115043542_create_asm_tags.rb: -------------------------------------------------------------------------------- 1 | class CreateAsmTags < ActiveRecord::Migration 2 | def change 3 | create_table :asm_tags do |t| 4 | t.integer :asm_id 5 | t.string :asm_type 6 | t.integer :tag_id 7 | t.integer :max_exp 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20130825075032_add_unique_index_to_user_achievements.rb: -------------------------------------------------------------------------------- 1 | class AddUniqueIndexToUserAchievements < ActiveRecord::Migration 2 | def change 3 | remove_index :user_achievements, [:achievement_id, :user_course_id] 4 | add_index :user_achievements, [:user_course_id, :achievement_id], unique: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/tasks/populate_vote_count.rake: -------------------------------------------------------------------------------- 1 | namespace :db do 2 | desc "Populate survey question option count after migration" 3 | 4 | task populate_vote_count: :environment do 5 | SurveyQuestionOption.all.each do |option| 6 | option.count = option.answers.count 7 | option.save 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20121216071618_create_levels.rb: -------------------------------------------------------------------------------- 1 | class CreateLevels < ActiveRecord::Migration 2 | def change 3 | create_table :levels do |t| 4 | t.integer :level 5 | t.integer :exp_threshold 6 | t.integer :course_id 7 | t.integer :creator_id 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20130808144743_add_index_to_comment_subscription.rb: -------------------------------------------------------------------------------- 1 | class AddIndexToCommentSubscription < ActiveRecord::Migration 2 | def change 3 | add_index :comment_subscriptions, :course_id 4 | add_index :comment_subscriptions, [:topic_id, :topic_type] 5 | add_index :comment_subscriptions, :user_course_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20131109130918_create_forem_groups.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20120222155549) 2 | class CreateForemGroups < ActiveRecord::Migration 3 | def change 4 | create_table :forem_groups do |t| 5 | t.string :name 6 | end 7 | 8 | add_index :forem_groups, :name 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/assets/stylesheets/mission_coding_questions.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the MissionCodingQuestions controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | #template_code .CodeMirror-scroll { 6 | height: 470px !important; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /app/views/user_mailer/forum_topic_reply.html.erb: -------------------------------------------------------------------------------- 1 | <%= I18n.t('received_reply', :scope => 'forem.topic') %> You can view it here: 2 | 3 | <%= forem.forum_topic_url(@post.topic.forum_id, @post.topic) %> 4 | 5 | To unsubscribe from this topic, use the following link: 6 | <%= forem.unsubscribe_forum_topic_url(@post.topic.forum, @post.topic) %> 7 | -------------------------------------------------------------------------------- /db/migrate/20121026160233_create_user_courses.rb: -------------------------------------------------------------------------------- 1 | class CreateUserCourses < ActiveRecord::Migration 2 | def change 3 | create_table :user_courses do |t| 4 | t.integer :user_id 5 | t.integer :course_id 6 | t.integer :exp 7 | t.integer :role_id 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20121216072725_create_requirements.rb: -------------------------------------------------------------------------------- 1 | class CreateRequirements < ActiveRecord::Migration 2 | def change 3 | create_table :requirements do |t| 4 | t.integer :req_id 5 | t.string :req_type 6 | t.integer :obj_id 7 | t.string :obj_type 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20130808173814_change_date_format_in_coding_question.rb: -------------------------------------------------------------------------------- 1 | class ChangeDateFormatInCodingQuestion < ActiveRecord::Migration 2 | def up 3 | change_column :coding_questions, :last_commented_at, :datetime 4 | end 5 | 6 | def down 7 | change_column :coding_questions, :last_commented_at, :time 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20140721103118_create_data_map.rb: -------------------------------------------------------------------------------- 1 | class CreateDataMap < ActiveRecord::Migration 2 | def up 3 | create_table :data_maps do |t| 4 | t.string :data_type 5 | t.integer :old_data_id 6 | t.integer :new_data_id 7 | end 8 | end 9 | 10 | def down 11 | drop_table :data_maps 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/survey_questions/_one.html.erb: -------------------------------------------------------------------------------- 1 | <%= style_format(q.description) %> 2 |
    3 | 11 | 12 | -------------------------------------------------------------------------------- /db/migrate/20130219034623_create_comments.rb: -------------------------------------------------------------------------------- 1 | class CreateComments < ActiveRecord::Migration 2 | def change 3 | create_table :comments do |t| 4 | t.integer :user_course_id 5 | t.text :text 6 | t.integer :commentable_id 7 | t.string :commentable_type 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20130808173629_change_date_format_in_std_coding_answer.rb: -------------------------------------------------------------------------------- 1 | class ChangeDateFormatInStdCodingAnswer < ActiveRecord::Migration 2 | def up 3 | change_column :std_coding_answers, :last_commented_at, :datetime 4 | end 5 | 6 | def down 7 | change_column :std_coding_answers, :last_commented_at, :time 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20131109130912_create_forem_categories.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20111103210835) 2 | class CreateForemCategories < ActiveRecord::Migration 3 | def change 4 | create_table :forem_categories do |t| 5 | t.string :name, :null => false 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20141107064604_create_guild_users.rb: -------------------------------------------------------------------------------- 1 | class CreateGuildUsers < ActiveRecord::Migration 2 | def change 3 | create_table :guild_users do |t| 4 | t.integer :role_id 5 | t.references :user_course, index: true 6 | t.references :guild, index: true 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/models/modules/mail_monitor_plugin.rb: -------------------------------------------------------------------------------- 1 | 2 | class MailMonitorPlugin < Delayed::Plugin 3 | callbacks do |lifecycle| 4 | lifecycle.after(:perform) do |worker, job| 5 | queue = QueuedJob.where(delayed_job_id: job.id).first 6 | if queue 7 | QueuedJob.delete(queue) 8 | end 9 | end 10 | end 11 | end 12 | 13 | -------------------------------------------------------------------------------- /app/views/materials/new.html.erb: -------------------------------------------------------------------------------- 1 | <%- model_class = Material -%> 2 | 6 |
    7 | <%= render :partial => 'form' %> 8 | -------------------------------------------------------------------------------- /app/views/role_requests/edit.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | <% if current_user.is_lecturer? %> 7 | You are already given lecturer right! 8 | <% else %> 9 | <%= render :partial => 'form' %> 10 | <% end %> 11 | 12 | -------------------------------------------------------------------------------- /db/migrate/20130115043452_create_tags.rb: -------------------------------------------------------------------------------- 1 | class CreateTags < ActiveRecord::Migration 2 | def change 3 | create_table :tags do |t| 4 | t.string :name 5 | t.string :description 6 | t.integer :course_id 7 | t.string :icon_url 8 | t.integer :max_exp 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20130713010831_change_description_text_format_in_coding_questions.rb: -------------------------------------------------------------------------------- 1 | class ChangeDescriptionTextFormatInCodingQuestions < ActiveRecord::Migration 2 | def up 3 | change_column :coding_questions, :description, :text 4 | end 5 | 6 | def down 7 | change_column :coding_questions, :description, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20131109130908_add_forem_views.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20110520150056) 2 | class AddForemViews < ActiveRecord::Migration 3 | def change 4 | create_table :forem_views do |t| 5 | t.integer :user_id 6 | t.integer :topic_id 7 | t.datetime :created_at 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20140526072050_add_course_preference_index.rb: -------------------------------------------------------------------------------- 1 | class AddCoursePreferenceIndex < ActiveRecord::Migration 2 | 3 | def up 4 | add_index :course_preferences, [:course_id, :preferable_item_id], unique: true 5 | end 6 | 7 | def down 8 | remove_index :course_preferences, [:course_id, :preferable_item_id] 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20140723210136_create_system_wide_announcements.rb: -------------------------------------------------------------------------------- 1 | class CreateSystemWideAnnouncements < ActiveRecord::Migration 2 | def change 3 | create_table :system_wide_announcements do |t| 4 | t.references :creator 5 | t.string :subject 6 | t.string :body 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20150625084352_add_auto_graded_to_assessment_general_questions.rb: -------------------------------------------------------------------------------- 1 | class AddAutoGradedToAssessmentGeneralQuestions < ActiveRecord::Migration 2 | def change 3 | add_column :assessment_general_questions, :auto_graded, :boolean 4 | add_column :assessment_general_questions, :auto_grading_type_cd, :integer, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20150702085119_create_auto_grading_keyword_options.rb: -------------------------------------------------------------------------------- 1 | class CreateAutoGradingKeywordOptions < ActiveRecord::Migration 2 | def change 3 | create_table :assessment_auto_grading_keyword_options do |t| 4 | t.integer :general_question_id 5 | t.string :keyword 6 | t.integer :score 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/tasks/add_zero_level.rake: -------------------------------------------------------------------------------- 1 | namespace :db do 2 | task add_zero_level: :environment do 3 | courses = Course.all 4 | courses.each do |course| 5 | unless course.levels.find_by_level(0) 6 | level = course.levels.build({ level: 0, exp_threshold: 0 }) 7 | level.save 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/models/assessment/auto_grading_exact_option.rb: -------------------------------------------------------------------------------- 1 | class Assessment::AutoGradingExactOption < ActiveRecord::Base 2 | validates :answer, presence: true 3 | validates :explanation, presence: true 4 | 5 | attr_accessible :general_question_id 6 | attr_accessible :correct, :answer, :explanation 7 | 8 | belongs_to :general_question 9 | end 10 | -------------------------------------------------------------------------------- /app/views/announcements/show.html.erb: -------------------------------------------------------------------------------- 1 | 4 |
    5 |

    <%= @announcement.title %>

    6 |

    <%= @announcement.description.html_safe %>

    7 | <%= @announcement.publish_at.to_formatted_s(:long) %> 8 |
    9 | -------------------------------------------------------------------------------- /config/database.yml.sample: -------------------------------------------------------------------------------- 1 | default: &default 2 | adapter: mysql2 3 | encoding: utf8 4 | reconnect: true 5 | pool: 16 6 | 7 | development: 8 | <<: *default 9 | database: coursemology_dev 10 | 11 | test: 12 | <<: *default 13 | database: coursemology_test 14 | 15 | production: 16 | <<: *default 17 | database: coursemology 18 | 19 | -------------------------------------------------------------------------------- /db/migrate/20121112101918_create_announcements.rb: -------------------------------------------------------------------------------- 1 | class CreateAnnouncements < ActiveRecord::Migration 2 | def change 3 | create_table :announcements do |t| 4 | t.integer :creator_id 5 | t.integer :course_id 6 | t.datetime :publish_at 7 | t.integer :important 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20121213103531_create_std_mcq_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateStdMcqAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :std_mcq_answers do |t| 4 | t.integer :mcq_answer_id 5 | t.string :choices 6 | t.integer :student_id 7 | t.integer :mcq_id 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20130111050334_create_course_theme_attributes.rb: -------------------------------------------------------------------------------- 1 | class CreateCourseThemeAttributes < ActiveRecord::Migration 2 | def change 3 | create_table :course_theme_attributes do |t| 4 | t.integer :course_id 5 | t.integer :theme_attribute_id 6 | t.string :value 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20130723141520_create_masquerade_logs.rb: -------------------------------------------------------------------------------- 1 | class CreateMasqueradeLogs < ActiveRecord::Migration 2 | def change 3 | create_table :masquerade_logs do |t| 4 | t.integer :by_user_id 5 | t.integer :as_user_id 6 | t.integer :action 7 | t.text :description 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20131109130914_create_forem_subscriptions.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20111208014437) 2 | class CreateForemSubscriptions < ActiveRecord::Migration 3 | def change 4 | create_table :forem_subscriptions do |t| 5 | t.integer :subscriber_id 6 | t.integer :topic_id 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/tasks/user_achievement.rake: -------------------------------------------------------------------------------- 1 | namespace :user_achievement do 2 | desc "set obtain date to submitted date or create_at" 3 | task :set_obtain_date => :environment do 4 | UserAchievement.all.each do |uach| 5 | uach.assign_obtained_date 6 | uach.obtained_at ||= uach.created_at 7 | uach.save 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20130910190241_create_survey_question_options.rb: -------------------------------------------------------------------------------- 1 | class CreateSurveyQuestionOptions < ActiveRecord::Migration 2 | def change 3 | create_table :survey_question_options do |t| 4 | t.integer :question_id 5 | t.text :description 6 | 7 | t.time :deleted_at 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20131102064208_populate_original_file_name.rb: -------------------------------------------------------------------------------- 1 | class PopulateOriginalFileName < ActiveRecord::Migration 2 | def up 3 | FileUpload.all.each do |file| 4 | unless file.original_name 5 | file.original_name = file.file_file_name 6 | file.save 7 | end 8 | end 9 | end 10 | 11 | def down 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20131109130909_add_updated_at_and_count_to_forem_views.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20110626150056) 2 | class AddUpdatedAtAndCountToForemViews < ActiveRecord::Migration 3 | def change 4 | add_column :forem_views, :updated_at, :datetime 5 | add_column :forem_views, :count, :integer, :default => 0 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20140605155859_add_rewardable_to_exp_transaction.rb: -------------------------------------------------------------------------------- 1 | class AddRewardableToExpTransaction < ActiveRecord::Migration 2 | def change 3 | add_column :exp_transactions, :rewardable_id, :integer 4 | add_column :exp_transactions, :rewardable_type, :string 5 | 6 | add_index :exp_transactions, [:rewardable_id, :rewardable_type] 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/tasks/populate_comment_subscriptions.rake: -------------------------------------------------------------------------------- 1 | namespace :db do 2 | desc "populate existing subscriptions for existing comments" 3 | 4 | task populate_comment_subscriptions: :environment do 5 | Comment.all.each do |comment| 6 | puts comment.to_json 7 | CommentSubscription.populate_subscription(comment) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /python/sandbox/testing/valid_excep.py: -------------------------------------------------------------------------------- 1 | def exception_trigger(x): 2 | print(x) 3 | if x == 5: 4 | x = 1 / 0 5 | return 0 6 | 7 | 8 | print(exception_trigger(1) == 0) 9 | print(exception_trigger(2) == 0) 10 | print(exception_trigger(3) == 0) 11 | print(exception_trigger(4) == 0) 12 | print(exception_trigger(5) == 0) 13 | print(exception_trigger(4) == 0) -------------------------------------------------------------------------------- /app/assets/stylesheets/materials_file_picker.css.scss: -------------------------------------------------------------------------------- 1 | #file-picker-tree ul.jqtree-tree { 2 | margin-left: 24px; 3 | } 4 | 5 | #file-picker-tree ul.jqtree-tree .jqtree-element { 6 | width: 100%; /* todo: why is this in here? */ 7 | *width: auto; /* ie7 fix; issue 41 */ 8 | position: relative; 9 | 10 | font-size: 14px; 11 | padding: 4px; 12 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/mission.css.scss: -------------------------------------------------------------------------------- 1 | // Refer to asm_qn.scss for details of question table's style 2 | .missions { 3 | td.actions-col { 4 | white-space: nowrap; 5 | } 6 | } 7 | 8 | .missions-overview { 9 | #submit-button { 10 | width: 50%; 11 | font-weight: bold; 12 | } 13 | 14 | td.publish { 15 | text-align: center 16 | } 17 | } -------------------------------------------------------------------------------- /app/models/modules/activity_object.rb: -------------------------------------------------------------------------------- 1 | module ActivityObject 2 | 3 | def self.included(base) 4 | base.class_eval do 5 | has_many :activities, as: :obj, dependent: :destroy 6 | end 7 | end 8 | 9 | def get_title 10 | raise NotImplementedError 11 | end 12 | 13 | def get_path 14 | raise NotImplementedError 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/models/scribble.rb: -------------------------------------------------------------------------------- 1 | class Scribble < ActiveRecord::Base 2 | 3 | belongs_to :answer, class_name: "Assessment::ScribingAnswer" 4 | belongs_to :std_course, class_name: "UserCourse" 5 | has_one :user, through: :std_course 6 | 7 | attr_accessible :content, :user, :answer 8 | attr_accessible :std_course_id, :scribing_answer_id, :id 9 | 10 | end 11 | -------------------------------------------------------------------------------- /app/views/comics/new.html.erb: -------------------------------------------------------------------------------- 1 | <%- model_class = Comic -%> 2 | 6 | <%= render :partial => 'form', locals: {action: :new} %> 7 | -------------------------------------------------------------------------------- /db/migrate/20121029142406_create_written_questions.rb: -------------------------------------------------------------------------------- 1 | class CreateWrittenQuestions < ActiveRecord::Migration 2 | def change 3 | create_table :written_questions do |t| 4 | t.integer :creator_id 5 | t.integer :assignment_id 6 | t.string :description 7 | t.integer :order 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20121216071821_create_rewards.rb: -------------------------------------------------------------------------------- 1 | class CreateRewards < ActiveRecord::Migration 2 | def change 3 | create_table :rewards do |t| 4 | t.string :icon_url 5 | t.string :title 6 | t.string :description 7 | t.integer :creator_id 8 | t.integer :course_id 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/announcements/new.html.erb: -------------------------------------------------------------------------------- 1 | <%- model_class = Announcement -%> 2 | 6 | <%= render :partial => 'form' %> 7 | -------------------------------------------------------------------------------- /app/views/layouts/_mission_title.html.erb: -------------------------------------------------------------------------------- 1 |

    2 | <% if @is_new[mission.id] %> 3 | 4 | 5 | <% end %> 6 | <%= mission.title %> 7 |

    8 | -------------------------------------------------------------------------------- /app/views/user_mailer/new_enroll_request.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @lecturer.name %>! 2 | 3 |

    <%= @user.name %> (<%= @user.email %>) requests to enroll as: <%= @role.title %> for your course: <%= @course.title %>

    4 | 5 |

    Click here to view the request.

    6 | 7 | Best Regards, 8 |
    9 | 10 | The Coursemology Team 11 | -------------------------------------------------------------------------------- /app/views/users/mailer/unlock_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

    Hello <%= @resource.email %>!

    2 | 3 |

    Your account has been locked due to an excessive amount of unsuccessful sign in attempts.

    4 | 5 |

    Click the link below to unlock your account:

    6 | 7 |

    <%= link_to 'Unlock my account', locked_url(@resource, :unlock_token => @resource.unlock_token) %>

    8 | -------------------------------------------------------------------------------- /db/migrate/20121029141223_create_mcqs.rb: -------------------------------------------------------------------------------- 1 | class CreateMcqs < ActiveRecord::Migration 2 | def change 3 | create_table :mcqs do |t| 4 | t.integer :creator_id 5 | t.integer :assignment_id 6 | t.string :description 7 | t.integer :order 8 | t.integer :correct_answer_id 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20131226124705_create_tabs.rb: -------------------------------------------------------------------------------- 1 | class CreateTabs < ActiveRecord::Migration 2 | def change 3 | create_table :tabs do |t| 4 | t.integer :course_id, :null => false 5 | t.string :type, :null => false 6 | t.string :title, :null => false 7 | t.text :description 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20150625085254_create_auto_grading_exact_options.rb: -------------------------------------------------------------------------------- 1 | class CreateAutoGradingExactOptions < ActiveRecord::Migration 2 | def change 3 | create_table :assessment_auto_grading_exact_options do |t| 4 | t.integer :general_question_id 5 | t.boolean :correct 6 | t.text :answer 7 | t.text :explanation 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/tasks/generate_uncategorized_taggroups.rake: -------------------------------------------------------------------------------- 1 | namespace :db do 2 | 3 | task generate_uncategorized_taggroups: :environment do 4 | Course.all.each do |c| 5 | tg = c.tag_groups.create({name: "Uncategorized"}) 6 | c.tags.where(tag_group_id: 0).each do |t| 7 | t.tag_group = tg 8 | t.save 9 | end 10 | end 11 | end 12 | end -------------------------------------------------------------------------------- /lib/tasks/populate_empty_materials_root.rake: -------------------------------------------------------------------------------- 1 | namespace :db do 2 | desc "Populate with root Materials folder" 3 | 4 | task populate_empty_materials_root: :environment do 5 | Course.all.each do |course| 6 | unless course.root_folder 7 | MaterialFolder.create(:course => course, :name => "Root") 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/models/modules/date_validator.rb: -------------------------------------------------------------------------------- 1 | class DateValidator < ActiveModel::Validator 2 | def initialize(options) 3 | super 4 | @fields = options[:fields] 5 | end 6 | 7 | def validate(record) 8 | if record.send(@fields[0]) > record.send(@fields[1]) 9 | record.errors[:base] << "End time should be after start time." 10 | end 11 | end 12 | end -------------------------------------------------------------------------------- /app/views/announcements/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%- model_class = Announcement -%> 2 | 6 | <%= render :partial => 'form' %> 7 | -------------------------------------------------------------------------------- /db/migrate/20121213095957_create_mcq_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateMcqAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :mcq_answers do |t| 4 | t.integer :mcq_id 5 | t.string :text 6 | t.integer :creator_id 7 | t.string :explanation 8 | t.boolean :is_correct 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20121213103737_create_sbm_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateSbmAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :sbm_answers do |t| 4 | t.integer :sbm_id 5 | t.string :sbm_type 6 | t.integer :answer_id 7 | t.string :answer_type 8 | t.boolean :is_final 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20121218092223_change_user_id_to_user_course_id_in_game_tables.rb: -------------------------------------------------------------------------------- 1 | class ChangeUserIdToUserCourseIdInGameTables < ActiveRecord::Migration 2 | def change 3 | rename_column :user_achievements, :user_id, :user_course_id 4 | rename_column :user_rewards, :user_id, :user_course_id 5 | rename_column :user_titles, :user_id, :user_course_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20131109130904_create_forem_posts.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20110221094502) 2 | class CreateForemPosts < ActiveRecord::Migration 3 | def change 4 | create_table :forem_posts do |t| 5 | t.integer :topic_id 6 | t.text :text 7 | t.integer :user_id 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/tasks/fix_last_comment_at.rake: -------------------------------------------------------------------------------- 1 | namespace :db do 2 | desc "populate existing courses with preference" 3 | 4 | task fix_last_comment_at: :environment do 5 | CommentTopic.all.each do |topic| 6 | unless topic.last_commented_at 7 | topic.last_commented_at = topic.created_at 8 | topic.save 9 | end 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/models/assessment/scribing_answer.rb: -------------------------------------------------------------------------------- 1 | class Assessment::ScribingAnswer < ActiveRecord::Base 2 | acts_as_paranoid 3 | is_a :answer, as: :as_answer, auto_join: false, class_name: "Assessment::Answer" 4 | has_many :scribbles, dependent: :destroy 5 | 6 | attr_accessible :std_course_id, :question_id, :content, :submission_id, :attempt_left 7 | 8 | end 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/views/assessment/mcq_questions/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%- model_class = Assessment::McqQuestion -%> 2 | <%- title = 'MCQ Question' -%> 3 | 7 | <%= render :partial => 'form' %> 8 | -------------------------------------------------------------------------------- /app/views/assessment/mcq_questions/new.html.erb: -------------------------------------------------------------------------------- 1 | <%- model_class = Assessment::McqQuestion -%> 2 | <%- title = 'MCQ Question' -%> 3 | 7 | <%= render :partial => 'form' %> 8 | -------------------------------------------------------------------------------- /app/views/user_mailer/email_changed.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user_name %>: 2 | 3 |

    Your email has been updated to : <%= @new_email %>

    4 |

    Your old email address: <%= @email_was %> won't be able to sign in your account any more.

    5 |

    Please use the new one to sign in to Coursemology in the future.

    6 | Best Regards, 7 |
    8 | 9 | The Coursemology Team 10 | -------------------------------------------------------------------------------- /db/migrate/20121216071705_create_achievements.rb: -------------------------------------------------------------------------------- 1 | class CreateAchievements < ActiveRecord::Migration 2 | def change 3 | create_table :achievements do |t| 4 | t.string :icon_url 5 | t.string :title 6 | t.string :description 7 | t.integer :creator_id 8 | t.integer :course_id 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20130808144647_create_comment_subscriptions.rb: -------------------------------------------------------------------------------- 1 | class CreateCommentSubscriptions < ActiveRecord::Migration 2 | def change 3 | create_table :comment_subscriptions do |t| 4 | t.integer :topic_id 5 | t.string :topic_type 6 | t.integer :course_id 7 | t.integer :user_course_id 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/views/assessment/mcq_questions/_one.html.erb: -------------------------------------------------------------------------------- 1 |
    <%= style_format(q.description) %>
    2 |
    3 | 12 | 13 | -------------------------------------------------------------------------------- /app/views/surveys/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%- model_class = Survey -%> 3 | 7 | <%= render :partial => 'form' %> 8 | -------------------------------------------------------------------------------- /db/migrate/20121209022425_create_submissions.rb: -------------------------------------------------------------------------------- 1 | class CreateSubmissions < ActiveRecord::Migration 2 | def change 3 | create_table :submissions do |t| 4 | t.integer :student_id 5 | t.integer :assignment_id 6 | t.datetime :open_at 7 | t.datetime :submit_at 8 | t.integer :attempt 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20121222083630_create_exp_transactions.rb: -------------------------------------------------------------------------------- 1 | class CreateExpTransactions < ActiveRecord::Migration 2 | def change 3 | create_table :exp_transactions do |t| 4 | t.integer :exp 5 | t.string :reason 6 | t.boolean :is_valid 7 | t.integer :user_course_id 8 | t.integer :giver_id 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20130103031840_change_student_id_to_student_course_id_in_sbms.rb: -------------------------------------------------------------------------------- 1 | class ChangeStudentIdToStudentCourseIdInSbms < ActiveRecord::Migration 2 | def change 3 | rename_column :submissions, :student_id, :std_course_id 4 | rename_column :quiz_submissions, :student_id, :std_course_id 5 | rename_column :training_submissions, :student_id, :std_course_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20131109130903_create_forem_topics.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20110221092741) 2 | class CreateForemTopics < ActiveRecord::Migration 3 | def change 4 | create_table :forem_topics do |t| 5 | t.integer :forum_id 6 | t.integer :user_id 7 | t.string :subject 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20131114230000_create_category_subscriptions.rb: -------------------------------------------------------------------------------- 1 | class CreateCategorySubscriptions < ActiveRecord::Migration 2 | def up 3 | create_table :forem_category_subscriptions do |t| 4 | t.integer :subscriber_id 5 | t.integer :category_id 6 | end 7 | 8 | end 9 | 10 | def down 11 | drop_table :forem_category_subscriptions 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20140105222740_create_survey_essay_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateSurveyEssayAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :survey_essay_answers do |t| 4 | t.integer :user_course_id 5 | t.integer :question_id 6 | t.text :text 7 | 8 | t.time :deleted_at 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/views/assessment/coding_questions/edit.html.erb: -------------------------------------------------------------------------------- 1 | <%- model_class = Assessment::CodingQuestion -%> 2 | <%- title = 'Coding Question' -%> 3 | 7 | 8 | <%= render :partial => 'form' %> -------------------------------------------------------------------------------- /app/views/layouts/_user_thumb_profile.html.erb: -------------------------------------------------------------------------------- 1 | <% user = user_course.user %> 2 | 3 | 4 | 5 | 6 | <%= user_course.name %> 7 | 8 | 9 |
    10 | -------------------------------------------------------------------------------- /app/views/surveys/edit.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%- model_class = Survey -%> 3 | 7 | 8 | <%= render :partial => 'form' %> 9 | -------------------------------------------------------------------------------- /app/views/user_mailer/new_announcement.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %>! 2 | 3 |

    New announcement from course: <%= @course.title %>

    4 |
    5 | <%= @ann.description.html_safe %> 6 |
    7 | 8 |

    Click here to view.

    9 | 10 | Best Regards, 11 |
    12 | 13 | The Coursemology Team 14 | -------------------------------------------------------------------------------- /db/migrate/20121213175707_create_quiz_submissions.rb: -------------------------------------------------------------------------------- 1 | class CreateQuizSubmissions < ActiveRecord::Migration 2 | def change 3 | create_table :quiz_submissions do |t| 4 | t.integer :student_id 5 | t.integer :quiz_id 6 | t.datetime :open_at 7 | t.datetime :submit_at 8 | t.integer :attempt 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20130731172921_create_pending_comments.rb: -------------------------------------------------------------------------------- 1 | class CreatePendingComments < ActiveRecord::Migration 2 | def change 3 | create_table :pending_comments do |t| 4 | t.integer :answer_id 5 | t.string :answer_type 6 | t.boolean :pending 7 | 8 | t.timestamps 9 | end 10 | 11 | add_index :pending_comments, :answer_id 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20130911102159_create_survey_mrq_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateSurveyMrqAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :survey_mrq_answers do |t| 4 | t.text :selected_options 5 | t.integer :user_course_id 6 | t.integer :question_id 7 | 8 | t.time :deleted_at 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20131109130902_create_forem_forums.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20110214221555) 2 | class CreateForemForums < ActiveRecord::Migration 3 | def up 4 | create_table :forem_forums do |t| 5 | t.string :title 6 | t.text :description 7 | end 8 | 9 | end 10 | 11 | def down 12 | drop_table :forem_forums 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/layouts/_facebook_like.html.erb: -------------------------------------------------------------------------------- 1 | <% unless defined?(style)%> 2 | <% style = "standard" %> 3 | <% end %> 4 |
    12 |
    -------------------------------------------------------------------------------- /db/migrate/20130103163744_change_user_id_to_user_course_id_in_update_and_notification.rb: -------------------------------------------------------------------------------- 1 | class ChangeUserIdToUserCourseIdInUpdateAndNotification < ActiveRecord::Migration 2 | def change 3 | rename_column :activities, :actor_id, :actor_course_id 4 | rename_column :activities, :target_id, :target_course_id 5 | rename_column :notifications, :actor_id, :actor_course_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/models/assignment_display_mode.rb: -------------------------------------------------------------------------------- 1 | class AssignmentDisplayMode < ActiveRecord::Base 2 | attr_accessible :title, :description 3 | 4 | scope :single, where(title: 'Single Page') 5 | scope :tab, where(title: 'Tab') 6 | 7 | def self.single_page 8 | AssignmentDisplayMode.single.first 9 | end 10 | 11 | def self.tab_mode 12 | AssignmentDisplayMode.tab.first 13 | end 14 | end -------------------------------------------------------------------------------- /db/migrate/20130702092559_create_coding_questions.rb: -------------------------------------------------------------------------------- 1 | class CreateCodingQuestions < ActiveRecord::Migration 2 | def change 3 | create_table :coding_questions do |t| 4 | t.integer :creator_id 5 | t.string :step_name 6 | t.string :description 7 | t.text :data 8 | t.integer :max_grade 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20130808101129_create_std_mcq_all_answers.rb: -------------------------------------------------------------------------------- 1 | class CreateStdMcqAllAnswers < ActiveRecord::Migration 2 | def change 3 | create_table :std_mcq_all_answers do |t| 4 | t.text :selected_choices 5 | t.integer :student_id 6 | t.integer :mcq_id 7 | t.integer :std_course_id 8 | t.text :choices 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20131109130919_create_forem_memberships.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20120222204450) 2 | class CreateForemMemberships < ActiveRecord::Migration 3 | def change 4 | create_table :forem_memberships do |t| 5 | t.integer :group_id 6 | t.integer :member_id 7 | end 8 | 9 | add_index :forem_memberships, :group_id 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/views/role_requests/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | <% if current_user.is_lecturer? %> 7 | You are already given lecturer right! 8 | <% else %> 9 | <%= render :partial => 'form' %> 10 | <% end %> 11 | 12 | -------------------------------------------------------------------------------- /db/migrate/20121211031948_create_answer_gradings.rb: -------------------------------------------------------------------------------- 1 | class CreateAnswerGradings < ActiveRecord::Migration 2 | def change 3 | create_table :answer_gradings do |t| 4 | t.integer :grader_id 5 | t.integer :grade 6 | t.string :comment 7 | t.integer :student_answer_id 8 | t.integer :submission_grading_id 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20130822102151_add_comment_topic_to_other_tables.rb: -------------------------------------------------------------------------------- 1 | class AddCommentTopicToOtherTables < ActiveRecord::Migration 2 | def change 3 | add_column :comments, :comment_topic_id, :integer 4 | add_index :comments, :comment_topic_id 5 | 6 | add_column :comment_subscriptions, :comment_topic_id, :integer 7 | add_index :comment_subscriptions, :comment_topic_id 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/views/user_mailer/mission_reminder_summary.html.erb: -------------------------------------------------------------------------------- 1 | Hi, 2 | 3 |

    Emails were sent to the following students to remind them that <%= @assessment.title %> is due on <%= @assessment.close_at %>

    4 | 5 | 10 | 11 | Best Regards, 12 |
    13 | 14 | The Coursemology Team -------------------------------------------------------------------------------- /app/views/user_mailer/new_comment.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %> 2 | 3 |

    <%= @comment.user_course.name %> has made a new comment to a thread you are subscribed to:

    4 |
    5 | <%= @comment.text.html_safe %> 6 |
    7 | 8 |

    Click here to view the full thread.

    9 | 10 | Best Regards, 11 |
    12 | 13 | The Coursemology Team 14 | -------------------------------------------------------------------------------- /db/migrate/20121211032525_create_submission_gradings.rb: -------------------------------------------------------------------------------- 1 | class CreateSubmissionGradings < ActiveRecord::Migration 2 | def change 3 | create_table :submission_gradings do |t| 4 | t.integer :grader_id 5 | t.integer :total_grade 6 | t.string :comment 7 | t.integer :submission_id 8 | t.datetime :publish_at 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20121213105710_create_training_submissions.rb: -------------------------------------------------------------------------------- 1 | class CreateTrainingSubmissions < ActiveRecord::Migration 2 | def change 3 | create_table :training_submissions do |t| 4 | t.integer :student_id 5 | t.integer :training_id 6 | t.integer :current_step 7 | t.datetime :open_at 8 | t.datetime :submit_at 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20131109112240_add_materials_permissions.rb: -------------------------------------------------------------------------------- 1 | class AddMaterialsPermissions < ActiveRecord::Migration 2 | def change 3 | add_column :material_folders, :open_at, :datetime, :after => :description 4 | add_column :material_folders, :close_at, :datetime, :after => :open_at 5 | add_column :material_folders, :can_student_upload, :boolean, :after => :close_at, :default => false 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20140909023230_survey_has_section_to_contest.rb: -------------------------------------------------------------------------------- 1 | class SurveyHasSectionToContest < ActiveRecord::Migration 2 | def up 3 | rename_column :surveys, :has_section, :is_contest 4 | 5 | Survey.all.each do |s| 6 | s.is_contest= !s.is_contest 7 | s.save 8 | end 9 | end 10 | 11 | def down 12 | rename_column :surveys, :is_contest, :has_section 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/extensions/renderer.rb: -------------------------------------------------------------------------------- 1 | # For issue rails#12579 2 | ActionView::PartialRenderer.class_eval do 3 | private 4 | 5 | def setup_with_formats(context, options, block) 6 | formats = Array(options[:formats]) 7 | @lookup_context.formats = formats | @lookup_context.formats 8 | setup_without_formats(context, options, block) 9 | end 10 | 11 | alias_method_chain :setup, :formats 12 | end 13 | -------------------------------------------------------------------------------- /app/models/system_wide_announcement.rb: -------------------------------------------------------------------------------- 1 | class SystemWideAnnouncement < ActiveRecord::Base 2 | # System wide announcements are announcements sent through email to all the 3 | # users in the entire system. 4 | # 5 | # TODO: Send to users in a specific course 6 | # TODO: Send to users in a specific user group 7 | 8 | attr_accessible :subject, :body 9 | validates :body, presence: true 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20121230194838_create_notifications.rb: -------------------------------------------------------------------------------- 1 | class CreateNotifications < ActiveRecord::Migration 2 | def change 3 | create_table :notifications do |t| 4 | t.integer :target_course_id 5 | t.integer :actor_id 6 | t.integer :action_id 7 | t.integer :obj_id 8 | t.string :obj_type 9 | t.string :extra 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20131109130920_create_forem_moderator_groups.forem.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from forem (originally 20120223162058) 2 | class CreateForemModeratorGroups < ActiveRecord::Migration 3 | def change 4 | create_table :forem_moderator_groups do |t| 5 | t.integer :forum_id 6 | t.integer :group_id 7 | end 8 | 9 | add_index :forem_moderator_groups, :forum_id 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20131115100001_add_notified_to_topics.rb: -------------------------------------------------------------------------------- 1 | class AddNotifiedToTopics < ActiveRecord::Migration 2 | def self.up 3 | add_column :forem_topics, :notified, :integer, :default => 0 4 | 5 | # Uncomment this line to force caching of existing votes 6 | # Post.find_each(&:update_cached_votes) 7 | end 8 | 9 | def self.down 10 | remove_column :forem_topics, :notified 11 | end 12 | end -------------------------------------------------------------------------------- /app/views/notifications/_popup_level.html.erb: -------------------------------------------------------------------------------- 1 | 13 | 14 | -------------------------------------------------------------------------------- /db/migrate/20130711080325_create_tutorial_groups.rb: -------------------------------------------------------------------------------- 1 | class CreateTutorialGroups < ActiveRecord::Migration 2 | def change 3 | create_table :tutorial_groups do |t| 4 | t.integer :course_id 5 | t.integer :std_course_id 6 | t.integer :tut_course_id 7 | 8 | t.timestamps 9 | end 10 | add_index :tutorial_groups, [:std_course_id, :tut_course_id],unique: true 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20130724170444_create_annotations.rb: -------------------------------------------------------------------------------- 1 | class CreateAnnotations < ActiveRecord::Migration 2 | def change 3 | create_table :annotations do |t| 4 | t.integer :annotable_id 5 | t.string :annotable_type 6 | t.integer :line_start 7 | t.integer :line_end 8 | t.integer :user_course_id 9 | t.text :text 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/models/assessment/coding_answer.rb: -------------------------------------------------------------------------------- 1 | class Assessment::CodingAnswer < ActiveRecord::Base 2 | acts_as_paranoid 3 | is_a :answer, as: :as_answer, auto_join: false, class_name: "Assessment::Answer" 4 | 5 | attr_accessible :std_course_id, :question_id, :content, :submission_id, :attempt_left, :result 6 | 7 | def result_hash 8 | self.result ? JSON.parse(self.result) : {} 9 | end 10 | end 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/models/modules/as_requirement.rb: -------------------------------------------------------------------------------- 1 | module AsRequirement 2 | 3 | def self.included(base) 4 | base.class_eval do 5 | has_many :as_requirements, as: :req, dependent: :destroy, class_name: "Requirement" 6 | end 7 | end 8 | 9 | # it is an interface but ruby does not seems to have the 10 | # concept of interface 11 | def get_req_short_desc 12 | raise NotImplementedError 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20121212154351_create_trainings.rb: -------------------------------------------------------------------------------- 1 | class CreateTrainings < ActiveRecord::Migration 2 | def change 3 | create_table :trainings do |t| 4 | t.integer :course_id 5 | t.integer :creator_id 6 | t.string :title 7 | t.string :description 8 | t.integer :exp 9 | t.datetime :open_at 10 | t.integer :order 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/views/tag_groups/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= simple_form_for [@course, @tag_group], 2 | :html => { :class => 'form-horizontal' }, 3 | defaults: { input_html: { class: 'span7' } } do |f| %> 4 | <%= f.input :name %> 5 | <%= f.input :description, as: :text, input_html:{class: "span7 text-area", rows:10} %> 6 | <%= f.button :form_submit, cancel: course_tags_path(@course) %> 7 | <% end %> 8 | -------------------------------------------------------------------------------- /config/initializers/fix_dev_cache.rb: -------------------------------------------------------------------------------- 1 | if Rails.env == "development" 2 | Dir.foreach("#{Rails.root}/app/models") do |model_name| 3 | require_dependency model_name unless model_name.start_with?(".") || !File.exist?(model_name) 4 | end 5 | 6 | Dir.foreach("#{Rails.root}/app/models/modules") do |module_name| 7 | require_dependency module_name unless module_name.start_with?(".") || !File.exist?(module_name) 8 | end 9 | end -------------------------------------------------------------------------------- /db/migrate/20121230193603_create_activities.rb: -------------------------------------------------------------------------------- 1 | class CreateActivities < ActiveRecord::Migration 2 | def change 3 | create_table :activities do |t| 4 | t.integer :course_id 5 | t.integer :actor_id 6 | t.integer :target_id 7 | t.integer :action_id 8 | t.integer :obj_id 9 | t.string :obj_type 10 | t.string :extra 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20130803065441_create_preferable_items.rb: -------------------------------------------------------------------------------- 1 | class CreatePreferableItems < ActiveRecord::Migration 2 | def change 3 | create_table :preferable_items do |t| 4 | t.string :item 5 | t.string :item_type 6 | t.string :name 7 | t.string :default_value 8 | t.boolean :default_display 9 | t.string :description 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/assessment/missions/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%- model_name = "Missions" -%> 3 | 7 | <%= render :partial => 'form' %> 8 | -------------------------------------------------------------------------------- /db/migrate/20130809154027_create_mass_enrollment_emails.rb: -------------------------------------------------------------------------------- 1 | class CreateMassEnrollmentEmails < ActiveRecord::Migration 2 | def change 3 | create_table :mass_enrollment_emails do |t| 4 | t.integer :course_id 5 | t.string :name 6 | t.string :email 7 | t.boolean :signed_up, default: false 8 | t.integer :delayed_job_id 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20131212055119_create_comics.rb: -------------------------------------------------------------------------------- 1 | class CreateComics < ActiveRecord::Migration 2 | def change 3 | create_table :comics do |t| 4 | t.string :name 5 | t.integer :chapter 6 | t.integer :episode 7 | t.boolean :visible 8 | t.belongs_to :course 9 | t.belongs_to :dependent_mission 10 | t.belongs_to :next_mission 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20140729115342_add_missing_taggable_index.acts_as_taggable_on_engine.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from acts_as_taggable_on_engine (originally 4) 2 | class AddMissingTaggableIndex < ActiveRecord::Migration 3 | def self.up 4 | add_index :taggings, [:taggable_id, :taggable_type, :context] 5 | end 6 | 7 | def self.down 8 | remove_index :taggings, [:taggable_id, :taggable_type, :context] 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/helpers/assessment_helper.rb: -------------------------------------------------------------------------------- 1 | module AssessmentHelper 2 | # Given a string of text and a list of keywords, highlights each 3 | # keyword occurrence with a tag. 4 | def highlight_keywords(original, keywords) 5 | highlighted = original.dup 6 | keywords.each do |keyword| 7 | highlighted.gsub!(keyword_regex(keyword), content_tag(:mark, '\0').html_safe) 8 | end 9 | highlighted 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/models/duplicate_log.rb: -------------------------------------------------------------------------------- 1 | class DuplicateLog < ActiveRecord::Base 2 | attr_accessible :dest_course_id, :dest_obj_id, :dest_obj_type, :origin_course_id, :origin_obj_id, :origin_obj_type, :user_id 3 | 4 | belongs_to :user 5 | belongs_to :origin_course, class_name: "Course" 6 | belongs_to :origin_obj, polymorphic: true 7 | belongs_to :dest_course, class_name: "Course" 8 | belongs_to :dest_obj, polymorphic: true 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20130910182934_create_survey_sections.rb: -------------------------------------------------------------------------------- 1 | class CreateSurveySections < ActiveRecord::Migration 2 | def change 3 | create_table :survey_sections do |t| 4 | t.integer :survey_id 5 | t.string :title 6 | t.text :description 7 | t.integer :pos 8 | t.boolean :publish, default: true 9 | 10 | t.time :deleted_at 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20140109030619_add_pending_email_to_mass_enrollment_email.rb: -------------------------------------------------------------------------------- 1 | class AddPendingEmailToMassEnrollmentEmail < ActiveRecord::Migration 2 | def change 3 | add_column :mass_enrollment_emails, :pending_email, :boolean, default: true 4 | 5 | #existing ones should be marked as false 6 | MassEnrollmentEmail.all.each do |enrol| 7 | enrol.pending_email = false 8 | enrol.save 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/jobs/enumerable.rb: -------------------------------------------------------------------------------- 1 | module Enumerable 2 | 3 | def sum_e 4 | self.reduce(0){|accum, i| accum + i } 5 | end 6 | 7 | def mean 8 | self.sum_e/self.length.to_f 9 | end 10 | 11 | def sample_variance 12 | m = self.mean 13 | sum = self.reduce(0){|accum, i| accum + (i-m)**2 } 14 | sum/self.length.to_f 15 | end 16 | 17 | def standard_deviation 18 | Math.sqrt(self.sample_variance) 19 | end 20 | 21 | end -------------------------------------------------------------------------------- /app/views/assessment/scribing_questions/_canvas.html.erb: -------------------------------------------------------------------------------- 1 | 9 | <% if @question.document %> 10 | 14 | <% end %> 15 | -------------------------------------------------------------------------------- /app/views/assessment/trainings/new.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <%- model_class = Assessment::Training -%> 3 | 7 | <%= render :partial => 'form' %> 8 | -------------------------------------------------------------------------------- /app/views/enroll_requests/new.html.erb: -------------------------------------------------------------------------------- 1 | <% if not current_user %> 2 | Please <%= link_to 'log in', new_user_session_path %> first. 3 | <% elsif curr_user_course.id %> 4 |

    You have already registed to this class as a <%= @curr_user_course.role.title %>

    5 | <% elsif @er.id %> 6 |

    Request to enroll as: <%= @er.role.title %>

    7 |

    Your request has been received. Please come back later to check for the result!

    8 | <% end %> 9 | -------------------------------------------------------------------------------- /config/initializers/delayed_job_config.rb: -------------------------------------------------------------------------------- 1 | # config/initializers/delayed_job_config.rb 2 | 3 | Delayed::Worker.destroy_failed_jobs = false 4 | Delayed::Worker.sleep_delay = 60 5 | Delayed::Worker.max_attempts = 3 6 | Delayed::Worker.max_run_time = 5.minutes 7 | Delayed::Worker.read_ahead = 10 8 | Delayed::Worker.default_queue_name = 'default' 9 | Delayed::Worker.plugins << MailMonitorPlugin 10 | Delayed::Worker.delay_jobs = !Rails.env.test? -------------------------------------------------------------------------------- /app/assets/stylesheets/guilds.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Guilds controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | .guild-table td { 6 | text-align: center; 7 | font-size: 120%; 8 | } 9 | 10 | .guild-table th { 11 | text-align: center; 12 | font-size: 120%; 13 | } 14 | 15 | .my-guild { 16 | font-weight: bold; 17 | } -------------------------------------------------------------------------------- /app/models/pending_action.rb: -------------------------------------------------------------------------------- 1 | class PendingAction < ActiveRecord::Base 2 | # attr_accessible :title, :body 3 | 4 | attr_accessible :item_type, :item_id, :is_ignored, :is_done 5 | 6 | scope :to_show, where(is_done: false, is_ignored: false) 7 | 8 | belongs_to :item, polymorphic: true 9 | belongs_to :course 10 | belongs_to :user_course 11 | 12 | def set_done 13 | self.is_done = true 14 | self.save 15 | end 16 | 17 | end 18 | -------------------------------------------------------------------------------- /app/views/courses/_manage_user_tab.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/user_mailer/enrollment_invitation.html.erb: -------------------------------------------------------------------------------- 1 | Dear <%= @user_name %>: 2 | 3 |

    You are invited by <%= @lecturer %> to register for course: <%= @course_title %> on Coursemology.

    4 |

    Click here to accept the invitation.

    5 | 6 |

    Please note that you should sign in with the email address <%= @email %>.

    7 | 8 | Best Regards, 9 |
    10 | 11 | The Coursemology Team 12 | 13 | 14 | -------------------------------------------------------------------------------- /db/migrate/20131019100355_create_materials.rb: -------------------------------------------------------------------------------- 1 | class CreateMaterials < ActiveRecord::Migration 2 | def change 3 | create_table :material_folders do |t| 4 | t.integer :parent_folder_id, default: nil 5 | t.integer :course_id 6 | t.string :name 7 | t.text :description 8 | end 9 | create_table :materials do |t| 10 | t.integer :folder_id 11 | t.text :description 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/templates/erb/scaffold/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%%= simple_form_for(@<%= singular_table_name %>) do |f| %> 2 | <%%= f.error_notification %> 3 | 4 |
    5 | <%- attributes.each do |attribute| -%> 6 | <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %> 7 | <%- end -%> 8 |
    9 | 10 |
    11 | <%%= f.button :submit %> 12 |
    13 | <%% end %> 14 | -------------------------------------------------------------------------------- /app/views/notifications/_popup.html.erb: -------------------------------------------------------------------------------- 1 | 13 | 14 | -------------------------------------------------------------------------------- /app/views/users/unlocks/new.html.erb: -------------------------------------------------------------------------------- 1 |

    Resend unlock instructions

    2 | 3 | <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
    <%= f.label :email %>
    7 | <%= f.email_field :email %>
    8 | 9 |
    <%= f.submit "Resend unlock instructions" %>
    10 | <% end %> 11 | 12 | <%= render "devise/shared/links" %> 13 | -------------------------------------------------------------------------------- /db/migrate/20140526060026_create_navbar_preferable_items.rb: -------------------------------------------------------------------------------- 1 | class CreateNavbarPreferableItems < ActiveRecord::Migration 2 | create_table :navbar_preferable_items do |t| 3 | t.string :item 4 | t.references :navbar_link_type 5 | t.string :name 6 | t.boolean :is_displayed 7 | t.boolean :is_enabled 8 | t.string :description 9 | t.string :link_to 10 | t.integer :pos 11 | 12 | t.timestamps 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/user_mailer/new_annotation.html.erb: -------------------------------------------------------------------------------- 1 | Hello, <%= @user.name %> 2 | 3 |

    New annotation by <%= @comment.user_course.name %> on <%= @assessment.title %>:

    4 | 5 |
    6 | <%= @comment.text.html_safe %> 7 |
    8 | 9 |

    Click here to view the full thread.

    10 | 11 | Best Regards, 12 |
    13 | 14 | The Coursemology Team 15 | -------------------------------------------------------------------------------- /db/migrate/20130804092515_create_queued_jobs.rb: -------------------------------------------------------------------------------- 1 | class CreateQueuedJobs < ActiveRecord::Migration 2 | def change 3 | create_table :queued_jobs do |t| 4 | t.integer :owner_id 5 | t.string :owner_type 6 | t.integer :delayed_job_id 7 | t.timestamps 8 | end 9 | 10 | add_index :queued_jobs, :owner_id 11 | add_index :queued_jobs, :owner_type 12 | add_index :queued_jobs, :delayed_job_id 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/assets/stylesheets/comments.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the comments controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | .comment-table { 6 | width: 100%; 7 | } 8 | 9 | .comment-table td { 10 | vertical-align: top; 11 | } 12 | 13 | .comment-table p { 14 | margin: 0px; 15 | } 16 | 17 | .comment-profile-pic-col { 18 | width: 38px; 19 | } 20 | -------------------------------------------------------------------------------- /app/models/assessment/auto_grading_keyword_option.rb: -------------------------------------------------------------------------------- 1 | class Assessment::AutoGradingKeywordOption < ActiveRecord::Base 2 | validates :keyword, format: { 3 | with: /[\w\d]+/i, 4 | message: "%{value} should be a single alphanumeric word." 5 | } 6 | validates :score, numericality: { greater_than_or_equal_to: 1 } 7 | 8 | attr_accessible :general_question_id 9 | attr_accessible :keyword, :score 10 | 11 | belongs_to :general_question 12 | end 13 | -------------------------------------------------------------------------------- /app/views/users/passwords/new.html.erb: -------------------------------------------------------------------------------- 1 |

    Forgot your password?

    2 | 3 | <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
    <%= f.label :email %>
    7 | <%= f.email_field :email %>
    8 | 9 |
    <%= f.submit "Send me reset password instructions" %>
    10 | <% end %> 11 | 12 | <%= render "devise/shared/links" %> 13 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /app/assets/javascripts/stats.js: -------------------------------------------------------------------------------- 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 | 4 | $(document).ready(function() { 5 | $('.btn-select-nav').click(function(evt) { 6 | evt.preventDefault(); 7 | var target = $(this).attr('data-target'); 8 | var selected_url = $(target).find(":selected").val(); 9 | location = selected_url; 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /app/models/modules/has_requirement.rb: -------------------------------------------------------------------------------- 1 | module HasRequirement 2 | 3 | def self.included(base) 4 | base.class_eval do 5 | has_many :requirements, as: :obj, dependent: :destroy 6 | amoeba do 7 | include_field :requirements 8 | end 9 | end 10 | end 11 | 12 | # it is an interface but ruby does not seems to have the 13 | # concept of interface 14 | def get_req_short_desc 15 | raise NotImplementedError 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/models/survey_section.rb: -------------------------------------------------------------------------------- 1 | class SurveySection < ActiveRecord::Base 2 | acts_as_paranoid 3 | acts_as_duplicable 4 | acts_as_sortable column: :pos 5 | default_scope { order(:pos) } 6 | 7 | attr_accessible :survey_id, :title, :description, :pos 8 | 9 | belongs_to :survey 10 | has_many :survey_questions 11 | 12 | amoeba do 13 | include_field :survey_questions 14 | end 15 | 16 | def questions 17 | survey_questions 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/views/enroll_requests/_enroll_tab.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/materials/edit_folder.html.erb: -------------------------------------------------------------------------------- 1 | <%- model_class = MaterialFolder -%> 2 | 6 |
    7 | 8 | <%= render partial: "subfolder_form", locals: { :modal => false, :folder_to_change => @folder, :subfolder_method => :put, :parent => nil } %> 9 | -------------------------------------------------------------------------------- /db/migrate/20130321041710_create_duplicate_logs.rb: -------------------------------------------------------------------------------- 1 | class CreateDuplicateLogs < ActiveRecord::Migration 2 | def change 3 | create_table :duplicate_logs do |t| 4 | t.integer :user_id 5 | t.integer :origin_course_id 6 | t.integer :dest_course_id 7 | t.integer :origin_obj_id 8 | t.string :origin_obj_type 9 | t.integer :dest_obj_id 10 | t.string :dest_obj_type 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20131117034500_add_is_digest_to_category_subscription.rb: -------------------------------------------------------------------------------- 1 | class AddIsDigestToCategorySubscription < ActiveRecord::Migration 2 | def self.up 3 | add_column :forem_category_subscriptions, :is_digest, :integer, :default => 0 4 | 5 | # Uncomment this line to force caching of existing votes 6 | # Post.find_each(&:update_cached_votes) 7 | end 8 | 9 | def self.down 10 | remove_column :forem_category_subscriptions, :is_digest 11 | end 12 | end -------------------------------------------------------------------------------- /app/assets/javascripts/level.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('.lvl-add-more').click(function(evt) { 3 | evt.preventDefault(); 4 | 5 | var num_lvl = $(this).parents('tbody').children().length; 6 | format = ['', 7 | ' ' + num_lvl + '', 8 | ' ', 9 | ''].join(''); 10 | $(this).parents('tr').before(format); 11 | 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /lib/tasks/add_survey_section.rake: -------------------------------------------------------------------------------- 1 | namespace :db do 2 | task add_survey_section: :environment do 3 | Survey.where(is_contest: true).each do |s| 4 | qns = SurveyQuestion.where(survey_id: s.id) 5 | if s.sections.count == 0 6 | section = s.sections.create 7 | else 8 | section = s.sections.first 9 | end 10 | qns.each do |qn| 11 | qn.survey_section = section 12 | qn.save 13 | end 14 | end 15 | end 16 | end -------------------------------------------------------------------------------- /app/models/course_navbar_preference.rb: -------------------------------------------------------------------------------- 1 | class CourseNavbarPreference < ActiveRecord::Base 2 | attr_accessible :item, :name, :is_displayed, :is_enabled, :pos, :link_to 3 | belongs_to :navbar_link_type 4 | belongs_to :course 5 | belongs_to :navbar_preferable_item 6 | 7 | after_save :sweep_navbar_cache 8 | 9 | 10 | def sweep_navbar_cache 11 | Role.all.each do |role| 12 | Rails.cache.delete("nav_items_#{course_id}_#{role.id}") 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Coursemology::Application.config.session_store :cookie_store, key: '_coursemology_session' 4 | 5 | # Use the database for sessions instead of the cookie-based default, 6 | # which shouldn't be used to store highly confidential information 7 | # (create the session table with "rails generate session_migration") 8 | # Coursemology::Application.config.session_store :active_record_store 9 | -------------------------------------------------------------------------------- /app/assets/stylesheets/courses.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the courses controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | 5 | .course-logo { 6 | height: 150px; 7 | width: auto; 8 | } 9 | 10 | .course-thumbnails .media-heading { 11 | height: 60px; 12 | overflow-y: scroll; 13 | } 14 | 15 | .course-thumbnails { 16 | margin-left: auto; 17 | margin-right: auto; 18 | } 19 | -------------------------------------------------------------------------------- /app/views/asm_tags/_form_row.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <% if local_assigns.has_key?(:asm_tag) %> 3 | <% tag = asm_tag.tag %> 4 | 5 | <% else %> 6 | 7 | <% end %> 8 | 9 | <%= tag.name %> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/views/requirements/_lvl_req_row.erb: -------------------------------------------------------------------------------- 1 | 2 | <% if lvl_req.id %> 3 | 4 | <% else %> 5 | 6 | <% end %> 7 |

    Reached 8 | <%= lvl_req.req.get_title %>

    9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /db/migrate/20130803065431_create_course_preferences.rb: -------------------------------------------------------------------------------- 1 | class CreateCoursePreferences < ActiveRecord::Migration 2 | def change 3 | create_table :course_preferences do |t| 4 | t.integer :course_id 5 | t.integer :preferable_item_id 6 | t.string :prefer_value 7 | t.boolean :display 8 | 9 | t.timestamps 10 | end 11 | 12 | add_index :course_preferences, :course_id 13 | add_index :course_preferences, :preferable_item_id 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /remove_duplicate.sql: -------------------------------------------------------------------------------- 1 | delete from seen_by_users where id not in 2 | (select * from 3 | (select distinct(del.id) from ( 4 | select id, obj_id, obj_type, user_course_id, MAX(created_at) as created_at 5 | from seen_by_users 6 | group by obj_id, obj_type, user_course_id) 7 | as del INNER JOIN seen_by_users AS hs ON 8 | hs.obj_type=del.obj_type 9 | AND hs.obj_id = del.obj_id 10 | AND hs.user_course_id=del.user_course_id 11 | AND hs.created_at = del.created_at) as we) -------------------------------------------------------------------------------- /spec/support/controller_helpers.rb: -------------------------------------------------------------------------------- 1 | module ControllerHelpers 2 | def sign_in(user = double('user')) 3 | if user.nil? 4 | allow(request.env['warden']).to receive(:authenticate!).and_throw(:warden, {:scope => :user}) 5 | allow(controller).to receive(:current_user).and_return(nil) 6 | else 7 | allow(request.env['warden']).to receive(:authenticate!).and_return(user) 8 | allow(controller).to receive(:current_user).and_return(user) 9 | end 10 | end 11 | end -------------------------------------------------------------------------------- /app/views/users/confirmations/new.html.erb: -------------------------------------------------------------------------------- 1 |

    Resend confirmation instructions

    2 | 3 | <%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
    <%= f.label "Email" %>
    7 | <%= f.email_field :email %>
    8 | 9 |
    <%= f.submit "Resend confirmation instructions", class:"btn" %>
    10 | <% end %> 11 | 12 | <%= render "devise/shared/links" %> 13 | -------------------------------------------------------------------------------- /db/migrate/20170426054216_add_constraint_to_question_assessments.rb: -------------------------------------------------------------------------------- 1 | class AddConstraintToQuestionAssessments < ActiveRecord::Migration 2 | def change 3 | ids = Assessment.pluck(:id) 4 | QuestionAssessment.where("assessment_id NOT IN (#{ids.join(",")})").update_all(deleted_at: Time.new(2016, 1)) 5 | 6 | change_column :question_assessments, :assessment_id, :integer, null: false 7 | change_column :question_assessments, :question_id, :integer, null: false 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/support/feature_helpers.rb: -------------------------------------------------------------------------------- 1 | include ApplicationHelper 2 | 3 | def sign_in(user) 4 | visit new_user_session_path 5 | fill_in "Email", with: user.email 6 | fill_in "Password", with: user.password 7 | click_button "Sign in" 8 | end 9 | 10 | def create_course(course) 11 | visit my_courses_path 12 | click_link "New Course" 13 | fill_in 'course_title', with: course.title 14 | fill_in 'course_description', with: course.description 15 | click_button "Create" 16 | end 17 | -------------------------------------------------------------------------------- /app/models/assessment/scribing_question.rb: -------------------------------------------------------------------------------- 1 | class Assessment::ScribingQuestion < ActiveRecord::Base 2 | acts_as_paranoid 3 | is_a :question, as: :as_question, class_name: "Assessment::Question" 4 | has_one :document, as: :owner, class_name: "FileUpload", dependent: :destroy 5 | 6 | attr_accessible :creator_id, :dependent_id 7 | attr_accessible :title, :description, :max_grade, :attempt_limit, :staff_comments 8 | attr_accessible :auto_graded 9 | attr_accessible :document 10 | end 11 | -------------------------------------------------------------------------------- /app/views/forums/posts/edit.html.erb: -------------------------------------------------------------------------------- 1 |
    2 | <%= render partial: 'forums/topics/header', locals: { topic: @topic } %> 3 | 4 |

    Edit Post

    5 | <%= form_for @post, url: course_forum_topic_post_path(@course, @forum, @topic, @post, method: 'PUT'), 6 | html: { class: 'form-horizontal' } do |f| %> 7 | <%= render partial: 'form', locals: { reply_to: nil, form: f } %> 8 | <%= f.submit 'Save', class: 'btn btn-primary' %> 9 | <% end %> 10 |
    11 | -------------------------------------------------------------------------------- /app/views/materials/_subfolder_title.html.erb: -------------------------------------------------------------------------------- 1 |

    2 | <%= subfolder.name %> 3 | <% if not subfolder.is_open? %> 4 | Closed 5 | <% end %> 6 | 7 | <% if @is_subfolder_new[subfolder.id] %> 8 | 9 | New 10 | <% end %> 11 |

    --------------------------------------------------------------------------------