Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Conversation

@conzty01
Copy link
Contributor

This is still a 'work in progress'. What needs to be added is a way for the javascript to check with the server and see if the exam has been taken before it will activate the reset button. It also needs to record that the exam has been reset.

@conzty01
Copy link
Contributor Author

This is now functional.

@conzty01 conzty01 requested a review from bnmnetp June 27, 2017 21:37
Copy link
Member

@bnmnetp bnmnetp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I temporarily fixed the problem with True in my local branch. And then attempted to reset the exam. However when I press the reset button it looks like the exam is submitted because it now shows me all the answers and feedback. In addition I have two rows written to the database at the same instant. One shows the reset and the other just shows as though I had submitted. I'm using Safari, I'm going to try this same exercise in Chrome just to verify.

if (window.confirm("Only reset the exam if you encountered problems completing it. The Instructor will be notified of the reset.")) {
eventInfo = {"event":"timedExam","act":"reset","div_id":this.divid,
"course":eBookConfig.course,"correct":this.score,"incorrect":this.incorrect,
"skipped":this.skipped,"time":this.timeTaken,"reset":True}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "reset":True should be "reset":true Capital True is Python.

Copy link
Member

@bnmnetp bnmnetp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the same behavior in chrome.

  1. I cleared the database and local storage.
  2. I answered a couple of questions and then closed the tab.
  3. I opened the tab and went back to the quiz. The reset button was available so I tried to reset the quiz.
    after my reset it showed me the feedback for everything.

@conzty01
Copy link
Contributor Author

conzty01 commented Jul 7, 2017

Did the page refresh after you hit the reset button? And, if so, were you able to retake the quiz and submit answers? @bnmnetp

@bnmnetp
Copy link
Member

bnmnetp commented Jul 7, 2017

The page did refresh, but I was not able to answer any of the unanswered questions.

@conzty01
Copy link
Contributor Author

conzty01 commented Jul 7, 2017

Fixes on the server-side

@bnmnetp
Copy link
Member

bnmnetp commented Jul 10, 2017

@conzty01

I'm still trying to get this to work the way I think it should. Maybe we didn't have a good understanding on this one.

  1. I start the exam and answer a couple of questions.
  2. I force close the page. -- nothing in the database yet
  3. I go back to the page. Now I can see the questions. None of them have the feedback showing, but I cannot answer any questions. The timer is not running. The Reset button is active now. -- this seems like a bad state. Now I appear to have as much time as I want to look at and think about these questions.
  4. I click reset and OK
  5. The page refreshes and all of the feedback is showing for all of the questions. I still can't answer any.

What I would expect to happen

  1. I start the exam and answer some questions.
  2. I force close the page.
  3. I go back to the page. I can see the feedback for the questions I already answered before the force close, but I cannot see feedback for unanswered questions. Reset is available.
  4. I click on reset. -- a database entry is made indicating the reset, and the questions I had already answered.
  5. Feedback is still there for the questions I already answered. But now I can answer the questions that I had not answered before.
  6. I submit my exam -- another database row is added with my final information.

@conzty01
Copy link
Contributor Author

Our understandings of what you were looking for were a bit off, but I have not been able to replicate the issue you are having with not being able to answer the questions after the reset. I am still working on getting my VM back up and running as I am having issues installing, but I will start to work on implementing the behavior you are looking for when I can.

@bnmnetp
Copy link
Member

bnmnetp commented Jul 10, 2017

OK, please describe for me your understanding of what I should expect. Once we have compared notes we can decide on the best course.

@conzty01
Copy link
Contributor Author

  1. Start the exam and answer some questions.
  2. Force close the page.
  3. Reload page. See feedback for the questions previously answered before the force close, but not for unanswered questions. Reset is enabled.
  4. Click on reset. Database is notified of reset and previous answers.
  5. Feedback is still there for the questions already answered. But now the user can answer the questions that that were not answered before.
  6. Submit the exam. Feedback is displayed for entire exam and database is notified of completed exam.

@conzty01
Copy link
Contributor Author

Might I suggest, that feedback would be kept hidden until the entire exam is completed. This would eliminate the possibility of being able to read the question without the timer running and the lack of the green and red highlighting would be an indication to a student browsing by or double checking the submission that the exam was not finished properly.

Such a design might behave like:

  1. Start exam and answer some, but not all, questions
  2. Force navigation away from the page
  3. Reload page and see that exam appear similar to how it was before starting but with an updated timer to reflect how much time they took previously.
    4a. Hit 'Reset' to reset entire exam
    5a. Page reloads with a fresh copy of the exam and record of reset is sent to the database.

4b. Hit start exam again and resume the exam as before but without the ability to edit previously answered questions.
5b. On completion, the exam displays all feedback.

@bnmnetp
Copy link
Member

bnmnetp commented Jul 10, 2017

@conzty01, I like your second option a lot.

@conzty01
Copy link
Contributor Author

So, my newly installed VM doesn't have the same functionality with the reset feature that it did before the crash, so I believe we are in the same boat now. Because of the lack of functionality and the new approach that you would like from my last comment, I have gone through the timed.js script, excluding any changes I made for the reset, to try to figure out where/when might be the best place to check the localStorage and server for submitted exams. The "flow" chart that I found is below.

@conzty01
Copy link
Contributor Author

14998109307001747138441

@conzty01
Copy link
Contributor Author

The bulk of the loading of the timed exam is in done in the tookTimedExam( ) function so I figure that that would be the most appropriate place to check for previous answers. However, I am stuck on how to proceed with checking-- i.e. which place do I check for answers first and when in the order should it occur. My initial idea is to check right at the beginning of tookTimedExam( ) but from there I am unsure. Thoughts, @bnmnetp ? The flowchart begins from the "Timedexam init" box in the top left corner.

@bnmnetp
Copy link
Member

bnmnetp commented Jul 11, 2017

So, if there is not a full timed_exam entry in localStorage but there are individual entries for one or more of the timed elements that is a really strong indication that the exam was interrupted or force quit somehow right?

I think you will already want to invent a local storage way to keep track of the time. So maybe you could also use local storage to keep track of whether the exam was submitted or not??

@bnmnetp
Copy link
Member

bnmnetp commented Jul 11, 2017

@conzty01 Not sure my response made sense, and I'm not sure I understand your flowchart. Maybe we should do a hangout tomorrow morning to really work this out.

Fetch Upstream 7/12/17 8:39AM
@conzty01
Copy link
Contributor Author

conzty01 commented Jul 12, 2017

  • Re-order timed.js to eliminate extraneous/outdated code.
  • Keep track of time taken on the exam in localStorage.
  • If Database has no results for exam, check localStorage for answers.
    • If the difference between the timestamp and current time is greater than the length allotted for the exam, do not allow students to continue the exam.
    • If the difference listed previously is less than the allotted time, allow the students to continue the exam without changing previous answers.
  • Display feedback at the end of an exam only if the exam is either finished, or there is a database entry.
  • Allow exam to be reset if the Database has no record of an exam and localStorage says that all questions were skipped.

@conzty01
Copy link
Contributor Author

Server Updates

@conzty01
Copy link
Contributor Author

I've updated the reset function if you'd like to take a look, @bnmnetp , but I am still working on being able to resume an incomplete exam.

conzty01 added 5 commits July 17, 2017 08:35
Fetch Upstream 07/17/17 8:36AM
Alert now occurs when the server determines an exam is not a candidate for resetting.
Merge Upstream 07/18/17 8:49AM
Fetch upstream 07/19/17 1:05PM
@bnmnetp
Copy link
Member

bnmnetp commented Jul 20, 2017

It seems to me that this is a good point to stop with this one. I can see some benefit to being able to restore answers prior to some kind of catastrophic end to the exam, but the additional complexity it would add to all of the components and the already fragile nature of the timed_exams make me think that a simple reset capability is all that is needed.

Fetch Upstream 07/21/17 10:30AM
Copy link
Member

@bnmnetp bnmnetp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like almost all of the changes I made to runestone base are undone by this PR. Can you identify exactly what you intended to change so I can make sure all of mine are restored?

@@ -1,35 +1,7 @@
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not have been deleted. Any idea why it was?


}

RunestoneBase.prototype.init = function(opts) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not have been deleted either


RunestoneBase.prototype.checkServer = function (eventInfo) {
// Check if the server has stored answer
if (this.useRunestoneServices || this.graderactive) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this

data.div_id = this.divid;
data.course = eBookConfig.course;
data.event = eventInfo;
if (this.sid) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this

for (var i = 0; i < this.newChildren.length; i++) {
var tmpChild = this.newChildren[i];
opts = {'orig':tmpChild, 'useRunestoneServices':eBookConfig.useRunestoneServices}
if ($(tmpChild).children("[data-component]")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should not have disappeared either

Copy link
Member

@bnmnetp bnmnetp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the exception of a . instead of a , on line 899 causing getAssessResults to fail every time, this seems to work fine now. I fixed the problem, and will include it in my merge.

@bnmnetp bnmnetp merged commit dfa2736 into RunestoneInteractive:master Jul 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants