Posts made by Judy Hsu

Thanks Muhammad...

I think one possible "manual" way to achieve this, is to run a SQL query after two weeks to force the password to be reset to something generic (but safe) passwords. However it would be great if this can be built in... Thanks again!

Dear all:

We are trying to implement something that is different from the Moodle "Email-based self-registration" process. Here is the flow that we envisioned:

1. Upload a Excel spreadsheet Using Moodle's "Upload users" feature, this Excel spreadsheet will include maybe 30,000+ users with their firstname, lastname, email, and intial (temporary) password (password being randomly generated by some sort of script, that would output to a Excel file). This "intial (temporary)" password will automatically expired in 2 weeks. And once the user log in for the first time, they will be greeted by a "user agreement" (done), and they will be forced change their passwords on their first login.

2. Moodle will automatically sent out 30,000+ emails (after the spreadsheet is uploaded) to notify users with the URL to login, and the intial temporary password.

3. Student will click on the link, and the verification is based on three things:

  • First and Last Name
  • Official departmental email
  • Their assigned initial temporary password

My questions:

1. Is there a good script or program that I could use to quickly generate 30,000 random passwords and will output to a Excel file?

2. How could I make the initial temporary password expire after two weeks? I don't see a "expiration" field in the mdl_user table? Is there any other alternatives to achieve this without local code customization?

Thanks!

Average of ratings: -

Hi Tim, by the way I just checked out Moodle 2.0 (MDL-18485), and noticed some really great changes (when compared to 1.9), such as "disable some filds when they are not applicable"...etc. Very cool!

However, I noticed that I could still just check "Scores" under the "Later, while the quiz is still open" column, and the corrosponding "Scores" under the "After the quiz is closed" will NOT be automatically checked and disabled. I also double checked the /lib/formslib.php and could not find another similar function like "disabledIf()" that would disable and check the checkbox at the same time. Did I miss anything here? So what I'm trying to do here is that in the mod/quiz/mod_forum.php, add the following line:

$mform->disabledIf('scoreclosed', 'scoreopen');

But I'm expecting that when it's disabling the 'scoreclosed', it would also force this checkbox to be checked. Is there a easy way (without invoking javascript) to do this? Thanks a bunch!

Hi Tim, thanks for your reply.

1. Are you referring to the /course/modedit.php or the /mod/quiz/mod_form.php? It seems that when I'm updating the quiz page, it is actually loading the /course/modedit.php. Just want to confirm. Thanks!

I also tried a hack that I learned from a patch in moodle bug tracker, that patch is to hack the /lib/pear/HTML/QuickForm/select.php and at around line #597 (under the function of onQuickFormEvent, change it to:

        if ('updateValue' == $event) {
            $value = $this->_findValue($caller->_constantValues);
            if (null === $value) {
                $value = $this->_findValue($caller->_submitValues);
                if (null === $value && (!$caller->isSubmitted() || !$this->getMultiple())) {
                    $value = $this->_findValue($caller->_defaultValues);
                }
            }
            if (null !== $value) {
                $this->setValue($value);
            }
            return true;

        //add new codes here

        else if ($arg[0] == delay1) {
                $caller->disabledIf('delay1', 'timeclose[off]', 'checked');
        }

        } else {
            return parent::onQuickFormEvent($event, $arg, $caller);

However, that seems to work for other options such as TIMING and DISPLAY pull-down menus, but when I tried to use the same logic with checkboxes under quiz REVIEW OPTIONS (e.g. scoreopen and scoreclosed), it won't work. Any idea why is that? Can you elaborate a little bit more about the approach that you mentioned? Thanks!

2. As for the "use-case for wanted to show the scores to students, then hide them again later," one example would be instructors might want to show answers/responses/feedback (not necessarily "scores") to students right after they take the quiz, but then they want to hide all these (at both quiz and Gradebook students' view) just so that students won't be able to try to "memorize" all the answers (or continue to remember the score they got). Does this make sense to you?

I think if there is really no good "use-case" for such scenario, then Moodle probably should remove the "possibility" to create such a combination at the UI level (e.g. be able to ONLY check the "score" under the "Later, while the quiz is still open" column). What do you think?