SEBSERV-75 fixed Moodle request API with form URL encoded array values
This commit is contained in:
parent
e6272058e6
commit
7bbe6386a3
2 changed files with 7 additions and 1 deletions
|
@ -618,7 +618,7 @@ public final class Utils {
|
|||
}
|
||||
|
||||
public static String toAppFormUrlEncodedBody(final String name, final Collection<String> array) {
|
||||
final String _name = name.contains(String.valueOf(Constants.SQUARE_BRACE_OPEN))
|
||||
final String _name = name.contains(String.valueOf(Constants.SQUARE_BRACE_OPEN)) || array.size() <= 1
|
||||
? name
|
||||
: name + Constants.SQUARE_BRACE_OPEN + Constants.SQUARE_BRACE_CLOSE;
|
||||
|
||||
|
|
|
@ -18,6 +18,9 @@ import java.util.function.Function;
|
|||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ch.ethz.seb.sebserver.gbl.Constants;
|
||||
import ch.ethz.seb.sebserver.gbl.async.AsyncService;
|
||||
import ch.ethz.seb.sebserver.gbl.async.CircuitBreaker;
|
||||
|
@ -31,6 +34,8 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
|
|||
|
||||
public abstract class CourseAccess {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(CourseAccess.class);
|
||||
|
||||
protected final MemoizingCircuitBreaker<List<QuizData>> allQuizzesRequest;
|
||||
protected final CircuitBreaker<Chapters> chaptersRequest;
|
||||
protected final CircuitBreaker<ExamineeAccountDetails> accountDetailRequest;
|
||||
|
@ -103,6 +108,7 @@ public abstract class CourseAccess {
|
|||
public String getExamineeName(final String examineeSessionId) {
|
||||
return getExamineeAccountDetails(examineeSessionId)
|
||||
.map(ExamineeAccountDetails::getDisplayName)
|
||||
.onError(error -> log.warn("Failed to request Moodle user-name for ID: {}", error.getMessage(), error))
|
||||
.getOr(examineeSessionId);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue