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

Moving multiple instances of assessments into their own subpage #2185

Closed
wants to merge 21 commits into from

Conversation

astrosticks
Copy link
Member

@astrosticks astrosticks commented Mar 20, 2020

Fixes #2086 by moving links to instances of assessments that allow multiple instances into a student view that was previously only used to generate a new instance. @nikitaa4 and I worked on this at HackIllinois 2020. Screenshots showing the changes are below:

pages/studentAssessments

Previously Now*
pl_instancesCondensed_before_assessments pl_instancesCondensed_after_assessments

*Currently shows the maximum of all of the score percentages, but Dave's wording in #2068 seems to imply that this might not always be the final score that the student receives.

pages/studentAssessmentExam

Previously Now*
pl_instancesCondensed_before_instances pl_instancesCondensed_after_instances

*May want to switch order so that the most recent attempt is at the top of the list? This would keep the most relevant information near the top of the page.

Still to-do (based on conversation from Jun 18):

nicknytko
nicknytko previously approved these changes Mar 30, 2020
Copy link
Collaborator

@nicknytko nicknytko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay, I will defer review of the SQL stuff to @mwest1066 since I'm not sure what he's wanting in terms of code style here.

@astrosticks astrosticks added this to In progress in Student dev May 5, 2020
@astrosticks astrosticks added enhancement A desired new feature or change (not a bug) high impact Impacts many people, would have high value if fixed review wanted This PR needs a code review labels May 5, 2020
@astrosticks astrosticks linked an issue May 12, 2020 that may be closed by this pull request
@mfsilva22
Copy link
Contributor

This looks great and will be very helpful to students.
I like the order as it is. At least I think of order of assessments going from old to new.
I am not sure about how the point system works. I would think displaying the max score seems the right way to go.

@astrosticks astrosticks added under development This PR is under development and shouldn’t be merged yet and removed review wanted This PR needs a code review labels Jun 24, 2020
@astrosticks astrosticks marked this pull request as draft June 24, 2020 05:17
@astrosticks astrosticks removed the under development This PR is under development and shouldn’t be merged yet label Jun 25, 2020
@astrosticks astrosticks marked this pull request as ready for review June 25, 2020 18:08
@astrosticks astrosticks marked this pull request as draft June 25, 2020 18:12
@astrosticks astrosticks marked this pull request as ready for review June 29, 2020 16:34
@astrosticks astrosticks marked this pull request as draft June 29, 2020 16:41
@astrosticks astrosticks marked this pull request as ready for review July 7, 2020 22:11
@mwest1066 mwest1066 self-assigned this Jul 9, 2020
JOIN assessment_sets AS aset ON (aset.id = a.assessment_set_id)
LEFT JOIN LATERAL authz_assessment(a.id, $authz_data, $req_date, ci.display_timezone) AS aa ON TRUE
WHERE
ci.id = $course_instance_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets all assessments, but we know that we only want the one with a.id = $assessment_id

AND a.multiple_instance
AND a.deleted_at IS NULL
),

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code style: no blank lines within queries

ai.assessment_id = $assessment_id
AND ai.user_id = $user_id
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no blank line

WHEN assessment_instance_id IS NULL THEN '/assessment/' || assessment_id || '/'
ELSE '/assessment_instance/' || assessment_instance_id || '/'
END AS link,
(lag(assessment_set_id) OVER (PARTITION BY assessment_set_id ORDER BY assessment_order_by, assessment_id, assessment_instance_number NULLS FIRST) IS NULL) AS start_new_set
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be needed? It looks to me like you copied this code from somewhere else and didn't entirely clean it up? Perhaps it's worth going back over this query and thinking about whether any parts of it could be simpler.

WHERE
authorized
ORDER BY
assessment_set_number, assessment_order_by, assessment_id, assessment_instance_number NULLS FIRST;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these seem unnecessary (e.g., won't all the rows have the same assessment_set_number?

if (res.locals.assessment.type !== 'Exam') return next();

var params = {
course_instance_id: res.locals.course_instance.id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

SELECT
*,
CASE
WHEN assessment_instance_id IS NULL THEN '/assessment/' || assessment_id || '/'
WHEN (multiple_instance = true OR assessment_instance_count = 0 ) THEN '/assessment/' || assessment_id || '/'
ELSE '/assessment_instance/' || assessment_instance_id || '/'
END AS link,
(lag(assessment_set_id) OVER (PARTITION BY assessment_set_id ORDER BY assessment_order_by, assessment_id, assessment_instance_number NULLS FIRST) IS NULL) AS start_new_set
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this?

@@ -1,118 +1,56 @@
-- BLOCK select_assessments
WITH
multiple_instance_assessments AS (
assessments_ AS (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need a WITH here? Can you collapse everything down into a single SELECT?

@mwest1066
Copy link
Member

Can you add a skeleton news item to this PR? With some hires screenshots of before and after? I'll write the text of the news item, but having some images and an outline of the main points would be very helpful.

@mwest1066 mwest1066 added this to In progress in Fall 2020 Development via automation Sep 2, 2020
@mwest1066 mwest1066 removed the high impact Impacts many people, would have high value if fixed label Sep 4, 2020
@mwest1066 mwest1066 moved this from In progress to PRs needing review in Fall 2020 Development Sep 4, 2020
@mwest1066 mwest1066 removed the request for review from nicknytko September 17, 2020 13:13
@jonatanschroeder jonatanschroeder added this to In progress in Winter Break 2020 via automation Dec 14, 2020
@mwest1066 mwest1066 moved this from In progress to Review in progress in Winter Break 2020 Dec 19, 2020
@mwest1066 mwest1066 moved this from Review in progress to Needs review in Winter Break 2020 Dec 24, 2020
@nwalters512 nwalters512 dismissed nicknytko’s stale review October 21, 2022 18:46

This PR is outdated; dismissing review to clean up the "approved PRs" view

@nwalters512
Copy link
Contributor

Discussed with the dev team: while we still like the concept, this has drifted sufficiently far from master that we think it'd be easiest to reimplement this from scratch when we're ready for this.

Copy link
Contributor

CLA Assistant Lite bot: Thanks for your contribution! Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by posting a comment with the below format:


I have reviewed and hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (astrosticks)[https://github.com/astrosticks]
@nikitaa4
You can retrigger this bot by commenting recheck in this Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A desired new feature or change (not a bug)
Projects
No open projects
Fall 2020 Development
  
PRs needing review
Student dev
  
In progress
Winter Break 2020
  
Needs review
6 participants