Skip to content

Commit 99fbfab

Browse files
committed
Add an "accessibility time factor" to provide for extra time on timed tests.
This accesibility time factor is a user property and is set when editing a student on the "Accounts Manager" page. The time that a student will have to complete any timed test is the product of the "Test Time Limit" set for the test on the "Set Detail" page, and this accesibility time factor for the student taking the test. By default the accesibility time factor for each student is 1, but can be set to something like 1.5 to determine that a student is allowed time and a half to complete timed tests. The point of this is that it is a bit tedious to need to go through all timed tests and change the test time limit for all of the students that need to be given extra time for accesibility accomodations. With this you only need to set one number, and it is rather convenient to do so for all of the students in the class that need it from one page. Since this is a per user setting, this requires the addition of a new column to the user table in the database.
1 parent d3708c5 commit 99fbfab

File tree

8 files changed

+63
-43
lines changed

8 files changed

+63
-43
lines changed

lib/WeBWorK/ContentGenerator/GatewayQuiz.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ async sub pre_header_initialize ($c) {
502502
my $maxAttemptsPerVersion = $tmplSet->attempts_per_version || 0;
503503
my $timeInterval = $tmplSet->time_interval || 0;
504504
my $versionsPerInterval = $tmplSet->versions_per_interval || 0;
505-
my $timeLimit = $tmplSet->version_time_limit || 0;
506505

507506
# What happens if someone didn't set one of these? Perhaps this can happen if we're handed a malformed set, where
508507
# the values in the database are null.
@@ -588,7 +587,8 @@ async sub pre_header_initialize ($c) {
588587
$set = $db->getMergedSetVersion($effectiveUserID, $setID, $setVersionNumber);
589588
$set->visible(1);
590589

591-
# If there is a cap on problems per page, make sure that is respected in case something higher snuck in.
590+
# If there is a cap on problems per page, make sure that is respected
591+
# in case something higher snuck in.
592592
if (
593593
$ce->{test}{maxProblemsPerPage}
594594
&& ($tmplSet->problems_per_page == 0
@@ -603,6 +603,8 @@ async sub pre_header_initialize ($c) {
603603
# Convert the floating point value from Time::HiRes to an integer for use below. Truncate toward 0.
604604
my $timeNowInt = int($c->submitTime);
605605

606+
my $timeLimit = ($tmplSet->version_time_limit || 0) * $effectiveUser->accessibility_time_factor;
607+
606608
# Set up creation time, and open and due dates.
607609
my $ansOffset = $set->answer_date - $set->due_date;
608610
$set->version_creation_time($timeNowInt);
@@ -625,7 +627,7 @@ async sub pre_header_initialize ($c) {
625627
$cleanSet->due_date($set->due_date);
626628
$cleanSet->answer_date($set->answer_date);
627629
$cleanSet->version_last_attempt_time($set->version_last_attempt_time);
628-
$cleanSet->version_time_limit($set->version_time_limit);
630+
$cleanSet->version_time_limit($set->version_time_limit * $effectiveUser->accessibility_time_factor);
629631
$cleanSet->attempts_per_version($set->attempts_per_version);
630632
$cleanSet->assignment_type($set->assignment_type);
631633
$db->putSetVersion($cleanSet);

lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ use constant FIELD_PROPERTIES => {
281281
'This sets a number of minutes for each version of a test, once it is started. Use "0" to indicate no '
282282
. 'time limit. If there is a time limit, then there will be an indication that this is a timed '
283283
. 'test on the main "Assignments" page. Additionally the student will be sent to a confirmation '
284-
. 'page beefore they can begin.'
284+
. 'page before they can begin. Note that the actual time a student will have to complete a timed test '
285+
. 'is the product of this time limit and the accessibility time factor set for the student in the '
286+
. 'accounts manager.'
285287
)
286288
},
287289
time_limit_cap => {

lib/WeBWorK/ContentGenerator/Instructor/UserList.pm

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,26 @@ use constant SORT_SUBS => {
9393
};
9494

9595
use constant FIELDS => [
96-
'user_id', 'first_name', 'last_name', 'email_address', 'student_id', 'status',
97-
'section', 'recitation', 'comment', 'permission', 'password'
96+
'user_id', 'first_name', 'last_name', 'email_address',
97+
'student_id', 'status', 'accessibility_time_factor', 'section',
98+
'recitation', 'comment', 'permission', 'password'
9899
];
99100

100101
# Note that only the editable fields need a type (i.e. all but user_id),
101102
# and only the text fields need a size.
102103
use constant FIELD_PROPERTIES => {
103-
user_id => { name => x('Login Name') },
104-
first_name => { name => x('First Name'), type => 'text', size => 10 },
105-
last_name => { name => x('Last Name'), type => 'text', size => 10 },
106-
email_address => { name => x('Email Address'), type => 'text', size => 20 },
107-
student_id => { name => x('Student ID'), type => 'text', size => 11 },
108-
status => { name => x('Enrollment Status'), type => 'status' },
109-
section => { name => x('Section'), type => 'text', size => 3 },
110-
recitation => { name => x('Recitation'), type => 'text', size => 3 },
111-
comment => { name => x('Comment'), type => 'text', size => 20 },
112-
permission => { name => x('Permission Level'), type => 'permission' },
113-
password => { name => x('Password'), type => 'password' },
104+
user_id => { name => x('Login Name') },
105+
first_name => { name => x('First Name'), type => 'text', size => 10 },
106+
last_name => { name => x('Last Name'), type => 'text', size => 10 },
107+
email_address => { name => x('Email Address'), type => 'text', size => 20 },
108+
student_id => { name => x('Student ID'), type => 'text', size => 11 },
109+
status => { name => x('Enrollment Status'), type => 'status' },
110+
accessibility_time_factor => { name => x('Accessibility Time Factor'), type => 'text', size => 5 },
111+
section => { name => x('Section'), type => 'text', size => 3 },
112+
recitation => { name => x('Recitation'), type => 'text', size => 3 },
113+
comment => { name => x('Comment'), type => 'text', size => 20 },
114+
permission => { name => x('Permission Level'), type => 'permission' },
115+
password => { name => x('Password'), type => 'password' },
114116
};
115117

116118
sub pre_header_initialize ($c) {

lib/WeBWorK/ContentGenerator/ProblemSet.pm

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,14 @@ sub gateway_body ($c) {
180180
my $ce = $c->ce;
181181
my $db = $c->db;
182182

183-
my $set = $c->{set};
184-
my $effectiveUser = $c->param('effectiveUser');
185-
my $user = $c->param('user');
183+
my $set = $c->{set};
184+
my $effectiveUserID = $c->param('effectiveUser');
185+
my $userID = $c->param('user');
186+
187+
my $effectiveUser = $db->getUser($effectiveUserID);
186188

187189
my $timeNow = time;
188-
my $timeLimit = $set->version_time_limit || 0;
190+
my $timeLimit = ($set->version_time_limit || 0) * $effectiveUser->accessibility_time_factor;
189191

190192
# Compute how many versions have been launched within timeInterval to determine if a new version can be created,
191193
# if a version can be continued, and the date a next version can be started. If there is an open version that
@@ -206,8 +208,9 @@ sub gateway_body ($c) {
206208
}
207209

208210
# Get a problem to determine how many submits have been made.
209-
my @ProblemNums = $db->listUserProblems($effectiveUser, $set->set_id);
210-
my $Problem = $db->getMergedProblemVersion($effectiveUser, $set->set_id, $verSet->version_id, $ProblemNums[0]);
211+
my @ProblemNums = $db->listUserProblems($effectiveUserID, $set->set_id);
212+
my $Problem =
213+
$db->getMergedProblemVersion($effectiveUserID, $set->set_id, $verSet->version_id, $ProblemNums[0]);
211214
my $verSubmits = defined $Problem ? $Problem->num_correct + $Problem->num_incorrect : 0;
212215
my $maxSubmits = $verSet->attempts_per_version || 0;
213216

@@ -292,11 +295,11 @@ sub gateway_body ($c) {
292295

293296
$data->{score} = '';
294297
# Only show score if user has permission and assignment has at least one submit.
295-
if ($authz->hasPermissions($user, 'view_hidden_work')
298+
if ($authz->hasPermissions($userID, 'view_hidden_work')
296299
|| ($verSet->hide_score eq 'N' && $verSubmits >= 1)
297300
|| ($verSet->hide_score eq 'BeforeAnswerDate' && $timeNow > $set->answer_date))
298301
{
299-
my ($total, $possible) = grade_set($db, $verSet, $effectiveUser, 1);
302+
my ($total, $possible) = grade_set($db, $verSet, $effectiveUserID, 1);
300303
$total = wwRound(2, $total);
301304
$data->{score} = "$total/$possible";
302305
}

lib/WeBWorK/DB/Record/User.pm

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@ use warnings;
1212

1313
BEGIN {
1414
__PACKAGE__->_fields(
15-
user_id => { type => "VARCHAR(100) NOT NULL", key => 1 },
16-
first_name => { type => "TEXT" },
17-
last_name => { type => "TEXT" },
18-
email_address => { type => "TEXT" },
19-
student_id => { type => "TEXT" },
20-
status => { type => "TEXT" },
21-
section => { type => "TEXT" },
22-
recitation => { type => "TEXT" },
23-
comment => { type => "TEXT" },
24-
displayMode => { type => "TEXT" },
25-
showOldAnswers => { type => "INT" },
26-
useMathView => { type => "INT" },
27-
useMathQuill => { type => "INT" },
28-
lis_source_did => { type => "TEXT" },
15+
user_id => { type => "VARCHAR(100) NOT NULL", key => 1 },
16+
first_name => { type => "TEXT" },
17+
last_name => { type => "TEXT" },
18+
email_address => { type => "TEXT" },
19+
student_id => { type => "TEXT" },
20+
status => { type => "TEXT" },
21+
accessibility_time_factor => { type => "FLOAT NOT NULL DEFAULT 1" },
22+
section => { type => "TEXT" },
23+
recitation => { type => "TEXT" },
24+
comment => { type => "TEXT" },
25+
displayMode => { type => "TEXT" },
26+
showOldAnswers => { type => "INT" },
27+
useMathView => { type => "INT" },
28+
useMathQuill => { type => "INT" },
29+
lis_source_did => { type => "TEXT" },
2930
);
3031
}
3132

templates/ContentGenerator/Instructor/UserList/user_list.html.ep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<%= include 'ContentGenerator/Instructor/UserList/sort_button', field => 'status' =%>
5353
</div>
5454
</th>
55+
<th><%= maketext('Accessibility Time Factor') %></th>
5556
<th>
5657
<div class="d-flex justify-content-between align-items-end gap-1">
5758
<%= link_to maketext('Section') => '#', class => 'sort-header',

templates/ContentGenerator/ProblemSet/version_list.html.ep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div class="alert alert-warning"><%= $c->{invalidSet} %></div>
1616
% } elsif ($continueVersion) {
1717
% # Display information about the current test and a continue open test button.
18-
% if ($timeLimit > 0) {
18+
% if ($continueVersion->version_time_limit > 0) {
1919
% if ($timeNow >= $continueVersion->due_date) {
2020
% # If the currently open test is in the grace period, display a mesage stating this.
2121
<div class="alert alert-danger">

templates/HelpFiles/InstructorUserList.html.ep

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
%
44
<p>
55
<%== maketext('From this page you can <strong>add new students</strong>, <strong>edit</strong> user data '
6-
. '(name, email address, recitation, section, permission level, enrollment status, and password), '
7-
. 'and <strong>export</strong> (save) class lists for back-up or use in another course. '
8-
. 'You can also delete students from the class roster, but this cannot be undone.') =%>
6+
. '(name, email address, student ID, enrollment status, accessibility time factor, section, recitation, '
7+
. 'comment, permission level, and password), and <strong>export</strong> (save) class lists for back-up or use '
8+
. 'in another course. You can also delete students from the class roster, but this cannot be undone.') =%>
99
</p>
1010
<p>
1111
<%= maketext('This page gives access to information about the student, independent of the assignments '
@@ -142,6 +142,15 @@
142142
. 'grade for each problem is listed as "status" on this third page).') =%>
143143
</dd>
144144

145+
<dt><%= maketext('Give one student or several students additional time for all timed tests.') %></dt>
146+
<dd>
147+
<%= maketext('Click on the "Select" checkbox next to the names of the students that additional time is to be '
148+
. 'assigned, click on the radio button for editing selected users and then click the "Edit" button .'
149+
. 'Set the "Accesibility Time Factor" to the desired multiplier for each student selected. The time '
150+
. 'that a student will have to complete a timed test will be the product of the "Test Time Limit" for the '
151+
. 'test set in the "Sets Manager" and the "Accessibility Time Factor" set here.') =%>
152+
</dd>
153+
145154
<dt><%= maketext('Extend the number of attempts allowed a student on a given problem.') %></dt>
146155
<dd>
147156
<%= maketext(q{Click first in the "Assigned Sets" column in the student's row. This will take you to a new }

0 commit comments

Comments
 (0)