Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New/feedback enhancement #450

Open
wants to merge 24 commits into
base: new/feedback-enhancement
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c74a676
feat: add stage for feedback enhangement additions
macite Dec 15, 2022
70a7ddb
quality: move stage into feedback folder and load
macite Dec 16, 2022
17732bc
fix: ensure devise is setup for ldap auth
macite Aug 29, 2023
45ccc3c
chore(release): 7.0.20
macite Aug 29, 2023
640489d
feat: allow admin bind in ldap
macite Sep 4, 2023
ebb053b
chore(release): 7.0.21
macite Sep 4, 2023
a86d1b0
fix: change_task_comment_fail
maddernd Dec 1, 2023
d41110f
ci: ensure up quote included in latex env
macite Dec 1, 2023
6aacd04
Merge branch 'fix/fail_comments_change' of https://github.com/maddern…
macite Dec 1, 2023
12d7f93
Merge pull request #431 from maddernd/fix/fail_comments_change
macite Dec 1, 2023
69a822d
Merge branch '7.0.x' into development
macite Dec 1, 2023
8a714f1
Merge development into new/feedback-enhancement
coskun-kilinc Mar 16, 2024
9d76b0a
Merge pull request #14 from coskun-kilinc/new/feedback-enhancement
maddernd Mar 18, 2024
5ec86e8
feat: add stage model to feedback api
coskun-kilinc May 14, 2024
b9a5df2
fix: correct formatting violations in stage api
coskun-kilinc May 17, 2024
e440aef
feat: add stages table to schema.rb
coskun-kilinc May 22, 2024
67133e6
Merge branch 'thoth-tech:new/feedback-enhancement' into new/feedback-…
coskun-kilinc Jul 24, 2024
c17e8c7
feat: merge upstream into new/feedback-enhancement
coskun-kilinc Aug 5, 2024
f7b782d
feat: add feedback group model tests
coskun-kilinc Aug 5, 2024
0a020d0
feat: Remove unused code related to feedback comments and entities
coskun-kilinc Aug 13, 2024
e6f0394
feat: add feedback group and comment template factories and tests
coskun-kilinc Aug 13, 2024
29cbf9b
feat: add feedbackgroup and feedbackcommenttemplate models and tests
coskun-kilinc Aug 13, 2024
f8cd0d8
feat: update feedback feature api endpoints
coskun-kilinc Aug 15, 2024
a24bdc7
feat: remove stages/criterion and introduce feedback groups/templates
coskun-kilinc Aug 15, 2024
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: 1 addition & 1 deletion .ci-setup/texlive-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if ! command -v "$TEX_COMPILER" > /dev/null; then

echo "----------------------------------------"
echo "Installing additional texlive packages:"
tlmgr install fontawesome luatextra luacode minted fvextra catchfile xstring framed lastpage pdfmanagement-testphase newpax tcolorbox environ pdfcol tikzfill markdown paralist csvsimple gobble
tlmgr install fontawesome luatextra luacode minted fvextra catchfile xstring framed lastpage pdfmanagement-testphase newpax tcolorbox environ pdfcol tikzfill markdown paralist csvsimple gobble upquote

echo "----------------------------------------"
echo "Ensuring the newpax package is sufficiently up to date:"
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ rails_best_practices_output.html
spec/reports

