Adapted all Modules to work with a global actual course. It is

functional, however, initial states should be revised and better
defined. The appearance should be also improved.
This commit is contained in:
Helena Rodriguez 2012-04-09 18:29:22 +02:00
parent cf85e9ec19
commit 0b791516c2
8 changed files with 11 additions and 14 deletions

View File

@ -12,12 +12,10 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:prompt="@string/selectCourseTitle" /> android:prompt="@string/selectCourseTitle" />
<ExpandableListView <ExpandableListView
android:id="@+id/android:list" android:id="@+id/android:list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:cacheColorHint="@color/background" > android:cacheColorHint="@color/background" >
</ExpandableListView> </ExpandableListView>
</LinearLayout>
</LinearLayout>

View File

@ -31,7 +31,7 @@ public class Global {
/** /**
* SWAD application key * SWAD application key
*/ */
private static final String AppKey = ""; private static final String AppKey = "HTC-Desire";
/** /**
* Server URL * Server URL
*/ */

View File

@ -19,6 +19,7 @@
package es.ugr.swad.swadroid; package es.ugr.swad.swadroid;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -48,6 +49,9 @@ import es.ugr.swad.swadroid.model.DataBaseHelper;
import es.ugr.swad.swadroid.model.Model; import es.ugr.swad.swadroid.model.Model;
import es.ugr.swad.swadroid.modules.Courses; import es.ugr.swad.swadroid.modules.Courses;
import es.ugr.swad.swadroid.modules.Groups; import es.ugr.swad.swadroid.modules.Groups;
import es.ugr.swad.swadroid.model.Course;
import es.ugr.swad.swadroid.model.DataBaseHelper;
import es.ugr.swad.swadroid.model.Model;
import es.ugr.swad.swadroid.modules.Messages; import es.ugr.swad.swadroid.modules.Messages;
import es.ugr.swad.swadroid.modules.Module; import es.ugr.swad.swadroid.modules.Module;
import es.ugr.swad.swadroid.modules.Notices; import es.ugr.swad.swadroid.modules.Notices;
@ -383,7 +387,6 @@ public class SWADMain extends MenuExpandableListActivity {
courseCode = courseSelected.getId(); courseCode = courseSelected.getId();
Global.setSelectedCourseCode(courseCode); Global.setSelectedCourseCode(courseCode);
createMenu(); createMenu();
} }
@Override @Override
@ -567,5 +570,4 @@ public class SWADMain extends MenuExpandableListActivity {
} }
currentRole = Global.TEACHER_TYPE_CODE; currentRole = Global.TEACHER_TYPE_CODE;
} }
} }

View File

@ -412,6 +412,7 @@ public abstract class Module extends MenuActivity {
* Use of KeepAliveHttpsTransport deals with the problems with the Android ssl libraries having trouble * Use of KeepAliveHttpsTransport deals with the problems with the Android ssl libraries having trouble
* with certificates and certificate authorities somehow messing up connecting/needing reconnects. * with certificates and certificate authorities somehow messing up connecting/needing reconnects.
*/ */
String u =prefs.getServer();
URL = prefs.getServer(); URL = prefs.getServer();
connection = new KeepAliveHttpsTransportSE(URL, 443, "", TIMEOUT); connection = new KeepAliveHttpsTransportSE(URL, 443, "", TIMEOUT);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

View File

@ -199,4 +199,4 @@ public class Notices extends Module {
} }

View File

@ -74,8 +74,7 @@ public class TestsConfigDownload extends Module {
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
prefs.getPreferences(getBaseContext()); prefs.getPreferences(getBaseContext());
try { try {
if(isDebuggable) { if(isDebuggable) {
Log.d(TAG, "selectedCourseCode = " + Long.toString(Global.getSelectedCourseCode())); Log.d(TAG, "selectedCourseCode = " + Long.toString(Global.getSelectedCourseCode()));
} }
@ -89,7 +88,7 @@ public class TestsConfigDownload extends Module {
Log.e(ex.getClass().getSimpleName(), errorMsg); Log.e(ex.getClass().getSimpleName(), errorMsg);
ex.printStackTrace(); ex.printStackTrace();
} }
} }
} }
@ -114,7 +113,6 @@ public class TestsConfigDownload extends Module {
if (result != null) { if (result != null) {
//Stores tests data returned by webservice response //Stores tests data returned by webservice response
Vector<?> res = (Vector<?>) result; Vector<?> res = (Vector<?>) result;
Integer pluggable = new Integer(res.get(0).toString()); Integer pluggable = new Integer(res.get(0).toString());
isPluggable = Global.parseIntBool(pluggable); isPluggable = Global.parseIntBool(pluggable);
numQuestions = new Integer(res.get(1).toString()); numQuestions = new Integer(res.get(1).toString());

View File

@ -651,7 +651,6 @@ public class TestsMake extends Module {
test = (Test) dbHelper.getRow(Global.DB_TABLE_TEST_CONFIG, "id", test = (Test) dbHelper.getRow(Global.DB_TABLE_TEST_CONFIG, "id",
Long.toString(Global.getSelectedCourseCode())); Long.toString(Global.getSelectedCourseCode()));
if(test != null) { if(test != null) {
setNumQuestions(); setNumQuestions();
} else { } else {
@ -661,7 +660,7 @@ public class TestsMake extends Module {
} else { } else {
Toast.makeText(getBaseContext(), R.string.testNoQuestionsMsg, Toast.LENGTH_LONG).show(); Toast.makeText(getBaseContext(), R.string.testNoQuestionsMsg, Toast.LENGTH_LONG).show();
finish(); finish();
} }
} }

View File

@ -91,7 +91,6 @@ public class TestsQuestionsDownload extends Module {
sendRequest(Test.class, false); sendRequest(Test.class, false);
if (result != null) { if (result != null) {
//Stores tests data returned by webservice response
Vector<?> res = (Vector<?>) result; Vector<?> res = (Vector<?>) result;
SoapObject tagsListObject = (SoapObject)res.get(0); SoapObject tagsListObject = (SoapObject)res.get(0);