Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5a8b74a
created test cases for assignment marks, edit and update
chickenwaddle77 May 20, 2025
5de080a
Merge remote-tracking branch 'upstream/master'
chickenwaddle77 May 20, 2025
f1636e6
removed unnecessary comments
chickenwaddle77 May 20, 2025
36c16d3
added myself to list of contributors
chickenwaddle77 May 20, 2025
f4bea09
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 20, 2025
48b0303
added my change to changelog
chickenwaddle77 May 20, 2025
a4d30b1
Merge remote-tracking branch 'origin/master'
chickenwaddle77 May 20, 2025
6f6e9b3
merged from upstream/master
chickenwaddle77 May 20, 2025
26f5e6c
Added changes from 1 to 5
chickenwaddle77 May 28, 2025
16de70e
Added routing to redirect tab to submissions
chickenwaddle77 May 29, 2025
c82f105
Fixed previous commit for assignment description
chickenwaddle77 May 29, 2025
289cb58
Merge branch 'master' into assignment-view-students
chickenwaddle77 May 29, 2025
7d4ba25
Delete Changelog.md.orig
chickenwaddle77 May 29, 2025
fc3304b
Delete spec/controllers/criteria_controller_spec.rb.orig
chickenwaddle77 May 29, 2025
eb6de31
Added to changelog
chickenwaddle77 May 29, 2025
c97aeb8
Fixed rspec changes
chickenwaddle77 May 29, 2025
609a964
fixed from comments
chickenwaddle77 Jun 4, 2025
1994dff
fixed merge conflicts
chickenwaddle77 Jun 4, 2025
f489ab1
re-fixed a bug with styling
chickenwaddle77 Jun 4, 2025
c88a81d
implemented new section in summary stats, before clean-up
chickenwaddle77 Jun 4, 2025
fa3a513
removed commented code
chickenwaddle77 Jun 4, 2025
190b332
added to changelog
chickenwaddle77 Jun 4, 2025
8807ac7
fixed errors from rspec
chickenwaddle77 Jun 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### ✨ New features and improvements
- Improved layout and labeling in the assignment settings form for both standard and timed assessments. (#7531)
- Improve Assignment view for students (#7533)
- Add average annotations section in Assignment Summary (#7556)

### 🐛 Bug fixes

Expand Down
1 change: 1 addition & 0 deletions app/controllers/assignments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ def grade_distribution
assignment_remark_requests = assignment.groupings.joins(current_submission_used: :submitted_remark)
summary = {
name: "#{assignment.short_identifier}: #{assignment.description}",
average_annotations: assignment.average_annotations,
average: assignment.results_average(points: true) || 0,
median: assignment.results_median(points: true) || 0,
max_mark: assignment.max_mark || 0,
Expand Down
9 changes: 9 additions & 0 deletions app/javascript/Components/assignment_chart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class AssignmentChart extends React.Component {
this.state = {
summary: {
average: null,
average_annotations: null,
median: null,
num_submissions_collected: null,
num_submissions_graded: null,
Expand Down Expand Up @@ -187,6 +188,13 @@ export class AssignmentChart extends React.Component {
);
}

let annotation_summary = (
<div className="distribution-graph">
<h3>{I18n.t("assignments.annotation_summary")}</h3>
<p>{I18n.t("assignments.average_annotations", {average_annotations: 2.75})}</p>
</div>
);

return (
<React.Fragment>
<h2>
Expand Down Expand Up @@ -227,6 +235,7 @@ export class AssignmentChart extends React.Component {
/>
{criteria_graph}
{ta_grade_distribution_chart}
{annotation_summary}
</React.Fragment>
);
}
Expand Down
69 changes: 33 additions & 36 deletions app/views/assignments/_read.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<% short_identifier = @assignment.is_peer_review? ?
"#{@assignment.parent_assignment.short_identifier} #{PeerReview.model_name.human}" :
@assignment.short_identifier %>

<h2><%= "#{short_identifier}: #{@assignment.description}" %></h2>
<h2><%= t('assignments.assignment_information') %></h2>

<div class='block-content'>
<% if @assignment.message %>
Expand Down Expand Up @@ -134,6 +130,32 @@
</div>
<% end %>
<% end %>
<% unless @assignment.starter_file_updated_at.nil? || @grouping.nil? %>
<% if allowed_to?(:download_starter_file?, @grouping) %>
<h3><%= I18n.t('assignments.starter_file.title').downcase.capitalize %></h3>
<p><%= I18n.t('assignments.starter_file.provided') %></p>
<p><%= I18n.t('assignments.starter_file.changed_at',
changed_date: I18n.l(@assignment.starter_file_updated_at)) %></p>
<p>
<%= button_to t(:download_the, item: t('assignments.starter_file.title')),
download_starter_file_course_assignment_groups_path(@current_course, @assignment),
method: 'get' %>
</p>
<% # Display the URL of this group's repository if applicable
if allowed_to?(:access_repo?, @grouping) %>
<p>
<%= button_to t('assignments.starter_file.populate_repo'),
populate_repo_with_starter_files_course_assignment_groups_path(
course_id: @assignment.course_id,
assignment_id: @assignment.id
),
{ method: :patch,
data: { confirm: t('assignments.starter_file.populate_repo_confirm'),
disable_with: t(:please_wait) } } %>
</p>
<% end %>
<% end %>
<% end %>
<% if !peer_review && (!@assignment.is_timed || !@grouping&.start_time.nil? || @grouping&.past_collection_date?) %>
<h3><%= Submission.model_name.human.pluralize %></h3>
<% if @grouping.nil? %>
Expand All @@ -146,19 +168,20 @@
</p>
<% end %>
<ul>
<li><%= link_to t('submissions.student.files_submitted', count: @num_submitted_files),
file_manager_course_assignment_submissions_path(course_id: @assignment.course_id,
assignment_id: @assignment.id)%>
</li>
<% if @num_submitted_files > 0 %>
<li>
<%= t('submissions.student.last_revision_date') %>
<%= l(@last_modified_date) %>
</li>
<% end %>
<li><%= t('submissions.student.files_submitted', count: @num_submitted_files) %></li>
</ul>

<h3><%= Assignment.human_attribute_name(:assignment_files) %></h3>
<% if @assignment.assignment_files.length == 0 %>
<p><%= t('assignments.no_required_files') %></p>
<% else %>
<% if @assignment.assignment_files.length > 0 %>
<h3><%= Assignment.human_attribute_name(:assignment_files) %></h3>
<ul>
<% @assignment.assignment_files.each do |assignment_file| %>
<li><%= assignment_file.filename %></li>
Expand All @@ -175,30 +198,4 @@
<% end %>
<% end %>
<% end %>
<% unless @assignment.starter_file_updated_at.nil? || @grouping.nil? %>
<% if allowed_to?(:download_starter_file?, @grouping) %>
<h3><%= I18n.t('assignments.starter_file.title') %></h3>
<p><%= I18n.t('assignments.starter_file.provided') %></p>
<p><%= I18n.t('assignments.starter_file.changed_at',
changed_date: I18n.l(@assignment.starter_file_updated_at)) %></p>
<p>
<%= button_to t(:download_the, item: t('assignments.starter_file.title')),
download_starter_file_course_assignment_groups_path(@current_course, @assignment),
method: 'get' %>
</p>
<% # Display the URL of this group's repository if applicable
if allowed_to?(:access_repo?, @grouping) %>
<p>
<%= button_to t('assignments.starter_file.populate_repo'),
populate_repo_with_starter_files_course_assignment_groups_path(
course_id: @assignment.course_id,
assignment_id: @assignment.id
),
{ method: :patch,
data: { confirm: t('assignments.starter_file.populate_repo_confirm'),
disable_with: t(:please_wait) } } %>
</p>
<% end %>
<% end %>
<% end %>
</div>
6 changes: 5 additions & 1 deletion app/views/assignments/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
<% end %>
<% end %>

<% content_for :title, "#{Assignment.model_name.human} #{@assignment.short_identifier}" %>
<% short_identifier = @assignment.is_peer_review? ?
"#{@assignment.parent_assignment.short_identifier} #{PeerReview.model_name.human}" :
@assignment.short_identifier %>

<% content_for :title, "#{short_identifier}: #{@assignment.description}" %>

<div class='pane-wrapper'>
<div class='pane block'>
Expand Down
5 changes: 3 additions & 2 deletions config/locales/views/assignments/en.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
en:
assignments:
annotation_summary: Annotation Summary
assignment_has_groupings: Assignment has groupings.
assignment_information: Assignment information
average_annotations: "%{average_annotations} annotations per marked submission"
configuration_zip_file: Configuration Zip File
deadline_with_extension: You have an extension until %{extension_deadline}.
Expand Down Expand Up @@ -31,7 +33,6 @@ en:
hidden: "%{assignment_text} (hidden)"
manage_course_work: Manage Course Work
marking_scheme: 'Marking Scheme: %{identifier}'
no_required_files: There are no required files for this assignment.
none: There are currently no assignments.
scanned_exam:
under_review: This exam is still under review.
Expand Down Expand Up @@ -64,7 +65,7 @@ en:
populate_repo_confirm: Are you sure you want to add the starter files to your repository? If they already exist in the repository, any changes will be overwritten.
populate_repo_error: Unfortunately, the starter files could not be added to your repository. Please download them as a zip file instead.
populate_repo_success: Starter files successfully added to your repository.
provided: Starter files have been provided for this assignment
provided: Starter files have been provided for this assignment.
rename: Rename Selected File or Directory
starter_file_rule: Starter File Assignment Rules
starter_file_rule_types:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/views/groups/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ en:
not_allowed_to_delete_group: If you would like to remove this group, you must contact your instructor.
not_allowed_to_form_group: You are not allowed to form a group yourself. Please wait until your instructor forms your group.
section_groups_only: You can only form a group with students in your section.
students_work_alone: Students work individually.
students_work_alone: You must complete this assignment individually.
url_repository: Repository URL
work_alone: Work alone
working_alone: You have indicated you are working individually on this assignment. If you change your mind and want to create or join a group, first delete your group using the button below.
Expand Down
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
end
end
resources :assignments, except: [:new, :edit] do
member do
get 'average_annotations'
end
resources :groups, except: [:new, :edit, :destroy] do
collection do
get 'annotations'
Expand Down
2 changes: 2 additions & 0 deletions spec/controllers/assignments_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,7 @@
it 'should contain the right keys' do
keys = response.parsed_body['summary'].keys
expect(keys).to contain_exactly('name',
'average_annotations',
'average',
'median',
'max_mark',
Expand All @@ -1325,6 +1326,7 @@
summary = response.parsed_body['summary']
assignment_remark_requests = assignment.groupings.joins(current_submission_used: :submitted_remark)
expected = { name: "#{assignment.short_identifier}: #{assignment.description}",
average_annotations: assignment.average_annotations,
average: assignment.results_average(points: true) || 0,
median: assignment.results_median(points: true) || 0,
max_mark: assignment.max_mark || 0,
Expand Down