config/initializers/pdfkit.rb
config/ldap.yml
student_work/
student-work/

Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [7.0.21](https://github.com/macite/doubtfire-deploy/compare/v7.0.20...v7.0.21) (2023-09-04)


### Features

* allow admin bind in ldap ([de66236](https://github.com/macite/doubtfire-deploy/commit/de662367d8cb3a291cc00424e25ccf1a6d6587ac))

### [7.0.20](https://github.com/macite/doubtfire-deploy/compare/v7.0.19...v7.0.20) (2023-08-29)


### Bug Fixes

* add processing for raw cells in ipynb ([ebacf38](https://github.com/macite/doubtfire-deploy/commit/ebacf3867aa09dbfad1a9eaa88953cbb418644f8))
* auto generate rake task ([3bd9107](https://github.com/macite/doubtfire-deploy/commit/3bd91079764ad153f299e2519e7ddbba9377fc8e))
* ensure devise is setup for ldap auth ([2561a05](https://github.com/macite/doubtfire-deploy/commit/2561a05649b0a3b34420fc2104b0c0b6be1a2fca))

### [7.0.19](https://github.com/macite/doubtfire-deploy/compare/v7.0.18...v7.0.19) (2023-06-20)


Expand Down
8 changes: 2 additions & 6 deletions app/api/api_root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ class ApiRoot < Grape::API
mount BreaksApi
mount DiscussionCommentApi
mount ExtensionCommentsApi
mount FeedbackApi::StageApi
mount FeedbackApi::FeedbackGroupApi
mount FeedbackApi::FeedbackCommentTemplateApi
mount FeedbackApi::CriterionApi
mount FeedbackApi::CriterionOptionApi
mount GroupSetsApi
mount LearningOutcomesApi
mount LearningAlignmentApi
Expand Down Expand Up @@ -105,10 +103,8 @@ class ApiRoot < Grape::API
AuthenticationHelpers.add_auth_to LearningAlignmentApi
AuthenticationHelpers.add_auth_to ProjectsApi
AuthenticationHelpers.add_auth_to StudentsApi
AuthenticationHelpers.add_auth_to FeedbackApi::StageApi
AuthenticationHelpers.add_auth_to FeedbackApi::FeedbackGroupApi
AuthenticationHelpers.add_auth_to FeedbackApi::FeedbackCommentTemplateApi
AuthenticationHelpers.add_auth_to FeedbackApi::CriterionApi
AuthenticationHelpers.add_auth_to FeedbackApi::CriterionOptionApi
AuthenticationHelpers.add_auth_to Submission::PortfolioApi
AuthenticationHelpers.add_auth_to Submission::PortfolioEvidenceApi
AuthenticationHelpers.add_auth_to Submission::BatchTaskApi
Expand Down
10 changes: 0 additions & 10 deletions app/api/entities/feedback_entities/criterion_entity.rb

This file was deleted.

11 changes: 0 additions & 11 deletions app/api/entities/feedback_entities/criterion_option_entity.rb

This file was deleted.

8 changes: 0 additions & 8 deletions app/api/entities/feedback_entities/feedback_comment_entity.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ module Entities
module FeedbackEntities
class FeedbackCommentTemplateEntity < Grape::Entity
expose :id
expose :comment_text_situation
expose :comment_text_next_action
expose :abbreviation
expose :order
expose :chip_text
expose :description
expose :comment_text
expose :summary_text
expose :task_status
end
end
end
7 changes: 7 additions & 0 deletions app/api/entities/stage_entity.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Entities
class StageEntity < Grape::Entity
expose :id
expose :title
expose :order
end
end
75 changes: 0 additions & 75 deletions app/api/feedback_api/criterion_api.rb

This file was deleted.

77 changes: 0 additions & 77 deletions app/api/feedback_api/criterion_option_api.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/api/feedback_api/feedback_comment_api.rb

This file was deleted.

56 changes: 39 additions & 17 deletions app/api/feedback_api/feedback_comment_template_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,63 @@ module FeedbackApi
class FeedbackCommentTemplateApi < Grape::API
desc 'Feedback comment templates are used to provide a list of comments that can be used to provide feedback on a task. This endpoint allows you to create a new feedback comment template.'
params do
requires :comment_text_situation, type: String, desc: 'What the comment is about. Could be what is wrong with or what is good about a student\'s submission.'
requires :comment_text_next_action, type: String, desc: 'What the student should do next to improve their submission'
optional :criterion_option_id, type: Integer, desc: 'The criterion option to which the comment template is associated'
requires :abbreviation, type: String, desc: 'A short abbreviation for the feedback comment template'
requires :order, type: Integer, desc: 'The order in which to display the comment templates'
requires :chip_text, type: String, desc: 'A short text displayed on the feedback UI'
requires :description, type: String, desc: 'A detailed description of the feedback comment template'
requires :comment_text, type: String, desc: 'The actual feedback comment text'
requires :summary_text, type: String, desc: 'A short summary of the feedback comment'
optional :task_status_id, type: Integer, desc: 'The task status associated with this feedback comment template'
requires :feedback_group_id, type: Integer, desc: 'The feedback group to which the comment template belongs'
end
post '/feedback_comment_templates' do # pathname of URL
criterion_option = CriterionOption.find(params[:criterion_option_id])
feedback_group = FeedbackGroup.find(params[:feedback_group_id])

unless authorise? current_user, criterion_option.unit, :update
unless authorise? current_user, feedback_group.unit, :update
error!({ error: 'Not authorised to create a feedback comment template for this unit' }, 403)
end

feedback_comment_template_parameters = ActionController::Parameters.new(params)
.permit(:comment_text_situation, :comment_text_next_action)

feedback_comment_template_parameters[:criterion_option] = criterion_option
.permit(:abbreviation, :order, :chip_text, :description, :comment_text, :summary_text, :task_status_id)
feedback_comment_template_parameters[:feedback_group] = feedback_group

# If the task_status_id is provided, find the task status and add it to
# the feedback_comment_template_parameters
if params[:task_status_id]
task_status = TaskStatus.find(params[:task_status_id])
feedback_comment_template_parameters[:task_status] = task_status
end

result = FeedbackCommentTemplate.create!(feedback_comment_template_parameters)

present result, with: Entities::FeedbackEntities::FeedbackCommentTemplateEntity
# presents JSON format of the newly posted FeedbackCommentTemplate object from the FeedbackCommentTemplateEntity
end

desc 'This endpoint allows you to get all the feedback comment templates for a given criterion_option.'
desc 'This endpoint allows you to get all the feedback comment templates for a given feedback_group.'
params do
requires :criterion_option_id, type: Integer, desc: 'The criterion option to which the comment template belongs'
requires :feedback_group_id, type: Integer, desc: 'The feedback group to which the comment template belongs'
end

get '/feedback_comment_templates' do
criterion_option = CriterionOption.find(params[:criterion_option_id])
feedback_group = FeedbackGroup.find(params[:feedback_group_id])

unless authorise? current_user, criterion_option.unit, :read
unless authorise? current_user, feedback_group.unit, :read
error!({ error: 'Not authorised to read feedback comment templates for this unit' }, 403)
end

present stage.feedback_comment_templates, with: Entities::FeedbackEntities::FeedbackCommentTemplateEntity
end

desc 'This endpoint allows you to update the comment text situation or comment text next action for a feedback comment template.'
desc 'This endpoint allows you to update a feedback comment template.'
params do
optional :comment_text_situation, type: String, desc: 'The new comment text situation for the feedback comment template'
optional :comment_text_next_action, type: String, desc: 'The new comment text next action for the feedback comment template'
optional :abbreviation, type: String, desc: 'The new abbreviation for the feedback comment template'
optional :order, type: Integer, desc: 'The new order value for the comment template'
optional :chip_text, type: String, desc: 'The new chip text for the feedback comment template'
optional :description, type: String, desc: 'The new description for the feedback comment template'
optional :comment_text, type: String, desc: 'The new comment text for the feedback comment template'
optional :summary_text, type: String, desc: 'The new summary text for the feedback comment template'
optional :task_status_id, type: Integer, desc: 'The new task status associated with this feedback comment template'
end
put '/feedback_comment_templates/:id' do
feedback_comment_template = FeedbackCommentTemplate.find(params[:id])
Expand All @@ -53,7 +70,12 @@ class FeedbackCommentTemplateApi < Grape::API
end

feedback_comment_template_parameters = ActionController::Parameters.new(params)
.permit(:comment_text_situation, :comment_text_next_action)
.permit(:abbreviation, :order, :chip_text, :description, :comment_text, :summary_text, :task_status_id)

if params[:task_status_id]
task_status = TaskStatus.find(params[:task_status_id])
feedback_comment_template_parameters[:task_status] = task_status
end

feedback_comment_template.update!(feedback_comment_template_parameters)

Expand All @@ -64,7 +86,7 @@ class FeedbackCommentTemplateApi < Grape::API
delete '/feedback_comment_templates/:id' do
feedback_comment_template = FeedbackCommentTemplate.find(params[:id])

unless authorise? current_user, feedback_comment_template.unit, :update
unless authorise? current_user, feedback_comment_template.feedback_group.unit, :update
error!({ error: 'Not authorised to delete feedback comment templates for this unit' }, 403)
end

Expand Down
Loading