SMF Quiz

Started by Diego Andrés, February 18, 2009, 01:08:19 PM

Previous topic - Next topic

stefan357965

Great stuff, this is a great deal!

CerebralJam

Hi guys, here comes trouble.  Kindred, please don't sigh :D

Have had this wonderful mod since 2009 and always loved it.  I have recently upgraded my old forum to the latest release as I decided to move webhosts recently.  I wasn't sure I'd be able to update this - was thrilled to see it installs on a fresh 2.0.11 - wonderful work peeps.

Before I moved - a long time ago, the menu part of the mod displayed funny in the CSS.  I lived with it, but thought now's the time to put it right.  Trouble is, I can't quite work out what to edit.  I noticed this line in the source page view right clicking: <td><div id="admin_menu"><ul class="dropmenu" id="dropdown_menu_1">

But where is the dropdown_menu_1?  I seem to have quite a few css files (and would have thought the quiz.css would have the info in?) Can someone point me in the right direction?  Yes, Davejo, this is another reason why I have been lurking on your site.  I can see your menu working.  On a fresh install I also got it to work.

I have reinstalled mods: Ultimate Profile, SMF Quiz and E-Arcade.  I did use to have SMF Quiz Categories but that won't install after the upgrade.  The database seems to have kept the categories for me as they all showed up.

I have attached a screenshot.  Thanks for any help with this one.


Dave J

The folder 'quiz_css' should be inside '/public_html/Themes/default/css'

Look to see if it's there like the image below. If it's not then copy the whole folder to it.

If that doesn't do try plan B

I can't remember if uninstalling the mod removes the database files or not, if it doesn't then uninstall it and then re-install it and see if that works.

CerebralJam

#943
Hi there, yes, my quiz_css folder is within the css folder under  '/public_html/Themes/default/css'

I went to see if I could uninstall it yesterday as the upgrade was in place and mod was only just recently reinstalled.  The database files were safe at that point, but uninstalling now, it doesn't sound the same as how the upgrader worked. Then am I telling the database to drop the files? I would be really sad to lose this.

Looking at uninstall gave me further problems as you will see from this screenshot.  If I could tell where the css instruction actually was I might be able alter it.  Safer than losing it.  Don't want to reset scores or members using it as most members have moved on and site is more of an archive of years gone by than active. 

Looking at the screenshot though, does that indicate something that could be edited and might sort the problem out - never used the 'replace' instructions before.  I don't know how the files they are talking about work.

Looking at the arcade files  - it also accesses both the files that are listed as failed for the uninstall.  I reinstalled the arcade straight after the quiz once I could see it was working.  In both cases I'm concerned that if I uninstall either mod now it will erase the original database files.  The arcade doesn't show any errors in the uninstall list. 

Think the css might be the easiest option but I can't work out where that instruction is?

Annoying.  And thank you.  :)

