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

.

.
  • Loading branch information
jumarub authored and bgarciaentornos committed Dec 11, 2024
1 parent bd0386c commit c84a32f
Show file tree
Hide file tree
Showing 29 changed files with 666 additions and 210 deletions.
2 changes: 1 addition & 1 deletion assignment/api/src/resources/assignment.properties
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ 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
6 changes: 3 additions & 3 deletions assignment/api/src/resources/assignment_ca.properties
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,9 @@ range.allgroups=tot l\u2019espai

group=Grup
groups=Grups
group.sitegradebook.info=Este lloc està 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ó corresponent.
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
6 changes: 3 additions & 3 deletions assignment/api/src/resources/assignment_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,10 @@ range.allgroups=sitio

group=Grupo
groups=Grupos
group.sitegradebook.info=Este sitio está configurado para tener varios libros de calificaciones, por lo tanto se deberán escoger los grupos y posteriormente su categoría o un item de calificación correspondiente.
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 @@ -11051,7 +11051,6 @@ public void doDelete_assignment(RunData data) {
// remove from Gradebook
List<String> gradebookUids = gradingService.getGradebookUidByExternalId(item);
for (String gradebookUid : gradebookUids) {
//TODO validar si ese guid va con grupo o da igual?
addAlerts(state, assignmentToolUtils.integrateGradebook(stateToMap(state), gradebookUid, ref, item, "remove", null, null, -1, null, null, null, -1));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public void gradeSubmission(AssignmentSubmission submission, String gradeOption,
alerts.addAll(integrateGradebook(options, gradebookUid, aReference, item, null, null, null, -1, null, sReference, op, -1));
}
} catch (NumberFormatException e) {
System.out.println("e: " + e);
log.error("Exception trying to parse item value {} : {} ", item, ex);
}
}
}
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 @@ -91,7 +91,7 @@ public boolean removeExternalAssessmentByGradebookList(List<String> gradebookUid
try {
gradingService.removeExternalAssignment(gradebookUid, externalId, LessonBuilderConstants.TOOL_ID);
} catch (Exception e) {
log.info("failed remove " + e);
log.error("Failed removing external gradebook with id {} : {}", externalId, e);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7485,6 +7485,11 @@ public String updateComments() {
maxPoints = "1";
}

if (gradebookIfc.isGradebookGroupEnabled(getCurrentSiteId()) && (selectedGroups == null || selectedGroups.length <= 0)) {
setErrMessage(messageLocator.getMessage("simplepage.multi_gradebook.no_group"));
return "failure";
}

Integer points = parseMaxPoints(maxPoints);

if (graded) {
Expand Down Expand Up @@ -7526,11 +7531,6 @@ public String updateComments() {
add = gradebookIfc.removeExternalAssessmentByGradebookList(deletedGroups, gradebookId);
}

if (!add) {
setErrMessage(messageLocator.getMessage("simplepage.no-gradebook"));
} else {
comment.setGradebookTitle(pageTitle + commentTitle);
}
} else {
if (comment.getGradebookId() != null && !comment.getGradebookPoints().equals(points)) {
add = gradebookIfc.updateExternalAssessment(gradebookUids, gradebookId, null,
Expand All @@ -7544,18 +7544,18 @@ public String updateComments() {
setErrMessage(messageLocator.getMessage("simplepage.existing-gradebook"));
}
}
if (!add) {
setErrMessage(messageLocator.getMessage("simplepage.no-gradebook"));
} else {
comment.setGradebookTitle(pageTitle + commentTitle);
}
}

if (!add) {
setErrMessage(messageLocator.getMessage("simplepage.no-gradebook"));
} else {
comment.setGradebookTitle(pageTitle + commentTitle);
}
} else {
// Must be a student page comments tool.
SimpleStudentPage studentPage = simplePageToolDao.findStudentPage(Long.valueOf(comment.getSakaiId()));
SimplePageItem studentPageItem = simplePageToolDao.findItem(studentPage.getItemId());

//pageTitle = simplePageToolDao.findStudentPage(Long.valueOf(comment.getSakaiId())).getTitle();
gradebookId = "lesson-builder:page-comment:" + studentPageItem.getId();
}

Expand Down Expand Up @@ -7935,10 +7935,16 @@ public String updateQuestion() {

}

Integer pointsInt = parseMaxPoints(maxPoints);

if (pointsInt == null) {
return "failure";
int pointsInt = 10;
if(StringUtils.isNotBlank(maxPoints)) {
try {
pointsInt = Integer.valueOf(maxPoints);
}catch(Exception ex) {
setErrMessage(messageLocator.getMessage("simplepage.integer-expected"));
// can't fail, because it will leave an inconsistent items. So create one with default point value
// check in UI to make sure it can't happen
// return "failure";
}
}

if (!graded || (gradebookTitle != null && gradebookTitle.trim().equals(""))) {
Expand Down Expand Up @@ -8292,21 +8298,6 @@ public String updateStudent() {
page.setOwnerGroups(ownerGroups.toString());
}

// TODO: this section currently does nothing but do a database call to get an item... Can it be removed?
// Update the comments tools to reflect any changes
/* if(comments) {
List<SimpleStudentPage> pages = simplePageToolDao.findStudentPages(itemId);
for(SimpleStudentPage p : pages) {
if(p.getCommentsSection() != null) {
SimplePageItem item = simplePageToolDao.findItem(p.getCommentsSection());
//if(item.isAnonymous() != forcedAnon) {
//item.setAnonymous(forcedAnon);
//update(item);
//}
}
}
} */

// RU Rubrics
// This function is called last. By the time this function is called, rubricRows has been created.
//the peerEval should not be in here
Expand All @@ -8333,13 +8324,17 @@ public String updateStudent() {

if (gradebookIfc.isGradebookGroupEnabled(getCurrentSiteId())) {
gradebookUids = Arrays.asList(selectedGroups);
}

Integer points = parseMaxPoints(maxPoints);
Integer pointsC = parseMaxPoints(sMaxPoints);
if (gradebookUids == null || gradebookUids.size() <= 0) {
setErrMessage(messageLocator.getMessage("simplepage.multi_gradebook.no_group"));
return "failure";
}
}

// Handle the grading of pages
if (graded) {
Integer points = parseMaxPoints(maxPoints);

if (points == null) {
return "failure";
}
Expand Down Expand Up @@ -8370,6 +8365,9 @@ public String updateStudent() {

// Handling the grading of comments on pages
if (sGraded) {

Integer pointsC = parseMaxPoints(sMaxPoints);

if (pointsC == null) {
return "failure";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import org.sakaiproject.lessonbuildertool.SimpleStudentPage;
import org.sakaiproject.lessonbuildertool.model.SimplePageToolDao;
import org.sakaiproject.lessonbuildertool.service.BltiInterface;
import org.sakaiproject.lessonbuildertool.service.GradebookIfc;
import org.sakaiproject.lessonbuildertool.service.LessonBuilderAccessService;
import org.sakaiproject.lessonbuildertool.service.LessonEntity;
import org.sakaiproject.lessonbuildertool.tool.beans.SimplePageBean;
Expand Down Expand Up @@ -146,6 +147,7 @@ public class ShowPageProducer implements ViewComponentProducer, DefaultView, Nav

private SimplePageBean simplePageBean;
private SimplePageToolDao simplePageToolDao;
@Setter private GradebookIfc gradebookIfc;
@Setter private AuthzGroupService authzGroupService;
@Setter private SecurityService securityService;
@Setter ContentHostingService contentHostingService;
Expand Down Expand Up @@ -5284,7 +5286,9 @@ private void createQuestionDialog(UIContainer tofill, SimplePage currentPage) {
UIBoundBoolean.make(form, "question-graded", "#{simplePageBean.graded}");
UIInput.make(form, "question-gradebook-title", "#{simplePageBean.gradebookTitle}");
UIInput.make(form, "question-max", "#{simplePageBean.maxPoints}");


UIInput.make(form, "multi_gradebook", String.valueOf(gradebookIfc.isGradebookGroupEnabled(simplePageBean.getCurrentSiteId())));

UIInput.make(form, "question-multiplechoice-answer-complete", "#{simplePageBean.addAnswerData}");
UIInput.make(form, "question-multiplechoice-answer-id", null);
UIBoundBoolean.make(form, "question-multiplechoice-answer-correct");
Expand Down
1 change: 1 addition & 0 deletions lessonbuilder/tool/src/webapp/WEB-INF/requestContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<bean name="showPageProducer" class="org.sakaiproject.lessonbuildertool.tool.producers.ShowPageProducer">
<property name="messageLocator" ref="messageLocator"/>
<property name="simplePageBean" ref="simplePageBean" />
<property name="gradebookIfc" ref="org.sakaiproject.lessonbuildertool.service.GradebookIfc" />
<property name="authzGroupService" ref="org.sakaiproject.authz.api.AuthzGroupService" />
<property name="contentHostingService" ref="org.sakaiproject.content.api.ContentHostingService" />
<property name="securityService" ref="org.sakaiproject.authz.api.SecurityService" />
Expand Down
5 changes: 5 additions & 0 deletions lessonbuilder/tool/src/webapp/js/show-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -3453,6 +3453,11 @@ function prepareQuestionDialog() {
$('#question-error').text(msg("simplepage.gbname-expected"));
$('#question-error-container').show();
return false;
} else if ($("input[name='multi_gradebook-fossil']").length > 0 && $("input[name='multi_gradebook-fossil']").val().includes("true") &&
$("input[name='group-list-span-selection']:checked").length === 0) {
$('#question-error').text(msg("simplepage.multi_gradebook.no_group"));
$('#question-error-container').show();
return false;
} else if ($("#question-text-area-evolved\\:\\:input").val() === '') {
$('#question-error').text(msg("simplepage.missing-question-text"));
$('#question-error-container').show();
Expand Down
5 changes: 5 additions & 0 deletions lessonbuilder/tool/src/webapp/templates/ShowPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,8 @@ <h4 rsf:id="msg=simplepage.answers"></h4></legend>
</div>

<div id="multipleChoiceDialogDiv">
<input type='hidden' rsf:id="multi_gradebook" id="multi_gradebook" />

<fieldset>
<legend>
<h4 rsf:id="msg=simplepage.answers"></h4></legend>
Expand Down Expand Up @@ -3310,6 +3312,9 @@ <h4><span rsf:id="peer-eval-target-name"></span></h4>
<p rsf:id="msg=simplepage.integer-expected" id="simplepage.integer-expected"></p>
<p rsf:id="msg=simplepage.integer-too-big" id="simplepage.integer-too-big"></p>
<p rsf:id="msg=simplepage.gbname-expected" id="simplepage.gbname-expected"></p>

<p rsf:id="msg=simplepage.multi_gradebook.no_group" id="simplepage.multi_gradebook.no_group"></p>

<p rsf:id="msg=simplepage.width-height" id="simplepage.width-height"></p>
<p rsf:id="msg=simplepage.nothing-over-100-percent" id="simplepage.nothing-over-100-percent"></p>
<p rsf:id="msg=simplepage.missing-question-text" id="simplepage.missing-question-text"></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1006,4 +1006,13 @@ pvt_enter_search_tags=Please select tags for search.

cdfm_gradebook_group_selector_instructions=Please, select only one item from the gradebook for groups selector
cdfm_gradebook_group_selector_error=You have selected more than one item in the gradebook for groups selector
cdfm_gradebook_group_selector_select_button=Select Item
cdfm_gradebook_group_selector_send_button=Select Item

# MULTI GRADEBOOK
group_sitegradebook_group_error=The site is configured with different instances per gradebook group, so the "Automatically create forums for groups" option must be selected.
group_sitegradebook_items_must_select=At least one gradebook item must be selected.
group_sitegradebook_items_error=The selected groups must have an associated gradebook item.
group_sitegradebook_info=This site is configured to have multiple gradebooks, so groups must be selected first, followed by their category or the corresponding gradebook item.
group_sitegradebook_group_items_error=Group gradebook items cannot be assigned to generic forums.
group_sitegradebook_simple_forum=This forum has been created generically, so group gradebook items cannot be assigned.
group_sitegradebook_forum_group_item_error=The selected item must belong to the configured group.
Original file line number Diff line number Diff line change
Expand Up @@ -996,3 +996,12 @@ pvt_read_receipt_email_subject={0} ha estat llegit
pvt_tags_header=Etiquetes
pvt_tags_save=Desar Etiquetes
pvt_enter_search_tags=Introdu\u00efu etiquetes per a la cerca.

# MULTI GRADEBOOK
group_sitegradebook_group_error=El curs est\u00e0 configurat amb inst\u00e0ncies diferents per grups de qualificacions, per la qual cosa cal seleccionar l\u2019opci\u00f3 "Crea autom\u00e0ticament diversos f\u00f2rums pels grups".
group_sitegradebook_items_must_select=Heu de seleccionar almenys un item del llibre de qualificacions.
group_sitegradebook_items_error=Els grups seleccionats han de tindre associat un \u00edtem del llibre de qualificacions.
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_group_items_error=No es poden assignar \u00edtems de llibre de qualificacions grupals a f\u00f2rums gen\u00e8rics.
group_sitegradebook_simple_forum=Aquest f\u00f2rum s\u0027ha creat de manera gen\u00e8rica, per la qual cosa no es poden assignar \u00edtems de llibres de qualificacions grupals.
group_sitegradebook_forum_group_item_error=L\u0027\u00edtem seleccionat ha de pert\u00e0nyer al grup configurat.
Original file line number Diff line number Diff line change
Expand Up @@ -1000,4 +1000,13 @@ pvt_enter_search_tags=Introduzca etiquetas de b\u00fasqueda.

cdfm_gradebook_group_selector_instructions=Por favor, elija s\u00f3lo un elemento en el selector de calificaciones por grupos
cdfm_gradebook_group_selector_error=Has seleccionado m\u00e1s de un elemento en el selector de calificaciones por grupos
cdfm_gradebook_group_selector_select_button=Seleccionar elemento
cdfm_gradebook_group_selector_send_button=Seleccionar elemento

# MULTI GRADEBOOK
group_sitegradebook_group_error=El curso est\u00e1 configurado con instancias diferentes por grupo de calificaciones por lo que se debe seleccionar la opción "Crear foros para grupos autom\u00e1ticamente".
group_sitegradebook_items_must_select=Se debe seleccionar al menos un item de calificaciones.
group_sitegradebook_items_error=Los grupos seleccionados deben tener asociado un item del libro de calificaciones.
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_group_items_error=No se pueden asignar items de libro de calificaciones grupales a foros genéricos.
group_sitegradebook_simple_forum=Este foro se ha creado de forma gen\u00e9rica, por lo que no se pueden asignar items de libros de calificaciones grupales.
group_sitegradebook_forum_group_item_error=El item seleccionado debe pertenecer al grupo configurado.
Loading

0 comments on commit c84a32f

Please sign in to comment.