Skip to content

Rework flags handling for essay type answers#1884

Merged
pstaabp merged 3 commits intoopenwebwork:developfrom
drgrice1:essay-flags-rework
Mar 30, 2023
Merged

Rework flags handling for essay type answers#1884
pstaabp merged 3 commits intoopenwebwork:developfrom
drgrice1:essay-flags-rework

Conversation

@drgrice1
Copy link
Copy Markdown
Member

@drgrice1 drgrice1 commented Feb 4, 2023

This rework caused a chain reaction that led to other related changes. Here is the summary of these changes.

Instead of saving global problem flags in the form "essay," and user problem flags in the form "graded," or "needs_grading," which gives no real information about what answers the problem has, save the type for all answers. This is saved as a comma separated list to the user problem. If an answer does not have a type just save it as the empty string. If there are essay type answers in the problem, then ":needs_grading" is appended to the end of the comma separated list of answer types. That is removed after the essay answers in the problem are graded. Nothing is stored in the global problem flags column. The reason that it is all saved in the user problem is that different students can have different answer types in certain cases (usually for a gateway test with problems drawing from a grouping set).

In addition, the only use of the global flag previously was to determine if a problem is gradable. Now, all problems are gradable. The "Grade Problem" link appears for all problems on the problem set list page for non-gateway assignments. The grader link also appears for all problems on the problem set detail page (with the render problem, edit problem, and open in new window buttons), and again on the stats page for the set.

The past answers table has been revised so that for courses created with this in effect no problems are rendered. The flag is used to get answer types instead, and correctly display them for all users. There is a compatibility layer that basically does the same thing as before if that flag has a value that appears to be in the old format (they all ended with a comma, the new format never does). The old method is improved however. As long as students all have the same answer types the problems will still be rendered correctly. Also, gateway problems that draw from a grouping set will work as long as the problems in the grouping set have essay answers in the same answer order. Note grouping set problems did not work at all previously. Answers were displayed but essay answers were not displayed correctly.

The biggest change in this pull request is a complete rework of the old manual problem grader. That now works for all types of sets including gateway tests. In that case the problems from all versions are shown.

The page now correctly renders problems (not just showing the problem text). The problem that renders initially is the problem for the first student in the list. The problem for any student can be rendered instead by choosing that student from a select field.

You can still click on a students name to open a particular student's problem in a new window. In addition, for gateway tests the problem is opened in the actual test version for that student and on the correct page of the test. This technique was also used to make this work on the set detail editor page when editing a set version for a student as well. This was requested previously (by @Alex-Jordan I believe). Furthermore, on the manual grader page, when a set is opened in a new window the single problem grader is already active and answers, solutions, and hints shown.

The rpc javascript rendering method is separated into a new file. That is used by the problem grader, stats problem page, the library browser, and the problem set detail page. The PG problem editor has its own code for now as it does some additional handling that doesn't fit into that code. Note that there were some id/name elements that needed to be made uniform across various pages for this to work (which led to minor modifications to the tag widget code).

There are a few changes to the stats page.

For problem rendering the missing language and display mode elements that were looked for in the javascript were added. Also, instead of having a show/hide button for the problem, just render it when the page loads. If the display mode is changed with the new select button, then the problem is re-rendered.

The siblings when viewing problem statistics was incorrect. If viewing statistics for a problem the siblings should be the other problems in the set. Not all of the sets. So that is fixed.

@drgrice1 drgrice1 mentioned this pull request Feb 6, 2023
@drgrice1 drgrice1 force-pushed the essay-flags-rework branch 3 times, most recently from ebfa2d2 to 95a7fed Compare February 10, 2023 22:16
drgrice1 added a commit to drgrice1/webwork2 that referenced this pull request Feb 10, 2023
…ameter.

This causes an error when clicking on "Advanced Search" in the library
browser.

This fix is in openwebwork#1884, but is unrelated to that pull request.  So I will
add this separately.
@drdrew42
Copy link
Copy Markdown
Member

Just running through this quickly, things look good -- though I don't have a good sample set for testing a gateway with grouped problems.

Other than that, the manual grader is working as described, as is the statistics page and both forms of set details.

My only suggestion for possible improvement is to include the other problems in the set as siblings for the sidebar when working in the manual problem grader... as is, there isn't a convenient way to navigate between problems

@drgrice1
Copy link
Copy Markdown
Member Author

I have added other problems as siblings to the manual problem grader.

Copy link
Copy Markdown
Member

@drdrew42 drdrew42 left a comment

Choose a reason for hiding this comment

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

Looks great!

@pstaabp
Copy link
Copy Markdown
Member

pstaabp commented Mar 25, 2023

Starting to dive into this. On first glance, in the problem grader, I'm seeing:
image

where the rightmost button is a little larger. Was this intentional? It looks like the previous two buttons have the mb-1 class added and this doesn't.

@pstaabp
Copy link
Copy Markdown
Member

pstaabp commented Mar 25, 2023

The above isn't in the problem grader. It's in the viewing a problem as a student. And it looks like it might be in develop as well.

Copy link
Copy Markdown
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

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

I honestly haven't used essay problems much in classes, so am not very familiar with the previous version. What I see looks good.

@drgrice1 drgrice1 force-pushed the essay-flags-rework branch from 5e564ab to 44e9c63 Compare March 25, 2023 16:54
@drgrice1
Copy link
Copy Markdown
Member Author

I added the margin to that submit button @pstaabp.

@drgrice1 drgrice1 force-pushed the essay-flags-rework branch from 44e9c63 to 91a5318 Compare March 28, 2023 21:22
This rework caused a chain reaction that led to other related changes.
Here is the summary of these changes.

Instead of saving global problem flags in the form "essay," and user
problem flags in the form "graded," or "needs_grading," which gives no
real information about what answers the problem has, save the type for
all answers.  This is saved as a comma separated list to the user
problem.  If an answer does not have a type just save it as the empty
string.  If there are essay type answers in the problem, then
":needs_grading" is appended to the end of the comma separated list of
answer types.  That is removed after the essay answers in the problem
are graded.  Nothing is stored in the global problem flags column.
The reason that it is all saved in the user problem is that different
students can have different answer types in certain cases (usually for a
gateway test with problems drawing from a grouping set).

In addition, the only use of the global flag previously was to determine
if a problem is gradable.  Now, all problems are gradable.  The "Grade
Problem" link appears for all problems on the problem set list page for
non-gateway assignments.  The grader link also appears for all problems
on the problem set detail page (with the render problem, edit problem,
and open in new window buttons), and again on the stats page for the
set.

The past answers table has been revised so that for courses created with
this in effect no problems are rendered.  The flag is used to get answer
types instead, and correctly display them for all users.  There is a
compatibility layer that basically does the same thing as before if that
flag has a value that appears to be in the old format (they all ended
with a comma, the new format never does).  The old method is improved
however.  As long as students all have the same answer types the
problems will still be rendered correctly.  Also, gateway problems that
draw from a grouping set will work as long as the problems in the
grouping set have essay answers in the same answer order.  Note grouping
set problems did not work at all previously.  Answers were displayed but
essay answers were not displayed correctly.

The biggest change in this pull request is a complete rework of the old
manual problem grader.  That now works for all types of sets including
gateway tests.  In that case the problems from all versions are shown.

The page now correctly renders problems (not just showing the problem
text).  The problem that renders initially is the problem for the first
student in the list.  The problem for any student can be rendered
instead by choosing that student from a select field.

You can still click on a students name to open a particular student's
problem in a new window.  In addition, for gateway tests the problem is
opened in the actual test version for that student and on the correct
page of the test.  This technique was also used to make this work on the
set detail editor page when editing a set version for a student as well.
This was requested previously (by @Alex-Jordan I believe).  Furthermore,
on the manual grader page, when a set is opened in a new window the
single problem grader is already active and answers, solutions, and
hints shown.

The rpc javascript rendering method is separated into a new file.  That
is used by the problem grader, stats problem page, the library
browser, and the problem set detail page.  The PG problem editor has its
own code for now as it does some additional handling that doesn't fit
into that code.  Note that there were some id/name elements that needed
to be made uniform across various pages for this to work (which led to
minor modifications to the tag widget code).

There are a few changes to the stats page.

For problem rendering the missing language and display mode elements
that were looked for in the javascript were added.  Also, instead of
having a show/hide button for the problem, just render it when the page
loads.  If the display mode is changed with the new select button, then
the problem is re-rendered.

The siblings when viewing problem statistics was incorrect.  If viewing
statistics for a problem the siblings should be the other problems in
the set.  Not all of the sets.  So that is fixed.
@drgrice1 drgrice1 force-pushed the essay-flags-rework branch from 91a5318 to bdbd236 Compare March 30, 2023 10:42
@pstaabp pstaabp merged commit 10df84c into openwebwork:develop Mar 30, 2023
@drgrice1 drgrice1 deleted the essay-flags-rework branch March 30, 2023 18:06
drgrice1 added a commit to drgrice1/webwork2 that referenced this pull request Feb 14, 2025
…em" link is shown.

I removed the `canScoreProblems` flag in openwebwork#1884, but forgot to remove
the instance that is used for the header of the table.  As such the
header row ends up having one less column than the entries of the table
for those that have permission to use the problem graders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants