Giter VIP home page Giter VIP logo

moodle-mod_hotquestion's People

Contributors

jerray avatar nadavkav avatar sunner avatar zhanganzhen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-mod_hotquestion's Issues

[TODO] More readable time

The post time of questions is printed ugly. It should be changed to:

  1. now if it is posted just now.
  2. 2 hours and 40 mins ago if it was posted less than 24 hours ago
  3. FULL DATE if it has been posted for more than 24 hours

The patch should be on the following line of code in view.php:

$a->time = userdate($question->time).'&nbsp('.get_string('early', 'assignment', format_time(time() - $question->time)) . ')';

改进Ajax刷新的处理

现在的刷新机制是整个HTML代码块替换。替换后本来绑定了点击事件的元素丢失,所以又进行了重新绑定。
一个避免重复绑定的方案是利用JavaScript事件冒泡:
为需要监听的元素的父级元素(不会因刷新被替换的那个节点)绑定点击事件,当其中的元素被点击时捕获目标元素,判断如果是刷新按钮,则执行刷新流程。其余不做处理。

Database error when adding a question and AJAX is off, or when failing to add a question

As @daveyboond points out elsewhere, failing to add a question, or successfully adding a question when $ajax is false, results in a database error. This is because you are trying to redirect to view.php?id=$cm->id, but you haven't set $cm anywhere. You need to use $hq->cm->id as per the following patch.

diff --git a/view.php b/view.php
index ff2471c..80ed2e9 100644
--- a/view.php
+++ b/view.php
@@ -76,10 +76,10 @@ if (has_capability('mod/hotquestion:ask', $context)) {
     $mform = new hotquestion_form(null, array($hq->instance->anonymouspost, $hq->cm));
     if ($fromform=$mform->get_data()) {
         if (!$hq->add_new_question($fromform)) {
-            redirect('view.php?id='.$cm->id, get_string('invalidquestion', 'hotquestion'));
+            redirect('view.php?id='.$hq->cm->id, get_string('invalidquestion', 'hotquestion'));
         }
         if (!$ajax) {
-            redirect('view.php?id='.$cm->id, get_string('questionsubmitted', 'hotquestion'));
+            redirect('view.php?id='.$hq->cm->id, get_string('questionsubmitted', 'hotquestion'));
         }
     }
 }

Better layout

Could moodleform provides more flexible layout of forms?

增加一个刷新按钮

@7lemon ,ajax做得很帅!现在需要一个刷新按钮,只刷那个表格,否则用户还得刷新整个页面才能看到最新的问题后投票

Wrong string used in posting time

renderer.php uses get_string('early', 'assignment',...) to get the word "early", to add to the posting time. For example: "(16 mins 25 secs early)"

This is not correct English. The word should be "ago", e.g. "(16 mins 25 secs ago)"

I think you need to add a new string to the local lang file to deal with this.

改为“真匿名”

现在的匿名提问并不是真的,数据库里还会记录用户id,只是在显示的时候显示为匿名。应该将其改为真匿名,不然不厚道。

Some Administration block links do not work

When using the current version of Hot Question in Moodle 2.4.3+ or Moodle 2.5.1+ and you are in a Hot Question activity, the Administration block links to Course Administration, Switch role to..., My profile settings, and Site administration do not work. Other links do.

Unable to delete hot-topic

As a teacher, I would like to remove some topics from the list and I am unable to.
Also as a student, I would like to remove one of my posts (topics) and I am unable to.

Not working with Moodle 2.1

Please update the module to make it work with Moodle 2.1. Submitting a question doesn't do anything.
I really would like to test it. Could be quite useful here.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.