Skip to content

Commit

Permalink
feat: Added rubric doc url [PT-184748744]
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmartin committed Jul 20, 2023
1 parent b156df5 commit 0aaa50f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion rails/app/controllers/external_activities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions rails/app/models/api/v1/offering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down
2 changes: 2 additions & 0 deletions rails/app/views/external_activities/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion rails/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions rails/db/migrate/20230720110611_add_rubric_doc_url.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddRubricDocUrl < ActiveRecord::Migration[6.1]
def change
add_column :external_activities, :rubric_doc_url, :string
end
end
3 changes: 2 additions & 1 deletion rails/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 0aaa50f

Please sign in to comment.