Skip to content

Conversation

@jaericson
Copy link

@nparlante

Creating pull request for the "timer between quiz attempts" feature on any problem type.

This allows the author to specify how many seconds they want to lock out a student from submitting another attempt of the same quiz.

How do you enable this feature? For a problem, go to its settings in EdX (within a problem, click on the EDIT button and then click on the SETTINGS button). One of the settings listed should read Timer Between Attempts. By default, there are 0 seconds a student must wait between submissions, but you can increase this.

Note that a student can still start another attempt of the quiz, but will only be disallowed from submitting again until time has elapsed. This is to prevent students from rapidly submitting quiz attempts, particularly for quizzes that offer hundreds of allowed attempts.

@nparlante
Copy link
Contributor

Hey Jeff -- hmm, that's a pretty handy feature.

Two things that jump out before I get to a detailed review:

  1. I'm sure this is super simple but ... how does an author get this feature? I tried adding a tag in but I don't think that's it. Anyway, could you add a real no-brainer sentence in the changelog bit about how an author gets this feature.
  2. We'll need tests. I would think grep around for other tests that call get_score to steal the pattern. Then test calling get_score twice with this feature not set verifying that it does not mess things up, then tests before and after the deadline. Also test the seconds formatter thing, but that will be trivial since you've got it broken out so nicely.

@sefk
Copy link
Contributor

sefk commented Dec 5, 2013

I have two concerns with this PR.

  1. Failing tests.
  2. I don't understand how the duration is carried across requests. Is it stored in the session somehow via some Django magic that I don't understand? It certainly isn't in the DB, which I think is fine. But if not in the DB, there must be some place where this is stored since the server is stateless across requests (of course).

@nparlante and @jaericson pls explain how this works, thanks.

@jaericson
Copy link
Author

Re:1. The two failed tests on my original commit were from not realizing that there is a file I needed to add my additional problem setting (i.e. ones that show up when you click on a problem's settings in the EdX UI, like number of attempts and weight of problem) to... this doesn't look like a hard fix. The assertion failing was that "5 != 6" because there were only 5 setting options in that file, but I added a 6th.

Re:2. I think capa problem does hold state in some database somewhere. For example, it does so to remember the last set of student answers or to remember if a problem is done or not. See the function set_state_from_lcp in capa_module.py. I am doing something similar, though I may need to explicitly hold state within a lcp and not the capa_module. Also, what I am doing is modeled off of code in the conditional block that begins with if self.lcp.is_queued(): within capa_module.py.

@nparlante
Copy link
Contributor

@sefk As we chatted, I guess this Scope.user_state thing makes it happen magically. I grepped around it is used in a few places but that's all I know.

last_submission_time = Date(help="Last submission time", scope=Scope.user_state)

@shnayder
Copy link

shnayder commented Dec 5, 2013

Capa does indeed store state--xblock fields are automagically saved in the db.

@jaericson
Copy link
Author

@nparlante

I added in 12 test cases that should cover everything you mentioned in your above comment. Feel free to let me know if there's anything else I should add or that you want to test for. Thanks!

@jaericson
Copy link
Author

Woohoo, passed! @sefk

@sefk
Copy link
Contributor

sefk commented Dec 6, 2013

That's great thanks @jaericson

@jaericson
Copy link
Author

Just rebased this branch so that commits from others aren't showing up anymore. Please checkout this branch anew if you want to test anything on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

As we talked about -- add an explanatory comment here about how this parallels the existing test.

@nparlante
Copy link
Contributor

Ok, I squished this down to a single commit, like you do.

@nparlante
Copy link
Contributor

I'm going to close this one in favor of an umbrella PR of the shuffle feature and all of Jeff's stuff, staring with this: https://github.com/edx/edx-platform/pull/1995

@nparlante nparlante closed this Jan 17, 2014
@benpatterson benpatterson deleted the jeff/feature-timer-between-quiz-attempts branch January 21, 2015 13:12
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants