Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public class GradingServiceImpl implements GradingService {

private String gradebookGroupEnabledCache = "org.sakaiproject.tool.gradebook.group.enabled";
private String gradebookGroupInstancesCache = "org.sakaiproject.tool.gradebook.group.instances";
private String matchingUserGradebookItemCache = "org.sakaiproject.tool.gradebook.group.user_gradebookItem";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you removing the cache?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we didn't use it at all, was added in the multi gradebook feature

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's from another commit that got carried on, but it's already incorporated


private MemoryService memoryService;

Expand Down Expand Up @@ -174,11 +173,9 @@ public void init() {

log.debug(buildCacheLogDebug("creatingCache", gradebookGroupEnabledCache));
log.debug(buildCacheLogDebug("creatingCache", gradebookGroupInstancesCache));
log.debug(buildCacheLogDebug("creatingCache", matchingUserGradebookItemCache));

memoryService.newCache(gradebookGroupEnabledCache);
memoryService.newCache(gradebookGroupInstancesCache);
memoryService.newCache(matchingUserGradebookItemCache);
}

@Override
Expand Down Expand Up @@ -5412,19 +5409,6 @@ public Map<String, String> buildCategoryGradebookMap(List<String> selectedGradeb
}

public Long getMatchingUserGradebookItemId(String siteId, String userId, String gradebookItemIdString) {
Cache<String, Long> matchingUserGradebookItem = memoryService.getCache(matchingUserGradebookItemCache);

if (matchingUserGradebookItem != null && matchingUserGradebookItem.containsKey(userId)) {
log.debug(buildCacheLogDebug("cacheKeyFound", gradebookGroupInstancesCache));
Long gradebookItemId = matchingUserGradebookItem.get(userId);

if (gradebookItemId != null) {
log.debug(buildCacheLogDebug("cacheValueFound", gradebookGroupInstancesCache));

return gradebookItemId;
}
}

List<String> userGradebookList = getGradebookInstancesForUser(siteId, userId);
List<String> gradebookItemList = Arrays.asList(gradebookItemIdString.split(","));

Expand All @@ -5434,8 +5418,6 @@ public Long getMatchingUserGradebookItemId(String siteId, String userId, String

if (userGradebookList.contains(foundGradebookUid)) {
Long gradebookItemId = Long.valueOf(gradebookItem);

matchingUserGradebookItem.put(userId, gradebookItemId);
return gradebookItemId;
}
}
Expand Down
33 changes: 18 additions & 15 deletions samigo/samigo-app/src/webapp/js/authoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,26 +843,29 @@ if (typeof MathJax != 'undefined') {
}

function toggleCategories(checkbox) {
// Toggle categories selector. If categories are disabled it won't exist
// so check first.
const categoryDiv = document.querySelector('#assessmentSettingsAction\\:toGradebookCategory');
const selectedGradebook = document.querySelector('#assessmentSettingsAction\\:toGradebookSelected');
if (categoryDiv) {
// If checkbox is a string, it's the initial call from document ready
if (typeof checkbox === 'string') {
categoryDiv.style.display = checkbox === '1' ? 'block' : 'none';
} else {
categoryDiv.style.display = checkbox.value === '1' ? 'block' : 'none';
}
// Toggle categories selector. If categories are disabled it won't exist
// so check first.
const categoryDiv = document.querySelector('#assessmentSettingsAction\\:toGradebookCategory');
const selectedGradebook = document.querySelector('#assessmentSettingsAction\\:toGradebookSelected');

if (categoryDiv) {
// If checkbox is a string, it's the initial call from document ready
if (typeof checkbox === 'string') {
categoryDiv.style.display = checkbox === '1' ? 'block' : 'none';
} else {
categoryDiv.style.display = checkbox.value === '1' ? 'block' : 'none';
}
}

if (selectedGradebook != undefined && selectedGradebook.length) {
if ($(checkbox).val() === '3') {
selectedGradebook.fadeIn();
if (selectedGradebook) {
// If checkbox is a string, it's the initial call from document ready
if (typeof checkbox === 'string') {
selectedGradebook.style.display = checkbox === '3' ? 'block' : 'none';
} else {
selectedGradebook.fadeOut();
selectedGradebook.style.display = checkbox.value === '3' ? 'block' : 'none';
}
}

}

function expandAccordion(iframId){
Expand Down
17 changes: 9 additions & 8 deletions samigo/samigo-app/src/webapp/jsf/author/authorSettings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@
<script src="/samigo-app/js/authoringSecureDeliverySettings.js"></script>
<script src="/library/js/spinner.js"></script>
<script>includeWebjarLibrary('bootstrap-multiselect');</script>
<f:verbatim rendered="#{assessmentSettingsAction.gradebookGroupEnabled}">
<script>
// Initialize input sync
window.addEventListener("load", () => {
window.syncGbSelectorInput("gb-selector", "assessmentSettingsAction:gb_selector");
window.syncGbSelectorInput("category-selector", "assessmentSettingsAction:category_selector");
});
</script>

<f:verbatim rendered="#{assessmentSettings.gradebookGroupEnabled}">
<script>
// Initialize input sync
window.addEventListener("load", () => {
window.syncGbSelectorInput("gb-selector", "assessmentSettingsAction:gb_selector");
window.syncGbSelectorInput("category-selector", "assessmentSettingsAction:category_selector");
});
</script>
</f:verbatim>

<script>
Expand Down
18 changes: 10 additions & 8 deletions samigo/samigo-app/src/webapp/jsf/author/publishedSettings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@
<script src="/samigo-app/js/authoringSecureDeliverySettings.js"></script>
<script src="/library/js/spinner.js"></script>
<script>includeWebjarLibrary('bootstrap-multiselect');</script>
<f:verbatim rendered="#{assessmentSettingsAction.gradebookGroupEnabled}">
<script>
// Initialize input sync
window.addEventListener("load", () => {
window.syncGbSelectorInput("gb-selector", "assessmentSettingsAction:gb_selector");
window.syncGbSelectorInput("category-selector", "assessmentSettingsAction:category_selector");
});
</script>

<f:verbatim rendered="#{publishedSettings.gradebookGroupEnabled}">
<script>
// Initialize input sync
window.addEventListener("load", () => {
window.syncGbSelectorInput("gb-selector", "assessmentSettingsAction:gb_selector");
window.syncGbSelectorInput("category-selector", "assessmentSettingsAction:category_selector");
});
</script>
</f:verbatim>

<script>
$(document).ready(function() {
// set up the accordion for settings
Expand Down
Loading