Open taniwallach opened 4 years ago
create a method for a PG problem to be aware it is in GW vs homework usage mode [Edward Sternin]
I have a hack for this. Not that I want to promote hacks, but until the feature is built, it has worked for me. You can look at the environment variables and see if the GW suffix is defined. As in if($envir{QUIZ_PREFIX}) {do stuff};
.
As a reminder to myself and others: Tom (?) from Rederly mentioned using some sort of timer on changes to input boxes to trigger their auto-save of answers.
Actually the more relevant approach would be to determine whether the hints are enabled or not. One of the differences between using the same problem in homework and in a gateway/quiz is to enable/disable hints, so displaying all text that is referring to hints ("You can get a hint if you do not get the answer in three tries" or similar) should be conditional on whether hints are enabled. And, this will take care of those cases where hints are actually allowed during GW as well.
But I am not clear: is there such an envir variable already, or is this a "hack" in the sense that you need to add the variable somewhere yourself? Surely, the renderer knows whether hints are enabled or not, but how?
Regarding the hints issue.
WW has a cascading sequence of config files: defaults.conf, site.conf, localOverrides.conf, course.conf, simple.conf. (I may have the first two out of order). What is missing (imho) is a configuration for a problem set. It would come last in the load sequence. With hints (as well as MathQuill and other things) they could be turned on/off for a problem set. GW could be built to show hints in general, but turn it on/off depending on the configuration. I imagine all these configuration settings being stored in the database (and in set...def files), not actually in a .conf file. I might even advocate to take it so far as having config options per question (in the context of a problem set, not the code for the problem).
The leg work for this would be in building the interface for the instructor to configure a problem set.
@esternin My opinion is that it's a mistake to code any meta-information about hints into a problem in the first place. I mean, yes, code the hint itself. But don't refer to it in problem text. If hints are enabled and a hint exists for the problem, the system should just always automatically tell students that a hint is available in some reasonable, accessible way. I also advocate against setting a value for $showHints
in problem code, since it is an instructor choice that depends on the context of how the problem is being used. But this again brings me back to wanting/needing problem set level configuration options.
@Alex-Jordan Possibly it is a mistake to "code any meta-information about hints into a problem", but this has been the default way of coding here for a long time. And just to make it clear, I want to read, not set the $showHints
value, as in if if($showHints) {do stuff};
@esternin Yes, I do understand all that. I feel that a big part of our problems in this area are legacy design issues and I'd love to see us tear those out by the roots instead of patching things at the surface level. But I know it will take a lot more work.
@taniwallach: Nathan, do you know of a way to know whether hints are enabled from inside the pg, or is this definitely a new feature request?
@taniwallach: Nathan, do you know of a way to know whether hints are enabled from inside the pg, or is this definitely a new feature request?
@esternin I took the bait and took a look. From what I think I understood, I don't think one can currently determine whether hints are enabled from inside a problem (from PG code). From what I seem to understand from looking at code in pg and webwork2, the webwork2 layer only passes to PG a setting called displayHintsQ
(whether the hints should be shown or not) but none of the "reasons" why it was set.
showHints
is a value set to control whether PG should provide the option to display hints.displayHintsQ
in the envir
to tell PG to display hints. This setting is handled in pg/macros/PGbasicmacros.pl
which is expected to be 1 when a hint it to be displayed. There is a check also that a sufficient number of attempts were made.hide_hint
setting from the set
table (can be overridden in the set_user
table). That seems to only be used for "homeworks" and not for Gateway quizzes.lib/WeBWorK/ContentGenerator/Problem.pm
uses that in sub can_showHints
, but does not make the setting directly available to PG.lib/WeBWorK/ContentGenerator/GatewayQuiz.pm
does not seem to have a dependence of the value of hide_hint
.showHints
setting is passed to PG depends on the can
, want
and must
values which are used to set a will
value. That code is pretty similar in lib/WeBWorK/ContentGenerator/GatewayQuiz.pm
and lib/WeBWorK/ContentGenerator/Problem.pm
.displayHintsQ
is set in by the defineProblemEnvir
routine of lib/WeBWorK/PG.pm
from the value of $translationOptions->{showHints}
and the value of numOfAttempts
is passed to the PG side of things also in the same manner.$showHints
variable in PG
has a totally different meaning, related to the attempts before hints are shown, and there is also a "flag" called showHints
for MathObjects.While we're at it:
Ability for instructors to subscribe to email notifications when a student submits a test. Preferably this should be per-test, ie, each test has its own set of instructors who receive notifications
Ability to show the correct answers in gateway quiz results, while the quiz is still open. So a student can complete the test, see their results and correct answers, then re-attempt the quiz. This is helpful for practice tests.
Prompt user for confirmation when they click Grade test. With a message reminding them that they can only submit the test once (or n times, according to test setting).
An option to require a password to start a test, but no password to submit the test.
When a test is set to allow one attempt per time interval, and the time interval is set to infinity, and the student tries to re-attempt the test, they get the message: The selected problem set (SETNAME) is not a valid set for USER: You have already taken all available versions of this test in the current time interval. You may take the test again after the time interval has expired. This message isn't helpful. It should say something like: You have already taken the test 1 time(s), which is the maximum allowable number of attempts.
@awmorp: Note that your second suggestion is already implemented (at least if I understand what you are suggesting). In the gateway quiz settings select "Yes" for both "Show Scores on Finished Assignments?" and "Show Problems on Finished Tests".
@awmorp: Note that your second suggestion is already implemented (at least if I understand what you are suggesting). In the gateway quiz settings select "Yes" for both "Show Scores on Finished Assignments?" and "Show Problems on Finished Tests".
So it is, thank you!
@esternin I took the bait and took a look. From what I think I understood, I don't think one can currently determine whether hints are enabled from inside a problem (from PG code). From what I seem to understand from looking at code in pg and webwork2, the webwork2 layer only passes to PG a setting called
displayHintsQ
(whether the hints should be shown or not) but none of the "reasons" why it was set. ...
displayHintsQ
is set in by thedefineProblemEnvir
routine oflib/WeBWorK/PG.pm
from the value of$translationOptions->{showHints}
and the value ofnumOfAttempts
is passed to the PG side of things also in the same manner.- Warning: The
$showHints
variable inPG
has a totally different meaning, related to the attempts before hints are shown, and there is also a "flag" calledshowHints
for MathObjects.
It took me a while to digest this, @taniwallach. Thanks very much for trying, and I think your conclusion is: one cannot.
The reason I want it is to make certain text conditional. If hints are disabled, do not show this: "If you do not answer this question correctly in $showHint attempts, you can get a hint".
$translationOptions->{showHints}
returns nothing. I also tried $showHints
, but I think you just misspelled $showHint
.
However, $displayHintsQ
returns 0 on the same problem, if it is a part of a gateway quiz where hints are disabled, and 1 if it is in the homework where hints are enabled. The library browser also sets it to 0, so you do not see the text in the list of rendered problems in the preview, but behaves differently when you "Try it", depending on what is the target set defined in the top entry field of the Library browser.
if ($displayHintsQ == 1) {
$hintString = "<b>If you do not answer this question correctly in $showHint attempts, you can get a hint.</b>";
}
Context() -> texStrings;
BEGIN_TEXT
$hintString
$PAR
...
Is this a valid solution or a fluke?
Specifically, the Manual Grader page does not appear to be available when an essay problem is used within a Gateway Quiz. Originally brought up in a forum
Farming out rendering to back-end standalone renderers to allow better "front end" scale to allow more students to make requests in parallel to a WW server. If rendering was handled by a "render cluster" (of containers) whose size could either be manually or automatically scaled - it is likely that a "regular" webwork server could support larger quizes. This is probably a major redesign task - but would hopefully provide for far better capabilities of the WW system to support load-spikes from quizzes and exams.
See discussion at: https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4961
I'm copying my reply from that thread below:
Given that problems are typically customized per student with random parameters - and that the "seed" range is pretty large, I suspect pre-computing and storing cached "rendered" problems would be both CPU and storage intensive, and it would not help once answers are being submitted. I suspect that load peaks occur both at the start of a quiz (many students opening the quiz in a short time period) and at the end (many submissions very close to to the deadline).
I think that the issue is the current "single build in" PG renderer per Apache process, as rendering each PG file takes time, and causes the memory ballooning issue which the current generation of the WW server software experiences.
I think that the goal should be to improve WW so that it can easily provide more or less "power" without requiring provisioning a fixed large amount of resources based on expected peak loads. Anyone running in the cloud or with access to a Kubernetes cluster or the like would hopefully be able to then provision for "typical" demand as a standard, but either schedule or "auto-scale" for higher demand when necessary.
I think that the best long-term direction will be to separate the "PG renderer" out of the Apache process, using the new "standalone render" or something similar. Hopefully that will allow somewhat parallel processing of multi-problem rendering requests - or at least provide a means to better control the memory issues which probably is the bigger problem than the CPU resource issue. (Less memory ballooning would allow more Apache processes to run, so many more students could be served in parallel.)
This is something which is not likely to be ready for WW 2.16, but could be a major goal for development in the near future.
From a discussion in the forums:
Ideas from Larry Riddle, @esternin, @dlglin
There's some discussion on this here . Might be easier to implement for a gateway quiz than a homework set?
From https://webwork.maa.org/moodle/mod/forum/discuss.php?d=5571 (Jaimos Skriletz)
I have been working with WeBWorK Gateway Quizzes (as have many due to remote teaching), and think they could use some improvement to make it clear when students start a quiz by clicking on the assignment name. I think that just clicking on the quiz name and having a new version created is a bit unintuitive (I have had students for a timed quiz on their own time click and start the timed version before they were ready). I have also had to use question 1 to be a set of quiz information/rules for students since I can't display a quiz header. I think it would be beneficial to have GatewayQuizzes (both normal and proctored) have a launch/info page that provides info about the quiz, including the setHeader that could be used to provide information/instructions about the quiz. My basic thought is when a quiz is clicked on a page comes up that contains the following information: • Quiz name. • setHeader under the quiz name in the main body of the page (this could be used for quiz instructions/information/etc). • Course Information to the right (currently the LoginProctor shows site_info and think course info is more appropriate). • A list of the quiz conditions, such as time limit (if timed), due date, open date (if it isn't opened), how often new versions can be taken and so on. • A list of current versions (if any) that have been taken, so students could just go back to a current version instead of starting a new version (if it is opened), or see grades/scores (This would be basically like the list of versions from the homework sets page). • A start new version button (if they are able to start a new version -- also maybe a comment that this starts a new version, to continue a previous version click the appropriate version above). • Login/Proctor information for a proctored quiz, similar to LoginProctor for proctored quizzes. I have looked at LoginProctor.pm as maybe a starting point to see if I could help, but quickly found myself over my head. Anyways, I think I've seen mention of such a thing elsewhere, but can't seem to find it, and though I would add my thoughts here. It would be nice to have something like this in 2.16, but I doubt there is time for that, but it would be something I would like to use on my server to provide more information about quizzes, and make it clearer about when students open/start a new version. I think this may also help deal with students accidentally starting another version if they get confused which link to click on the the homework list page.
As an aside, it would also be nice to have an easier way to edit specific version information for a student (this can be done but it is a bit hard to get to the specific version compared to just the quiz), and delete versions (that get accidentally created).
Another feature request for gateway quizzes:
In Webwork 2.16, there is nothing to stop a student accidentally closing or navigating away from an active gateway quiz, which can result in data loss. A simple way to address this would be to use a javascript onbeforeunload event handler to trigger a warning alert before closing/reloading/navigating away from the page.
However, the event handler would need some logic to detect when the student clicked Grade Test or navigated between test pages, which should not trigger a warning.
I want to follow on to @esternin 's post above, working towards text that appears conditionally on whether hints are shown. My experience teaching with Webwork has led me to believe that I should tell students that there's a hint; a hint magically showing up after a number of attempts without telling them that it will leads to students entering garbage N times until they give up or a hint appears. So I just tell them that I'm giving them a hint. But, once the hint shows up, they no longer need the text telling them a hint will appears after N attempts. So, here's what I've arrived at:
# I put this in a macro file, included via pgCourse.pl
sub theresahint {
my $hintafter = $showHint+1;
my $hintReminder = '';
if ($numOfAttempts<$hintafter && $displayHintsQ == 1){
$hintReminder = '(This problem has a hint that shows after ' . $hintafter . ' attempts.)';}
$hintReminder;
};
And then I include this in the problem text via
\{ theresahint \}
or if in PGML, I use
[@ theresahint @]*
Depending on how an instructor views the problem, it appears differently. But it appears to work correctly for students, so I'm going with it.
@ofloveandhate: Your code will cease to work with WeBWorK/PG 2.18. The $showHint
variable will no longer be defined, and won't do anything. If and when hints are shown will be controlled by a webwork2 setting and will be configurable per problem by the instructor.
Also, your post is off topic for this conversation about gateway quizzes. Hints are never shown in gateway quizzes. They aren't even implemented for gateway quizzes. So you should open a separate issue for this.
@drgrice1 Thanks for the followup, good to know that $showHint
will be removed in 2.18. Would you please add this to the 2.18 release notes?
One suggestion mentioned here is about the set header in a test (aka quiz). In 2.18, when I first go to a quiz and see the "Start New Test" button, I see the set header in the usual place off to the right in a panel.
Do we currently have a way to show the set header on all pages while actually doing the quiz? If not, are we open to that? I'm not sure how people use set headers on tests, but I would typically want to put some kind of instructions or reference information that I'd want students to have constant access to. Locally, people are putting that kind of stuff in "question 1" instead. But for that use case it would be nice either have it off to the right on a wide screen, or maybe up at the top. And I guess up a the top on small screen.
[initially collected from participant comments during the "Lessons From the Major Online Systems" session at https://rederly.com/finals-conference.]