Skip to content

Commit

Permalink
S2U-8 5.1.1.4 Tests & Quizzes: Tracking and reporting of delivery tim…
Browse files Browse the repository at this point in the history
…es for questions - fix
  • Loading branch information
JuanDavid102 authored and fadesta102 committed Feb 21, 2024
1 parent e9a1e7a commit 5f11476
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,14 @@
.form-control {
@include border-radius(0 $button-radius 0 0);
}
.form-control-center {
@include border-radius(0);
}
}

p.input-group-addon.input-group-addon-right {
@include border-radius(0 $button-radius 0 0);
}
&:last-of-type {
.input-group-addon {
@include border-radius(0 0 $button-radius $button-radius);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ fixed_random_draw_info=(fixed draw, {0} questions and random draw, {1} questions
# S2U-8
t_sortTimeElapsed=Sort by Time Elapsed
time_elapsed=Time Elapsed
time_min=Minimum time:
time_avg=Average time:
time_max=Maximum time:
time_min=Minimum time
time_avg=Average time
time_max=Maximum time
timeStats_title=Time elapsed per response
timeStatsVariation_title=Variation
questionVariation_title=Variation of students who have obtained more than a {0} in the score ({1} submitted)
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ fixed_random_draw_info=(elecci\u00f3 fixa, {0} preguntes i selecci\u00f3 aleat\u
# S2U-8
t_sortTimeElapsed=Ordenar per Temps Emprat
time_elapsed=Temps Emprat
time_min=Temps m\u00ednim:
time_avg=Temps mitj\u00e0:
time_max=Temps m\u00e0xim:
time_min=Temps m\u00ednim
time_avg=Temps mitj\u00e0
time_max=Temps m\u00e0xim
timeStats_title=Temps transcorregut per resposta
timeStatsVariation_title=Variaci\u00f3
questionVariation_title=Variaci\u00f3 d'estudiants que han obtingut m\u00e9s d'un {0} en la puntuaci\u00f3 ({1} enviada)
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ fixed_random_draw_info=(modo fijo, {0} preguntas, modo aleatorio, {1} de {2} pre
# S2U-8
t_sortTimeElapsed=Ordenar por Tiempo Empleado
time_elapsed=Tiempo Empleado
time_min=Tiempo m\u00ednimo:
time_avg=Tiempo medio:
time_max=Tiempo m\u00e1ximo:
time_min=Tiempo m\u00ednimo
time_avg=Tiempo medio
time_max=Tiempo m\u00e1ximo
timeStats_title=Tiempo transcurrido por respuesta
timeStatsVariation_title=Variaci\u00f3n
questionVariation_title=Variaci\u00f3n de los alumnos que han sacado mas de un {0} de la puntuaci\u00f3n ({1} env\u00edos)
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ fixed_random_draw_info=(finkoak {0} galdera dira, eta ausazkoak {1} galdera dira
# S2U-8
t_sortTimeElapsed=Ordenatu erabilitako denboraren arabera
time_elapsed=Erabilitako denbora
time_min=Gutxieneko denbora:
time_avg=Batez besteko denbora:
time_max=Gehienezko denbora:
time_min=Gutxieneko denbora
time_avg=Batez besteko denbora
time_max=Gehienezko denbora
timeStats_title=Erantzun bakoitzeko igarotako denbora
timeStatsVariation_title=Aldakuntza
questionVariation_title=Puntuazioan {0} bat baino gehiago lortu duten ikasleen aldakuntza ({1} bidalitakoak)
Original file line number Diff line number Diff line change
Expand Up @@ -1259,9 +1259,9 @@ public ArrayList getTimeStatsArray() {
}

ArrayList timeStringArray = new ArrayList<>();
timeStringArray.add(new String[]{evaluationMessages.getString("time_min"), TimeUtil.getFormattedTime(timeStatsArray.get(1))});
timeStringArray.add(new String[]{evaluationMessages.getString("time_avg"), TimeUtil.getFormattedTime(timeStatsArray.get(0))});
timeStringArray.add(new String[]{evaluationMessages.getString("time_max"), TimeUtil.getFormattedTime(timeStatsArray.get(2))});
timeStringArray.add(new String[]{evaluationMessages.getString("time_min") + ":", TimeUtil.getFormattedTime(timeStatsArray.get(1))});
timeStringArray.add(new String[]{evaluationMessages.getString("time_avg") + ":", TimeUtil.getFormattedTime(timeStatsArray.get(0))});
timeStringArray.add(new String[]{evaluationMessages.getString("time_max") + ":", TimeUtil.getFormattedTime(timeStatsArray.get(2))});
return timeStringArray;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ private void prepareItemGradingPerItem(ActionEvent ae, DeliveryBean delivery,
|| itemgrading.getAttemptDate() != null) {
// null=> skipping this question
itemgrading.setAgentId(AgentFacade.getAgentString());
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
if (itemgrading.getRationale() != null && itemgrading.getRationale().length() > 0) {
itemgrading.setRationale(TextFormat.convertPlaintextToFormattedTextNoHighUnicode(itemgrading.getRationale()));
}
Expand All @@ -678,7 +678,7 @@ private void prepareItemGradingPerItem(ActionEvent ae, DeliveryBean delivery,
for (int m = 0; m < grading.size(); m++) {
ItemGradingData itemgrading = grading.get(m);
itemgrading.setAgentId(AgentFacade.getAgentString());
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
}
for (int m = 0; m < grading.size(); m++) {
ItemGradingData itemgrading = grading.get(m);
Expand All @@ -694,7 +694,7 @@ private void prepareItemGradingPerItem(ActionEvent ae, DeliveryBean delivery,
for (int m = 0; m < grading.size(); m++) {
ItemGradingData itemgrading = grading.get(m);
itemgrading.setAgentId(AgentFacade.getAgentString());
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
}
for (int m = 0; m < grading.size(); m++) {
ItemGradingData itemgrading = grading.get(m);
Expand All @@ -717,7 +717,7 @@ private void prepareItemGradingPerItem(ActionEvent ae, DeliveryBean delivery,
for (int m = 0; m < grading.size(); m++) {
ItemGradingData itemgrading = grading.get(m);
itemgrading.setAgentId(AgentFacade.getAgentString());
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
}
int fakeitemgrading=-1;
for (int m = 0; m < grading.size(); m++) {
Expand Down Expand Up @@ -760,7 +760,7 @@ else if (s != null) {
if (itemgrading.getPublishedAnswerId() != null ||
(itemgrading.getRationale() != null && !itemgrading.getRationale().trim().equals(""))) {
itemgrading.setAgentId(AgentFacade.getAgentString());
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
adds.add(itemgrading);
} else {
removes.add(itemgrading);
Expand All @@ -771,7 +771,7 @@ else if (s != null) {
(itemgrading.getRationale() != null && !itemgrading.getRationale().trim().equals(""))) {
// new addition not accepting any new answer with null for MCMR
itemgrading.setAgentId(AgentFacade.getAgentString());
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
adds.add(itemgrading);
}
}
Expand All @@ -789,7 +789,7 @@ else if (s != null) {
// old answer, check which one to keep, not keeping null answer
if (itemgrading.getPublishedAnswerId() != null) {
itemgrading.setAgentId(AgentFacade.getAgentString());
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
adds.add(itemgrading);
log.debug("adding answer: " + itemgrading.getItemGradingId());
} else if((!item.isTimedQuestion() && !delivery.isTrackingQuestions()) || grading.size() > 1){
Expand All @@ -801,7 +801,7 @@ else if (s != null) {
if (itemgrading.getPublishedAnswerId() != null) {
// new addition not accepting any new answer with null for EMI
itemgrading.setAgentId(AgentFacade.getAgentString());
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
adds.add(itemgrading);
log.debug("adding new answer answer: " + itemgrading.getItemGradingId());
}
Expand Down Expand Up @@ -834,7 +834,7 @@ else if (s != null) {
for(MediaData md : medias) {
delivery.getSubmissionFiles().put(itemgrading.getItemGradingId()+"_"+md.getMediaId(), md);
}
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
grading.set(m, itemgrading);
}
}
Expand Down Expand Up @@ -869,7 +869,7 @@ else if (s != null) {
if (itemgrading !=null && (itemgrading.getPublishedAnswerId() != null || itemgrading.getAnswerText() != null
|| (itemgrading.getRationale() != null && StringUtils.isNotBlank(itemgrading.getRationale())))) {
itemgrading.setAgentId(AgentFacade.getAgentString());
itemgrading.setSubmittedDate(new Date());
verifySubmittedDateInItemGrading(item, itemgrading);
if (itemgrading.getRationale() != null && itemgrading.getRationale().length() > 0) {
itemgrading.setRationale(TextFormat.convertPlaintextToFormattedTextNoHighUnicode(itemgrading.getRationale()));
}
Expand Down Expand Up @@ -932,6 +932,15 @@ else if (s != null) {
alladds.addAll(adds);
}

public void verifySubmittedDateInItemGrading(ItemContentsBean item, ItemGradingData itemgrading) {
int currentTimeInSeconds = 0;
if (itemgrading.getAttemptDate() != null) {
currentTimeInSeconds = (int) ((new Date()).getTime()/1000 - itemgrading.getAttemptDate().getTime()/1000);
}
if (item.getTimeLimit().equals("false") || Integer.parseInt(item.getTimeLimit()) >= currentTimeInSeconds) {
itemgrading.setSubmittedDate(new Date());
}
}
/**
* Identify the items in an EMI Answer that are orphaned
* @param grading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,24 @@ private AssessmentReport statisticsReport(String title, String subject, Histogra
}

private List<String> statisticsHeader(HistogramScoresBean histogramScoresBean) {
if(histogramScoresBean.isTrackingQuestion()) {
return Stream.of(
"sub_view",
"tot_score_possible",
"mean_eq",
"median",
"mode",
"range_eq",
"time_min",
"time_avg",
"time_max",
"qtile_1_eq",
"qtile_3_eq",
"std_dev",
"skew_coef"
).map(EVALUATION_BUNDLE::getFormattedMessage).collect(Collectors.toList());
}

return Stream.of(
"sub_view",
"tot_score_possible",
Expand All @@ -343,6 +361,12 @@ private List<List<String>> statisticsData(HistogramScoresBean histogramScoresBea
dataRow.add(histogramScoresBean.getMedian());
dataRow.add(histogramScoresBean.getMode());
dataRow.add(histogramScoresBean.getRange());
if (histogramScoresBean.isTrackingQuestion()) {
String[] timeStats = histogramScoresBean.getTimeStats();
dataRow.add(timeStats[0]);
dataRow.add(timeStats[1]);
dataRow.add(timeStats[2]);
}
dataRow.add(histogramScoresBean.getQ1());
dataRow.add(histogramScoresBean.getQ3());
dataRow.add(histogramScoresBean.getStandDev());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ function toPoint(id)
<h:outputText value="#{deliveryMessages.q} #{question.sequence} #{deliveryMessages.of} " />
<h:outputText value="#{part.numbering}#{deliveryMessages.column} " />
</p>
<h:inputText styleClass="form-control adjustedScore#{studentScores.assessmentGradingId}.#{question.itemData.itemId}" id="adjustedScore" value="#{question.pointsForEdit}" onchange="toPoint(this.id);" validatorMessage="#{evaluationMessages.number_format_error_adjusted_score}" disabled="#{question.cancelled}">
<h:inputText styleClass="form-control #{delivery.trackingQuestions && question.formattedTimeElapsed ? '' : 'form-control-center'} adjustedScore#{studentScores.assessmentGradingId}.#{question.itemData.itemId}" id="adjustedScore" value="#{question.pointsForEdit}" onchange="toPoint(this.id);" validatorMessage="#{evaluationMessages.number_format_error_adjusted_score}" disabled="#{question.cancelled}">
<f:validateDoubleRange/>
</h:inputText>
<h:panelGroup rendered="#{delivery.trackingQuestions && question.formattedTimeElapsed != ''}">
<p class="input-group-addon">
<p class="input-group-addon input-group-addon-right">
<h:outputText value="#{evaluationMessages.time_elapsed}: #{question.formattedTimeElapsed}" />
</p>
</h:panelGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,23 +276,23 @@ $Id$
<h:panelGroup rendered="#{histogramScores.trackingQuestion}">
<tr>
<th>
<h:outputText value="#{evaluationMessages.time_min}" />
<h:outputText value="#{evaluationMessages.time_min}:" />
</th>
<td>
<h:outputText value="#{histogramScores.timeStats[0]}" />
</td>
</tr>
<tr>
<th>
<h:outputText value="#{evaluationMessages.time_avg}" />
<h:outputText value="#{evaluationMessages.time_avg}:" />
</th>
<td>
<h:outputText value="#{histogramScores.timeStats[1]}" />
</td>
</tr>
<tr>
<th>
<h:outputText value="#{evaluationMessages.time_max}" />
<h:outputText value="#{evaluationMessages.time_max}:" />
</th>
<td>
<h:outputText value="#{histogramScores.timeStats[2]}" />
Expand Down

0 comments on commit 5f11476

Please sign in to comment.