Created
January 21, 2025 17:24
-
-
Save ivaynberg/d8e9da4570035ac326d863bdaec8410d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/application/model/src/main/java/net/ftlines/model/txcee/slo/StudentLearningObjectiveManager.java b/application/model/src/main/java/net/ftlines/model/txcee/slo/StudentLearningObjectiveManager.java | |
| index f1c167255f..17d4a39e12 100644 | |
| --- a/application/model/src/main/java/net/ftlines/model/txcee/slo/StudentLearningObjectiveManager.java | |
| +++ b/application/model/src/main/java/net/ftlines/model/txcee/slo/StudentLearningObjectiveManager.java | |
| @@ -1968,20 +1968,20 @@ public class StudentLearningObjectiveManager extends DiscussionManager { | |
| } | |
| public int countDistinctImportRecordsFromDistrictYear(DistrictYearConfiguration config, String instructorSearch, | |
| - String assessmentSearch, String studentSearch, Boolean usedInSlo) { | |
| + String assessmentSearch, String studentSearch, Boolean usedInSlo, StudentLearningObjectiveImport scoreImport) { | |
| // This is a little un-kosher, selecting the list just to get the count, but Hibernte does not support | |
| // COUNT(DISTINCT) with multiple columns. | |
| - return queryImportRecordsFromDistrictYear(config, instructorSearch, assessmentSearch, studentSearch, usedInSlo) | |
| + return queryImportRecordsFromDistrictYear(config, instructorSearch, assessmentSearch, studentSearch, usedInSlo, scoreImport) | |
| .fetch().size(); | |
| } | |
| public List<ImportRecordDTO> getDistinctImportRecordsFromDistrictYear(DistrictYearConfiguration config, | |
| - String instructorSearch, String assessmentSearch, String studentSearch, Boolean usedInSlo, | |
| + String instructorSearch, String assessmentSearch, String studentSearch, Boolean usedInSlo, StudentLearningObjectiveImport scoreImport, | |
| QueryParam<IMPORT_RECORD_SORT> queryParam) { | |
| final JPQLQuery<Long> innerQuery = queryImportRecordsFromDistrictYear(config, instructorSearch, | |
| - assessmentSearch, studentSearch, usedInSlo); | |
| + assessmentSearch, studentSearch, usedInSlo, scoreImport); | |
| JPQLQuery<StudentLearningObjectiveImportRecord> outerQuery = from(importRecord_) // | |
| .leftJoin(user_).on(importRecord_.teacherSsin.eq(user_.studentId)) // | |
| @@ -2042,7 +2042,7 @@ public class StudentLearningObjectiveManager extends DiscussionManager { | |
| } | |
| private JPQLQuery<Long> queryImportRecordsFromDistrictYear(DistrictYearConfiguration config, | |
| - String instructorSearch, String assessmentSearch, String studentSearch, Boolean usedInSlo) { | |
| + String instructorSearch, String assessmentSearch, String studentSearch, Boolean usedInSlo, StudentLearningObjectiveImport scoreImport) { | |
| final QStudentLearningObjectiveImportRecord mostRecentImportRecord = new QStudentLearningObjectiveImportRecord( | |
| "mostRecentImportRecord"); | |
| final QStudentLearningObjectiveImport mostRecentImport = new QStudentLearningObjectiveImport( | |
| @@ -2055,6 +2055,10 @@ public class StudentLearningObjectiveManager extends DiscussionManager { | |
| .groupBy(mostRecentImportRecord.studentSsin, mostRecentImportRecord.teacherSsin, | |
| mostRecentImportRecord.assessmentName); | |
| + if (scoreImport!=null) { | |
| + query.where(mostRecentImport.eq(scoreImport)); | |
| + } | |
| + | |
| if (!Strings.isEmpty(instructorSearch)) { | |
| if (StringUtils.isNumeric(instructorSearch)) { | |
| query.where(mostRecentImportRecord.teacherSsin.contains(instructorSearch)); | |
| diff --git a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel.html b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel.html | |
| index 87cee827d6..84c8d3964e 100644 | |
| --- a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel.html | |
| +++ b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel.html | |
| @@ -28,6 +28,12 @@ | |
| </label> | |
| <select wicket:id="linkedToSloSearch"></select> | |
| </li> | |
| + <li> | |
| + <label wicket:for="scoreImport"> | |
| + <wicket:message key="scoreImport">Import</wicket:message> | |
| + </label> | |
| + <select wicket:id="scoreImport"></select> | |
| + </li> | |
| </ul> | |
| <button wicket:id="searchButton" class="small-button"><wicket:message key="search"/></button> | |
| <button class="context-button small-button" wicket:id="clear"><wicket:message key="clearAll"/></button> | |
| diff --git a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel.java b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel.java | |
| index 749eb201f6..0e1e384895 100644 | |
| --- a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel.java | |
| +++ b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel.java | |
| @@ -7,6 +7,7 @@ import java.util.Iterator; | |
| import java.util.List; | |
| import java.util.stream.Collectors; | |
| +import edu.emory.mathcs.backport.java.util.Collections; | |
| import jakarta.inject.Inject; | |
| import jakarta.persistence.EntityManager; | |
| @@ -21,6 +22,7 @@ import org.apache.wicket.markup.html.WebMarkupContainer; | |
| import org.apache.wicket.markup.html.form.DropDownChoice; | |
| import org.apache.wicket.markup.html.form.EnumChoiceRenderer; | |
| import org.apache.wicket.markup.html.form.Form; | |
| +import org.apache.wicket.markup.html.form.IChoiceRenderer; | |
| import org.apache.wicket.markup.html.form.TextField; | |
| import org.apache.wicket.markup.html.panel.EmptyPanel; | |
| import org.apache.wicket.markup.html.panel.Fragment; | |
| @@ -33,6 +35,8 @@ import org.joda.time.DateTime; | |
| import net.ftlines.lms.components.AbstractBasePanel; | |
| import net.ftlines.lms.components.AjaxButton; | |
| +import net.ftlines.lms.components.EntityChoiceRenderer; | |
| +import net.ftlines.lms.components.EntityModel; | |
| import net.ftlines.lms.components.ReadOnlyAdapterModel; | |
| import net.ftlines.lms.components.SelfInternationalizableComponent; | |
| import net.ftlines.lms.components.actionbar.AbstractActionBar; | |
| @@ -52,9 +56,11 @@ import net.ftlines.metagen.wicket.MetaModel; | |
| import net.ftlines.model.permissions.StudentLearningObjectiveCapabilities; | |
| import net.ftlines.model.txcee.DistrictYearConfiguration; | |
| import net.ftlines.model.txcee.slo.StudentLearningObjective; | |
| +import net.ftlines.model.txcee.slo.StudentLearningObjectiveImport; | |
| import net.ftlines.model.txcee.slo.StudentLearningObjectiveImportRecord; | |
| import net.ftlines.model.txcee.slo.StudentLearningObjectiveManager; | |
| import net.ftlines.model.txcee.slo.StudentLearningObjectiveManager.IMPORT_RECORD_SORT; | |
| +import net.ftlines.model.txcee.slo.StudentLearningObjectiveManager.IMPORT_SORT; | |
| import net.ftlines.model.txcee.slo.StudentLearningObjectiveManager.ImportRecordDTO; | |
| import net.ftlines.model.txcee.slo.StudentLearningObjectiveMeta; | |
| import net.ftlines.txcee.crossmodulepagefactories.StudentLearningObjectiveViewDetailsPageLinkFactory; | |
| @@ -75,9 +81,11 @@ class AssessmentScoresPanel extends AbstractBasePanel implements SelfInternation | |
| final IModel<DistrictYearConfiguration> districtYearModel; | |
| final IModel<Boolean> canEditScoresModel; | |
| + final IModel<StudentLearningObjectiveImport> scoreImport=EntityModel.of(StudentLearningObjectiveImport.class); | |
| private boolean displayTable = false; | |
| + | |
| public AssessmentScoresPanel(String id, IModel<DistrictYearConfiguration> districtYearModel) { | |
| super(id); | |
| this.setOutputMarkupId(true); | |
| @@ -125,6 +133,22 @@ class AssessmentScoresPanel extends AbstractBasePanel implements SelfInternation | |
| } | |
| }, new EnumChoiceRenderer<>(AssessmentScoresPanel.this))); | |
| + | |
| + IChoiceRenderer<StudentLearningObjectiveImport> scoreImportRenderer=new EntityChoiceRenderer<StudentLearningObjectiveImport>() { | |
| + @Override | |
| + public Object getDisplayValue(StudentLearningObjectiveImport scoreImport) { | |
| + return scoreImport.getImportJob().getDateStarted().toString("M/d/yyyy h:mm aa"); | |
| + } | |
| + }; | |
| + | |
| + queue(new DropDownChoice<>("scoreImport", scoreImport, new LoadableDetachableModel<List<StudentLearningObjectiveImport>>() { | |
| + @Override | |
| + protected List<StudentLearningObjectiveImport> load() { | |
| + return sloManager.getImports(districtYearModel.getObject(), new QueryParam<>(IMPORT_SORT.DATE)); | |
| + } | |
| + }, scoreImportRenderer) | |
| + .setNullValid(true)); | |
| + | |
| queue(new AjaxLink("clear") { | |
| @Override | |
| public void onClick(AjaxRequestTarget target) { | |
| @@ -268,7 +292,7 @@ class AssessmentScoresPanel extends AbstractBasePanel implements SelfInternation | |
| public long size() { | |
| return sloManager.countDistinctImportRecordsFromDistrictYear(districtYearModel.getObject(), | |
| instructorSearchModel.getObject(), assessmentSearchModel.getObject(), | |
| - studentSearchModel.getObject(), linkedSearchModel.getObject().toBoolean()); | |
| + studentSearchModel.getObject(), linkedSearchModel.getObject().toBoolean(), scoreImport.getObject()); | |
| } | |
| @Override | |
| @@ -293,7 +317,7 @@ class AssessmentScoresPanel extends AbstractBasePanel implements SelfInternation | |
| return sloManager | |
| .getDistinctImportRecordsFromDistrictYear(districtYearModel.getObject(), | |
| instructorSearchModel.getObject(), assessmentSearchModel.getObject(), | |
| - studentSearchModel.getObject(), linkedSearchModel.getObject().toBoolean(), queryParam) | |
| + studentSearchModel.getObject(), linkedSearchModel.getObject().toBoolean(), scoreImport.getObject(), queryParam) | |
| .iterator(); | |
| }; | |
| diff --git a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel_en.utf8.properties b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel_en.utf8.properties | |
| index 70a49cbdec..81e855f1d7 100644 | |
| --- a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel_en.utf8.properties | |
| +++ b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/AssessmentScoresPanel_en.utf8.properties | |
| @@ -1,6 +1,8 @@ | |
| instructorSearch=Search Teacher | |
| studentSearch=Search Student | |
| assessmentSearch=Search Assessment | |
| +scoreImport=Score Import | |
| +scoreImport.nullValid=All | |
| linkedToSloSearch=Linked to SGM | |
| LinkedToSloSearch.ALL=All | |
| diff --git a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/ImportsPanel.java b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/ImportsPanel.java | |
| index c79ae1abe7..682afda8e3 100644 | |
| --- a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/ImportsPanel.java | |
| +++ b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/ImportsPanel.java | |
| @@ -96,12 +96,18 @@ public class ImportsPanel extends AbstractBasePanel implements SelfInternational | |
| return String.valueOf(importToRecordCountMapModel.getObject().get(i.getId())); | |
| } | |
| }); | |
| - columns.add(new LabelColumn<>(getComponentString("status"), IMPORT_SORT.STATUS) { | |
| + columns.add(new LabelColumn<>(getComponentString("uploadStatus"), IMPORT_SORT.STATUS) { | |
| @Override | |
| public String getStringValue(StudentLearningObjectiveImport i) { | |
| return getComponentString(i.getImportJob().getStatus()).getObject(); | |
| } | |
| }); | |
| + columns.add(new LabelColumn<>(getComponentString("processingStatus")) { | |
| + @Override | |
| + public String getStringValue(StudentLearningObjectiveImport object) { | |
| + return getComponentString(object.isMerged()?"complete":"pending").getObject(); | |
| + } | |
| + }); | |
| columns.add(new ActionBarColumn<>(getComponentString("actions")) { | |
| @Override | |
| protected void onConfigureActionBar(ActionBar bar, final IModel<StudentLearningObjectiveImport> row) { | |
| diff --git a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/ImportsPanel_en.utf8.properties b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/ImportsPanel_en.utf8.properties | |
| index fc3d898882..638821f5c5 100644 | |
| --- a/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/ImportsPanel_en.utf8.properties | |
| +++ b/application/studentLearningObjective/src/main/java/net/ftlines/lms/pages/txcee/system/orgmanagement/ImportsPanel_en.utf8.properties | |
| @@ -6,6 +6,10 @@ review=Review Import | |
| delete=Delete Import | |
| importInUse=This file is not eligible for deletion. It is referenced in a SGM. | |
| download=Download | |
| - | |
| downloadImport=Download Import | |
| -downloadInstructions=Click on specific file from the import to download | |
| \ No newline at end of file | |
| +downloadInstructions=Click on specific file from the import to download | |
| + | |
| +uploadStatus=Upload Status | |
| +processingStatus=Processing Status | |
| +pending=Pending | |
| +complete=Complete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment