Index: lams_tool_assessment/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r50badebd77a913275818f3966f85503a56581e5b -r69e2980b566d069500c2e5c07dccf96e29cc287c --- lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 50badebd77a913275818f3966f85503a56581e5b) +++ lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 69e2980b566d069500c2e5c07dccf96e29cc287c) @@ -1,348 +1,352 @@ -appName = assessment -#language code: en -#locale code: AU - - # Exported from the LAMS Community by Ernie Ghiglione on Fri Dec 28 09:17:35 CST 2018 - -#=================== labels for Assessment =================# - -appName =Assessment Tool -activity.description =Tool for assessing learners -activity.helptext =Create questions to assess learners. -tool.display.name =Assessment Tool -tool.description =Tool for assessing learners. -label.authoring.heading =Assessment Authoring -label.author.title =Assessment -label.authoring.heading.basic =Basic -label.authoring.heading.basic.desc =Basic input information for assessment tool -label.authoring.heading.advance.desc =Please input advance options for assessment tool -label.authoring.basic.title =Title -label.authoring.basic.question.name =Question name -label.authoring.basic.question.text =Question text -label.authoring.basic.default.question.grade =Default question grade -label.authoring.basic.penalty.factor =Penalty factor -label.authoring.basic.general.feedback =General feedback -label.authoring.basic.shuffle.the.choices =Shuffle answers? -label.authoring.basic.add.question =Add question -label.authoring.basic.question.list.title =Question list -label.authoring.basic.list.header.type =Type -label.authoring.basic.list.header.question =Question -label.authoring.basic.type.multiple.choice =Multiple choice -label.authoring.basic.type.matching.pairs =Matching pairs -label.authoring.basic.type.short.answer =Short answer -label.authoring.basic.type.numerical =Numerical -label.authoring.basic.type.true.false =True/False -label.authoring.basic.type.essay =Essay -label.authoring.basic.type.ordering =Ordering -label.authoring.basic.edit =Edit -label.authoring.basic.delete =Delete -label.authoring.basic.down =Move down -label.authoring.basic.up =Move Up -label.authoring.basic.option.answer =Answer -label.authoring.basic.option.question =Question -label.authoring.basic.option.grade =Grade -label.authoring.basic.option.feedback =Feedback -label.authoring.basic.option.accepted.error =Accepted error -label.authoring.basic.unit.unit =Unit -label.authoring.basic.unit.multiplier =Multiplier -label.authoring.basic.none =None -label.authoring.choice.add.multiple.choice =Add multiple choice -label.authoring.choice.field.required =This field is required. -label.authoring.choice.enter.integer =Please enter an integer. -label.authoring.choice.enter.float =Please enter a floating point number. -label.authoring.choice.one.multiple.answers =One or multiple answers? -label.authoring.choice.one.answer =One answer only -label.authoring.choice.multiple.answers =Multiple answers allowed -label.authoring.choice.overall.feedback =Overall feedback -label.authoring.choice.feedback.on.correct =For any correct response -label.authoring.choice.feedback.on.partially.correct =For any partially correct response -label.authoring.choice.feedback.on.incorrect =For any incorrect response -label.authoring.choice.add.option =Add another answer -label.authoring.matching.pairs.add.matching.pairs =Add question -label.authoring.matching.pairs.matching.pairs =Matching pairs -label.authoring.matching.pairs.error.one.matching.pair =You should provide at least 1 matching pair. -label.authoring.matching.pairs.add.matching.pair =Add another -label.authoring.short.answer.no.case.unimportant =No, case is unimportant -label.authoring.short.answer.yes.case.must.match =Yes, case must match -label.authoring.short.answer.case.sensitivity =Case sensitivity -label.authoring.short.answer.answers =Answers -label.authoring.short.answer.add.answer =Add another answer -label.authoring.short.answer.add.short.answer =Add question -label.authoring.true.false.question =True/False question -label.authoring.true.false.correct.answer =Correct answer -label.authoring.true.false.false =False -label.authoring.true.false.true =True -label.authoring.true.false.feedback.on.true =Feedback for the response 'True'. -label.authoring.true.false.feedback.on.false =Feedback for the response 'False'. -label.authoring.true.false.add.true.false =Add question -label.authoring.numerical.question =Numerical question -label.authoring.numerical.answers =Answers -label.authoring.numerical.units =Units -label.authoring.numerical.error.answer =You should provide at least one possible answer. -label.authoring.numerical.add.answer =Add another answer -label.authoring.numerical.add.numerical =Add question -label.authoring.numerical.add.unit =Add another unit -label.authoring.essay.add.essay =Add question -label.authoring.ordering.add.ordering =Add question -label.authoring.advance.allow.students.overall.feedback =Display overall feedback at the end of each attempt -label.authoring.advance.time.limit =Time limit (minutes) -label.authoring.advance.questions.per.page =Questions per page -label.authoring.advance.all.in.one.page =All in one page -label.authoring.advance.shuffle.questions =Shuffle questions -label.authoring.advance.attempts.allowed =Attempts allowed -label.authoring.advance.unlimited =Unlimited -label.authoring.advance.allow.students.question.feedback =Allow learners to see question feedback after each question -label.authoring.advance.allow.students.right.wrong.answers =Allow learners to see right/wrong answers -label.authoring.advance.allow.students.grades =Allow learners to see grades at the end of each attempt -label.authoring.advance.allow.students.history.responses =Allow learners to see history of responses at the end of each attempt -label.authoring.advance.overall.feedback =Overall feedback -label.authoring.advance.grade.boundary =Grade boundary -label.authoring.advance.feedback =Feedback -label.authoring.advance.add.feedback.field =Add feedback -label.authoring.cancel.button =Cancel -label.authoring.basic.answer.options =Answer options -label.authoring.basic.instruction =Instructions -error.default.grade.wrong.format =Default question grade should be of numeric format -error.penalty.factor.wrong.format =Penalty factor should be of float format -error.question.name.blank =Question name can not be blank. -error.question.text.blank =Question text can not be blank. -error.msg.default.content.not.find =Could not retrieve default content record for this tool. -error.monitoring.export.excel =Export assessment report failed because of this reason: {0} -authoring.msg.cancel.save =Do you want to close this window without saving? -authoring.msg.one.question.to.be.saved =There must be at least one question to be saved. -label.learning.page =Page: -label.learning.title =Assessment -label.learning.choose.one.answer =Choose one of the following answers. -label.learning.choose.at.least.one.answer =Choose at least one answer. -label.learning.matching.pairs.pick.up =Pick up the corresponding answers -label.learning.matching.pairs.choose =Choose -label.learning.short.answer.answer =Answer: -label.learning.true.false.true =True -label.learning.true.false.false =False -label.learning.ordering.sort.answers =Sort answers in the right order -label.learning.marks =Marks for this submission: {0}/{1}. -label.learning.penalty =This submission attracted a penalty of {0}. -label.learning.finish.test =Finish -label.learning.submit.all =Submit all -label.learning.next.activity =Next Activity -label.learning.resubmit =Resubmit -label.learning.summary.started.on =Started on -label.learning.summary.completed.on =Completed on -label.learning.summary.time.taken =Time taken (minutes) -label.learning.summary.hours =hour(s) -label.learning.summary.minutes =minutes -label.learning.summary.grade =Grade -label.learning.summary.out.of.maximum =out of a maximum of -label.learning.summary.feedback =Feedback -label.learning.question.summary.history.responces =History of responses: -label.learning.question.summary.response =Response -label.learning.question.summary.grade =Grade -label.learning.countdown.time.left =Time left -label.learning.blockui.time.is.over =Time is over. Processing your answers... -label.learning.blockui.are.you.ready =You are going to participate in activity that has time limitation. Are you ready to start? -monitoring.tab.summary =Summary -monitoring.tab.statistics =Stats -monitoring.tab.edit.activity =Edit Activity -monitoring.label.group =Group -monitoring.label.user.name =Name -label.monitoring.edit.activity.edit =Edit -label.monitoring.summary.summary =Summary -label.monitoring.summary.double.click =Double click on learner's name to get full individual report. -label.monitoring.summary.report.by.question =Report by question -label.monitoring.summary.export.summary =Export summary -label.monitoring.summary.results.question =Detailed question results -label.monitoring.summary.choose =Choose... -label.monitoring.summary.user.name =Name -label.monitoring.summary.total =Total -label.monitoring.summary.learner.summary =Learner summary -label.monitoring.user.summary.history.responses =History of responses -label.monitoring.user.summary.user.name =Username -label.monitoring.user.summary.number.attempts =Number of attempts -label.monitoring.user.summary.time.last.attempt =Time in the last attempt -label.monitoring.user.summary.last.attempt.grade =Last attempt grade -label.monitoring.user.summary.attempt =Attempt -label.monitoring.user.summary.time =Time -label.monitoring.user.summary.response =Response -label.monitoring.user.summary.grade =Grade -label.monitoring.user.summary.title =Title: -label.monitoring.user.summary.question =Question: -label.monitoring.user.summary.ok =Ok -label.monitoring.question.summary.history.responses =Responses for the question -label.monitoring.question.summary.title =Title -label.monitoring.question.summary.question =Question -label.monitoring.question.summary.default.mark =Default mark -label.monitoring.question.summary.penalty =Penalty -label.monitoring.question.summary.average.mark =Average mark -label.monitoring.question.summary.group =Group: -label.monitoring.question.summary.ok =Ok -output.desc.learner.total.score =Last total score -output.desc.learner.time.taken =Time taken -output.desc.learner.number.of.attempts =Number of attempts -output.user.score.for.question =Score for the question: -error.form.validation.error =You have 1 error in a form. It has been highlighted -error.form.validation.errors =You have {0} errors in a form. They have been highlighted -error.form.validation.hundred.score =One of the answers should have a grade of 100% so it is possible to get full marks for this question. -error.form.validation.positive.accepted.errors =All the accepted errors should be positive. -message.monitoring.summary.no.session =No learners yet -label.cancel =Cancel -define.later.message =Please wait for the instructor to complete the contents of this activity. -button.try.again =Try again -activity.title =Assessment -label.authoring.save.button =Save -label.authoring.heading.advance =Advanced -label.down =Move down -label.finished =Next Activity -label.finish =Finished -label.on =On -label.off =Off -monitor.summary.th.advancedSettings =Advanced settings -label.authoring.advanced.notify.on.attempt.completion =Notify instructor when learner completes attempt -event.learner.completes.attempt.subject =LAMS: Learner completed attempt in Assessment tool -event.learner.completes.attempt.body =The learner {0} completed attempt in Assessment tool.\n\nThis message was send automatically, following tool''''s advanced settings. -message.alertContentEdit =Note: One or more learners have accessed this activity and it cannot longer be modified. -warning.msg.authoring.do.you.want.to.delete =Do you really want to delete this question? -label.export.exported.on =Exported on: -label.export.question.summary =Question summary -label.export.user.summary =Learner summary -label.export.date.attempted =Date attempted -label.export.mark =Mark -label.export.time.taken =Time taken from activity start (seconds) -label.export.average =Average -label.export.summary.by.user =Summary by learner -lable.export.summary.by.question =Summary by question -label.export.user.id =Username -label.authoring.basic.allow.learners.rich.editor =Allow learners to use rich text editor -label.authoring.advance.allow.students.right.answers =Indicate choice(s) that have been answered correctly. -label.authoring.advance.allow.students.wrong.answers =Indicate choice(s) that have been answered incorrectly. -monitor.summary.date.restriction =Deadline -monitor.summary.when.date.restriction.is.set =Learners will not be able to take this assessment after the set date and time. -monitor.summary.after.date =Date/time: -monitor.summary.set.restriction =Set restriction -monitor.summary.unset.restriction =Remove restriction -authoring.info.teacher.set.restriction =For this activity, the instructor fixed a deadline until {0}. After this time this activity will not be available. -monitor.summary.notification =Notification -monitor.summary.date.restriction.set =Deadline has been set -monitor.summary.date.restriction.removed =Deadline has been removed -label.authoring.advance.passing.mark =Assessment passing mark -label.authoring.advance.choose.restriction =Choose restriction: -label.authoring.advance.passing.mark.none =None -label.learning.havent.reached.passing.mark =Sorry, you haven''t scored {0} required to pass the activity. Please, try one more time. -label.authoring.basic.add.question.to.pool =Add question -label.authoring.basic.add.question.to.list =Add question to list -label.authoring.basic.question.bank.title =Question bank -label.authoring.basic.list.header.mark =Mark -label.authoring.basic.type.random.question =Random question -label.authoring.basic.select.random.question =Random question from pool -label.authoring.basic.random.question =Question -label.authoring.basic.warning.too.many.questions =Too many questions in a list. Please, remove some of them. -authoring.import.result =Import tool content result -authoring.title.import =Import questions -authoring.import.instruction =Please choose questions to import. -button.select.importfile =Select file to import -msg.import.file.format =The import file must be .xml file exported from assessment tool and not exceed size of {0} -label.import.file =Import xml file -button.import =Import -label.authoring.basic.import.questions =Import -label.authoring.basic.export.questions =Export -label.authoring.advance.display.summary =Display all questions and answers once the learner finishes. -label.authoring.basic.import.qti =Import IMS QTI -advanced.reflectOnActivity =Add a notebook at end of Assessment with the following instructions: -monitor.summary.td.addNotebook =Add a notebook at end of Assessment -monitor.summary.td.notebookInstructions =Notebook instructions -label.export.reflection =Notebook Entries -label.continue =Continue -label.edit =Edit -label.submit =Finish -label.authoring.advance.numbered.questions =Enable questions' numbering -label.learning.draft.autosaved =Draft autosaved -label.waiting.for.leader =Please, wait while somebody will become a group leader -label.users.from.group =Other learners participating in current group: -label.use.select.leader.tool.output =Use leaders from Select Leader tool -label.group.leader =Group leader: {0} -label.refresh =Refresh -label.display.name.column =Display name column -label.authoring.answer.required =Answer required? -warn.answers.required =Please, answer highlighted questions in order to continue. -label.authoring.basic.export.qti =Export IMS QTI -label.monitoring.heading =Assessment Monitoring -label.maximum.number.words =Maximum number of words -label.minimum.number.words =Minimum number of words -label.info.maximum.number.words =This answer must have a maximum of {0} words. -label.info.minimum.number.words =This answer must have a minimum of {0} words. -label.info.max.and.min.number.words =This answer must have a minimal of {0} and maximum of {1} words. -warn.answers.word.requirements.limit =In order to continue, please note the word limit restrictions. -label.words =Words: -message.no.reflection.available =No notebook entry has been added. -label.authoring.basic.type.mark.hedging =Mark hedging -label.option.correct =Correct? -label.assign.hedging.mark =Assign marks to answers. Max possible mark: {0} -label.learning.submit =Submit -warn.mark.hedging.wrong.total =In order to continue, all mark hedging questions should have all available marks assigned. -label.incorrect.answer.nullifies.mark =Assigns full mark only when the correct answers are selected. -label.export.summary =Summary -label.justify.hedging.marks =Please, justify your mark allocation. -label.select.leader =Leader selection -label.question.options =Question options -label.activity.completion =End of activity -label.notifications =Notifications -label.ask.for.hedging.justification =Ask for hedging justification? -label.number.learners.per.session =Number of learners per session -label.tool.output =Tool Output -output.desc.best.score =Best score -label.tool.output.has.been.changed =Tool Output has been changed -output.desc.first.score =First score -output.desc.average.score =Average score -label.waiting.for.leader.launch.time.limit =Leader has not started the activity. Please wait until he/she commences it. -label.waiting.for.leader.finish =Time limit set by teacher is over. Please wait until a group leader submits all answers. -warn.mark.hedging.wrong.justification =Justification cannot be left blank -error.import.file.format =The import file is not an .xml file. -label.file =File -errors.maxfilesize =File exceeds maximum file size {0} -label.summary.downloaded =Summary downloaded -label.not.answered =Not Answered -label.other =Other -label.graph.help =In the graph(s) below, click on a bar in the graph and then use your mouse wheel to zoom in and out of the graph. Once you zoom in, the grey selection in the bottom graph can be dragged left or right to show a different set of marks. -label.lowest.mark =Lowest mark: -label.highest.mark =Highest mark: -label.number.learners =Number of learners -label.percentage =Percentage -label.operation.failed =Operation failed. -label.number.groups.finished =Number of groups finished -label.marks =Marks -label.number.learners.in.mark.range =Number of learners in mark range -label.number.groups.in.mark.range =Number of groups in mark range -label.average.mark =Average mark -label.error =Error -error.loaderror =There was an error loading the grid. If this problem persists, please contact your system administrator. -label.ok =OK -message.monitoring.edit.activity.warning =Warning: if you edit and modify a question or change an answer that when a student has already answer, the marks will be recalculated based on the changes. -label.enable.confidence.levels =Enable confidence level -label.what.is.your.confidence.level =How confident are you of your answer? -label.confidence =Confidence -label.no.question.references =No questions have been added to the question list. Do you still want to proceed with no questions? -label.hide.name.column =Hide name column -label.ae.questions.marks =AE Questions & Marks -label.ira.questions.marks =iRA Questions & Marks -label.attendance =Attendance -label.show.students.choices =Show students' choices -label.hide.students.choices =Hide students' choices -label.print =Print -label.excel.export =Excel export -label.teams =Teams -label.no.questions.in.question.bank =No questions have been added to the question list. Do you still want to proceed with no questions? -label.authoring.advance.disclose.answers =Disclose learner's and other groups' answers in monitor -label.learning.summary.other.team.answers =Other teams' answers -label.learning.summary.selected.by =Selected by: -label.disclose.correct.answers =Disclose correct answers -label.disclose.groups.answers =Disclose groups' answers -label.disclose.all.correct.answers =Disclose all correct answers -label.disclose.all.groups.answers =Disclose all groups' answers -label.prefix.sequential.letters.for.each.answer =Prefix sequential letters for each answer -label.edit.in.monitor.warning =Attention: while you edit this assessment students don't have access to it. You must save your changes so students can re-attempt this assessment again. -outcome.authoring.title =Learning outcomes -outcome.authoring.input =Search and select by outcome name or code -outcome.authoring.existing =Added outcomes -outcome.authoring.existing.none =none - - -#======= End labels: Exported 337 labels for en AU ===== +appName = assessment +#language code: en +#locale code: AU + + # Exported from the LAMS Community by Ernie Ghiglione on Fri Dec 28 09:17:35 CST 2018 + +#=================== labels for Assessment =================# + +appName =Assessment Tool +activity.description =Tool for assessing learners +activity.helptext =Create questions to assess learners. +tool.display.name =Assessment Tool +tool.description =Tool for assessing learners. +label.authoring.heading =Assessment Authoring +label.author.title =Assessment +label.authoring.heading.basic =Basic +label.authoring.heading.basic.desc =Basic input information for assessment tool +label.authoring.heading.advance.desc =Please input advance options for assessment tool +label.authoring.basic.title =Title +label.authoring.basic.question.name =Question name +label.authoring.basic.question.text =Question text +label.authoring.basic.default.question.grade =Default question grade +label.authoring.basic.penalty.factor =Penalty factor +label.authoring.basic.general.feedback =General feedback +label.authoring.basic.shuffle.the.choices =Shuffle answers? +label.authoring.basic.add.question =Add question +label.authoring.basic.question.list.title =Question list +label.authoring.basic.list.header.type =Type +label.authoring.basic.list.header.question =Question +label.authoring.basic.type.multiple.choice =Multiple choice +label.authoring.basic.type.matching.pairs =Matching pairs +label.authoring.basic.type.short.answer =Short answer +label.authoring.basic.type.numerical =Numerical +label.authoring.basic.type.true.false =True/False +label.authoring.basic.type.essay =Essay +label.authoring.basic.type.ordering =Ordering +label.authoring.basic.edit =Edit +label.authoring.basic.delete =Delete +label.authoring.basic.down =Move down +label.authoring.basic.up =Move Up +label.authoring.basic.option.answer =Answer +label.authoring.basic.option.question =Question +label.authoring.basic.option.grade =Grade +label.authoring.basic.option.feedback =Feedback +label.authoring.basic.option.accepted.error =Accepted error +label.authoring.basic.unit.unit =Unit +label.authoring.basic.unit.multiplier =Multiplier +label.authoring.basic.none =None +label.authoring.choice.add.multiple.choice =Add multiple choice +label.authoring.choice.field.required =This field is required. +label.authoring.choice.enter.integer =Please enter an integer. +label.authoring.choice.enter.float =Please enter a floating point number. +label.authoring.choice.one.multiple.answers =One or multiple answers? +label.authoring.choice.one.answer =One answer only +label.authoring.choice.multiple.answers =Multiple answers allowed +label.authoring.choice.overall.feedback =Overall feedback +label.authoring.choice.feedback.on.correct =For any correct response +label.authoring.choice.feedback.on.partially.correct =For any partially correct response +label.authoring.choice.feedback.on.incorrect =For any incorrect response +label.authoring.choice.add.option =Add another answer +label.authoring.matching.pairs.add.matching.pairs =Add question +label.authoring.matching.pairs.matching.pairs =Matching pairs +label.authoring.matching.pairs.error.one.matching.pair =You should provide at least 1 matching pair. +label.authoring.matching.pairs.add.matching.pair =Add another +label.authoring.short.answer.no.case.unimportant =No, case is unimportant +label.authoring.short.answer.yes.case.must.match =Yes, case must match +label.authoring.short.answer.case.sensitivity =Case sensitivity +label.authoring.short.answer.answers =Answers +label.authoring.short.answer.add.answer =Add another answer +label.authoring.short.answer.add.short.answer =Add question +label.authoring.true.false.question =True/False question +label.authoring.true.false.correct.answer =Correct answer +label.authoring.true.false.false =False +label.authoring.true.false.true =True +label.authoring.true.false.feedback.on.true =Feedback for the response 'True'. +label.authoring.true.false.feedback.on.false =Feedback for the response 'False'. +label.authoring.true.false.add.true.false =Add question +label.authoring.numerical.question =Numerical question +label.authoring.numerical.answers =Answers +label.authoring.numerical.units =Units +label.authoring.numerical.error.answer =You should provide at least one possible answer. +label.authoring.numerical.add.answer =Add another answer +label.authoring.numerical.add.numerical =Add question +label.authoring.numerical.add.unit =Add another unit +label.authoring.essay.add.essay =Add question +label.authoring.ordering.add.ordering =Add question +label.authoring.advance.allow.students.overall.feedback =Display overall feedback at the end of each attempt +label.authoring.advance.time.limit =Time limit (minutes) +label.authoring.advance.questions.per.page =Questions per page +label.authoring.advance.all.in.one.page =All in one page +label.authoring.advance.shuffle.questions =Shuffle questions +label.authoring.advance.attempts.allowed =Attempts allowed +label.authoring.advance.unlimited =Unlimited +label.authoring.advance.allow.students.question.feedback =Allow learners to see question feedback after each question +label.authoring.advance.allow.students.right.wrong.answers =Allow learners to see right/wrong answers +label.authoring.advance.allow.students.grades =Allow learners to see grades at the end of each attempt +label.authoring.advance.allow.students.history.responses =Allow learners to see history of responses at the end of each attempt +label.authoring.advance.overall.feedback =Overall feedback +label.authoring.advance.grade.boundary =Grade boundary +label.authoring.advance.feedback =Feedback +label.authoring.advance.add.feedback.field =Add feedback +label.authoring.cancel.button =Cancel +label.authoring.basic.answer.options =Answer options +label.authoring.basic.instruction =Instructions +error.default.grade.wrong.format =Default question grade should be of numeric format +error.penalty.factor.wrong.format =Penalty factor should be of float format +error.question.name.blank =Question name can not be blank. +error.question.text.blank =Question text can not be blank. +error.msg.default.content.not.find =Could not retrieve default content record for this tool. +error.monitoring.export.excel =Export assessment report failed because of this reason: {0} +authoring.msg.cancel.save =Do you want to close this window without saving? +authoring.msg.one.question.to.be.saved =There must be at least one question to be saved. +label.learning.page =Page: +label.learning.title =Assessment +label.learning.choose.one.answer =Choose one of the following answers. +label.learning.choose.at.least.one.answer =Choose at least one answer. +label.learning.matching.pairs.pick.up =Pick up the corresponding answers +label.learning.matching.pairs.choose =Choose +label.learning.short.answer.answer =Answer: +label.learning.true.false.true =True +label.learning.true.false.false =False +label.learning.ordering.sort.answers =Sort answers in the right order +label.learning.marks =Marks for this submission: {0}/{1}. +label.learning.penalty =This submission attracted a penalty of {0}. +label.learning.finish.test =Finish +label.learning.submit.all =Submit all +label.learning.next.activity =Next Activity +label.learning.resubmit =Resubmit +label.learning.summary.started.on =Started on +label.learning.summary.completed.on =Completed on +label.learning.summary.time.taken =Time taken (minutes) +label.learning.summary.hours =hour(s) +label.learning.summary.minutes =minutes +label.learning.summary.grade =Grade +label.learning.summary.out.of.maximum =out of a maximum of +label.learning.summary.feedback =Feedback +label.learning.question.summary.history.responces =History of responses: +label.learning.question.summary.response =Response +label.learning.question.summary.grade =Grade +label.learning.countdown.time.left =Time left +label.learning.blockui.time.is.over =Time is over. Processing your answers... +label.learning.blockui.are.you.ready =You are going to participate in activity that has time limitation. Are you ready to start? +monitoring.tab.summary =Summary +monitoring.tab.statistics =Stats +monitoring.tab.edit.activity =Edit Activity +monitoring.label.group =Group +monitoring.label.user.name =Name +label.monitoring.edit.activity.edit =Edit +label.monitoring.summary.summary =Summary +label.monitoring.summary.double.click =Double click on learner's name to get full individual report. +label.monitoring.summary.report.by.question =Report by question +label.monitoring.summary.export.summary =Export summary +label.monitoring.summary.results.question =Detailed question results +label.monitoring.summary.choose =Choose... +label.monitoring.summary.user.name =Name +label.monitoring.summary.total =Total +label.monitoring.summary.learner.summary =Learner summary +label.monitoring.user.summary.history.responses =History of responses +label.monitoring.user.summary.user.name =Username +label.monitoring.user.summary.number.attempts =Number of attempts +label.monitoring.user.summary.time.last.attempt =Time in the last attempt +label.monitoring.user.summary.last.attempt.grade =Last attempt grade +label.monitoring.user.summary.attempt =Attempt +label.monitoring.user.summary.time =Time +label.monitoring.user.summary.response =Response +label.monitoring.user.summary.grade =Grade +label.monitoring.user.summary.title =Title: +label.monitoring.user.summary.question =Question: +label.monitoring.user.summary.ok =Ok +label.monitoring.question.summary.history.responses =Responses for the question +label.monitoring.question.summary.title =Title +label.monitoring.question.summary.question =Question +label.monitoring.question.summary.default.mark =Default mark +label.monitoring.question.summary.penalty =Penalty +label.monitoring.question.summary.average.mark =Average mark +label.monitoring.question.summary.group =Group: +label.monitoring.question.summary.ok =Ok +output.desc.learner.total.score =Last total score +output.desc.learner.time.taken =Time taken +output.desc.learner.number.of.attempts =Number of attempts +output.user.score.for.question =Score for the question: +error.form.validation.error =You have 1 error in a form. It has been highlighted +error.form.validation.errors =You have {0} errors in a form. They have been highlighted +error.form.validation.hundred.score =One of the answers should have a grade of 100% so it is possible to get full marks for this question. +error.form.validation.positive.accepted.errors =All the accepted errors should be positive. +message.monitoring.summary.no.session =No learners yet +label.cancel =Cancel +define.later.message =Please wait for the instructor to complete the contents of this activity. +button.try.again =Try again +activity.title =Assessment +label.authoring.save.button =Save +label.authoring.heading.advance =Advanced +label.down =Move down +label.finished =Next Activity +label.finish =Finished +label.on =On +label.off =Off +monitor.summary.th.advancedSettings =Advanced settings +label.authoring.advanced.notify.on.attempt.completion =Notify instructor when learner completes attempt +event.learner.completes.attempt.subject =LAMS: Learner completed attempt in Assessment tool +event.learner.completes.attempt.body =The learner {0} completed attempt in Assessment tool.\n\nThis message was send automatically, following tool''''s advanced settings. +message.alertContentEdit =Note: One or more learners have accessed this activity and it cannot longer be modified. +warning.msg.authoring.do.you.want.to.delete =Do you really want to delete this question? +label.export.exported.on =Exported on: +label.export.question.summary =Question summary +label.export.user.summary =Learner summary +label.export.date.attempted =Date attempted +label.export.mark =Mark +label.export.time.taken =Time taken from activity start (seconds) +label.export.average =Average +label.export.summary.by.user =Summary by learner +lable.export.summary.by.question =Summary by question +label.export.user.id =Username +label.authoring.basic.allow.learners.rich.editor =Allow learners to use rich text editor +label.authoring.advance.allow.students.right.answers =Indicate choice(s) that have been answered correctly. +label.authoring.advance.allow.students.wrong.answers =Indicate choice(s) that have been answered incorrectly. +monitor.summary.date.restriction =Deadline +monitor.summary.when.date.restriction.is.set =Learners will not be able to take this assessment after the set date and time. +monitor.summary.after.date =Date/time: +monitor.summary.set.restriction =Set restriction +monitor.summary.unset.restriction =Remove restriction +authoring.info.teacher.set.restriction =For this activity, the instructor fixed a deadline until {0}. After this time this activity will not be available. +monitor.summary.notification =Notification +monitor.summary.date.restriction.set =Deadline has been set +monitor.summary.date.restriction.removed =Deadline has been removed +label.authoring.advance.passing.mark =Assessment passing mark +label.authoring.advance.choose.restriction =Choose restriction: +label.authoring.advance.passing.mark.none =None +label.learning.havent.reached.passing.mark =Sorry, you haven''t scored {0} required to pass the activity. Please, try one more time. +label.authoring.basic.add.question.to.pool =Add question +label.authoring.basic.add.question.to.list =Add question to list +label.authoring.basic.question.bank.title =Question bank +label.authoring.basic.list.header.mark =Mark +label.authoring.basic.type.random.question =Random question +label.authoring.basic.select.random.question =Random question from pool +label.authoring.basic.random.question =Question +label.authoring.basic.warning.too.many.questions =Too many questions in a list. Please, remove some of them. +authoring.import.result =Import tool content result +authoring.title.import =Import questions +authoring.import.instruction =Please choose questions to import. +button.select.importfile =Select file to import +msg.import.file.format =The import file must be .xml file exported from assessment tool and not exceed size of {0} +label.import.file =Import xml file +button.import =Import +label.authoring.basic.import.questions =Import +label.authoring.basic.export.questions =Export +label.authoring.advance.display.summary =Display all questions and answers once the learner finishes. +label.authoring.basic.import.qti =Import IMS QTI +advanced.reflectOnActivity =Add a notebook at end of Assessment with the following instructions: +monitor.summary.td.addNotebook =Add a notebook at end of Assessment +monitor.summary.td.notebookInstructions =Notebook instructions +label.export.reflection =Notebook Entries +label.continue =Continue +label.edit =Edit +label.submit =Finish +label.authoring.advance.numbered.questions =Enable questions' numbering +label.learning.draft.autosaved =Draft autosaved +label.waiting.for.leader =Please, wait while somebody will become a group leader +label.users.from.group =Other learners participating in current group: +label.use.select.leader.tool.output =Use leaders from Select Leader tool +label.group.leader =Group leader: {0} +label.refresh =Refresh +label.display.name.column =Display name column +label.authoring.answer.required =Answer required? +warn.answers.required =Please, answer highlighted questions in order to continue. +label.authoring.basic.export.qti =Export IMS QTI +label.monitoring.heading =Assessment Monitoring +label.maximum.number.words =Maximum number of words +label.minimum.number.words =Minimum number of words +label.info.maximum.number.words =This answer must have a maximum of {0} words. +label.info.minimum.number.words =This answer must have a minimum of {0} words. +label.info.max.and.min.number.words =This answer must have a minimal of {0} and maximum of {1} words. +warn.answers.word.requirements.limit =In order to continue, please note the word limit restrictions. +label.words =Words: +message.no.reflection.available =No notebook entry has been added. +label.authoring.basic.type.mark.hedging =Mark hedging +label.option.correct =Correct? +label.assign.hedging.mark =Assign marks to answers. Max possible mark: {0} +label.learning.submit =Submit +warn.mark.hedging.wrong.total =In order to continue, all mark hedging questions should have all available marks assigned. +label.incorrect.answer.nullifies.mark =Assigns full mark only when the correct answers are selected. +label.export.summary =Summary +label.justify.hedging.marks =Please, justify your mark allocation. +label.select.leader =Leader selection +label.question.options =Question options +label.activity.completion =End of activity +label.notifications =Notifications +label.ask.for.hedging.justification =Ask for hedging justification? +label.number.learners.per.session =Number of learners per session +label.tool.output =Tool Output +output.desc.best.score =Best score +label.tool.output.has.been.changed =Tool Output has been changed +output.desc.first.score =First score +output.desc.average.score =Average score +label.waiting.for.leader.launch.time.limit =Leader has not started the activity. Please wait until he/she commences it. +label.waiting.for.leader.finish =Time limit set by teacher is over. Please wait until a group leader submits all answers. +warn.mark.hedging.wrong.justification =Justification cannot be left blank +error.import.file.format =The import file is not an .xml file. +label.file =File +errors.maxfilesize =File exceeds maximum file size {0} +label.summary.downloaded =Summary downloaded +label.not.answered =Not Answered +label.other =Other +label.graph.help =In the graph(s) below, click on a bar in the graph and then use your mouse wheel to zoom in and out of the graph. Once you zoom in, the grey selection in the bottom graph can be dragged left or right to show a different set of marks. +label.lowest.mark =Lowest mark: +label.highest.mark =Highest mark: +label.number.learners =Number of learners +label.percentage =Percentage +label.operation.failed =Operation failed. +label.number.groups.finished =Number of groups finished +label.marks =Marks +label.number.learners.in.mark.range =Number of learners in mark range +label.number.groups.in.mark.range =Number of groups in mark range +label.average.mark =Average mark +label.error =Error +error.loaderror =There was an error loading the grid. If this problem persists, please contact your system administrator. +label.ok =OK +message.monitoring.edit.activity.warning =Warning: if you edit and modify a question or change an answer that when a student has already answer, the marks will be recalculated based on the changes. +label.enable.confidence.levels =Enable confidence level +label.what.is.your.confidence.level =How confident are you of your answer? +label.confidence =Confidence +label.no.question.references =No questions have been added to the question list. Do you still want to proceed with no questions? +label.hide.name.column =Hide name column +label.ae.questions.marks =AE Questions & Marks +label.ira.questions.marks =iRA Questions & Marks +label.attendance =Attendance +label.show.students.choices =Show students' choices +label.hide.students.choices =Hide students' choices +label.print =Print +label.excel.export =Excel export +label.teams =Teams +label.no.questions.in.question.bank =No questions have been added to the question list. Do you still want to proceed with no questions? +label.authoring.advance.disclose.answers =Disclose learner's and other groups' answers in monitor +label.learning.summary.other.team.answers =Other teams' answers +label.learning.summary.selected.by =Selected by: +label.disclose.correct.answers =Disclose correct answers +label.disclose.groups.answers =Disclose groups' answers +label.disclose.all.correct.answers =Disclose all correct answers +label.disclose.all.groups.answers =Disclose all groups' answers +label.prefix.sequential.letters.for.each.answer =Prefix sequential letters for each answer +label.edit.in.monitor.warning =Attention: while you edit this assessment students don't have access to it. You must save your changes so students can re-attempt this assessment again. +outcome.authoring.title =Learning outcomes +outcome.authoring.input =Search and select by outcome name or code +outcome.authoring.existing =Added outcomes +outcome.authoring.existing.none =none +label.qb.stats =Question indexes +label.qb.participant.count =Test participant count +label.qb.difficulty.index =Difficulty index +label.qb.discrimination.index =Discrimination index +label.qb.point.biserial =Point biserial + +#======= End labels: Exported 337 labels for en AU ===== Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/MonitoringController.java =================================================================== diff -u -rb41c8a8bc5134e78088378360a37f3906fadb3de -r69e2980b566d069500c2e5c07dccf96e29cc287c --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/MonitoringController.java (.../MonitoringController.java) (revision b41c8a8bc5134e78088378360a37f3906fadb3de) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/MonitoringController.java (.../MonitoringController.java) (revision 69e2980b566d069500c2e5c07dccf96e29cc287c) @@ -1,618 +1,632 @@ -/**************************************************************** - * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) - * ============================================================= - * License Information: http://lamsfoundation.org/licensing/lams/2.0/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2.0 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - * USA - * - * http://www.gnu.org/licenses/gpl.txt - * **************************************************************** - */ - -package org.lamsfoundation.lams.tool.assessment.web.controller; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Set; -import java.util.TimeZone; -import java.util.TreeSet; - -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; -import org.lamsfoundation.lams.tool.assessment.AssessmentConstants; -import org.lamsfoundation.lams.tool.assessment.dto.AssessmentResultDTO; -import org.lamsfoundation.lams.tool.assessment.dto.AssessmentUserDTO; -import org.lamsfoundation.lams.tool.assessment.dto.LeaderResultsDTO; -import org.lamsfoundation.lams.tool.assessment.dto.QuestionSummary; -import org.lamsfoundation.lams.tool.assessment.dto.ReflectDTO; -import org.lamsfoundation.lams.tool.assessment.dto.SessionDTO; -import org.lamsfoundation.lams.tool.assessment.dto.UserSummary; -import org.lamsfoundation.lams.tool.assessment.model.Assessment; -import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion; -import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionResult; -import org.lamsfoundation.lams.tool.assessment.model.AssessmentResult; -import org.lamsfoundation.lams.tool.assessment.model.AssessmentSession; -import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser; -import org.lamsfoundation.lams.tool.assessment.model.QuestionReference; -import org.lamsfoundation.lams.tool.assessment.service.IAssessmentService; -import org.lamsfoundation.lams.tool.assessment.util.AssessmentEscapeUtils; -import org.lamsfoundation.lams.usermanagement.dto.UserDTO; -import org.lamsfoundation.lams.util.CommonConstants; -import org.lamsfoundation.lams.util.DateUtil; -import org.lamsfoundation.lams.util.ExcelCell; -import org.lamsfoundation.lams.util.ExcelUtil; -import org.lamsfoundation.lams.util.JsonUtil; -import org.lamsfoundation.lams.util.WebUtil; -import org.lamsfoundation.lams.web.session.SessionManager; -import org.lamsfoundation.lams.web.util.AttributeNames; -import org.lamsfoundation.lams.web.util.SessionMap; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.util.HtmlUtils; - -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; - -@Controller -@RequestMapping("/monitoring") -public class MonitoringController { - public static Logger log = Logger.getLogger(MonitoringController.class); - - @Autowired - @Qualifier("laasseAssessmentService") - private IAssessmentService service; - - @RequestMapping("/summary") - public String summary(HttpServletRequest request, HttpServletResponse response) { - - // initialize Session Map - SessionMap sessionMap = new SessionMap<>(); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); - - Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); - List sessionDtos = service.getSessionDtos(contentId, false); - - Assessment assessment = service.getAssessmentByContentId(contentId); - - //set SubmissionDeadline, if any - if (assessment.getSubmissionDeadline() != null) { - Date submissionDeadline = assessment.getSubmissionDeadline(); - HttpSession ss = SessionManager.getSession(); - UserDTO teacher = (UserDTO) ss.getAttribute(AttributeNames.USER); - TimeZone teacherTimeZone = teacher.getTimeZone(); - Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(teacherTimeZone, submissionDeadline); - request.setAttribute(AssessmentConstants.ATTR_SUBMISSION_DEADLINE, tzSubmissionDeadline.getTime()); - // use the unconverted time, as convertToStringForJSON() does the timezone conversion if needed - request.setAttribute(AssessmentConstants.ATTR_SUBMISSION_DEADLINE_DATESTRING, - DateUtil.convertToStringForJSON(submissionDeadline, request.getLocale())); - } - - // Create reflectList if reflection is enabled. - if (assessment.isReflectOnActivity()) { - List reflectList = service.getReflectList(assessment.getContentId()); - // Add reflectList to sessionMap - sessionMap.put(AssessmentConstants.ATTR_REFLECT_LIST, reflectList); - } - - //prepare list of the questions to display in question drop down menu, filtering out questions that aren't supposed to be answered - Set questionList = new TreeSet<>(); - //in case there is at least one random question - we need to show all questions in a drop down select - if (assessment.hasRandomQuestion()) { - questionList.addAll(assessment.getQuestions()); - - //show only questions from question list otherwise - } else { - for (QuestionReference reference : (Set) assessment.getQuestionReferences()) { - questionList.add(reference.getQuestion()); - } - } - - //prepare toolOutputDefinitions and activityEvaluation - List toolOutputDefinitions = new ArrayList<>(); - toolOutputDefinitions.add(AssessmentConstants.OUTPUT_NAME_LEARNER_TOTAL_SCORE); - toolOutputDefinitions.add(AssessmentConstants.OUTPUT_NAME_BEST_SCORE); - toolOutputDefinitions.add(AssessmentConstants.OUTPUT_NAME_FIRST_SCORE); - toolOutputDefinitions.add(AssessmentConstants.OUTPUT_NAME_AVERAGE_SCORE); - String activityEvaluation = service.getActivityEvaluation(contentId); - sessionMap.put(AssessmentConstants.ATTR_TOOL_OUTPUT_DEFINITIONS, toolOutputDefinitions); - sessionMap.put(AssessmentConstants.ATTR_ACTIVITY_EVALUATION, activityEvaluation); - - // cache into sessionMap - boolean isGroupedActivity = service.isGroupedActivity(contentId); - sessionMap.put(AssessmentConstants.ATTR_IS_GROUPED_ACTIVITY, isGroupedActivity); - sessionMap.put("sessionDtos", sessionDtos); - sessionMap.put(AssessmentConstants.ATTR_ASSESSMENT, assessment); - sessionMap.put(AssessmentConstants.ATTR_QUESTION_LIST, questionList); - sessionMap.put(AssessmentConstants.ATTR_TOOL_CONTENT_ID, contentId); - sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID, - WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID)); - return "pages/monitoring/monitoring"; - } - - @RequestMapping("/userMasterDetail") - public String userMasterDetail(HttpServletRequest request, HttpServletResponse response) { - Long userId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID); - Long sessionId = WebUtil.readLongParam(request, AssessmentConstants.PARAM_SESSION_ID); - String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID); - AssessmentResultDTO result = service.getUserMasterDetail(sessionId, userId); - - request.setAttribute(AssessmentConstants.ATTR_ASSESSMENT_RESULT, result); - request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID); - return (result == null) ? null : "pages/monitoring/parts/masterDetailLoadUp"; - } - - @RequestMapping("/questionSummary") - public String questionSummary(HttpServletRequest request, HttpServletResponse response) { - SessionMap sessionMap = getSessionMap(request); - - Long questionUid = WebUtil.readLongParam(request, AssessmentConstants.PARAM_QUESTION_UID); - if (questionUid.equals(-1l)) { - return null; - } - Long contentId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_CONTENT_ID); - QuestionSummary questionSummary = service.getQuestionSummary(contentId, questionUid); - - request.setAttribute(AssessmentConstants.ATTR_QUESTION_SUMMARY, questionSummary); - return "pages/monitoring/parts/questionsummary"; - } - - @RequestMapping("/userSummary") - public String userSummary(HttpServletRequest request, HttpServletResponse response) { - SessionMap sessionMap = getSessionMap(request); - - Long userId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID); - Long sessionId = WebUtil.readLongParam(request, AssessmentConstants.PARAM_SESSION_ID); - Long contentId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_CONTENT_ID); - UserSummary userSummary = service.getUserSummary(contentId, userId, sessionId); - - request.setAttribute(AssessmentConstants.ATTR_USER_SUMMARY, userSummary); - return "pages/monitoring/parts/usersummary"; - } - - @RequestMapping("/saveUserGrade") - public void saveUserGrade(HttpServletRequest request, HttpServletResponse response) { - - if ((request.getParameter(AssessmentConstants.PARAM_NOT_A_NUMBER) == null) - && !StringUtils.isEmpty(request.getParameter(AssessmentConstants.PARAM_QUESTION_RESULT_UID))) { - Long questionResultUid = WebUtil.readLongParam(request, AssessmentConstants.PARAM_QUESTION_RESULT_UID); - float newGrade = Float.valueOf(request.getParameter(AssessmentConstants.PARAM_GRADE)); - service.changeQuestionResultMark(questionResultUid, newGrade); - } - } - - /** - * Set Submission Deadline - */ - @RequestMapping("/setSubmissionDeadline") - @ResponseBody - public String setSubmissionDeadline(HttpServletRequest request, HttpServletResponse response) throws IOException { - - Long contentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); - Assessment assessment = service.getAssessmentByContentId(contentID); - - Long dateParameter = WebUtil.readLongParam(request, AssessmentConstants.ATTR_SUBMISSION_DEADLINE, true); - Date tzSubmissionDeadline = null; - String formattedDate = ""; - if (dateParameter != null) { - Date submissionDeadline = new Date(dateParameter); - HttpSession ss = SessionManager.getSession(); - UserDTO teacher = (UserDTO) ss.getAttribute(AttributeNames.USER); - TimeZone teacherTimeZone = teacher.getTimeZone(); - tzSubmissionDeadline = DateUtil.convertFromTimeZoneToDefault(teacherTimeZone, submissionDeadline); - formattedDate = DateUtil.convertToStringForJSON(tzSubmissionDeadline, request.getLocale()); - - } - assessment.setSubmissionDeadline(tzSubmissionDeadline); - service.saveOrUpdateAssessment(assessment); - - response.setContentType("text/plain;charset=utf-8"); - response.getWriter().print(formattedDate); - return null; - } - - /** - * Set tool's activityEvaluation - */ - @RequestMapping("/setActivityEvaluation") - @ResponseBody - public String setActivityEvaluation(HttpServletRequest request, HttpServletResponse response) throws IOException { - SessionMap sessionMap = getSessionMap(request); - - Long contentID = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_CONTENT_ID); - String activityEvaluation = WebUtil.readStrParam(request, AssessmentConstants.ATTR_ACTIVITY_EVALUATION, true); - service.setActivityEvaluation(contentID, activityEvaluation); - - // update the session ready for stats tab to be reloaded otherwise flicking between tabs - // causes the old value to be redisplayed - sessionMap.put(AssessmentConstants.ATTR_ACTIVITY_EVALUATION, activityEvaluation); - - ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); - responseJSON.put("success", "true"); - response.setContentType("application/json;charset=utf-8"); - return responseJSON.toString(); - } - - /** - * Refreshes user list. - */ - @RequestMapping("/getUsers") - public String getUsers(HttpServletRequest request, HttpServletResponse res) throws IOException, ServletException { - SessionMap sessionMap = getSessionMap(request); - Assessment assessment = (Assessment) sessionMap.get(AssessmentConstants.ATTR_ASSESSMENT); - - Long sessionId = WebUtil.readLongParam(request, "sessionId"); - - // Getting the params passed in from the jqGrid - int page = WebUtil.readIntParam(request, CommonConstants.PARAM_PAGE); - int rowLimit = WebUtil.readIntParam(request, CommonConstants.PARAM_ROWS); - String sortOrder = WebUtil.readStrParam(request, CommonConstants.PARAM_SORD); - String sortBy = WebUtil.readStrParam(request, CommonConstants.PARAM_SIDX, true); - if (StringUtils.isEmpty(sortBy)) { - sortBy = "userName"; - } - String searchString = WebUtil.readStrParam(request, "userName", true); - - List userDtos = new ArrayList<>(); - int countSessionUsers = 0; - //in case of UseSelectLeaderToolOuput - display only one user - if (assessment.isUseSelectLeaderToolOuput()) { - - AssessmentSession session = service.getSessionBySessionId(sessionId); - AssessmentUser groupLeader = session.getGroupLeader(); - - if (groupLeader != null) { - - float assessmentResult = service.getLastTotalScoreByUser(assessment.getUid(), groupLeader.getUserId()); - Long portraitId = service.getPortraitId(groupLeader.getUserId()); - - AssessmentUserDTO userDto = new AssessmentUserDTO(); - userDto.setUserId(groupLeader.getUserId()); - userDto.setFirstName(groupLeader.getFirstName()); - userDto.setLastName(groupLeader.getLastName()); - userDto.setGrade(assessmentResult); - userDto.setPortraitId(portraitId); - userDtos.add(userDto); - countSessionUsers = 1; - } - - } else { - // Get the user list from the db - userDtos = service.getPagedUsersBySession(sessionId, page - 1, rowLimit, sortBy, sortOrder, searchString); - countSessionUsers = service.getCountUsersBySession(sessionId, searchString); - } - - int totalPages = Double.valueOf(Math.ceil(Double.valueOf(countSessionUsers) / Double.valueOf(rowLimit))) - .intValue(); - - ArrayNode rows = JsonNodeFactory.instance.arrayNode(); - int i = 1; - for (AssessmentUserDTO userDto : userDtos) { - - ArrayNode userData = JsonNodeFactory.instance.arrayNode(); - userData.add(userDto.getUserId()); - userData.add(sessionId); - String fullName = HtmlUtils.htmlEscape(userDto.getFirstName() + " " + userDto.getLastName()); - userData.add(fullName); - userData.add(userDto.getGrade()); - if (userDto.getPortraitId() != null) { - userData.add(userDto.getPortraitId()); - } - - ObjectNode userRow = JsonNodeFactory.instance.objectNode(); - userRow.put("id", i++); - userRow.set("cell", userData); - - rows.add(userRow); - } - - ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); - responseJSON.put("total", totalPages); - responseJSON.put("page", page); - responseJSON.put("records", countSessionUsers); - responseJSON.set("rows", rows); - - res.setContentType("application/json;charset=utf-8"); - res.getWriter().print(new String(responseJSON.toString())); - return null; - } - - /** - * Refreshes user list. - */ - @RequestMapping("/getUsersByQuestion") - public String getUsersByQuestion(HttpServletRequest request, HttpServletResponse res) - throws IOException, ServletException { - SessionMap sessionMap = getSessionMap(request); - Assessment assessment = (Assessment) sessionMap.get(AssessmentConstants.ATTR_ASSESSMENT); - - Long sessionId = WebUtil.readLongParam(request, "sessionId"); - Long questionUid = WebUtil.readLongParam(request, "questionUid"); - - // Getting the params passed in from the jqGrid - int page = WebUtil.readIntParam(request, CommonConstants.PARAM_PAGE); - int rowLimit = WebUtil.readIntParam(request, CommonConstants.PARAM_ROWS); - String sortOrder = WebUtil.readStrParam(request, CommonConstants.PARAM_SORD); - String sortBy = WebUtil.readStrParam(request, CommonConstants.PARAM_SIDX, true); - if (StringUtils.isEmpty(sortBy)) { - sortBy = "userName"; - } - String searchString = WebUtil.readStrParam(request, "userName", true); - - List userDtos = new ArrayList<>(); - int countSessionUsers = 0; - //in case of UseSelectLeaderToolOuput - display only one user - if (assessment.isUseSelectLeaderToolOuput()) { - - AssessmentSession session = service.getSessionBySessionId(sessionId); - AssessmentUser groupLeader = session.getGroupLeader(); - - if (groupLeader != null) { - - AssessmentResult assessmentResult = service.getLastFinishedAssessmentResult(assessment.getUid(), - groupLeader.getUserId()); - Long questionResultUid = null; - if (assessmentResult != null) { - for (AssessmentQuestionResult dbQuestionResult : assessmentResult.getQuestionResults()) { - if (dbQuestionResult.getQbToolQuestion().getUid().equals(questionUid)) { - questionResultUid = dbQuestionResult.getUid(); - break; - } - } - } - - AssessmentUserDTO userDto = new AssessmentUserDTO(); - userDto.setQuestionResultUid(questionResultUid); - userDto.setFirstName(groupLeader.getFirstName()); - userDto.setLastName(groupLeader.getLastName()); - userDtos.add(userDto); - countSessionUsers = 1; - } - - } else { - // Get the user list from the db - userDtos = service.getPagedUsersBySessionAndQuestion(sessionId, questionUid, page - 1, rowLimit, sortBy, - sortOrder, searchString); - countSessionUsers = service.getCountUsersBySession(sessionId, searchString); - } - - int totalPages = Double.valueOf(Math.ceil(Double.valueOf(countSessionUsers) / Double.valueOf(rowLimit))) - .intValue(); - - ArrayNode rows = JsonNodeFactory.instance.arrayNode(); - int i = 1; - for (AssessmentUserDTO userDto : userDtos) { - - Long questionResultUid = userDto.getQuestionResultUid(); - String fullName = HtmlUtils.htmlEscape(userDto.getFirstName() + " " + userDto.getLastName()); - - ArrayNode userData = JsonNodeFactory.instance.arrayNode(); - if (questionResultUid != null) { - AssessmentQuestionResult questionResult = service.getAssessmentQuestionResultByUid(questionResultUid); - - userData.add(questionResultUid); - userData.add(questionResult.getMaxMark()); - userData.add(fullName); - //LDEV_NTU-11 Swapping Mark and Response columns in Assessment Monitor - userData.add(questionResult.getMark()); - // show confidence levels if this feature is turned ON - if (assessment.isEnableConfidenceLevels()) { - userData.add(questionResult.getConfidenceLevel()); - } - - userData.add(AssessmentEscapeUtils.printResponsesForJqgrid(questionResult)); - if (userDto.getPortraitId() != null) { - userData.add(userDto.getPortraitId()); - } - - } else { - userData.add(""); - userData.add(""); - userData.add(fullName); - userData.add("-"); - if (assessment.isEnableConfidenceLevels()) { - userData.add(-1); - } - userData.add("-"); - } - - ObjectNode userRow = JsonNodeFactory.instance.objectNode(); - userRow.put("id", i++); - userRow.set("cell", userData); - - rows.add(userRow); - } - - ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); - responseJSON.put("total", totalPages); - responseJSON.put("page", page); - responseJSON.put("records", countSessionUsers); - responseJSON.set("rows", rows); - - res.setContentType("application/json;charset=utf-8"); - res.getWriter().print(new String(responseJSON.toString())); - return null; - } - - /** - * Get the mark summary with data arranged in bands. Can be displayed graphically or in a table. - */ - @RequestMapping("/getMarkChartData") - public String getMarkChartData(HttpServletRequest request, HttpServletResponse res) - throws IOException, ServletException { - SessionMap sessionMap = getSessionMap(request); - - Long contentId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_CONTENT_ID); - Assessment assessment = service.getAssessmentByContentId(contentId); - List results = null; - - if (assessment != null) { - if (assessment.isUseSelectLeaderToolOuput()) { - results = service.getMarksArrayForLeaders(contentId); - } else { - Long sessionId = WebUtil.readLongParam(request, AssessmentConstants.ATTR_TOOL_SESSION_ID); - results = service.getMarksArray(sessionId); - } - } - - ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); - if (results != null) { - responseJSON.set("data", JsonUtil.readArray(results)); - } else { - responseJSON.set("data", JsonUtil.readArray(new Float[0])); - } - - res.setContentType("application/json;charset=utf-8"); - res.getWriter().write(responseJSON.toString()); - return null; - - } - - /** - * Excel Summary Export. - */ - @SuppressWarnings("unchecked") - @RequestMapping("/exportSummary") - public String exportSummary(HttpServletRequest request, HttpServletResponse response) throws IOException { - String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID); - String fileName = null; - boolean showUserNames = true; - - Long contentId = null; - List sessionDtos; - if (sessionMapID != null) { - SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(sessionMapID); - request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); - contentId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_CONTENT_ID); - showUserNames = true; - sessionDtos = (List) sessionMap.get("sessionDtos"); - - } else { - contentId = WebUtil.readLongParam(request, "toolContentID"); - fileName = WebUtil.readStrParam(request, "fileName"); - showUserNames = false; - sessionDtos = service.getSessionDtos(contentId, true); - } - - Assessment assessment = service.getAssessmentByContentId(contentId); - if (assessment == null) { - return null; - } - - LinkedHashMap dataToExport = service.exportSummary(assessment, sessionDtos, - showUserNames); - - // Setting the filename if it wasn't passed in the request - if (fileName == null) { - fileName = "assessment_" + assessment.getUid() + "_export.xlsx"; - } - - response.setContentType("application/x-download"); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName); - log.debug("Exporting assessment to a spreadsheet: " + assessment.getContentId()); - - // set cookie that will tell JS script that export has been finished - String downloadTokenValue = WebUtil.readStrParam(request, "downloadTokenValue"); - Cookie fileDownloadTokenCookie = new Cookie("fileDownloadToken", downloadTokenValue); - fileDownloadTokenCookie.setPath("/"); - response.addCookie(fileDownloadTokenCookie); - - ServletOutputStream out = response.getOutputStream(); - ExcelUtil.createExcel(out, dataToExport, service.getMessage("label.export.exported.on"), true); - - return null; - } - - @RequestMapping("/statistic") - public String statistic(HttpServletRequest request, HttpServletResponse response) { - SessionMap sessionMap = getSessionMap(request); - - Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); - Assessment assessment = service.getAssessmentByContentId(contentId); - if (assessment != null) { - if (assessment.isUseSelectLeaderToolOuput()) { - LeaderResultsDTO leaderDto = service.getLeaderResultsDTOForLeaders(contentId); - sessionMap.put("leaderDto", leaderDto); - } else { - List sessionDtos = service.getSessionDtos(contentId, true); - sessionMap.put("sessionDtos", sessionDtos); - } - } - return "pages/monitoring/statisticpart"; - } - - /** - * Allows displaying correct answers to learners - */ - @RequestMapping("/discloseCorrectAnswers") - public void discloseCorrectAnswers(HttpServletRequest request, HttpServletResponse response) { - Long questionUid = WebUtil.readLongParam(request, "questionUid"); - Long toolContentId = WebUtil.readLongParam(request, AssessmentConstants.PARAM_TOOL_CONTENT_ID); - - AssessmentQuestion question = service.getAssessmentQuestionByUid(questionUid); - question.setCorrectAnswersDisclosed(true); - service.updateAssessmentQuestion(question); - - service.notifyLearnersOnAnswerDisclose(toolContentId); - - if (log.isDebugEnabled()) { - log.debug("Disclosed correct answers for Assessment tool content ID " + toolContentId + " and question ID " - + questionUid); - } - } - - /** - * Allows displaying other groups' answers to learners - */ - @RequestMapping("/discloseGroupsAnswers") - public void discloseGroupsAnswers(HttpServletRequest request, HttpServletResponse response) { - Long questionUid = WebUtil.readLongParam(request, "questionUid"); - Long toolContentId = WebUtil.readLongParam(request, AssessmentConstants.PARAM_TOOL_CONTENT_ID); - - AssessmentQuestion question = service.getAssessmentQuestionByUid(questionUid); - question.setGroupsAnswersDisclosed(true); - service.updateAssessmentQuestion(question); - - service.notifyLearnersOnAnswerDisclose(toolContentId); - - if (log.isDebugEnabled()) { - log.debug("Disclosed other groups' answers for Assessment tool content ID " + toolContentId - + " and question ID " + questionUid); - } - } - - @SuppressWarnings("unchecked") - private SessionMap getSessionMap(HttpServletRequest request) { - String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID); - request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID); - return (SessionMap) request.getSession().getAttribute(sessionMapID); - } - -} +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.assessment.web.controller; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TimeZone; +import java.util.TreeSet; + +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.qb.dto.QbStatsActivityDTO; +import org.lamsfoundation.lams.qb.service.IQbService; +import org.lamsfoundation.lams.tool.assessment.AssessmentConstants; +import org.lamsfoundation.lams.tool.assessment.dto.AssessmentResultDTO; +import org.lamsfoundation.lams.tool.assessment.dto.AssessmentUserDTO; +import org.lamsfoundation.lams.tool.assessment.dto.LeaderResultsDTO; +import org.lamsfoundation.lams.tool.assessment.dto.QuestionSummary; +import org.lamsfoundation.lams.tool.assessment.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.assessment.dto.SessionDTO; +import org.lamsfoundation.lams.tool.assessment.dto.UserSummary; +import org.lamsfoundation.lams.tool.assessment.model.Assessment; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionResult; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentResult; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentSession; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser; +import org.lamsfoundation.lams.tool.assessment.model.QuestionReference; +import org.lamsfoundation.lams.tool.assessment.service.IAssessmentService; +import org.lamsfoundation.lams.tool.assessment.util.AssessmentEscapeUtils; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.CommonConstants; +import org.lamsfoundation.lams.util.DateUtil; +import org.lamsfoundation.lams.util.ExcelCell; +import org.lamsfoundation.lams.util.ExcelUtil; +import org.lamsfoundation.lams.util.JsonUtil; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.util.HtmlUtils; + +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +@Controller +@RequestMapping("/monitoring") +public class MonitoringController { + public static Logger log = Logger.getLogger(MonitoringController.class); + + @Autowired + @Qualifier("laasseAssessmentService") + private IAssessmentService service; + + @Autowired + private IQbService qbService; + + @RequestMapping("/summary") + public String summary(HttpServletRequest request, HttpServletResponse response) { + + // initialize Session Map + SessionMap sessionMap = new SessionMap<>(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + + Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + List sessionDtos = service.getSessionDtos(contentId, false); + + Assessment assessment = service.getAssessmentByContentId(contentId); + + //set SubmissionDeadline, if any + if (assessment.getSubmissionDeadline() != null) { + Date submissionDeadline = assessment.getSubmissionDeadline(); + HttpSession ss = SessionManager.getSession(); + UserDTO teacher = (UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone teacherTimeZone = teacher.getTimeZone(); + Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(teacherTimeZone, submissionDeadline); + request.setAttribute(AssessmentConstants.ATTR_SUBMISSION_DEADLINE, tzSubmissionDeadline.getTime()); + // use the unconverted time, as convertToStringForJSON() does the timezone conversion if needed + request.setAttribute(AssessmentConstants.ATTR_SUBMISSION_DEADLINE_DATESTRING, + DateUtil.convertToStringForJSON(submissionDeadline, request.getLocale())); + } + + // Create reflectList if reflection is enabled. + if (assessment.isReflectOnActivity()) { + List reflectList = service.getReflectList(assessment.getContentId()); + // Add reflectList to sessionMap + sessionMap.put(AssessmentConstants.ATTR_REFLECT_LIST, reflectList); + } + + //prepare list of the questions to display in question drop down menu, filtering out questions that aren't supposed to be answered + Set questionList = new TreeSet<>(); + //in case there is at least one random question - we need to show all questions in a drop down select + if (assessment.hasRandomQuestion()) { + questionList.addAll(assessment.getQuestions()); + + //show only questions from question list otherwise + } else { + for (QuestionReference reference : assessment.getQuestionReferences()) { + questionList.add(reference.getQuestion()); + } + } + + //prepare toolOutputDefinitions and activityEvaluation + List toolOutputDefinitions = new ArrayList<>(); + toolOutputDefinitions.add(AssessmentConstants.OUTPUT_NAME_LEARNER_TOTAL_SCORE); + toolOutputDefinitions.add(AssessmentConstants.OUTPUT_NAME_BEST_SCORE); + toolOutputDefinitions.add(AssessmentConstants.OUTPUT_NAME_FIRST_SCORE); + toolOutputDefinitions.add(AssessmentConstants.OUTPUT_NAME_AVERAGE_SCORE); + String activityEvaluation = service.getActivityEvaluation(contentId); + sessionMap.put(AssessmentConstants.ATTR_TOOL_OUTPUT_DEFINITIONS, toolOutputDefinitions); + sessionMap.put(AssessmentConstants.ATTR_ACTIVITY_EVALUATION, activityEvaluation); + + // cache into sessionMap + boolean isGroupedActivity = service.isGroupedActivity(contentId); + sessionMap.put(AssessmentConstants.ATTR_IS_GROUPED_ACTIVITY, isGroupedActivity); + sessionMap.put("sessionDtos", sessionDtos); + sessionMap.put(AssessmentConstants.ATTR_ASSESSMENT, assessment); + sessionMap.put(AssessmentConstants.ATTR_QUESTION_LIST, questionList); + sessionMap.put(AssessmentConstants.ATTR_TOOL_CONTENT_ID, contentId); + sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID, + WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID)); + return "pages/monitoring/monitoring"; + } + + @RequestMapping("/userMasterDetail") + public String userMasterDetail(HttpServletRequest request, HttpServletResponse response) { + Long userId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID); + Long sessionId = WebUtil.readLongParam(request, AssessmentConstants.PARAM_SESSION_ID); + String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID); + AssessmentResultDTO result = service.getUserMasterDetail(sessionId, userId); + + request.setAttribute(AssessmentConstants.ATTR_ASSESSMENT_RESULT, result); + request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID); + return (result == null) ? null : "pages/monitoring/parts/masterDetailLoadUp"; + } + + @RequestMapping("/questionSummary") + public String questionSummary(HttpServletRequest request, HttpServletResponse response) { + SessionMap sessionMap = getSessionMap(request); + + Long questionUid = WebUtil.readLongParam(request, AssessmentConstants.PARAM_QUESTION_UID); + if (questionUid.equals(-1l)) { + return null; + } + Long contentId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_CONTENT_ID); + QuestionSummary questionSummary = service.getQuestionSummary(contentId, questionUid); + + request.setAttribute(AssessmentConstants.ATTR_QUESTION_SUMMARY, questionSummary); + return "pages/monitoring/parts/questionsummary"; + } + + @RequestMapping("/userSummary") + public String userSummary(HttpServletRequest request, HttpServletResponse response) { + SessionMap sessionMap = getSessionMap(request); + + Long userId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID); + Long sessionId = WebUtil.readLongParam(request, AssessmentConstants.PARAM_SESSION_ID); + Long contentId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_CONTENT_ID); + UserSummary userSummary = service.getUserSummary(contentId, userId, sessionId); + + request.setAttribute(AssessmentConstants.ATTR_USER_SUMMARY, userSummary); + return "pages/monitoring/parts/usersummary"; + } + + @RequestMapping("/saveUserGrade") + public void saveUserGrade(HttpServletRequest request, HttpServletResponse response) { + + if ((request.getParameter(AssessmentConstants.PARAM_NOT_A_NUMBER) == null) + && !StringUtils.isEmpty(request.getParameter(AssessmentConstants.PARAM_QUESTION_RESULT_UID))) { + Long questionResultUid = WebUtil.readLongParam(request, AssessmentConstants.PARAM_QUESTION_RESULT_UID); + float newGrade = Float.valueOf(request.getParameter(AssessmentConstants.PARAM_GRADE)); + service.changeQuestionResultMark(questionResultUid, newGrade); + } + } + + /** + * Set Submission Deadline + */ + @RequestMapping("/setSubmissionDeadline") + @ResponseBody + public String setSubmissionDeadline(HttpServletRequest request, HttpServletResponse response) throws IOException { + + Long contentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Assessment assessment = service.getAssessmentByContentId(contentID); + + Long dateParameter = WebUtil.readLongParam(request, AssessmentConstants.ATTR_SUBMISSION_DEADLINE, true); + Date tzSubmissionDeadline = null; + String formattedDate = ""; + if (dateParameter != null) { + Date submissionDeadline = new Date(dateParameter); + HttpSession ss = SessionManager.getSession(); + UserDTO teacher = (UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone teacherTimeZone = teacher.getTimeZone(); + tzSubmissionDeadline = DateUtil.convertFromTimeZoneToDefault(teacherTimeZone, submissionDeadline); + formattedDate = DateUtil.convertToStringForJSON(tzSubmissionDeadline, request.getLocale()); + + } + assessment.setSubmissionDeadline(tzSubmissionDeadline); + service.saveOrUpdateAssessment(assessment); + + response.setContentType("text/plain;charset=utf-8"); + response.getWriter().print(formattedDate); + return null; + } + + /** + * Set tool's activityEvaluation + */ + @RequestMapping("/setActivityEvaluation") + @ResponseBody + public String setActivityEvaluation(HttpServletRequest request, HttpServletResponse response) throws IOException { + SessionMap sessionMap = getSessionMap(request); + + Long contentID = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_CONTENT_ID); + String activityEvaluation = WebUtil.readStrParam(request, AssessmentConstants.ATTR_ACTIVITY_EVALUATION, true); + service.setActivityEvaluation(contentID, activityEvaluation); + + // update the session ready for stats tab to be reloaded otherwise flicking between tabs + // causes the old value to be redisplayed + sessionMap.put(AssessmentConstants.ATTR_ACTIVITY_EVALUATION, activityEvaluation); + + ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); + responseJSON.put("success", "true"); + response.setContentType("application/json;charset=utf-8"); + return responseJSON.toString(); + } + + /** + * Refreshes user list. + */ + @RequestMapping("/getUsers") + public String getUsers(HttpServletRequest request, HttpServletResponse res) throws IOException, ServletException { + SessionMap sessionMap = getSessionMap(request); + Assessment assessment = (Assessment) sessionMap.get(AssessmentConstants.ATTR_ASSESSMENT); + + Long sessionId = WebUtil.readLongParam(request, "sessionId"); + + // Getting the params passed in from the jqGrid + int page = WebUtil.readIntParam(request, CommonConstants.PARAM_PAGE); + int rowLimit = WebUtil.readIntParam(request, CommonConstants.PARAM_ROWS); + String sortOrder = WebUtil.readStrParam(request, CommonConstants.PARAM_SORD); + String sortBy = WebUtil.readStrParam(request, CommonConstants.PARAM_SIDX, true); + if (StringUtils.isEmpty(sortBy)) { + sortBy = "userName"; + } + String searchString = WebUtil.readStrParam(request, "userName", true); + + List userDtos = new ArrayList<>(); + int countSessionUsers = 0; + //in case of UseSelectLeaderToolOuput - display only one user + if (assessment.isUseSelectLeaderToolOuput()) { + + AssessmentSession session = service.getSessionBySessionId(sessionId); + AssessmentUser groupLeader = session.getGroupLeader(); + + if (groupLeader != null) { + + float assessmentResult = service.getLastTotalScoreByUser(assessment.getUid(), groupLeader.getUserId()); + Long portraitId = service.getPortraitId(groupLeader.getUserId()); + + AssessmentUserDTO userDto = new AssessmentUserDTO(); + userDto.setUserId(groupLeader.getUserId()); + userDto.setFirstName(groupLeader.getFirstName()); + userDto.setLastName(groupLeader.getLastName()); + userDto.setGrade(assessmentResult); + userDto.setPortraitId(portraitId); + userDtos.add(userDto); + countSessionUsers = 1; + } + + } else { + // Get the user list from the db + userDtos = service.getPagedUsersBySession(sessionId, page - 1, rowLimit, sortBy, sortOrder, searchString); + countSessionUsers = service.getCountUsersBySession(sessionId, searchString); + } + + int totalPages = Double.valueOf(Math.ceil(Double.valueOf(countSessionUsers) / Double.valueOf(rowLimit))) + .intValue(); + + ArrayNode rows = JsonNodeFactory.instance.arrayNode(); + int i = 1; + for (AssessmentUserDTO userDto : userDtos) { + + ArrayNode userData = JsonNodeFactory.instance.arrayNode(); + userData.add(userDto.getUserId()); + userData.add(sessionId); + String fullName = HtmlUtils.htmlEscape(userDto.getFirstName() + " " + userDto.getLastName()); + userData.add(fullName); + userData.add(userDto.getGrade()); + if (userDto.getPortraitId() != null) { + userData.add(userDto.getPortraitId()); + } + + ObjectNode userRow = JsonNodeFactory.instance.objectNode(); + userRow.put("id", i++); + userRow.set("cell", userData); + + rows.add(userRow); + } + + ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); + responseJSON.put("total", totalPages); + responseJSON.put("page", page); + responseJSON.put("records", countSessionUsers); + responseJSON.set("rows", rows); + + res.setContentType("application/json;charset=utf-8"); + res.getWriter().print(new String(responseJSON.toString())); + return null; + } + + /** + * Refreshes user list. + */ + @RequestMapping("/getUsersByQuestion") + public String getUsersByQuestion(HttpServletRequest request, HttpServletResponse res) + throws IOException, ServletException { + SessionMap sessionMap = getSessionMap(request); + Assessment assessment = (Assessment) sessionMap.get(AssessmentConstants.ATTR_ASSESSMENT); + + Long sessionId = WebUtil.readLongParam(request, "sessionId"); + Long questionUid = WebUtil.readLongParam(request, "questionUid"); + + // Getting the params passed in from the jqGrid + int page = WebUtil.readIntParam(request, CommonConstants.PARAM_PAGE); + int rowLimit = WebUtil.readIntParam(request, CommonConstants.PARAM_ROWS); + String sortOrder = WebUtil.readStrParam(request, CommonConstants.PARAM_SORD); + String sortBy = WebUtil.readStrParam(request, CommonConstants.PARAM_SIDX, true); + if (StringUtils.isEmpty(sortBy)) { + sortBy = "userName"; + } + String searchString = WebUtil.readStrParam(request, "userName", true); + + List userDtos = new ArrayList<>(); + int countSessionUsers = 0; + //in case of UseSelectLeaderToolOuput - display only one user + if (assessment.isUseSelectLeaderToolOuput()) { + + AssessmentSession session = service.getSessionBySessionId(sessionId); + AssessmentUser groupLeader = session.getGroupLeader(); + + if (groupLeader != null) { + + AssessmentResult assessmentResult = service.getLastFinishedAssessmentResult(assessment.getUid(), + groupLeader.getUserId()); + Long questionResultUid = null; + if (assessmentResult != null) { + for (AssessmentQuestionResult dbQuestionResult : assessmentResult.getQuestionResults()) { + if (dbQuestionResult.getQbToolQuestion().getUid().equals(questionUid)) { + questionResultUid = dbQuestionResult.getUid(); + break; + } + } + } + + AssessmentUserDTO userDto = new AssessmentUserDTO(); + userDto.setQuestionResultUid(questionResultUid); + userDto.setFirstName(groupLeader.getFirstName()); + userDto.setLastName(groupLeader.getLastName()); + userDtos.add(userDto); + countSessionUsers = 1; + } + + } else { + // Get the user list from the db + userDtos = service.getPagedUsersBySessionAndQuestion(sessionId, questionUid, page - 1, rowLimit, sortBy, + sortOrder, searchString); + countSessionUsers = service.getCountUsersBySession(sessionId, searchString); + } + + int totalPages = Double.valueOf(Math.ceil(Double.valueOf(countSessionUsers) / Double.valueOf(rowLimit))) + .intValue(); + + ArrayNode rows = JsonNodeFactory.instance.arrayNode(); + int i = 1; + for (AssessmentUserDTO userDto : userDtos) { + + Long questionResultUid = userDto.getQuestionResultUid(); + String fullName = HtmlUtils.htmlEscape(userDto.getFirstName() + " " + userDto.getLastName()); + + ArrayNode userData = JsonNodeFactory.instance.arrayNode(); + if (questionResultUid != null) { + AssessmentQuestionResult questionResult = service.getAssessmentQuestionResultByUid(questionResultUid); + + userData.add(questionResultUid); + userData.add(questionResult.getMaxMark()); + userData.add(fullName); + //LDEV_NTU-11 Swapping Mark and Response columns in Assessment Monitor + userData.add(questionResult.getMark()); + // show confidence levels if this feature is turned ON + if (assessment.isEnableConfidenceLevels()) { + userData.add(questionResult.getConfidenceLevel()); + } + + userData.add(AssessmentEscapeUtils.printResponsesForJqgrid(questionResult)); + if (userDto.getPortraitId() != null) { + userData.add(userDto.getPortraitId()); + } + + } else { + userData.add(""); + userData.add(""); + userData.add(fullName); + userData.add("-"); + if (assessment.isEnableConfidenceLevels()) { + userData.add(-1); + } + userData.add("-"); + } + + ObjectNode userRow = JsonNodeFactory.instance.objectNode(); + userRow.put("id", i++); + userRow.set("cell", userData); + + rows.add(userRow); + } + + ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); + responseJSON.put("total", totalPages); + responseJSON.put("page", page); + responseJSON.put("records", countSessionUsers); + responseJSON.set("rows", rows); + + res.setContentType("application/json;charset=utf-8"); + res.getWriter().print(new String(responseJSON.toString())); + return null; + } + + /** + * Get the mark summary with data arranged in bands. Can be displayed graphically or in a table. + */ + @RequestMapping("/getMarkChartData") + public String getMarkChartData(HttpServletRequest request, HttpServletResponse res) + throws IOException, ServletException { + SessionMap sessionMap = getSessionMap(request); + + Long contentId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_CONTENT_ID); + Assessment assessment = service.getAssessmentByContentId(contentId); + List results = null; + + if (assessment != null) { + if (assessment.isUseSelectLeaderToolOuput()) { + results = service.getMarksArrayForLeaders(contentId); + } else { + Long sessionId = WebUtil.readLongParam(request, AssessmentConstants.ATTR_TOOL_SESSION_ID); + results = service.getMarksArray(sessionId); + } + } + + ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); + if (results != null) { + responseJSON.set("data", JsonUtil.readArray(results)); + } else { + responseJSON.set("data", JsonUtil.readArray(new Float[0])); + } + + res.setContentType("application/json;charset=utf-8"); + res.getWriter().write(responseJSON.toString()); + return null; + + } + + /** + * Excel Summary Export. + */ + @SuppressWarnings("unchecked") + @RequestMapping("/exportSummary") + public String exportSummary(HttpServletRequest request, HttpServletResponse response) throws IOException { + String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID); + String fileName = null; + boolean showUserNames = true; + + Long contentId = null; + List sessionDtos; + if (sessionMapID != null) { + SessionMap sessionMap = (SessionMap) request.getSession() + .getAttribute(sessionMapID); + request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + contentId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_CONTENT_ID); + showUserNames = true; + sessionDtos = (List) sessionMap.get("sessionDtos"); + + } else { + contentId = WebUtil.readLongParam(request, "toolContentID"); + fileName = WebUtil.readStrParam(request, "fileName"); + showUserNames = false; + sessionDtos = service.getSessionDtos(contentId, true); + } + + Assessment assessment = service.getAssessmentByContentId(contentId); + if (assessment == null) { + return null; + } + + LinkedHashMap dataToExport = service.exportSummary(assessment, sessionDtos, + showUserNames); + + // Setting the filename if it wasn't passed in the request + if (fileName == null) { + fileName = "assessment_" + assessment.getUid() + "_export.xlsx"; + } + + response.setContentType("application/x-download"); + response.setHeader("Content-Disposition", "attachment;filename=" + fileName); + log.debug("Exporting assessment to a spreadsheet: " + assessment.getContentId()); + + // set cookie that will tell JS script that export has been finished + String downloadTokenValue = WebUtil.readStrParam(request, "downloadTokenValue"); + Cookie fileDownloadTokenCookie = new Cookie("fileDownloadToken", downloadTokenValue); + fileDownloadTokenCookie.setPath("/"); + response.addCookie(fileDownloadTokenCookie); + + ServletOutputStream out = response.getOutputStream(); + ExcelUtil.createExcel(out, dataToExport, service.getMessage("label.export.exported.on"), true); + + return null; + } + + @RequestMapping("/statistic") + public String statistic(HttpServletRequest request, HttpServletResponse response) { + SessionMap sessionMap = getSessionMap(request); + + Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Assessment assessment = service.getAssessmentByContentId(contentId); + if (assessment != null) { + if (assessment.isUseSelectLeaderToolOuput()) { + LeaderResultsDTO leaderDto = service.getLeaderResultsDTOForLeaders(contentId); + sessionMap.put("leaderDto", leaderDto); + } else { + List sessionDtos = service.getSessionDtos(contentId, true); + sessionMap.put("sessionDtos", sessionDtos); + } + + Map qbStats = new LinkedHashMap<>(); + for (AssessmentQuestion question : assessment.getQuestions()) { + QbStatsActivityDTO questionStats = qbService.getActivityStatsByContentId(assessment.getContentId(), + question.getQbQuestion().getUid()); + qbStats.put(question.getQbQuestion().getName(), questionStats); + } + request.setAttribute("qbStats", qbStats); + } + return "pages/monitoring/statisticpart"; + } + + /** + * Allows displaying correct answers to learners + */ + @RequestMapping("/discloseCorrectAnswers") + public void discloseCorrectAnswers(HttpServletRequest request, HttpServletResponse response) { + Long questionUid = WebUtil.readLongParam(request, "questionUid"); + Long toolContentId = WebUtil.readLongParam(request, AssessmentConstants.PARAM_TOOL_CONTENT_ID); + + AssessmentQuestion question = service.getAssessmentQuestionByUid(questionUid); + question.setCorrectAnswersDisclosed(true); + service.updateAssessmentQuestion(question); + + service.notifyLearnersOnAnswerDisclose(toolContentId); + + if (log.isDebugEnabled()) { + log.debug("Disclosed correct answers for Assessment tool content ID " + toolContentId + " and question ID " + + questionUid); + } + } + + /** + * Allows displaying other groups' answers to learners + */ + @RequestMapping("/discloseGroupsAnswers") + public void discloseGroupsAnswers(HttpServletRequest request, HttpServletResponse response) { + Long questionUid = WebUtil.readLongParam(request, "questionUid"); + Long toolContentId = WebUtil.readLongParam(request, AssessmentConstants.PARAM_TOOL_CONTENT_ID); + + AssessmentQuestion question = service.getAssessmentQuestionByUid(questionUid); + question.setGroupsAnswersDisclosed(true); + service.updateAssessmentQuestion(question); + + service.notifyLearnersOnAnswerDisclose(toolContentId); + + if (log.isDebugEnabled()) { + log.debug("Disclosed other groups' answers for Assessment tool content ID " + toolContentId + + " and question ID " + questionUid); + } + } + + @SuppressWarnings("unchecked") + private SessionMap getSessionMap(HttpServletRequest request) { + String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID); + request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID); + return (SessionMap) request.getSession().getAttribute(sessionMapID); + } + +} Index: lams_tool_assessment/web/pages/monitoring/statisticpart.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r69e2980b566d069500c2e5c07dccf96e29cc287c --- lams_tool_assessment/web/pages/monitoring/statisticpart.jsp (.../statisticpart.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_assessment/web/pages/monitoring/statisticpart.jsp (.../statisticpart.jsp) (revision 69e2980b566d069500c2e5c07dccf96e29cc287c) @@ -1,167 +1,231 @@ -<%@ include file="/common/taglibs.jsp"%> - - - - - - - - - - - - - - - - -

- - - -
-
- - - - - - - - - - - - - - -
- : - - - - : - - -
- - - - - - - -
-
-
-
-
-
-
-
- - - -
- -
- - : - -
-
-
- - - - - - - - - - - - - - - -
- : - - - - : - - -
- - - - - - - -
-
-
-
-
-
-
-
-
-
- -
-
- -<%@ include file="parts/toolOutput.jsp"%> +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + +

+ + + +
+
+ + + + + + + + + + + + + + +
+ : + + + + : + + +
+ + + + + + + +
+
+
+
+
+
+
+
+ + + +
+ +
+ + : + +
+
+
+ + + + + + + + + + + + + + + +
+ : + + + + : + + +
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + + +
+ + +
+
+ +
+
+ +<%@ include file="parts/toolOutput.jsp"%>