OLD | NEW |
1 package org.sakaiproject.gradebook.gwt.sakai; | 1 package org.sakaiproject.gradebook.gwt.sakai; |
2 | 2 |
3 import java.math.BigDecimal; | 3 import java.math.BigDecimal; |
4 import java.math.RoundingMode; | 4 import java.math.RoundingMode; |
5 import java.text.MessageFormat; | 5 import java.text.MessageFormat; |
6 import java.text.SimpleDateFormat; | 6 import java.text.SimpleDateFormat; |
7 import java.util.ArrayList; | 7 import java.util.ArrayList; |
8 import java.util.Collection; | 8 import java.util.Collection; |
9 import java.util.Collections; | 9 import java.util.Collections; |
10 import java.util.Comparator; | 10 import java.util.Comparator; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 private UserDirectoryService userService; | 288 private UserDirectoryService userService; |
289 ········ | 289 ········ |
290 /* | 290 /* |
291 * GRBK-824 : Adding class member that is only set during init via sakai
properties. | 291 * GRBK-824 : Adding class member that is only set during init via sakai
properties. |
292 * Thus, there are no thread safety concerns. | 292 * Thus, there are no thread safety concerns. |
293 */ | 293 */ |
294 private boolean checkFinalGradeSubmition = false; | 294 private boolean checkFinalGradeSubmition = false; |
295 ········ | 295 ········ |
296 protected boolean isShowWeightedEnabled = false; | 296 protected boolean isShowWeightedEnabled = false; |
297 ········ | 297 ········ |
| 298 /* |
| 299 * GRBK-1244: Check if we cache the statistics chart data and notify the
client· |
| 300 * accordingly. |
| 301 */ |
| 302 private boolean isStatisticsDataChached = false; |
| 303 private int statisticsDataCacheAge = AppConstants.CURRENT_STATISTICS_DAT
A; |
| 304 ········ |
298 | 305 |
299 public Learner assignComment(String itemId, String studentUid, String te
xt) { | 306 public Learner assignComment(String itemId, String studentUid, String te
xt) { |
300 | 307 |
301 Long assignmentId = Long.valueOf(Util.unpackItemIdFromKey(itemId
)); | 308 Long assignmentId = Long.valueOf(Util.unpackItemIdFromKey(itemId
)); |
302 Comment comment = doAssignComment(assignmentId, studentUid, text
); | 309 Comment comment = doAssignComment(assignmentId, studentUid, text
); |
303 Gradebook gradebook = null; | 310 Gradebook gradebook = null; |
304 | 311 |
305 if (comment != null) | 312 if (comment != null) |
306 gradebook = doCommitComment(comment, studentUid, text); | 313 gradebook = doCommitComment(comment, studentUid, text); |
307 else { | 314 else { |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 public ApplicationSetup getApplicationSetup(String... gradebookUids)· | 815 public ApplicationSetup getApplicationSetup(String... gradebookUids)· |
809 throws GradebookCreationException { | 816 throws GradebookCreationException { |
810 | 817 |
811 ApplicationSetup setup = new ApplicationSetupImpl(); | 818 ApplicationSetup setup = new ApplicationSetupImpl(); |
812 setup.setGradebookModels(getGradebookModels(gradebookUids)); | 819 setup.setGradebookModels(getGradebookModels(gradebookUids)); |
813 setup.setHelpUrl(helpUrl); | 820 setup.setHelpUrl(helpUrl); |
814 setup.setSearchRosterByFieldEnabled(searchRosterByFieldEnabled.b
ooleanValue()); | 821 setup.setSearchRosterByFieldEnabled(searchRosterByFieldEnabled.b
ooleanValue()); |
815 setup.setEnabledGradeTypes(enabledGradeTypes); | 822 setup.setEnabledGradeTypes(enabledGradeTypes); |
816 setup.setShowWeightedEnabled(this.isShowWeightedEnabled()); | 823 setup.setShowWeightedEnabled(this.isShowWeightedEnabled()); |
817 setup.setCheckFinalGradeSubmissionStatus(checkFinalGradeSubmitio
n); | 824 setup.setCheckFinalGradeSubmissionStatus(checkFinalGradeSubmitio
n); |
| 825 setup.setCachedDataAge(statisticsDataCacheAge); |
818 ················ | 826 ················ |
819 return setup; | 827 return setup; |
820 } | 828 } |
821 | 829 |
822 public String getAuthorizationDetails(String... gradebookUids) { | 830 public String getAuthorizationDetails(String... gradebookUids) { |
823 StringBuilder rv = new StringBuilder(); | 831 StringBuilder rv = new StringBuilder(); |
824 for (AuthModel m : getAuthorization(gradebookUids)) { | 832 for (AuthModel m : getAuthorization(gradebookUids)) { |
825 if (rv.length()!=0) { | 833 if (rv.length()!=0) { |
826 rv.append(AuthModel.AUTHMODEL_STRING_DELIMITER); | 834 rv.append(AuthModel.AUTHMODEL_STRING_DELIMITER); |
827 } | 835 } |
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2535 else if (limitScaledExtraCredit.contains("CATEGO
RIES")) | 2543 else if (limitScaledExtraCredit.contains("CATEGO
RIES")) |
2536 limitScaledExtraCreditToCategoryType = C
ategoryType.SIMPLE_CATEGORIES; | 2544 limitScaledExtraCreditToCategoryType = C
ategoryType.SIMPLE_CATEGORIES; |
2537 } | 2545 } |
2538 | 2546 |
2539 String enableShowWeighted = configService.getString(AppC
onstants.ENABLE_SHOW_WEIGHTED_TOGGLE); | 2547 String enableShowWeighted = configService.getString(AppC
onstants.ENABLE_SHOW_WEIGHTED_TOGGLE); |
2540 this.setShowWeightedEnabled(enableShowWeighted != null &
& Boolean.TRUE.toString().equalsIgnoreCase(enableShowWeighted.trim())); | 2548 this.setShowWeightedEnabled(enableShowWeighted != null &
& Boolean.TRUE.toString().equalsIgnoreCase(enableShowWeighted.trim())); |
2541 ························ | 2549 ························ |
2542 // GRBK-824 | 2550 // GRBK-824 |
2543 checkFinalGradeSubmition = configService.getBoolean(AppC
onstants.ENABLE_FINAL_GRADE_SUBMISSION_CHECK, false); | 2551 checkFinalGradeSubmition = configService.getBoolean(AppC
onstants.ENABLE_FINAL_GRADE_SUBMISSION_CHECK, false); |
2544 ························ | 2552 ························ |
2545 » » } else { | 2553 » » » // GRBK-1244 |
| 2554 » » » isStatisticsDataChached = configService.getBoolean(AppCo
nstants.ENABLE_STATISTICS_CACHE, false); |
| 2555 » » »······· |
| 2556 » » » if(isStatisticsDataChached) { |
| 2557 » » » »······· |
| 2558 » » » » statisticsDataCacheAge = configService.getInt(Ap
pConstants.STATISTICS_CACHE_TIME_TO_LIVE_SECONDS, AppConstants.STATISTICS_CACHE_
TIME_TO_LIVE_SECONDS_DEFAULT); |
| 2559 » » » } |
| 2560 » » » else { |
| 2561 » » » »······· |
| 2562 » » » » statisticsDataCacheAge = AppConstants.CURRENT_ST
ATISTICS_DATA; |
| 2563 » » » } |
| 2564 » » } |
| 2565 » » else { |
2546 enabledGradeTypes.add(GradeType.POINTS); | 2566 enabledGradeTypes.add(GradeType.POINTS); |
2547 enabledGradeTypes.add(GradeType.PERCENTAGES); | 2567 enabledGradeTypes.add(GradeType.PERCENTAGES); |
2548 enabledGradeTypes.add(GradeType.LETTERS); | 2568 enabledGradeTypes.add(GradeType.LETTERS); |
2549 } | 2569 } |
2550 | 2570 |
2551 if (learnerRoleNames == null) | 2571 if (learnerRoleNames == null) |
2552 learnerRoleNames = advisor.getLearnerRoleNames(); | 2572 learnerRoleNames = advisor.getLearnerRoleNames(); |
2553 | 2573 |
2554 if (learnerRoleNames == null) | 2574 if (learnerRoleNames == null) |
2555 learnerRoleNames = new String[] { "Student", "access" }; | 2575 learnerRoleNames = new String[] { "Student", "access" }; |
(...skipping 4345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6901 else { | 6921 else { |
6902 ································ | 6922 ································ |
6903 log.warn(i18n.getString("finalGradeSubmissionSta
tusWarning")); | 6923 log.warn(i18n.getString("finalGradeSubmissionSta
tusWarning")); |
6904 } | 6924 } |
6905 } | 6925 } |
6906 | 6926 |
6907 return (null != status ? status : new FinalGradeSubmissionStatus
Impl()); | 6927 return (null != status ? status : new FinalGradeSubmissionStatus
Impl()); |
6908 } | 6928 } |
6909 | 6929 |
6910 } | 6930 } |
OLD | NEW |