Skip to content

Commit

Permalink
Lesson multigradebook revamp, i18n changes and forum multi gradebook …
Browse files Browse the repository at this point in the history
…config

.

.

November changes in Lessons, Forums, info blocks and more
  • Loading branch information
jumarub authored and bgarciaentornos committed Dec 11, 2024
1 parent 7082214 commit b32f967
Show file tree
Hide file tree
Showing 38 changed files with 1,030 additions and 375 deletions.
3 changes: 2 additions & 1 deletion assignment/api/src/resources/assignment.properties
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,9 @@ range.allgroups = site

group = Group
groups = Groups
group.sitegradebook.info=This site is configured to have several gradebooks, so you must choose the groups and then their category or a corresponding grade item.
group.sitegradebook.items.error=Selected groups must have a gradebook item associated with them
group.sitegradebook.nopermission=Assignments for the entire site cannot be created when using group based gradebooks.
group.sitegradebook.nopermission=Assignments cannot for all sections/groups because the course is set up with different instances per grade group.
group.sitegradebook.categories.error=The selected categories must be associated with their corresponding group.
group.editsite.nopermission = Cannot edit the group state due to site permissions.
group.list.summary = Table contains list of groups. First will contain checkboxes, second will contain the group name, third the group description. Header links can be used to sort
Expand Down
5 changes: 3 additions & 2 deletions assignment/api/src/resources/assignment_ca.properties
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,9 @@ range.allgroups=tot l\u2019espai

group=Grup
groups=Grups
group.sitegradebook.items.error=Els grups seleccionats han de tindre associat un ítem del llibre de qualificacions
group.sitegradebook.nopermission=No es poden crear tasques de lloc en tindre qualificacions de grup.
group.sitegradebook.info=Este lloc est\u00e0 configurat per a tindre diversos llibres de qualificacions, per tant s'hauran de triar els grups i posteriorment la seua categoria o un item de qualificaci\u00f3 corresponent.
group.sitegradebook.items.error=Els grups seleccionats han de tindre associat un \u00edtem del llibre de qualificacions
group.sitegradebook.nopermission=No es poden crear tasques per a totes les seccions/grups perqu\u00e8 el curs est\u00e0 configurat amb inst\u00e0ncies diferents per grup de qualificacions.
group.sitegradebook.categories.error=Les categories seleccionades han d'estar associades al seu grup corresponent.
group.editsite.nopermission=No teniu els permisos corresponents en aquest espai per editar l\u2019estat del grup
group.list.summary=La taula cont\u00e9 una llista de grups. La primera columna contindr\u00e0 caselles de selecci\u00f3; la segona, el nom del grup; la tercera, la descripci\u00f3 del grup. Els enlla\u00e7os de l\u2019encap\u00e7alament es poden utilitzar per ordenar
Expand Down
5 changes: 3 additions & 2 deletions assignment/api/src/resources/assignment_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,10 @@ range.allgroups=sitio

group=Grupo
groups=Grupos
group.sitegradebook.info=Este sitio est\u00e1 configurado para tener varios libros de calificaciones, por lo tanto se deber\u00e1n escoger los grupos y posteriormente su categor\u00eda o un item de calificaci\u00f3n correspondiente.
group.sitegradebook.items.error=Los grupos seleccionados deben tener asociado un item del libro de calificaciones
group.sitegradebook.nopermission=No se pueden crear tareas de sitio al tener calificaciones de grupo.
group.sitegradebook.categories.error=Las categorías seleccionadas deben estar asociadas a su grupo correspondiente.
group.sitegradebook.nopermission=No se pueden crear tareas para todas las secciones/grupos debido a que el curso est\u00e1 configurado con instancias diferentes por grupo de calificaciones
group.sitegradebook.categories.error=Las categor\u00edas seleccionadas deben estar asociadas a su grupo correspondiente.
group.editsite.nopermission=No se puede editar el estado del grupo debido a los permisos del sitio.
group.list.summary=Lista de grupos. La primera columna contiene casillas de selecci\u00f3n, la segunda el nombre del grupo y la tercera su descripci\u00f3n. Los enlaces de la cabecera de la tabla permiten ordenar sus entradas.
group.list.descr=Descripci\u00f3n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4297,9 +4297,11 @@ protected String build_instructor_grade_submission_context(VelocityPortlet portl
}
}

Long associateGradebookAssignmentId = gbAssignment.getId();
context.put("associatedToGbItem", true);
context.put("associatedToGbEntityId", associateGradebookAssignmentId);
if (gbAssignment != null) {
Long associateGradebookAssignmentId = gbAssignment.getId();
context.put("associatedToGbItem", true);
context.put("associatedToGbEntityId", associateGradebookAssignmentId);
}
} catch (AssessmentNotFoundException e) {
log.error("Assignment not found while building grade submission context for custom gradebook item due to: {} {}", e.toString(), ExceptionUtils.getStackTrace(e));
}
Expand Down Expand Up @@ -11037,17 +11039,20 @@ public void doDelete_assignment(RunData data) {
}
}

String associateGradebookAssignment = properties.get(PROP_ASSIGNMENT_ASSOCIATE_GRADEBOOK_ASSIGNMENT);

String title = assignment.getTitle();

// remove rubric association if there is one
rubricsService.softDeleteRubricAssociation(AssignmentConstants.TOOL_ID, id);

// remove from Gradebook
List<String> gradebookUids = gradingService.getGradebookUidByExternalId(associateGradebookAssignment);
for (String gradebookUid : gradebookUids) {
addAlerts(state, assignmentToolUtils.integrateGradebook(stateToMap(state), gradebookUid, ref, associateGradebookAssignment, "remove", null, null, -1, null, null, null, -1));
String associateGradebookAssignment = properties.get(PROP_ASSIGNMENT_ASSOCIATE_GRADEBOOK_ASSIGNMENT);
List<String> itemList = Arrays.asList(associateGradebookAssignment.split(","));
Set<String> itemSet = new HashSet<>(itemList);
for (String item : itemSet) {
// remove from Gradebook
List<String> gradebookUids = gradingService.getGradebookUidByExternalId(item);
for (String gradebookUid : gradebookUids) {
addAlerts(state, assignmentToolUtils.integrateGradebook(stateToMap(state), gradebookUid, ref, item, "remove", null, null, -1, null, null, null, -1));
}
}
// we use to check "assignment.delete.cascade.submission" setting. But the implementation now is always remove submission objects when the assignment is removed.
// delete assignment and its submissions altogether
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,13 +454,17 @@ public void gradeSubmission(AssignmentSubmission submission, String gradeOption,
alerts.addAll(integrateGradebook(options, gradebookUid, aReference, item, null, null, null, -1, null, sReference, op, -1));
} else {
// In this case, we need to find the item in the list that matches the group being iterated.
Long itemId = Long.parseLong(item);
try {
Long itemId = Long.parseLong(item);

GradebookAssignment gradebookAssignment = gradingService.getGradebookAssigment(gradebookUid, itemId);
GradebookAssignment gradebookAssignment = gradingService.getGradebookAssigment(gradebookUid, itemId);

if (gradebookAssignment != null && gradebookAssignment.getGradebook() != null &&
gradebookAssignment.getGradebook().getUid().equals(gradebookUid)) {
alerts.addAll(integrateGradebook(options, gradebookUid, aReference, item, null, null, null, -1, null, sReference, op, -1));
if (gradebookAssignment != null && gradebookAssignment.getGradebook() != null &&
gradebookAssignment.getGradebook().getUid().equals(gradebookUid)) {
alerts.addAll(integrateGradebook(options, gradebookUid, aReference, item, null, null, null, -1, null, sReference, op, -1));
}
} catch (NumberFormatException e) {
log.error("Exception trying to parse item value {} : {} ", item, e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ can be either all members of the site, all members of selected groups, or the se

<p class="text-muted small">$tlang.getString("gen.cant.change.after.draft")</p>

#if ($isGradebookGroupEnabled)
<div class="sak-banner-info">$tlang.getString("group.sitegradebook.info")</div>
#end

## Radio Option 1: Each individual member of the site
#if($allowAddSiteAssignment)
<div class="radio">
Expand Down
2 changes: 2 additions & 0 deletions lessonbuilder/api/src/resources/lessons.properties
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,8 @@ simplepage.question-show-poll-option=Show students a graph of how others respond
simplepage.missing-question-text=Please supply text for the question
simplepage.question-need-2=Please supply at least 2 alternatives for this question

simplepage.multi_gradebook.no_group=This item cannot be published for all sections/groups because the course is set up with different instances per grade group.

simplepage.add_layout=Add Layout
simplepage.layoutlinktext=Add Layout
simplepage.layout-descrip=Select a preconfigured layout to add to the bottom of this page.
Expand Down
2 changes: 2 additions & 0 deletions lessonbuilder/api/src/resources/lessons_ca.properties
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@ simplepage.question-show-poll-option=Mostra als estudiants, un cop hagin respost
simplepage.missing-question-text=Introdu\u00efu un text per a la pregunta
simplepage.question-need-2=En aquesta pregunta cal introduir almenys dues alternatives

simplepage.multi_gradebook.no_group=No es puc publicar aquest item per a totes les seccions/grups perqu\u00e8 el curs est\u00e0 configurat amb inst\u00e0ncies diferents per grup de qualificacions.

simplepage.add_layout=Afegeix el format
simplepage.layoutlinktext=Afegeix el format
simplepage.layout-descrip=Seleccioneu un format preconfigurar per afegir-lo a la part inferior de la p\u00e0gina
Expand Down
2 changes: 2 additions & 0 deletions lessonbuilder/api/src/resources/lessons_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,8 @@ simplepage.question-show-poll-option=Mostrar un gr\u00e1fico que indique, tras
simplepage.missing-question-text=Por favor, especifique un texto para la pregunta
simplepage.question-need-2=Por favor, suministre por lo menos dos alternativas para esta pregunta

simplepage.multi_gradebook.no_group=No se puede publicar este item para todas las secciones/grupos debido a que el curso est\u00e1 configurado con instancias diferentes por grupo de calificaciones

simplepage.add_layout=A\u00f1adir vista
simplepage.layoutlinktext=A\u00f1adir vista
simplepage.layout-descrip=Seleccionar una maquetaci\u00f3n predise\u00f1ada para a\u00f1adirla al final de la p\u00e1gina.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,23 @@ public boolean removeExternalAssessment(final String gradebookUid, final String
return true;
}

public boolean removeExternalAssessmentByGradebookList(List<String> gradebookUidList, final String externalId) {
if (gradebookUidList != null && gradebookUidList.size() > 0) {
for (String gradebookUid : gradebookUidList) {
try {
gradingService.removeExternalAssignment(gradebookUid, externalId, LessonBuilderConstants.TOOL_ID);
} catch (Exception e) {
log.error("Failed removing external gradebook with id {} : {}", externalId, e);
return false;
}
}

return true;
} else {
return false;
}
}

public boolean updateExternalAssessmentScore(final String gradebookUid, final String siteId, final String externalId,
final String studentUid, final String points) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@ private boolean gradeComment() {
}

String gradebookId = null;

Integer maxpoints = null;

SimplePageItem gbItem;

if (studentPage != null) {
gradebookId = topItem.getAltGradebook();
maxpoints = topItem.getAltPoints();
gbItem = topItem;
} else {
gradebookId = commentItem.getGradebookId();
maxpoints = commentItem.getGradebookPoints();
gbItem = commentItem;
}

Double newpoints = Double.valueOf(points);
Expand All @@ -140,7 +144,7 @@ private boolean gradeComment() {
try {
List<String> gradebookUids = Arrays.asList(simplePageBean.getCurrentSiteId());
if (gradebookIfc.isGradebookGroupEnabled(simplePageBean.getCurrentSiteId())) {
gradebookUids = new ArrayList<String>(simplePageBean.getItemGroups(topItem, null, false));
gradebookUids = new ArrayList<String>(simplePageBean.getItemGroups(gbItem, null, false));
}
for (String gradebookUid : gradebookUids) {
r = gradebookIfc.updateExternalAssessmentScore(gradebookUid, simplePageBean.getCurrentSiteId(), gradebookId, comment.getAuthor(), Double.toString(newpoints));
Expand Down
Loading

0 comments on commit b32f967

Please sign in to comment.