source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/criterion_spec.rb
Ruby
mit
191
main
15,975
describe 'criterion' do let(:questionnaire) { Questionnaire.new min_question_score: 0, max_question_score: 5 } let(:criterion) { Criterion.new id: 1, type: 'Criterion', seq: 1.0, txt: 'test txt', weight: 1, questionnaire: questionnaire } let(:answer_no_comments) { Answer.new answer: 8 } let(:answer_comments) { ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/score_analytic_spec.rb
Ruby
mit
191
main
801
class ScoreAnalyticTestDummyClass attr_accessor :comments require 'analytic/score_analytic' include ScoreAnalytic def initialize(comments) @comments = comments end end describe ScoreAnalytic do describe '#unique_character_count' do it 'returns the unique number of characters' do satdc = Score...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/mailer_spec.rb
Ruby
mit
191
main
591
describe 'Tests mailer' do it 'should send email to required email address with proper content ' do # Send the email, then test that it got queued email = Mailer.sync_message( to: 'tluo@ncsu.edu', subject: 'Test', body: { obj_name: 'assignment', type: 'submission', lo...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/view_translation_substitutor_spec.rb
Ruby
mit
191
main
393
describe 'ViewTranslationSubstitutor' do let(:vts) { ViewTranslationSubstitutor.new } # The substitute method is currently broken in the actual model, this spec will fail # describe "#substitute" do # it "returns" do # locale = YAML.load_file('config/locales/en_US.yml')['en_US'] # ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/course_spec.rb
Ruby
mit
191
main
6,551
describe CourseTeam do let(:course) { build(:course, id: 1, name: 'ECE517') } let(:course_team1) { build(:course_team, id: 1) } let(:course_team2) { build(:course_team, id: 2) } let(:instructor) { build(:instructor, id: 6) } let(:user1) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com', p...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/participant_spec.rb
Ruby
mit
191
main
7,579
describe Participant do let(:team) { build(:assignment_team, id: 1, name: 'myTeam') } let(:user) { build(:student, id: 4, name: 'no name', fullname: 'no two') } let(:team_user) { build(:team_user, id: 1, user: user, team: team) } let(:topic) { build(:topic) } let(:participant) { build(:participant, user: buil...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/survey_deployment_spec.rb
Ruby
mit
191
main
1,939
require 'rspec' describe 'SurveyDeployment' do let(:assgt_survey_questionnaire) { AssignmentSurveyQuestionnaire.new id: 986, name: 'assgt_survey', private: 0, min_question_score: 0, max_question_score: 10, instructor_id: 1234 } let(:course_survey_questionnaire) { CourseSurveyQuestionnaire.new id: 985, name: 'cours...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/course_participant_spec.rb
Ruby
mit
191
main
3,175
describe 'CourseParticipant' do describe '#copy' do before(:each) do @assignment = build(:assignment) @course_participant = build(:course_participant) @assignment_participant = build(:participant) end it 'create a copy of participant' do allow(AssignmentParticipant).to receive(:cr...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/column_header_spec.rb
Ruby
mit
191
main
485
describe ColumnHeader do describe '#complete' do it 'returns the header' do ch = ColumnHeader.new ch.txt = 'Question 1' expect(ch.complete(1, nil)).to eq('<tr><th style="width: 15%">Question 1</th>') end end describe '#view_completed_question' do it 'returns the header' do ch =...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/system_settings_spec.rb
Ruby
mit
191
main
3,432
describe SystemSettings do before :all do @system_settings = SystemSettings.new @system_settings1 = SystemSettings.new @student_role = build(:role_of_student, id: 1, name: 'Student_role_test', description: '', parent_id: nil, default_page_id: nil) @system_settings.public_role = @student_role @mark...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/has_paper_trail_spec.rb
Ruby
mit
191
main
389
describe 'has_paper_trail' do it 'will create Version record when create delayed jobs record' do PaperTrail.enabled = true Version.all.each(&:delete) expect(Version.all.count).to eq(0) @delayed_job = DelayedJob.new @delayed_job.id = 1 @delayed_job.priority = 1 @delayed_job.attempts = 0 ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/ta_spec.rb
Ruby
mit
191
main
5,154
describe Ta do let!(:ta) { create(:teaching_assistant, id: 999) } let(:course1) { build(:course, id: 1, name: 'ECE517') } let(:course2) { build(:course, id: 2, name: 'ECE506') } let(:instructor) { build(:instructor, id: 6) } let(:assignment) { build(:assignment, id: 1, name: 'no assignment', participants: [pa...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/questionnaire_node_spec.rb
Ruby
mit
191
main
6,441
describe QuestionnaireNode do let(:questionnaire) { build(:questionnaire) } let(:questionnaire2) { build(:questionnaire) } let(:questionnaire3) { build(:questionnaire) } let(:questionnaire_node) { build(:questionnaire_node) } let(:teaching_assistant) { build(:teaching_assistant) } let(:student) { build(:stu...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/super_administrator_spec.rb
Ruby
mit
191
main
684
describe SuperAdministrator do let(:user1) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } let(:user2) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbe@gmail.com', password: '123456789', password_confirmation: '123456789'...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/assignment_spec.rb
Ruby
mit
191
main
35,251
describe Assignment do let(:assignment) { build(:assignment, id: 1, name: 'no assignment', participants: [participant], teams: [team], max_team_size: 2) } let(:instructor) { build(:instructor, id: 6) } let(:student) { build(:student, id: 3, name: 'no one') } let(:review_response_map) { build(:review_response_ma...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/teammate_review_response_map_spec.rb
Ruby
mit
191
main
6,533
describe TeammateReviewResponseMap do let(:questionnaire) { Questionnaire.new name: 'abc', private: 0, min_question_score: 0, max_question_score: 10, instructor_id: 1234 } let(:assignment_questionnaire1) { build(:assignment_questionnaire, id: 1, assignment_id: 1, questionnaire_id: 2, duty_id: 1) } let(:participan...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/rscore_spec.rb
Ruby
mit
191
main
463
describe Rscore do describe '#initialize' do it 'allows max, min, and avg to be accessible' do myscore = { quiz: { scores: { max: 95, min: 88, avg: 90 } } } rscore = Rscore.new(myscore, :quiz) expect(rscore.my_max).to ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/badge_spec.rb
Ruby
mit
191
main
706
describe Badge do let(:awarded_badge) { build(:awarded_badge) } describe '#get_id_from_name' do it 'returns the badge id from the name' do allow(Badge).to receive(:find_by).and_return(awarded_badge) allow(awarded_badge).to receive(:try).with(:id).and_return(1) expect(Badge.get_id_from_name('as...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/vm_question_response_score_cell_spec.rb
Ruby
mit
191
main
1,041
describe VmQuestionResponseScoreCell do let(:questionnaire) { create(:questionnaire, id: 1) } let(:question1) { create(:question, questionnaire: questionnaire, weight: 1, id: 1) } let!(:answer) { create(:answer, answer: 5, comments: 'This is a comment. I hope it is a good one') } let(:tp) { TagPrompt.new(prompt...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/response_analytic_spec.rb
Ruby
mit
191
main
12,471
class ResponseAnalyticTestDummyClass attr_accessor :scores require 'analytic/response_analytic' include ResponseAnalytic def initialize(scores) @scores = scores end end describe ResponseAnalytic do let(:questionnaire) { create(:questionnaire, id: 1) } let(:question1) { create(:question, questionnair...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/review_bid_spec.rb
Ruby
mit
191
main
3,093
describe ReviewBid do let(:bid1) { build(:review_bid, priority: 3, participant_id: 7601, signuptopic_id: 123, assignment_id: 2085, updated_at: '2018-01-01 00:00:00') } let(:bid2) { build(:review_bid, priority: 2, participant_id: '7602', signuptopic_id: 124, assignment_id: 2086) } let(:student) { build(:student, i...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/administrator_spec.rb
Ruby
mit
191
main
214
describe Administrator do describe 'class' do it 'creates a valid object' do expect(Administrator.new(name: 'name', fullname: 'John Bumgardner', email: 'email@email.com')).to be_valid end end end
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/simi_check_webservice_spec.rb
Ruby
mit
191
main
8,298
xdescribe 'SimiCheckWebservice' do def poll(comp_id) is_success = false until is_success begin response = SimiCheckWebService.get_similarity_nxn(comp_id) is_success = (response.code == 200) rescue StandardError sleep(2) next end end end describe '.get...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/invitation_spec.rb
Ruby
mit
191
main
8,009
describe Invitation do let(:user2) { build(:student, id: 2) } let(:user3) { build(:student, id: 3) } let(:assignment) { build(:assignment, id: 1) } let(:team) { build(:assignment_team, id: 1, parent_id: 1) } let(:team2) { build(:assignment_team, id: 2, parent_id: 1) } let(:topic) { build(:topic, id: 1, assi...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/feedback_response_map_spec.rb
Ruby
mit
191
main
7,960
describe FeedbackResponseMap do let(:questionnaire1) { build(:questionnaire, id: 1, type: 'AuthorFeedbackQuestionnaire') } let(:questionnaire2) { build(:questionnaire, id: 2, type: 'MetareviewQuestionnaire') } let(:participant) { build(:participant, id: 1) } let(:assignment) { build(:assignment, id: 1) } let(...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/rubric_spec.rb
Ruby
mit
191
main
346
describe Rubric do it 'is not valid without a name' do expect(Rubric.new(name: nil, max_question_score: 100, min_question_score: 0)).to_not be_valid end it 'is valid with a name, max and min question scores' do expect(Rubric.new(name: 'Test Assignment Rubric', max_question_score: 100, min_question_score: ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/instructor_spec.rb
Ruby
mit
191
main
3,136
describe Instructor do let(:assignment) { build(:assignment, id: 1, name: 'no assignment') } let(:instructor) { build(:instructor, id: 6) } let(:participant1) { build(:participant, id: 1) } let(:participant2) { build(:participant, id: 2) } let(:team) { build(:assignment_team, id: 1, name: 'no team') } let(:...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/tag_prompt_deployment_spec.rb
Ruby
mit
191
main
12,118
describe TagPromptDeployment do let(:tag_dep) { TagPromptDeployment.new id: 1, tag_prompt: tp, tag_prompt_id: 1, question_type: 'Criterion', answer_length_threshold: 5, questionnaire: questionnaire, assignment: assignment } let(:tag_dep1) { TagPromptDeployment.new id: 1, tag_prompt: tp, tag_prompt_id: 1, question_t...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/upload_file_spec.rb
Ruby
mit
191
main
1,048
describe 'UploadFile' do let(:uf) { UploadFile.new id: 1, type: 'UploadFile', seq: 1.0, txt: 'test txt', weight: 1 } describe '#edit' do it 'returns the html ' do html = uf.edit(0).to_s expect(html).to eq('<tr><td align="center"><a rel="nofollow" data-method="delete" href="/questions/1">Remove</a><...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/questionnaire_type_node_spec.rb
Ruby
mit
191
main
1,796
describe QuestionnaireTypeNode do let(:questionnaire_type_node) { build(:questionnaire_type_node) } let(:questionnaire) { build(:questionnaire) } let(:questionnaire2) { build(:questionnaire) } let(:questionnaire3) { build(:questionnaire) } it { should belong_to(:table) } it { should belong_to(:node_object) ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/missing_object_id_error_spec.rb
Ruby
mit
191
main
407
describe MissingObjectIDError do describe 'missing_object_id_error' do it 'raises an error' do expect { raise MissingObjectIDError }.to raise_error(StandardError) end it 'gives an exception message' do expect(MissingObjectIDError.new.exception).to eq('No object ID was provided to the import pr...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/quiz_assignment_spec.rb
Ruby
mit
191
main
4,230
describe QuizAssignment do let(:assignment) { build(:assignment, id: 1, name: 'no assignment', participants: [participant], teams: [team]) } let(:instructor) { build(:instructor, id: 6) } let(:student) { build(:student, id: 3, name: 'no one') } let(:participant) { build(:participant, id: 1) } let(:team) { bui...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/vm_question_response_spec.rb
Ruby
mit
191
main
6,897
describe VmQuestionResponse do let(:review_questionnaire) { build(:questionnaire) } let(:author_feedback_questionnaire) { AuthorFeedbackQuestionnaire.new } let(:teammate_review_questionnaire) { TeammateReviewQuestionnaire.new } let(:metareview_questionnaire) { MetareviewQuestionnaire.new } let(:assignment) {...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/response_map_spec.rb
Ruby
mit
191
main
8,148
describe ResponseMap do let(:team) { build(:assignment_team, id: 1, name: 'team no name', assignment: assignment, users: [student], parent_id: 1) } let(:team1) { build(:assignment_team, id: 2, name: 'team has name', assignment: assignment, users: [student1]) } let(:team2) { build(:assignment_team, id: 3, name: 't...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/review_questionnaire_spec.rb
Ruby
mit
191
main
1,327
describe ReviewQuestionnaire do let(:participant) { build(:participant, id: 1, reviews: [response_map]) } let(:questionnaire) { build(:questionnaire, id: 1) } let(:response_map) { build(:review_response_map, id: 1) } let(:response) { build(:response, is_submitted: true) } let(:team) { build(:assignment_team, ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/mentor_management_spec.rb
Ruby
mit
191
main
16,244
describe MentorManagement do # using let! so that state is automatically set up before each example group # this could also be accomplished with before(:each) and instance methods # but the rest of the code base makes use of let a lot, so this is consistent # with that, while achieving the same goal as before(:...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/response_spec.rb
Ruby
mit
191
main
22,474
describe Response do let(:user) { build(:student, id: 1, role_id: 1, name: 'no name', fullname: 'no one') } let(:user2) { build(:student, id: 2, role_id: 2, name: 'no name2', fullname: 'no one2') } let(:participant) { build(:participant, id: 1, parent_id: 1, user: user) } let(:participant2) { build(:participant...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/models/late_policy_spec.rb
Ruby
mit
191
main
6,107
require 'penalty_helper' include PenaltyHelper describe LatePolicy do let(:late_policy) { build(:late_policy) } let(:calculated_penalty) { build(:calculated_penalty) } let(:participant) { build(:participant) } let(:assignment_due_date) { build(:assignment_due_date) } let(:meta_review_response_map) { build(:me...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/answer_helper_spec.rb
Ruby
mit
191
main
7,039
describe AnswerHelper do before(:each) do @assignment1 = create(:assignment, name: 'name1', directory_path: 'name1') @assignment2 = create(:assignment, name: 'name2', directory_path: 'name2') @questionnaire1 = create(:questionnaire) @questionnaire2 = create(:questionnaire) @questionnaire3 = create...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/participants_helper_spec.rb
Ruby
mit
191
main
4,342
describe ParticipantsHelper do describe '#define_attributes' do context 'when define_attributes is called' do #Checking if attributes have been correctly defined line_split = ['Test1','test@ncsu.edu'] config = {'name'=>'0','fullname'=>'test2','email'=>'1'} it...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/join_team_request_helper_spec.rb
Ruby
mit
191
main
1,834
describe JoinTeamRequestsHelper do let(:join_team_request1) { build(:join_team_request) } describe '#display_request_status' do # Pending Status context 'when the request is pending' do # Set the status of the request to pending. before(:each) do join_team_request1.status = 'P' end...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/review_bids_helper_spec.rb
Ruby
mit
191
main
417
describe ReviewBidsHelper do let(:topic) { build(:topic) } describe '#get_intelligent_topic_row_review_bids' do context 'when no selected topics' do it 'returns a row' do allow(ReviewBid).to receive(:where).and_return([]) expect(helper.get_intelligent_topic_row_review_bids(topic, nil, 2))....
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/review_mapping_helper_spec.rb
Ruby
mit
191
main
55,683
require 'spec_helper' require 'rails_helper' describe ReviewMappingHelper, type: :helper do let(:team) { build(:assignment_team, id: 1) } let(:test_item) { build(:answer, id: 1, comments: 'https://wiki.archlinux.org/') } let(:test_response) { build(:response, id: 1) } describe 'get_team_color' do before(:e...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/deadline_helper_spec.rb
Ruby
mit
191
main
2,183
describe DeadlineHelper do before(:each) do @deadline_type = create(:deadline_type) @deadline_right = create(:deadline_right) @topic_due_date = create(:topic_due_date, deadline_type: @deadline_type, submission_allowed_id: @deadline_right.id, review_allowed_id:...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/grades_helper_spec.rb
Ruby
mit
191
main
18,665
require 'rails_helper' describe GradesHelper, type: :helper do let(:review_response) { build(:response, id: 1, map_id: 1) } let(:question) { build(:question) } let(:participant) { build(:participant, id: 1, assignment: assignment, user_id: 1, parent_id: 1) } let(:team) { build(:assignment_team, id: 1) } let(:...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/sign_up_sheet_helper_spec.rb
Ruby
mit
191
main
4,613
describe 'SignUpSheetHelper' do describe '#check_topic_due_date_value' do before(:each) do @assignment = create(:assignment) @topic = create(:topic, assignment: @assignment) @deadline_type = create(:deadline_type) @deadline_right = create(:deadline_right) @assignment_due_date = creat...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/summary_helper_spec.rb
Ruby
mit
191
main
4,042
# require for webservice calls require 'json' require 'rest_client' describe 'SummaryHelper' do let(:answer) { Answer.new(answer: 1, comments: 'This is a sentence. This is another sentence.', question_id: 1) } let(:answer1){ Answer.new(answer: 2, comments: 'This is a sentence1. This is another sentence1.', questio...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/authorization_helper_spec.rb
Ruby
mit
191
main
31,881
describe AuthorizationHelper do # Set up some dummy users # Inspired by spec/controllers/users_controller_spec.rb # Makes use of spec/factories/factories.rb # Use create instead of build so that these users get IDs # https://stackoverflow.com/questions/41149787/how-do-i-create-an-user-id-for-a-factorygirl-bui...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/helpers/assignment_helper_spec.rb
Ruby
mit
191
main
3,190
describe AssignmentHelper do let(:assignment_helper) { Class.new { extend AssignmentHelper } } let(:questionnaire) { create(:questionnaire, id: 1) } let(:question1) { create(:question, questionnaire: questionnaire, weight: 1, id: 1) } let(:response) { build(:response, id: 1, map_id: 1, scores: [answer]) } let...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
spec/support/teams_shared.rb
Ruby
mit
191
main
3,427
RSpec.configure do |rspec| rspec.shared_context_metadata_behavior = :apply_to_host_groups end # Declaring common stubbed objects: This creates single instances of superadmin, admin, instructor, teaching assistant, course and assignment. # There are 2 instances of students, 5 instances of assignment teams, 2 instances...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/application.rb
Ruby
mit
191
main
3,473
require File.expand_path('boot', __dir__) require 'net/https' require 'csv' require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module Expertiza class Application < Rails::Application # This is a log...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/puma.rb
Ruby
mit
191
main
2,010
# Puma can serve each request in a thread from an internal thread pool. # The `threads` method setting takes two numbers a minimum and maximum. # Any libraries that use thread pools should be configured to match # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum, this matches ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/routes.rb
Ruby
mit
191
main
15,218
Expertiza::Application.routes.draw do get 'lti/launch' post 'lti/launch' => 'lti#launch' require 'sidekiq/web' mount Sidekiq::Web => '/sidekiq' resources :admin, only: [] do collection do get :list_super_administrators get :list_administrators get :list_instructors post :create_i...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/diagnostic.rb
Ruby
mit
191
main
564
module MyApp # Logger to sit between test and server end. When using Selenium these are not reported in tests, error pages are just another web page class DiagnosticMiddleware FILENAME = 'log/diagnostic.txt'.freeze def initialize(app) @app = app end def call(env) @app.call(env) res...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/deploy.rb
Ruby
mit
191
main
2,749
# CapistranoDbTasks (https://github.com/sgruhier/capistrano-db-tasks) require 'capistrano-db-tasks' # if you haven't already specified set :rails_env, 'production' # if you want to remove the local dump file after loading set :db_local_clean, true # if you want to remove the dump file from the server after downloadi...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/navigation.rb
Ruby
mit
191
main
4,186
# Configures your navigation SimpleNavigation::Configuration.run do |navigation| # Specify a custom renderer if needed. # The default renderer is SimpleNavigation::Renderer::List which renders HTML lists. # The renderer can also be specified as option in the render_navigation call. # navigation.renderer = Your:...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/new_framework_defaults.rb
Ruby
mit
191
main
1,037
# Be sure to restart your server when you modify this file. # # This file contains migration options to ease your Rails 5.0 upgrade. # # Once upgraded flip defaults one by one to migrate to the new default. # # Read the Guide for Upgrading Ruby on Rails for more info on each option. # Enable per-form CSRF tokens. Prev...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/load_config.rb
Ruby
mit
191
main
269
GOOGLE_CONFIG = YAML.load_file("#{Rails.root}/config/google_auth.yml")[Rails.env] WEBSERVICE_CONFIG = YAML.load_file("#{Rails.root}/config/webservices.yml")[Rails.env] PLAGIARISM_CHECKER_CONFIG = YAML.load_file("#{Rails.root}/config/plagiarism_checker.yml")[Rails.env]
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/load_roles.rb
Ruby
mit
191
main
847
require 'credentials' require 'menu' CACHED_STUDENT_MENU = YAML.load_file("#{Rails.root}/config/role_student.yml")[Rails.env] CACHED_ADMIN_MENU = YAML.load_file("#{Rails.root}/config/role_admin.yml")[Rails.env] CACHED_SUPER_ADMIN_MENU = YAML.load_file("#{Rails.root}/config/role_super_admin.yml")[Rails.env] CACHED_INSTR...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/session_store.rb
Ruby
mit
191
main
413
# Be sure to restart your server when you modify this file. # Expertiza::Application.config.session_store :cookie_store, :key => '_expertiza_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/airbrake.rb
Ruby
mit
191
main
2,732
# Airbrake is an online tool that provides robust exception tracking in your Rails # applications. In doing so, it allows you to easily review errors, tie an error # to an individual piece of code, and trace the cause back to recent # changes. Airbrake enables for easy categorization, searching, and prioritization # of...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/omniauth.rb
Ruby
mit
191
main
306
OmniAuth.config.logger = Rails.logger # Secret client and secret key configuration for google app Rails.application.config.middleware.use OmniAuth::Builder do provider :google_oauth2, GOOGLE_CONFIG['client_key'], GOOGLE_CONFIG['client_secret'], client_options: { ssl: { verify: false } } end
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/initializer.rb
Ruby
mit
191
main
803
ActionController::ForceSSL::ClassMethods.module_eval do def force_ssl(options = {}) config = Rails.application.config return unless config.use_ssl # <= this is new host = options.delete(:host) port = config.ssl_port if config.respond_to?(:ssl_port) && config.ssl_port.present? # <= this is also new ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/lti.rb
Ruby
mit
191
main
548
Rails.application.config.lti_settings = { title: 'Expertiza', description: 'Expertiza', # icon: 'https://your-app-url.com/path/to/icon.png', launch_url: "#{ENV['moodle_base_url']}/enrol/lti/launch.php", jwks_url: "#{ENV['moodle_base_url']}/enrol/lti/jwks.php", redirect_uri: "#{ENV['moodle_base_url']}/auth/l...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/request_forgery_protection_mod.rb
Ruby
mit
191
main
299
module ActionController::RequestForgeryProtection protected def handle_unverified_request raise ActionController::InvalidAuthenticityToken, 'You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.' end end
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/mcp.rb
Ruby
mit
191
main
512
# config/initializers/mcp.rb Rails.application.config.x.mcp = ActiveSupport::OrderedOptions.new # Dummy IP for draft purposes (change to real MCP endpoint/env var in production) Rails.application.config.x.mcp.endpoint = ENV.fetch('MCP_ENDPOINT', 'http://152.7.176.64/:8000/') # Token used to talk to MCP (dummy by defaul...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/initializers/redis.rb
Ruby
mit
191
main
257
# http://ericlondon.com/2016/10/29/dockerize-rails-development-environment-integrated-with-postgresql-redis-and-elasticsearch-using-docker-compose.html $redis = Redis::Namespace.new('expertiza', redis: Redis.new(host: ENV.fetch('REDIS_HOST', 'localhost')))
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/environments/test.rb
Ruby
mit
191
main
1,561
Expertiza::Application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/environments/anonymization.rb
Ruby
mit
191
main
2,289
Expertiza::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to resta...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/environments/staging.rb
Ruby
mit
191
main
4,121
Expertiza::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true config.use_ssl = true # Eager load code on boot. This e...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/environments/production.rb
Ruby
mit
191
main
4,665
Expertiza::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true config.use_ssl = false # Eager load code on boot. This ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/environments/development.rb
Ruby
mit
191
main
2,178
Expertiza::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/deploy/production.rb
Ruby
mit
191
main
2,362
# server-based syntax # ====================== # Defines a single server with a list of roles and multiple properties. # You can define all roles on a single server, or split them: # server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value # server "example.com", user: "deploy", roles: %w{ap...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/deploy/proxy.rb
Ruby
mit
191
main
2,268
# server-based syntax # ====================== # Defines a single server with a list of roles and multiple properties. # You can define all roles on a single server, or split them: # server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value # server "example.com", user: "deploy", roles: %w{ap...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/deploy/development.rb
Ruby
mit
191
main
478
# server-based syntax # ====================== # Defines a single server with a list of roles and multiple properties. # You can define all roles on a single server, or split them: server '152.7.179.114', user: 'expertiza', roles: %w[web app] set :default_env, 'JAVA_HOME' => '/usr/jdk-11' set :branch, 'main' set :rvm_...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/deploy/anonymized.rb
Ruby
mit
191
main
516
# server-based syntax # ====================== # Defines a single server with a list of roles and multiple properties. # You can define all roles on a single server, or split them: server '152.7.179.77', user: 'expertiza', roles: %w[web app] set :default_env, 'JAVA_HOME' => '/usr/jdk-11' set :branch, 'anonymized_serv...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
config/deploy/staging.rb
Ruby
mit
191
main
2,377
# server-based syntax # ====================== # Defines a single server with a list of roles and multiple properties. # You can define all roles on a single server, or split them: # server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value # server "example.com", user: "deploy", roles: %w{ap...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/schema.rb
Ruby
mit
191
main
48,942
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # dat...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/007_create_deadline_types.rb
Ruby
mit
191
main
747
class CreateDeadlineTypes < ActiveRecord::Migration[4.2] def self.up create_table :deadline_types do |t| t.column :name, :string, limit: 32 end deadline_type = DeadlineType.create(name: 'submission') deadline_type.save deadline_type = DeadlineType.create(name: 'review') deadline_type.sav...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/002_menu_rest_items_users_cached_content_pages.rb
Ruby
mit
191
main
714
class MenuRestItemsUsersCachedContentPages < ActiveRecord::Migration[4.2] def self.up # Add URL to use for Actions, to better support REST add_column 'controller_actions', 'url_to_use', :string # Enhancements for Users add_column 'users', 'password_salt', :string add_column 'users', 'fullname', :...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/025_create_review_of_review_scores.rb
Ruby
mit
191
main
726
class CreateReviewOfReviewScores < ActiveRecord::Migration[4.2] def self.up create_table :review_of_review_scores do |t| t.column :review_of_review_id, :integer t.column :question_id, :integer t.column :score, :integer t.column :comments, :text end execute "alter table review_of_re...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/009_create_questionnaires.rb
Ruby
mit
191
main
823
class CreateQuestionnaires < ActiveRecord::Migration[4.2] def self.up create_table :questionnaires do |t| t.column :name, :string, limit: 64 t.column :instructor_id, :integer # id of instructor who created the questionnaire t.column :private, :boolean # whether questionnaire is visible to other ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/003_create_roles.rb
Ruby
mit
191
main
533
class CreateRoles < ActiveRecord::Migration[4.2] # This table need not be created in migration, as it is already created by Goldberg def self.up create_table :roles do |t| # t.column :name, :string t.column :name, :string, limit: 32 end role = Role.create(name: 'suadmin') role.save r...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/004_create_users.rb
Ruby
mit
191
main
1,805
class CreateUsers < ActiveRecord::Migration[4.2] def self.up # t.column :username, :string, :limit=>32 -- called "name" in Goldberg # t.column :password, :string -- already included in Goldberg table # t.column :first_name, :string, :limit=>30 -- subsumed by "fullname" in Goldberg data model (we may wa...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/015_create_review_mappings.rb
Ruby
mit
191
main
771
class CreateReviewMappings < ActiveRecord::Migration[4.2] # This table should have essentially the same format as review_of_review_mappings def self.up create_table :review_mappings do |t| t.column :author_id, :integer # if an individual is being reviewed, this field is non-null, otherwise is null t...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/022_create_review_feedbacks.rb
Ruby
mit
191
main
1,199
class CreateReviewFeedbacks < ActiveRecord::Migration[4.2] def self.up create_table :review_feedbacks do |t| # Note: Table name pluralized by convention. Do *NOT* refer to "feedbacks" in any documentation! t.column :assignment_id, :integer # the assignment to which this feedback pertains. t.col...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/008_create_deadline_rights.rb
Ruby
mit
191
main
463
class CreateDeadlineRights < ActiveRecord::Migration[4.2] def self.up create_table :deadline_rights do |t| t.column :name, :string, limit: 32 end deadline_right = DeadlineRight.create(name: 'No') deadline_right.save deadline_right = DeadlineRight.create(name: 'Late') deadline_right.save ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/006_create_late_policies.rb
Ruby
mit
191
main
826
class CreateLatePolicies < ActiveRecord::Migration[4.2] def self.up create_table :late_policies do |t| # t.column :name, :string t.column :penalty_period_in_minutes, :integer # length of penalty period, expressed in minutes; e.g., if penalty is per hour, value here is 60 t.column :penalty_per_un...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/026_create_question_advices.rb
Ruby
mit
191
main
623
class CreateQuestionAdvices < ActiveRecord::Migration[4.2] def self.up create_table :question_advices do |t| t.column :question_id, :integer t.column :score, :integer # either an integer or true/false. false should be assigned a score of 0, and true should be assigned a score of 1 t.column :adv...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/005_modify_users.rb
Ruby
mit
191
main
2,563
class ModifyUsers < ActiveRecord::Migration[4.2] def self.up # t.column :username, :string, :limit=>32 -- called "name" in Goldberg # t.column :password, :string -- already included in Goldberg table add_column :institution_id, :integer # reference to an entry in institutions table, referring to the ins...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/023_create_review_of_review_mappings.rb
Ruby
mit
191
main
1,034
class CreateReviewOfReviewMappings < ActiveRecord::Migration[4.2] # This table should have essentially the same format as review_mappings def self.up create_table :review_of_review_mappings do |t| t.column :review_mapping_id, :integer # the review that is being reviewed. Note that the review_mapping_id a...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/018_create_courses_users.rb
Ruby
mit
191
main
884
class CreateCoursesUsers < ActiveRecord::Migration[4.2] def self.up # This table is used as a mapping table associating users with courses, # but it also contains info as to whether a user has dropped a course. # If it didn't, when a user dropped a course, all his submitted work # would become inacces...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/016_create_reviews.rb
Ruby
mit
191
main
1,192
class CreateReviews < ActiveRecord::Migration[4.2] # This table should have essentially the same format as review_of_reviews def self.up create_table :reviews do |t| t.column :reviewed_at, :datetime # time that the review was saved t.column :review_mapping_id, :integer # the entry in the review_mapp...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/014_create_languages.rb
Ruby
mit
191
main
210
class CreateLanguages < ActiveRecord::Migration[4.2] def self.up create_table :languages do |t| t.column :name, :string, limit: 32 end end def self.down drop_table :languages end end
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/004_create_institutions.rb
Ruby
mit
191
main
276
class CreateInstitutions < ActiveRecord::Migration[4.2] def self.up create_table :institutions do |t| t.column :name, :string # printname of institution (college, university, high school, etc.) end end def self.down drop_table :institutions end end
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/012_create_due_dates.rb
Ruby
mit
191
main
2,391
class CreateDueDates < ActiveRecord::Migration[4.2] def self.up create_table :due_dates do |t| t.column :due_at, :datetime t.column :deadline_type_id, :integer # whether a submission deadline, a review deadline, etc. t.column :assignment_id, :integer # the assignment that this due date pertains ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/005_create_courses.rb
Ruby
mit
191
main
598
class CreateCourses < ActiveRecord::Migration[4.2] def self.up create_table :courses do |t| t.column :title, :string t.column :instructor_id, :int t.column :directory_path, :string # the directory for this course; all assgts. will be in subdirectories of this t.column :info, :text # this i...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/013_create_participants.rb
Ruby
mit
191
main
1,404
class CreateParticipants < ActiveRecord::Migration[4.2] def self.up create_table :participants do |t| t.column :submit_allowed, :boolean # true if user is allowed to submit to this assignment t.column :review_allowed, :boolean t.column :user_id, :integer t.column :assignment_id, :integer ...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/010_create_questions.rb
Ruby
mit
191
main
566
class CreateQuestions < ActiveRecord::Migration[4.2] def self.up create_table :questions do |t| t.column :txt, :text t.column :true_false, :boolean # either it's a true/false question, or it's a question that is to be given a numeric score t.column :weight, :integer t.column :questionnaire...
github
expertiza/expertiza
https://github.com/expertiza/expertiza
db/migrate_save/017_create_review_scores.rb
Ruby
mit
191
main
628
class CreateReviewScores < ActiveRecord::Migration[4.2] def self.up create_table :review_scores do |t| t.column :review_id, :integer t.column :question_id, :integer t.column :score, :integer t.column :comments, :text end execute "alter table review_scores add constrain...