Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 5 additions & 3 deletions lib/WeBWorK/ContentGenerator/GatewayQuiz.pm
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,6 @@ async sub pre_header_initialize ($c) {
my $maxAttemptsPerVersion = $tmplSet->attempts_per_version || 0;
my $timeInterval = $tmplSet->time_interval || 0;
my $versionsPerInterval = $tmplSet->versions_per_interval || 0;
my $timeLimit = $tmplSet->version_time_limit || 0;

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

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

my $timeLimit = ($tmplSet->version_time_limit || 0) * $effectiveUser->accessibility_time_factor;

# Set up creation time, and open and due dates.
my $ansOffset = $set->answer_date - $set->due_date;
$set->version_creation_time($timeNowInt);
Expand All @@ -625,7 +627,7 @@ async sub pre_header_initialize ($c) {
$cleanSet->due_date($set->due_date);
$cleanSet->answer_date($set->answer_date);
$cleanSet->version_last_attempt_time($set->version_last_attempt_time);
$cleanSet->version_time_limit($set->version_time_limit);
$cleanSet->version_time_limit($set->version_time_limit * $effectiveUser->accessibility_time_factor);
$cleanSet->attempts_per_version($set->attempts_per_version);
$cleanSet->assignment_type($set->assignment_type);
$db->putSetVersion($cleanSet);
Expand Down
4 changes: 3 additions & 1 deletion lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ use constant FIELD_PROPERTIES => {
'This sets a number of minutes for each version of a test, once it is started. Use "0" to indicate no '
. 'time limit. If there is a time limit, then there will be an indication that this is a timed '
. 'test on the main "Assignments" page. Additionally the student will be sent to a confirmation '
. 'page beefore they can begin.'
. 'page before they can begin. Note that the actual time a student will have to complete a timed test '
. 'is the product of this time limit and the accessibility time factor set for the student in the '
. 'accounts manager.'
)
},
time_limit_cap => {
Expand Down
28 changes: 15 additions & 13 deletions lib/WeBWorK/ContentGenerator/Instructor/UserList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,26 @@ use constant SORT_SUBS => {
};

use constant FIELDS => [
'user_id', 'first_name', 'last_name', 'email_address', 'student_id', 'status',
'section', 'recitation', 'comment', 'permission', 'password'
'user_id', 'first_name', 'last_name', 'email_address',
'student_id', 'status', 'accessibility_time_factor', 'section',
'recitation', 'comment', 'permission', 'password'
];

# Note that only the editable fields need a type (i.e. all but user_id),
# and only the text fields need a size.
use constant FIELD_PROPERTIES => {
user_id => { name => x('Login Name') },
first_name => { name => x('First Name'), type => 'text', size => 10 },
last_name => { name => x('Last Name'), type => 'text', size => 10 },
email_address => { name => x('Email Address'), type => 'text', size => 20 },
student_id => { name => x('Student ID'), type => 'text', size => 11 },
status => { name => x('Enrollment Status'), type => 'status' },
section => { name => x('Section'), type => 'text', size => 3 },
recitation => { name => x('Recitation'), type => 'text', size => 3 },
comment => { name => x('Comment'), type => 'text', size => 20 },
permission => { name => x('Permission Level'), type => 'permission' },
password => { name => x('Password'), type => 'password' },
user_id => { name => x('Login Name') },
first_name => { name => x('First Name'), type => 'text', size => 10 },
last_name => { name => x('Last Name'), type => 'text', size => 10 },
email_address => { name => x('Email Address'), type => 'text', size => 20 },
student_id => { name => x('Student ID'), type => 'text', size => 11 },
status => { name => x('Enrollment Status'), type => 'status' },
accessibility_time_factor => { name => x('Accessibility Time Factor'), type => 'text', size => 5 },
section => { name => x('Section'), type => 'text', size => 3 },
recitation => { name => x('Recitation'), type => 'text', size => 3 },
comment => { name => x('Comment'), type => 'text', size => 20 },
permission => { name => x('Permission Level'), type => 'permission' },
password => { name => x('Password'), type => 'password' },
};

sub pre_header_initialize ($c) {
Expand Down
19 changes: 11 additions & 8 deletions lib/WeBWorK/ContentGenerator/ProblemSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,14 @@ sub gateway_body ($c) {
my $ce = $c->ce;
my $db = $c->db;

my $set = $c->{set};
my $effectiveUser = $c->param('effectiveUser');
my $user = $c->param('user');
my $set = $c->{set};
my $effectiveUserID = $c->param('effectiveUser');
my $userID = $c->param('user');

my $effectiveUser = $db->getUser($effectiveUserID);

my $timeNow = time;
my $timeLimit = $set->version_time_limit || 0;
my $timeLimit = ($set->version_time_limit || 0) * $effectiveUser->accessibility_time_factor;

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

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

Expand Down Expand Up @@ -292,11 +295,11 @@ sub gateway_body ($c) {

$data->{score} = '';
# Only show score if user has permission and assignment has at least one submit.
if ($authz->hasPermissions($user, 'view_hidden_work')
if ($authz->hasPermissions($userID, 'view_hidden_work')
|| ($verSet->hide_score eq 'N' && $verSubmits >= 1)
|| ($verSet->hide_score eq 'BeforeAnswerDate' && $timeNow > $set->answer_date))
{
my ($total, $possible) = grade_set($db, $verSet, $effectiveUser, 1);
my ($total, $possible) = grade_set($db, $verSet, $effectiveUserID, 1);
$total = wwRound(2, $total);
$data->{score} = "$total/$possible";
}
Expand Down
29 changes: 15 additions & 14 deletions lib/WeBWorK/DB/Record/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ use warnings;

BEGIN {
__PACKAGE__->_fields(
user_id => { type => "VARCHAR(100) NOT NULL", key => 1 },
first_name => { type => "TEXT" },
last_name => { type => "TEXT" },
email_address => { type => "TEXT" },
student_id => { type => "TEXT" },
status => { type => "TEXT" },
section => { type => "TEXT" },
recitation => { type => "TEXT" },
comment => { type => "TEXT" },
displayMode => { type => "TEXT" },
showOldAnswers => { type => "INT" },
useMathView => { type => "INT" },
useMathQuill => { type => "INT" },
lis_source_did => { type => "TEXT" },
user_id => { type => "VARCHAR(100) NOT NULL", key => 1 },
first_name => { type => "TEXT" },
last_name => { type => "TEXT" },
email_address => { type => "TEXT" },
student_id => { type => "TEXT" },
status => { type => "TEXT" },
accessibility_time_factor => { type => "FLOAT NOT NULL DEFAULT 1" },
section => { type => "TEXT" },
recitation => { type => "TEXT" },
comment => { type => "TEXT" },
displayMode => { type => "TEXT" },
showOldAnswers => { type => "INT" },
useMathView => { type => "INT" },
useMathQuill => { type => "INT" },
lis_source_did => { type => "TEXT" },
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<%= include 'ContentGenerator/Instructor/UserList/sort_button', field => 'status' =%>
</div>
</th>
<th><%= maketext('Accessibility Time Factor') %></th>
<th>
<div class="d-flex justify-content-between align-items-end gap-1">
<%= link_to maketext('Section') => '#', class => 'sort-header',
Expand Down
2 changes: 1 addition & 1 deletion templates/ContentGenerator/ProblemSet/version_list.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="alert alert-warning"><%= $c->{invalidSet} %></div>
% } elsif ($continueVersion) {
% # Display information about the current test and a continue open test button.
% if ($timeLimit > 0) {
% if ($continueVersion->version_time_limit > 0) {
% if ($timeNow >= $continueVersion->due_date) {
% # If the currently open test is in the grace period, display a mesage stating this.
<div class="alert alert-danger">
Expand Down
15 changes: 12 additions & 3 deletions templates/HelpFiles/InstructorUserList.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
%
<p>
<%== maketext('From this page you can <strong>add new students</strong>, <strong>edit</strong> user data '
. '(name, email address, recitation, section, permission level, enrollment status, and password), '
. 'and <strong>export</strong> (save) class lists for back-up or use in another course. '
. 'You can also delete students from the class roster, but this cannot be undone.') =%>
. '(name, email address, student ID, enrollment status, accessibility time factor, section, recitation, '
. 'comment, permission level, and password), and <strong>export</strong> (save) class lists for back-up or use '
. 'in another course. You can also delete students from the class roster, but this cannot be undone.') =%>
</p>
<p>
<%= maketext('This page gives access to information about the student, independent of the assignments '
Expand Down Expand Up @@ -142,6 +142,15 @@
. 'grade for each problem is listed as "status" on this third page).') =%>
</dd>

<dt><%= maketext('Give one student or several students additional time for all timed tests.') %></dt>
<dd>
<%= maketext('Click on the "Select" checkbox next to the names of the students that additional time is to be '
. 'assigned, click on the radio button for editing selected users and then click the "Edit" button .'
. 'Set the "Accesibility Time Factor" to the desired multiplier for each student selected. The time '
. 'that a student will have to complete a timed test will be the product of the "Test Time Limit" for the '
. 'test set in the "Sets Manager" and the "Accessibility Time Factor" set here.') =%>
</dd>

<dt><%= maketext('Extend the number of attempts allowed a student on a given problem.') %></dt>
<dd>
<%= maketext(q{Click first in the "Assigned Sets" column in the student's row. This will take you to a new }
Expand Down