diff --git a/admin-panel/graphql-backend/src/entities/unused/ExternalActivities.ts b/admin-panel/graphql-backend/src/entities/unused/ExternalActivities.ts index 4a8507d2ea..280bfc2447 100644 --- a/admin-panel/graphql-backend/src/entities/unused/ExternalActivities.ts +++ b/admin-panel/graphql-backend/src/entities/unused/ExternalActivities.ts @@ -202,6 +202,9 @@ export class ExternalActivities { @Column("varchar", { name: "rubric_url", nullable: true, length: 255 }) rubricUrl: string | null; + @Column("varchar", { name: "rubric_doc_url", nullable: true, length: 255 }) + rubricDocUrl: string | null; + @Column("tinyint", { name: "saves_student_data", nullable: true, diff --git a/rails/app/controllers/external_activities_controller.rb b/rails/app/controllers/external_activities_controller.rb index f5d6ce0b8a..190bcb4709 100644 --- a/rails/app/controllers/external_activities_controller.rb +++ b/rails/app/controllers/external_activities_controller.rb @@ -332,6 +332,6 @@ def external_activity_strong_params(params) :material_type, :name, :offerings_count, :popup, :print_url, :publication_status, :rubric_url, :save_path, :saves_student_data, :short_description, :student_report_enabled, :teacher_copyable, :teacher_guide_url, :teacher_resources_url, :template_id, :template_type, :thumbnail_url, :tool_id, - :url, :user_id) + :url, :user_id, :rubric_doc_url) end end diff --git a/rails/app/models/api/v1/offering.rb b/rails/app/models/api/v1/offering.rb index 431c1cfb05..33d2b2d99f 100644 --- a/rails/app/models/api/v1/offering.rb +++ b/rails/app/models/api/v1/offering.rb @@ -56,6 +56,7 @@ def initialize(student, offering, protocol, host_with_port) attribute :material_type, String attribute :report_url, String attribute :rubric_url, String + attribute :rubric_doc_url, String attribute :preview_url, String attribute :has_teacher_edition, Boolean # 2019-07-16 NP: TODO: deprecate `external_report` in favor of `external_reports` @@ -89,6 +90,7 @@ def initialize(offering, protocol, host_with_port, current_user, additional_exte self.has_teacher_edition = runnable.has_teacher_edition self.reportable = offering.reportable? self.rubric_url = runnable.respond_to?(:rubric_url) ? runnable.rubric_url : nil + self.rubric_doc_url = runnable.respond_to?(:rubric_doc_url) ? runnable.rubric_doc_url : nil self.report_url = offering.reportable? ? report_portal_offering_url(id: offering.id, protocol: protocol, host: host_with_port) : nil self.preview_url = run_url_for(runnable, preview_params(current_user, {protocol: protocol, host: host_with_port})) # 2019-07-16 NP: TODO: deprecate `external_report` in favor of `external_reports` diff --git a/rails/app/views/external_activities/_form.html.haml b/rails/app/views/external_activities/_form.html.haml index d8d283c12d..aa0f2293c2 100644 --- a/rails/app/views/external_activities/_form.html.haml +++ b/rails/app/views/external_activities/_form.html.haml @@ -61,6 +61,8 @@ - else = f.check_box :has_teacher_edition, :disabled => true This activity has a teacher edition. + = field_set_tag t('authoring.rubric_doc_url_label') do + = f.text_field :rubric_doc_url, :size => 60 = field_set_tag t('authoring.rubric_url_label') do = f.text_field :rubric_url, :size => 60 = field_set_tag 'Thumbnail image URL (300 x 250 px)' do diff --git a/rails/config/locales/en.yml b/rails/config/locales/en.yml index 0473202166..96785dbd11 100644 --- a/rails/config/locales/en.yml +++ b/rails/config/locales/en.yml @@ -67,7 +67,8 @@ en: external_report_label: External Reporting external_report_description: Specify additional report links to be shown to teachers in the offering view. Unless you know what you are doing selecting none is recommended. report_client: Report Auth Client - rubric_url_label: Rubric (URL) + rubric_url_label: Rubric JSON (URL) + rubric_doc_url_label: Rubric Document (URL) short_description_description: Shown in search results, student listings, and used as a fallback for long descrption. It is recommended that every activity has this value provided. long_description_description: Shown in places where activity details are vible (e.g. STEM Resource finder lightbox). Uses Short Description as a fallback. long_description_for_teachers_description: Variant of Long Description visible only for teachers. Uses Long Description as a fallback. diff --git a/rails/db/migrate/20230720110611_add_rubric_doc_url.rb b/rails/db/migrate/20230720110611_add_rubric_doc_url.rb new file mode 100644 index 0000000000..1cf6f883ff --- /dev/null +++ b/rails/db/migrate/20230720110611_add_rubric_doc_url.rb @@ -0,0 +1,5 @@ +class AddRubricDocUrl < ActiveRecord::Migration[6.1] + def change + add_column :external_activities, :rubric_doc_url, :string + end +end diff --git a/rails/db/schema.rb b/rails/db/schema.rb index baeb5882dd..0baca66dab 100644 --- a/rails/db/schema.rb +++ b/rails/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_03_20_192316) do +ActiveRecord::Schema.define(version: 2023_07_20_110611) do create_table "access_grants", id: :integer, charset: "utf8", force: :cascade do |t| t.string "code" @@ -265,6 +265,7 @@ t.text "teacher_resources_url" t.boolean "teacher_copyable" t.text "legacy_lara_url" + t.string "rubric_doc_url" t.index ["is_featured", "publication_status"], name: "featured_public" t.index ["publication_status"], name: "pub_status" t.index ["save_path"], name: "index_external_activities_on_save_path"