Skip to content
Merged
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
4 changes: 2 additions & 2 deletions lib/WeBWorK/File/SetDef.pm
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ sub importSetsFromDef ($ce, $db, $setDefFiles, $existingSets = undef, $assign =

debug("$set_definition_file: adding problems to database");
# Add problems
my $freeProblemID = WeBWorK::Utils::max($db->listGlobalProblems($setData->{setID})) + 1;
my $freeProblemID = WeBWorK::Utils::max(grep {$_} map { $_->{problem_id} } @{ $setData->{problemData} }) + 1;
for my $rh_problem (@{ $setData->{problemData} }) {
addProblemToSet(
$db, $ce->{problemDefaults},
setName => $setData->{setID},
sourceFile => $rh_problem->{source_file},
problemID => $rh_problem->{problemID} ? $rh_problem->{problemID} : $freeProblemID++,
problemID => $rh_problem->{problem_id} || $freeProblemID++,
value => $rh_problem->{value},
maxAttempts => $rh_problem->{max_attempts},
showMeAnother => $rh_problem->{showMeAnother},
Expand Down