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
  • Loading branch information
JuanDavid102 authored Feb 12, 2024
1 parent 72a2f00 commit 8850381
Show file tree
Hide file tree
Showing 39 changed files with 654 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@
}

.time-bar-button-container{
margin-top: 1em;
margin-bottom: 1em;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public final class SamigoConstants {
public static final String EVENT_LOG_BUNDLE = "org.sakaiproject.tool.assessment.bundle.EventLogMessages";
public static final String DATA_TABLES_BUNDLE = "org.sakaiproject.tool.assessment.bundle.DataTablesMessages";
public static final String QUESTION_POOL_BUNDLE = "org.sakaiproject.tool.assessment.bundle.QuestionPoolMessages";
public static final String SELECT_INDEX_BUNDLE = "org.sakaiproject.tool.assessment.bundle.SelectIndexMessages";

public static final String REFERENCE_ROOT = Entity.SEPARATOR + "samigo";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public interface AssessmentMetaDataIfc
public static final String RUBRICS = "ASSESSMENT_RUBRICS";
public static final String BGCOLOR = "ASSESSMENT_BGCOLOR";
public static final String BGIMAGE = "ASSESSMENT_BGIMAGE";
public static final String TRACK_QUESTIONS = "ASSESSMENT_TRACK_QUESTIONS";
public static final String ALIAS = "ALIAS";

public static final String CALENDAR_DUE_DATE_EVENT_ID = "CALENDAR_DUE_DATE_EVENT_ID";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,3 +454,7 @@ to_selected_gradebook=Grades sent to MANUALLY created gradebook (Gradebook > Add
usedGradebookAssessment=associated with ''{0}''
addtogradebook.previouslyAssoc = You are trying to associate this assessment with an already associated Gradebook item and scores might be overwritten. Do you want to continue?
gbNotExistsError=The gradebook item that you are trying to associate does not exist anymore.

#S2U-8
track_questions_title=Track questions
track_questions_msg=Tracks when questions are started (Students must click Start button for every question).
Original file line number Diff line number Diff line change
Expand Up @@ -452,3 +452,7 @@ to_selected_gradebook = Les puntuacions s\u2019envien a una llibreta de notes cr
usedGradebookAssessment=associat amb \u2019{0}\u2019
addtogradebook.previouslyAssoc=Esteu intentant associar aquest examen amb un element del llibre de qualificacions que ja est\u00e0 associat i pot ser que les puntuacions es sobreescriguin. Voleu continuar?
gbNotExistsError=L\u2019element del llibre de qualificacions que est\u00e1 intentant asociar ja no existeix al llibre de qualificacions.

#S2U-8
track_questions_title=Rastrejar preguntes
track_questions_msg=Registra quan s\u2019inicien les preguntes (els estudiants han de fer clic en el bot\u00F3 Iniciar per a cada pregunta).
Original file line number Diff line number Diff line change
Expand Up @@ -452,3 +452,7 @@ to_selected_gradebook=Las notas se enviar\u00e1n a una calificaci\u00f3n creada
usedGradebookAssessment=Asociada con ''{0}''
addtogradebook.previouslyAssoc=Est\u00e1s intentando asociar este examen con un item de calificaciones que ya est\u00e1 asociado. El item de calificaciones y las notas se sobreescribir\u00e1n. \u00bfQuieres continuar?
gbNotExistsError=El elemento de calificaciones que est\u00e1 intentando asociar ya no existe en Calificaciones.

#S2U-8
track_questions_title=Rastrear preguntas
track_questions_msg=Registra cuando se inician las preguntas (los estudiantes deben hacer clic en el bot\u00F3n Iniciar para cada pregunta).
Original file line number Diff line number Diff line change
Expand Up @@ -443,3 +443,7 @@ question_timed_info=Kronometratua bada, denbora amaitu arte ahal dute bidali ika
part_timeSelect_error=Zehaztu denbora-muga bat edo hautatu "Ez" aukera.
question_timeSelect_error=Zehaztu denbora-muga bat edo hautatu "Ez" aukera.
multiple_timers_detected=Azterketa hau tenporizadore askorekin konfiguratuta dago. Azterketa, parteak edo galderak bakarrik kronometratzea gomendatzen da, pantailan hainbat kronometro izatea gehiegizkoa izan daitekeelako ikasleentzat.

#S2U-8
track_questions_title=Track questions
track_questions_msg=Track when questions are started (Students must click Start button for every question).
Original file line number Diff line number Diff line change
Expand Up @@ -638,3 +638,7 @@ questionTimer_info_start=Timed question. Once you click \"Start\" you will have
questionTimer_info_start_deadline=Timed question. Once you click \"Start\" you will have <b>{0} or until {1} whichever is shorter</b> to complete this question. It will be <b>submitted at that time</b>, regardless of whether you have answered it.
questionTimer_info_end=The time allowed for this question has expired.
title_not_available=Question not started yet

#S2U-8
begin_assessment_msg_tracking_questions=All questions on this exam will be monitored. Therefore, until the 'Start' button is pressed on each question, the statement will not be displayed.
begin_assessment_msg_tracking_questions_2=Monitoring will be done based on the time taken to answer each question
Original file line number Diff line number Diff line change
Expand Up @@ -633,3 +633,7 @@ questionTimer_info_start=Pregunta temporitzada. Un cop feu clic a "Comen\u00e7ar
questionTimer_info_start_deadline=Pregunta temporitzada. Un cop feu clic a "Comen\u00e7ar", tindreu <b>{0} o fins a {1}, el que sigui m\u00e9s curt</b> per completar la pregunta. La pregunta <b>es lliurar\u00e0 quan s\u2019esgoti el termini</b>, sense tenir en compte si heu contestat.
questionTimer_info_end=El temps perm\u00E9s per a aquesta pregunta ha expirat.
title_not_available=Pregunta encara no iniciada

#S2U-8
begin_assessment_msg_tracking_questions=Totes les preguntes daquest examen seran monitoritzades. Per aix\u00f2 fins que no es premeu el bot\u00F3 de 'Comen\u00e7ar' no es mostr\u00e9s l'enunciat de la pregunta
begin_assessment_msg_tracking_questions_2=La monitoritzaci\u00f3 es far\u00e0 en base al temps trigat a respondre cada pregunta
Original file line number Diff line number Diff line change
Expand Up @@ -623,3 +623,7 @@ questionTimer_info_start=Pregunta temporizada. Una vez haga clic en "Comenzar",
questionTimer_info_start_deadline=Pregunta temporizada. Una vez haga clic en "Comenzar", tendr\u00e1 <b>{0} o hasta el {1}, lo que sea m\u00E1s corto</b> para poder completar esta pregunta. Ser\u00e1 <b>enviada transcurrido ese tiempo</b>, independientemente de si ha respondido.
questionTimer_info_end=El tiempo permitido para esta pregunta ha expirado.
title_not_available=Pregunta todav\u00EDa no iniciada

#S2U-8
begin_assessment_msg_tracking_questions=Todas las preguntas de este examen ser\u00e1n monitorizadas. Por lo cual hasta que no se pulse el bot\u00f3n de 'Comenzar' no se mostrar\u00e1 el enunciado de la pregunta
begin_assessment_msg_tracking_questions_2=La monitorizaci\u00f3n se har\u00e1 en base al tiempo tardado en responder cada pregunta
Original file line number Diff line number Diff line change
Expand Up @@ -631,3 +631,7 @@ questionTimer_info_start=Galdera tenporizatua. \"Hasi" botoia sakatu ondoren, {0
questionTimer_info_start_deadline=Galdea tenporizatua. \"Hasi" botoia sakatu ondoren {0} izango duzu galderari erantzuteko, edo data hau arte, {1}, (lehenengo gertatzen dena). Une horretan bidaliko da, erantzun duzun edo ez alde batera utzita.
questionTimer_info_end=Galdera hau egiteko denbora agortu da.
title_not_available=Titulua ez dago erabilgarria oraindik

#S2U-8
begin_assessment_msg_tracking_questions=Azterketa honetako galdera guztiak monitorizatuko dira. Beraz, "Hasi" botoia sakatu arte, ez da agertuko galderaren enuntziatua.
begin_assessment_msg_tracking_questions_2=Monitorizazioa galdera bakoitzari erantzuteko behar den denboran oinarritzen da
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,13 @@ fixed_random_draw_info=(fixed draw, {0} questions and random draw, {1} questions

# S2U-9
print_report=Print report

# S2U-8
t_sortTimeElapsed=Sort by Time Elapsed
time_elapsed=Time Elapsed
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 @@ -397,3 +397,13 @@ fixed_random_draw_info=(elecci\u00f3 fixa, {0} preguntes i selecci\u00f3 aleat\u

# S2U-9
print_report=Imprimir reporti

# 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:
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 @@ -398,3 +398,13 @@ fixed_random_draw_info=(modo fijo, {0} preguntas, modo aleatorio, {1} de {2} pre

# S2U-9
print_report=Imprimir reporte

# 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:
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 @@ -397,3 +397,13 @@ fixed_random_draw_info=(finkoak {0} galdera dira, eta ausazkoak {1} galdera dira

# S2U-9
print_report=Inprimatu txostena

# 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:
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 @@ -142,6 +142,7 @@ public class AssessmentSettingsBean extends SpringBeanAutowiringSupport implemen
private String keywords;
private String rubrics;
private String authors;
@Getter @Setter private Boolean trackQuestions;

// these are properties in AssessmentAccessControl
private Date startDate;
Expand Down Expand Up @@ -357,6 +358,7 @@ public void setAssessment(AssessmentFacade assessment) {
BGCOLOR);
this.bgImage = assessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.
BGIMAGE);
this.trackQuestions = Boolean.valueOf(assessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.TRACK_QUESTIONS));
if((assessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.
BGIMAGE)!=null )&&(!assessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.
BGIMAGE).equals(""))){
Expand Down Expand Up @@ -1093,6 +1095,7 @@ public void setValueMap(HashMap newMap){
AssessmentMetaData.KEYWORDS,
AssessmentMetaData.OBJECTIVES,
AssessmentMetaData.RUBRICS,
AssessmentMetaData.TRACK_QUESTIONS,
SecureDeliveryServiceAPI.EXITPWD_KEY,
SecureDeliveryServiceAPI.MODULE_KEY
)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public class PublishedAssessmentSettingsBean extends SpringBeanAutowiringSupport
private String keywords;
private String rubrics;
private String authors;
@Getter @Setter private Boolean trackQuestions;

// these are properties in PublishedAccessControl
private Date startDate;
Expand Down Expand Up @@ -333,6 +334,7 @@ public void setAssessment(PublishedAssessmentFacade assessment) {
BGCOLOR);
this.bgImage = assessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.
BGIMAGE);
this.trackQuestions = Boolean.valueOf(assessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.TRACK_QUESTIONS));

if((assessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.BGIMAGE)!=null )
&& (!assessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.BGIMAGE).equals(""))){
Expand Down
12 changes: 12 additions & 0 deletions ...o/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import org.sakaiproject.tool.assessment.data.dao.grading.MediaData;
import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentAccessControlIfc;
import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentBaseIfc;
import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentMetaDataIfc;
import org.sakaiproject.tool.assessment.data.ifc.shared.TypeIfc;
import org.sakaiproject.tool.assessment.facade.AgentFacade;
import org.sakaiproject.tool.assessment.facade.EventLogFacade;
Expand Down Expand Up @@ -337,6 +338,7 @@ public class DeliveryBean implements Serializable {
private String takenHours;
@Getter @Setter
private String takenMinutes;
@Getter
private AssessmentGradingData adata;
@Getter
private PublishedAssessmentFacade publishedAssessment;
Expand Down Expand Up @@ -455,6 +457,8 @@ public class DeliveryBean implements Serializable {
private boolean firstTimeTaking;
@Setter
private boolean timeExpired = false;
@Setter @Getter
private boolean trackingQuestions = false;
@Getter @Setter
private long lastTimer=0;

Expand Down Expand Up @@ -2763,4 +2767,12 @@ private void verifyExtendedTimeDeliveryService() {
public String getSebDownloadLink() {
return ServerConfigurationService.getString(SecureDeliverySeb.SEB_DOWNLOAD_LINK_PROPERTY, SecureDeliverySeb.SEB_DOWNLOAD_LINK_DEFAULT);
}

public Boolean isTrackingQuestions() {
return Boolean.valueOf(publishedAssessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.TRACK_QUESTIONS));
}

public Boolean getTrackingQuestions() {
return Boolean.valueOf(publishedAssessment.getAssessmentMetaDataByLabel(AssessmentMetaDataIfc.TRACK_QUESTIONS));
}
}
43 changes: 34 additions & 9 deletions ...migo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/ItemContentsBean.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import org.sakaiproject.tool.assessment.ui.bean.author.AuthorBean;
import org.sakaiproject.tool.assessment.ui.bean.util.Validator;
import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil;
import org.sakaiproject.tool.assessment.ui.listener.util.TimeUtil;
import org.sakaiproject.tool.assessment.util.AttachmentUtil;
import org.sakaiproject.tool.assessment.util.ItemCancellationUtil;
import org.sakaiproject.util.ResourceLoader;
Expand Down Expand Up @@ -1762,6 +1763,11 @@ public boolean isTimedQuestion() {
return (StringUtils.isNotBlank(value) && !StringUtils.equalsIgnoreCase(Boolean.FALSE.toString(), value));
}

public boolean isTrackingQuestion() {
DeliveryBean dbean = (DeliveryBean) ContextUtil.lookupBean("delivery");
return dbean.isTrackingQuestions();
}

public String getTimeLimit() {
return itemData.getItemMetaDataByLabel(ItemMetaDataIfc.TIMED);
}
Expand Down Expand Up @@ -1812,13 +1818,13 @@ public void setAttemptDate(Date attemptDate) {

/**
* Check if current item is Enabled
* -1: TimedQuestion, NOT started
* -1: TimedQuestion or TrackingQuestion, NOT started
* 0: TimedQuestion, Time expired
* 1: OK -> TimedQuestion, started and NOT expired, or NOT TimedQuestion
* 1: OK -> TimedQuestion started and NOT expired, or TrackingQuestion started, or NOT (TimedQuestion or TrackingQuestion)
* @return
*/
public int getEnabled() {
if(!isTimedQuestion()) {
if(!isTimedQuestion() && !isTrackingQuestion()) {
return 1;
}

Expand All @@ -1827,12 +1833,15 @@ public int getEnabled() {
return -1;
}

String timeBeforeDueRetract = getRealTimeLimit();
long adjustedTimedAssesmentDueDateLong = attemptDate.getTime() + (Long.parseLong(timeBeforeDueRetract) * 1000);
Date endDate = new Date(adjustedTimedAssesmentDueDateLong);

Date now = new Date();
return now.before(endDate) ? 1 : 0;
if(isTimedQuestion()) {
String timeBeforeDueRetract = getRealTimeLimit();
long adjustedTimedAssesmentDueDateLong = attemptDate.getTime() + (Long.parseLong(timeBeforeDueRetract) * 1000);
Date endDate = new Date(adjustedTimedAssesmentDueDateLong);

Date now = new Date();
return now.before(endDate) ? 1 : 0;
}
return 1;
}


Expand All @@ -1846,6 +1855,22 @@ public String getTimeElapsed() {
return "0";
}
}

public String getFormattedTimeElapsed() {
String timeElapsedInString = "";
int timeElapsedInSeconds;
try {
ItemGradingData itemGrading = this.getItemGradingDataArray().get(0);
timeElapsedInSeconds = ((int) itemGrading.getSubmittedDate().getTime()) / 1000 - ((int)itemGrading.getAttemptDate().getTime()) / 1000;
} catch (Exception ex) {
log.error("Question no answered, setting time as 0");
timeElapsedInSeconds = 0;
}
if (timeElapsedInSeconds > 0) {
timeElapsedInString = TimeUtil.getFormattedTime(timeElapsedInSeconds);
}
return timeElapsedInString;
}

public String startTimedQuestion() {
DeliveryBean delivery = (DeliveryBean) ContextUtil.lookupBean("delivery");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.sakaiproject.tool.assessment.data.ifc.assessment.PublishedAssessmentIfc;
import org.sakaiproject.tool.assessment.ui.bean.util.Validator;
import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil;
import org.sakaiproject.tool.assessment.ui.listener.util.TimeUtil;
import org.sakaiproject.tool.assessment.util.AttachmentUtil;
import org.sakaiproject.tool.cover.SessionManager;

Expand Down Expand Up @@ -520,18 +521,12 @@ public void setTimeElapsed(Integer timeElapsed) {
this.timeElapsed = timeElapsed;
}

public String getFormatedTimeElapsed() {
public String getFormattedTimeElapsed() {
String timeElapsedInString = "n/a";
if (this.timeElapsed!=null && this.timeElapsed >0)
{
int totalSec = this.timeElapsed;
int hr = totalSec / 3600;
int min = (totalSec % 3600)/60;
int sec = (totalSec % 3600)%60;
timeElapsedInString = "";
if (hr > 0) timeElapsedInString = hr + " hr ";
if (min > 0) timeElapsedInString = timeElapsedInString + min + " min ";
if (sec > 0) timeElapsedInString = timeElapsedInString + sec + " sec ";
timeElapsedInString = TimeUtil.getFormattedTime(totalSec);
}
return timeElapsedInString;
}
Expand Down
Loading

0 comments on commit 8850381

Please sign in to comment.