Sorry - suggestions made are as follows:
1. ManagePermissions.php
Code: (Find) [Select]
   $permissionList = array(
      'membergroup' => array(
      
         //Begin SMFQuiz         
         'quiz_view' => array(false, 'quiz', 'quiz'),
         'quiz_play' => array(false, 'quiz', 'quiz'),
         'quiz_submit' => array(false, 'quiz', 'quiz'),
         'quiz_admin' => array(false, 'quiz', 'quiz'),
         //End SMFQuiz
Code: (Replace) [Select]
   $permissionList = array(
      'membergroup' => array(
      

2. ManagePermissions.php

Code: (Find) [Select]
   $context['non_guest_permissions'] = array(
      //Begin SMFQuiz
      'quiz_play',
      'quiz_submit',
      'quiz_admin',
      //End SMFQuiz
Code: (Replace) [Select]
   $context['non_guest_permissions'] = array(

1. Modifications.english.php

//Begin SMFQuiz
$txt['quiz'] = 'Quiz';

// Permission names and help
$txt['permissiongroup_quiz'] = 'Quiz';
$txt['permissiongroup_simple_quiz'] = 'Quiz';
$txt['permissionname_quiz_view'] = 'View Quiz';
$txt['permissionhelp_quiz_view'] = 'May access Quiz';
$txt['permissionname_quiz_play'] = 'Play the Quiz';
$txt['permissionhelp_quiz_play'] = 'Allows member to play the quiz';
$txt['permissionname_quiz_submit'] = 'Create Quiz';
$txt['permissionhelp_quiz_submit'] = 'Allows users to create quizzes';
$txt['permissionname_quiz_admin'] = 'Administrate Quiz';
$txt['permissionhelp_quiz_admin'] = 'Quiz Administarator can Install/Edit/Delete quizzes from the admin screen';

// Errors if they can't do something
$txt['cannot_quiz_view'] = 'You are not allowed to access the Quiz.';
$txt['cannot_quiz_play'] = 'You are not allowed to play the Quiz';
$txt['cannot_quiz_submit'] = 'You are not allowed to create Quizzes';

//End SMFQuiz
?>

Code: (Replace) [Select]
?>



Dave J

It's possible that another mod has wriiten before or after the line that the quiz wnts to write to thats why the error comes up. Check those files in the first instance to see if the quiz code is actuallt in the files.

The error that your show with the menu might also be related to the template file, if you haven't done so already, check one by one that all the files are in the correct place for the mod.

As a matter of interest which version of the mod are you using? The version I'm using is 1.1.1 beta 1

CerebralJam

Thank you, Dave. 

I installed the latest, the zip says beta2 in SMF Packages on my server, but the actual mod says 1.1.1 beta 1 in installed packages. 

I installed it via the package manager via the 'browse packages' on SMF Moderations.

I will go check all the files again. I'll compare the ones that the Arcade uses as well. This was the only mod I reinstalled after it.

Appreciate your help.  :)





CerebralJam

I think... I'm getting closer to the problem!

I casually clicked on my 'help' button today to find it giving me an error where it used to serve up the files no problems...
Quote
An Error Has Occurred!
Unable to load the 'manual' template.



so I did a search here for the error and came up with this thread: http://www.simplemachines.org/community/index.php?topic=443279.msg3114911#msg3114911

Now, the advice started by asking the person to check their site with domain/SMF/index.php?theme=1

When I do this, the help files ARE there and the menu for the quiz also works.

Could be something to do with my using Anecdota20bp - back in 2009 Curve wasn't around? and upgrading over the years (a few) then having to do the large upgrade recently? 'If' I can understand what this person did - and I can't - not sure what they mean by remove help files (?)...

But - does this mean, I should uninstall my old theme (Can I make a back up of the css so that I don't have to do all the tweaking again?) then make the new theme based on Curve?  I've forgotten how to do all this stuff but this might well be my issue.  Back then (2009) the choices were default, classic, core, Babylon.

If only I could get my brain to work and 'ding'  :D 

Like this though.

Could somebody babystep me through this painslessly so that I don't fiddle too much and make another fine mess?  Thanks in advance.  I'm feeling light at the end of the tunnel.

Kindred

#947
You can not use themes for 1.1.x on 2.0.x... period

You can also not use rc2 or rc3 themes on 2.0.x

So... yes, the problem is your theme, and you will have to find another one... and you will not be able to use the css from your old theme.
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CerebralJam


Dave J

Quote from: CerebralJam on January 19, 2016, 06:05:12 PM
I think... I'm getting closer to the problem!

I casually clicked on my 'help' button today to find it giving me an error where it used to serve up the files no problems...
Quote
An Error Has Occurred!
Unable to load the 'manual' template.



so I did a search here for the error and came up with this thread: http://www.simplemachines.org/community/index.php?topic=443279.msg3114911#msg3114911

Now, the advice started by asking the person to check their site with domain/SMF/index.php?theme=1

When I do this, the help files ARE there and the menu for the quiz also works.

Could be something to do with my using Anecdota20bp - back in 2009 Curve wasn't around? and upgrading over the years (a few) then having to do the large upgrade recently? 'If' I can understand what this person did - and I can't - not sure what they mean by remove help files (?)...

But - does this mean, I should uninstall my old theme (Can I make a back up of the css so that I don't have to do all the tweaking again?) then make the new theme based on Curve?  I've forgotten how to do all this stuff but this might well be my issue.  Back then (2009) the choices were default, classic, core, Babylon.

If only I could get my brain to work and 'ding'  :D 

Like this though.

Could somebody babystep me through this painslessly so that I don't fiddle too much and make another fine mess?  Thanks in advance.  I'm feeling light at the end of the tunnel.

I replicated this issue on the test site. If I come out of the default theme where the quiz is working as it should then go into the 'Core' theme that menu issues is replicated. So I agree with Kindred that this is a theme suue and not a quiz issue.

This is what I would do.

Find a theme from the list in SMF that is compatible with the SMF version you are using and install it. The next step you can do one of two ways.

1. Then once the theme is installed go through the list of mods you have installed on your site and uninstall and re-install them one by one till you have completed the list, the problem with this is the possible errors you have with the code changes as if you force the uninstall you may be left with redundant code in the files that could cause errors later. If a mod uninstalls with no errors this should not be an issue, obviously another side effect of this route is that it might lose the info related to any database entries the mod has written.

2. If the above doesn't work then you will need to go through each mod and check the install instructions and where they should add code to the template files of the new theme then you will need to copy it over manually.

If it were me I would do this on my PC using Notepad++ and then save them, rename the existing templates on the site you are about to upload and see what effect is has. If it cuases errors then you can rename the original files back to what they were and your site should work as it does now.

Whatever you do it's going to be a long job. Of course I too am just a relative novice at this and there are problebly people out there that will say 'that's rubbish Dave' and give you a better option than I have, whatever happens good luck and feel free to test on my test site as you have been.

regards

Dave

PS. One last thing I have done before is, if you have a spare database you can create on your host and space to do it, create a mirror image of your site but starting from scratch with 2.0.11. When you do this ensure that your username and password are identical for the mirror set up as they are for the old site.

You will need to create a new folder in your current 'public_html' folder called 'mirror' then upload SMF 2.0.11 files to it, once you have donme that got to 'h**p://www.yoursite.com/mirror. When you go there you will go through the setup steps for the mirror site. Once the main forum is installed then add the mods you have on your existing site to the mirror one.

Ensure that you create backup at every stage before making changes as there is nothing worse than changing something that didn't work and it's overwitten an existing file.

Once you have all the mods installed as you want them then introduce the database tables from your current site to the new database by overwritting the existing tables the only table you should not overwrite if you go that way is the 'smf_settings' , I started with the 'members' table first and then went on to the 'messages' followed by the others that had entries in them, not all tables have entries in them. Again this is time consuming and it might even cause errors with the tables being introduced as you working from an old set up, but it seems to me you have few options open to you so I just thought I would share this with you.

CerebralJam

Absolutely love your reply, Dave... I can see you have put a lot of time into your answer for me and very helpful.  I also really appreciated that you allowed me to test the quiz install/uninstall on a clean 2.0.11 and see the effect on the database.  Sadly, my old forum did not say - 'looks like you are doing an update ... database safe' :D  So not attempting to uninstall anything on this version as yet.

I had started to build a copy of the site using new 2.0.11 installation (thinking I could migrate it) before the transfer of the old site to new (webhost) servers AND upgrade of the old once transferred. So I do have two sets of public_html directories with my new hosts I can swap around, differently named and how I had been testing it.  Didn't think to test by answering some quizzes and then trying an uninstall so you helped me a lot there.

I can add as many sql databases as I wish and so your suggestion on creating a new database and copying across database  tables is also extremely helpful - especially on an experimental/learning curve basis. 

I love Notepad++ to the extent I even opt to keep the old icon when prompted on every update. Love being able to see the line numbers! 

There is a theme fairly similar to the one I use, built by the same author (Crip) last updated 2013, same name with _205 added, I downloaded this early 2014. Only difference being the top menu/buttons/display and a slightly lighter shade of blue header image (I had painstakingly custom designed the logo to the background gradient, shading in Photoshop to blend in with old theme  - sticks out a wee bit in this newer theme ).  I'm assuming this was for 2.0.5 build. This is the one that works on a fresh install. My headache was going through the css and customising it again - I wanted a shortcut. Couldn't remember what I did back in 2009 - (images/added sub navigation to front html pages etc and where). Doesn't hurt to refresh this knowledge on the learning curve though.

So, at the moment I have

1) the old upgraded site with this very slight niggle of the theme quiz menu (css) otherwise displaying perfectly - which to me was what I was hoping I could correct - everything else works brilliantly so far.
                (As you have said, NOT a quiz fault. And I did recognise that. Was just hopeful that someone who designed/updated the quiz could point me in the right direction with editing.
                But obviously not good now discovering having no help files for forum members!  :D
)

2) fresh install with alternative updated theme (but not completed customisation) that works on 2.0.11 minus the all important info/old database.

Having discovered that the default (Curve) (2.0) gives me back the help files on my updated old forum I started working on installing the alternative theme as a copy of the default renamed, and then customising it again.  The Core theme says default theme of SMF's previous incarnation.



Really, really appreciate all you have said in your post above and yeah, plan in action for positive outcome, even if a long path.  BIG THANK YOU.

Dave J

I'm glad it was of some help.

Dave J

One other thing I should mention about using the old tables on the new database is that the paths to various templates and folders on your site will not be correct i.e. file attachments folder will point to the old address and not the new one and therefore would give you an error on the site, the same can be said for the path to the themes too. If you download your complete database, you can open it in Notepad++ and use the 'Replace' option under the search function. If you need to know more just ask me.

CerebralJam

Hey, again REALLY helpful information.  I would not have known that. I want this year to study SQL and by creating a mirror site  (assuming this is an independent 'likewise' new install, not connected, but using information from what I already have functioning as a testing tool, with a new database) as you have suggested and using this with Notepad++/ and phpmyAdmin  I can't think of a better way to see how it all works underneath without causing any damage. Understanding paths obviously has been a big problem in just upgrading things and adding things on and off automatically without knowing what it actually does.

Thank you again for such encouragement and giving someone the courage to try things out.  Brilliant!  Happy also to have someone who is willing to give their time in the way you are doing.

I want to say again, because this is the quiz thread, what an incredible mod this is.  A lot of thought has been put into how to create it and make it interactive - even with members being able to create quizzes, not just the administrator.  A great feature for any website and it does show the power of what can be done.  Hats off to original author and those who have taken it on to keep it going and functional with the many advancements of the forum coding over the years.


lemur21

DaveJo,

Was this ever updated (?)/changed to allow administrators' scores to be counted (especially if they didn't *create* the quiz; but merely downloaded them)?

I love the idea of this -- but, I'm probably the person who'd be most interested in it (and I'm the admin). I don't love the idea of creating another account (because I can't be certain I'll remember to keep changing back) .....

Dave J

Quote from: lemur21 on February 24, 2016, 06:03:14 PM
DaveJo,

Was this ever updated (?)/changed to allow administrators' scores to be counted (especially if they didn't *create* the quiz; but merely downloaded them)?

I love the idea of this -- but, I'm probably the person who'd be most interested in it (and I'm the admin). I don't love the idea of creating another account (because I can't be certain I'll remember to keep changing back) .....

Hi Lemur

Nothing has changed. You dont have to keep changing the settings once it's done though. If you look at the attachment below you will see that in the Quiz/Settings page you can set the ID of the member who you want to be associated with importing the quizzes, once this is done it will remain that way unless you change it.

If you have already imported the quizzes then you will need to create a new member called 'Admin', remember the User ID then go into your cPanel to the 'phpmyadmin' section and change the ID from you to the 'Admin' IDin the database tables.

If you don't want to do that, then although I haven't tried it, maybe you could uninstall all the quizzes and then set the used ID then re-import them again, you might lose the scores but at least you will be able to play them as I do sometimes.

Hope that helps some

Dave

lemur21

Dave - one other question then (a two-parter):

I haven't installed any quizzes yet; so this is good ...

So - I have a user that is inactive on the site. I can easily use that ID as the importer. My question though -- does that make this inactive user the only one who can access the quiz admin panel? Or, does the overall site admin still have administrative rights over the quizzes and the control panel too (even though the inactive member is the quiz importer?)

Dave J

Quote from: lemur21 on February 25, 2016, 09:20:16 AM
Dave - one other question then (a two-parter):

I haven't installed any quizzes yet; so this is good ...

So - I have a user that is inactive on the site. I can easily use that ID as the importer. My question though -- does that make this inactive user the only one who can access the quiz admin panel? Or, does the overall site admin still have administrative rights over the quizzes and the control panel too (even though the inactive member is the quiz importer?)

Lemur

No the inactive user will not have admin rights at all, only site admin have access to the quiz admin unless you say otherwise through permissions.

lemur21

Wonderful! That's perfect -- there's definitely at least one person on my site who will have no interest in this.

I see in your signature - you have quizzes available  (I need to register on your site). And, earlier in this thread, you had a 10-pk of quizzes available. How many packs of quizzes exist currently? Do you (or does anyone) maintain a site where all user-designed quizzes are maintained?

It does sound super-easy, so I expect I will be able to launch it on my site, soon!

Dave J

Quote from: lemur21 on February 25, 2016, 03:32:20 PM
Wonderful! That's perfect -- there's definitely at least one person on my site who will have no interest in this.

I see in your signature - you have quizzes available  (I need to register on your site). And, earlier in this thread, you had a 10-pk of quizzes available. How many packs of quizzes exist currently? Do you (or does anyone) maintain a site where all user-designed quizzes are maintained?

It does sound super-easy, so I expect I will be able to launch it on my site, soon!

Lemur

I cant remember how many pks there are but I know there are in total more than 540 quizzes. You will note in a previous post I mention that you will need to create the categories before you add the quiz packs. The reason for this is so that the quizzes go into the categories when you install them rather than assigning to quizzes to a category later, which believe me is a long process. Of course you dont have to do it that way at all, it really is up to you.

One last thing, only add the quizzes in smallish batches as it takes a while for them to load. If you need any help let me know.

Happy quizing

Dave

PS. You will see on my site that there are inteactive music quizzes, these are not in any of the packs as the require special settings.

Advertisement: